Mercurial > pidgin.yaz
diff libgaim/protocols/qq/qq.c @ 14195:902c3aa4950a
[gaim-migrate @ 16867]
Revamped the QQ proxy code.
Fixed an infinite loop that was occurring if we hit qq_input_pending() with an unexpected value of cond.
Rewrote part of qq_proxy.c so that we use Gaim's non-blocking dns lookups.
Quieted some warnings created by new code in proxy.c and passed appropriate error messages to _qq_got_login().
Added some extra error handling to qq_proxy_write().
I was beginning to do major clean-up on this this code when I realized that once that clean-up is done, I will have duplicated a very large amount of code from proxy.c. Therefore, I am submitting this working code now and will later submit a patch to gaim-devel that will add support for UDP proxying in proxy.c, thus eliminating the need for such code in the individual prpls.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Huetsch <markhuetsch> |
---|---|
date | Sat, 19 Aug 2006 02:32:55 +0000 |
parents | 60b1bc8dbf37 |
children | 7cf90e0b6180 |
line wrap: on
line diff
--- a/libgaim/protocols/qq/qq.c Sat Aug 19 02:26:57 2006 +0000 +++ b/libgaim/protocols/qq/qq.c Sat Aug 19 02:32:55 2006 +0000 @@ -64,25 +64,26 @@ #define QQ_UDP_PORT "8000" const gchar *udp_server_list[] = { - "sz.tencent.com", /* 61.144.238.145 */ - "sz2.tencent.com", /* 61.144.238.146 */ - "sz3.tencent.com", /* 202.104.129.251 */ - "sz4.tencent.com", /* 202.104.129.254 */ - "sz5.tencent.com", /* 61.141.194.203 */ - "sz6.tencent.com", /* 202.104.129.252 */ - "sz7.tencent.com", /* 202.104.129.253 */ - "202.96.170.64", - "64.144.238.155", - "202.104.129.254" + "sz.tencent.com", + "sz2.tencent.com", + "sz3.tencent.com", + "sz4.tencent.com", + "sz5.tencent.com", + "sz6.tencent.com", + "sz7.tencent.com", + "sz8.tencent.com", + "sz9.tencent.com" }; const gint udp_server_amount = (sizeof(udp_server_list) / sizeof(udp_server_list[0])); const gchar *tcp_server_list[] = { - "tcpconn.tencent.com", /* 218.17.209.23 */ - "tcpconn2.tencent.com", /* 218.18.95.153 */ - "tcpconn3.tencent.com", /* 218.17.209.23 */ - "tcpconn4.tencent.com" /* 218.18.95.153 */ + "tcpconn.tencent.com", + "tcpconn2.tencent.com", + "tcpconn3.tencent.com", + "tcpconn4.tencent.com", + "tcpconn5.tencent.com", + "tcpconn6.tencent.com" }; const gint tcp_server_amount = (sizeof(tcp_server_list) / sizeof(tcp_server_list[0])); @@ -102,6 +103,7 @@ gc->flags |= GAIM_CONNECTION_HTML | GAIM_CONNECTION_NO_BGCOLOR | GAIM_CONNECTION_AUTO_RESP; qd = g_new0(qq_data, 1); + qd->gc = gc; gc->proto_data = qd; qq_server = gaim_account_get_string(account, "server", NULL); @@ -122,13 +124,14 @@ if (qq_server == NULL || strlen(qq_server) == 0) qq_server = use_tcp ? - tcp_server_list[random() % tcp_server_amount] : udp_server_list[random() % udp_server_amount]; + tcp_server_list[random() % tcp_server_amount] : + udp_server_list[random() % udp_server_amount]; if (qq_port == NULL || strtol(qq_port, NULL, 10) == 0) qq_port = use_tcp ? QQ_TCP_QUERY_PORT : QQ_UDP_PORT; gaim_connection_update_progress(gc, _("Connecting"), 0, QQ_CONNECT_STEPS); - + if (qq_connect(account, qq_server, strtol(qq_port, NULL, 10), use_tcp, FALSE) < 0) gaim_connection_error(gc, _("Unable to connect.")); }