Mercurial > pidgin
comparison src/protocols/yahoo/ycht.c @ 14089:10e8eb6a4910
[gaim-migrate @ 16712]
Pretty large commit here. Basically I got sick of having to verify
that gc is still valid on all the callback functions for
gaim_proxy_connect(). The fix for this for gaim_proxy_connect() to
return something that allows the connection attempt to be canceled.
It's not quite there yet, but this is a good first step. I changed
gaim_proxy_connect() to return a reference to a new
GaimProxyConnectInfo (this used to be called PHB). Eventually this
can be passed to a function that'll cancel the connection attempt.
I also decided to add an error_cb instead of using connect_cb and
passing a file descriptor of -1. And proxy.c will also pass an
error message to callers which should explain the reason that the
connection attempt failed.
Oh, and proxy.c now never calls gaim_connection_error()
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sat, 12 Aug 2006 10:12:43 +0000 |
parents | 33bef17125c2 |
children | 7a205b430d19 |
comparison
equal
deleted
inserted
replaced
14088:223570831b0b | 14089:10e8eb6a4910 |
---|---|
526 | 526 |
527 ycht_packet_free(pkt); | 527 ycht_packet_free(pkt); |
528 } | 528 } |
529 } | 529 } |
530 | 530 |
531 static void ycht_got_connected(gpointer data, gint source, GaimInputCondition cond) | 531 static void ycht_got_connected(gpointer data, gint source) |
532 { | 532 { |
533 YchtConn *ycht = data; | 533 YchtConn *ycht = data; |
534 GaimConnection *gc = ycht->gc; | 534 GaimConnection *gc = ycht->gc; |
535 struct yahoo_data *yd = gc->proto_data; | 535 struct yahoo_data *yd = gc->proto_data; |
536 YchtPkt *pkt; | 536 YchtPkt *pkt; |
569 yd->ycht = ycht; | 569 yd->ycht = ycht; |
570 | 570 |
571 if (gaim_proxy_connect(account, | 571 if (gaim_proxy_connect(account, |
572 gaim_account_get_string(account, "ycht-server", YAHOO_YCHT_HOST), | 572 gaim_account_get_string(account, "ycht-server", YAHOO_YCHT_HOST), |
573 gaim_account_get_int(account, "ycht-port", YAHOO_YCHT_PORT), | 573 gaim_account_get_int(account, "ycht-port", YAHOO_YCHT_PORT), |
574 ycht_got_connected, ycht) != 0) | 574 ycht_got_connected, NULL, ycht) == NULL) |
575 { | 575 { |
576 ycht_connection_error(ycht, _("Connection problem")); | 576 ycht_connection_error(ycht, _("Connection problem")); |
577 return; | 577 return; |
578 } | 578 } |
579 } | 579 } |