Mercurial > pidgin
comparison src/protocols/simple/simple.c @ 14118:87ff682bdf5f
[gaim-migrate @ 16752]
I don't feel like fixing simple right now, so I'm adding some
GAIM_CONNECTION_IS_VALID's to tide us over
committer: Tailor Script <tailor@pidgin.im>
| author | Mark Doliner <mark@kingant.net> |
|---|---|
| date | Mon, 14 Aug 2006 08:23:26 +0000 |
| parents | 7a205b430d19 |
| children | 8856312371cb |
comparison
equal
deleted
inserted
replaced
| 14117:ae1c155bed57 | 14118:87ff682bdf5f |
|---|---|
| 419 gaim_circ_buffer_mark_read(sip->txbuf, written); | 419 gaim_circ_buffer_mark_read(sip->txbuf, written); |
| 420 } | 420 } |
| 421 | 421 |
| 422 static void simple_input_cb(gpointer data, gint source, GaimInputCondition cond); | 422 static void simple_input_cb(gpointer data, gint source, GaimInputCondition cond); |
| 423 | 423 |
| 424 static void send_later_cb(gpointer data, gint source) { | 424 static void send_later_cb(gpointer data, gint source, const gchar *error) { |
| 425 GaimConnection *gc = data; | 425 GaimConnection *gc = data; |
| 426 struct simple_account_data *sip = gc->proto_data; | 426 struct simple_account_data *sip; |
| 427 struct sip_connection *conn; | 427 struct sip_connection *conn; |
| 428 | |
| 429 if (!GAIM_CONNECTION_IS_VALID(gc)) | |
| 430 { | |
| 431 if (source >= 0) | |
| 432 close(source); | |
| 433 return; | |
| 434 } | |
| 428 | 435 |
| 429 if(source < 0) { | 436 if(source < 0) { |
| 430 gaim_connection_error(gc, _("Could not connect")); | 437 gaim_connection_error(gc, _("Could not connect")); |
| 431 return; | 438 return; |
| 432 } | 439 } |
| 433 | 440 |
| 441 sip = gc->proto_data; | |
| 434 sip->fd = source; | 442 sip->fd = source; |
| 435 sip->connecting = FALSE; | 443 sip->connecting = FALSE; |
| 436 | 444 |
| 437 simple_canwrite_cb(gc, sip->fd, GAIM_INPUT_WRITE); | 445 simple_canwrite_cb(gc, sip->fd, GAIM_INPUT_WRITE); |
| 438 | 446 |
| 1451 conn = connection_create(sip, newfd); | 1459 conn = connection_create(sip, newfd); |
| 1452 | 1460 |
| 1453 conn->inputhandler = gaim_input_add(newfd, GAIM_INPUT_READ, simple_input_cb, gc); | 1461 conn->inputhandler = gaim_input_add(newfd, GAIM_INPUT_READ, simple_input_cb, gc); |
| 1454 } | 1462 } |
| 1455 | 1463 |
| 1456 static void login_cb(gpointer data, gint source) { | 1464 static void login_cb(gpointer data, gint source, const gchar *error_message) { |
| 1457 GaimConnection *gc = data; | 1465 GaimConnection *gc = data; |
| 1458 struct simple_account_data *sip = gc->proto_data; | 1466 struct simple_account_data *sip; |
| 1459 struct sip_connection *conn; | 1467 struct sip_connection *conn; |
| 1468 | |
| 1469 if (!GAIM_CONNECTION_IS_VALID(gc)) | |
| 1470 { | |
| 1471 if (source >= 0) | |
| 1472 close(source); | |
| 1473 return; | |
| 1474 } | |
| 1460 | 1475 |
| 1461 if(source < 0) { | 1476 if(source < 0) { |
| 1462 gaim_connection_error(gc, _("Could not connect")); | 1477 gaim_connection_error(gc, _("Could not connect")); |
| 1463 return; | 1478 return; |
| 1464 } | 1479 } |
| 1465 | 1480 |
| 1481 sip = gc->proto_data; | |
| 1466 sip->fd = source; | 1482 sip->fd = source; |
| 1467 | 1483 |
| 1468 conn = connection_create(sip, source); | 1484 conn = connection_create(sip, source); |
| 1469 | 1485 |
| 1470 sip->registertimeout = gaim_timeout_add((rand()%100)+10*1000, (GSourceFunc)subscribe_timeout, sip); | 1486 sip->registertimeout = gaim_timeout_add((rand()%100)+10*1000, (GSourceFunc)subscribe_timeout, sip); |
