pidgin: d221fa27: 2008.12.28 - flos <lonicerae(at)gmail.co...
csyfek at gmail.com
csyfek at gmail.com
Sun Jan 4 10:10:55 EST 2009
-----------------------------------------------------------------
Revision: d221fa27ec6a8f0ab246208650e5c26658127ed4
Ancestor: 1f2e7bc23b98250c7c2e507bd639833d6ad38039
Author: csyfek at gmail.com
Date: 2009-01-04T15:11:08
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/d221fa27ec6a8f0ab246208650e5c26658127ed4
Modified files:
libpurple/protocols/qq/ChangeLog
libpurple/protocols/qq/qq_network.c
ChangeLog:
2008.12.28 - flos <lonicerae(at)gmail.com>
* Fixes #7908, fixed a bug which would crash OpenQ while login in qq_network.c
2008.12.28 - flos <lonicerae(at)gmail.com>
* References #7908
-------------- next part --------------
============================================================
--- libpurple/protocols/qq/ChangeLog 3dc460c9b93da32aeb0382388599876b2c5572a8
+++ libpurple/protocols/qq/ChangeLog eb1c0cc13c8613614d53a4c5a2a83b1f880c04bf
@@ -1,3 +1,9 @@
+2008.12.28 - flos <lonicerae(at)gmail.com>
+ * Fixes #7908
+
+2008.12.28 - flos <lonicerae(at)gmail.com>
+ * References #7908
+
2008.12.25 - flos <lonicerae(at)gmail.com>
* References #7821
* Updated authors
============================================================
--- libpurple/protocols/qq/qq_network.c 8257f51bfa1d6db8e0878b23bd9f25122b2e9c32
+++ libpurple/protocols/qq/qq_network.c 7efc1ba7cf25c27c33c635663af8fbf9cc2cff3f
@@ -174,14 +174,16 @@ gboolean qq_connect_later(gpointer data)
* Please conside tcp_pending and udp_pending */
gboolean qq_connect_later(gpointer data)
{
- PurpleConnection *gc = (PurpleConnection *) data;
- qq_data *qd;
- char *server;
+ PurpleConnection *gc;
+ char *tmp_server;
int port;
gchar **segments;
+ qq_data *qd;
+ gc = (PurpleConnection *) data;
g_return_val_if_fail(gc != NULL && gc->proto_data != NULL, FALSE);
qd = (qq_data *) gc->proto_data;
+ tmp_server = NULL;
if (qd->check_watcher > 0) {
purple_timeout_remove(qd->check_watcher);
@@ -191,10 +193,12 @@ gboolean qq_connect_later(gpointer data)
if (qd->redirect_ip.s_addr != 0) {
/* redirect to new server */
- server = g_strdup_printf("%s:%d", inet_ntoa(qd->redirect_ip), qd->redirect_port);
- qd->servers = g_list_append(qd->servers, server);
- qd->curr_server = server;
+ tmp_server = g_strdup_printf("%s:%d", inet_ntoa(qd->redirect_ip), qd->redirect_port);
+ qd->servers = g_list_append(qd->servers, tmp_server);
+ qd->curr_server = tmp_server;
+ tmp_server = NULL;
+
qd->redirect_ip.s_addr = 0;
qd->redirect_port = 0;
qd->connect_retry = QQ_CONNECT_MAX;
@@ -211,21 +215,30 @@ gboolean qq_connect_later(gpointer data)
}
segments = g_strsplit_set(qd->curr_server, ":", 0);
- server = g_strdup(segments[0]);
- port = atoi(segments[1]);
- if (port <= 0) {
- purple_debug_info("QQ", "Port not define in %s\n", qd->curr_server);
+ tmp_server = g_strdup(segments[0]);
+ if (NULL != segments[1]) {
+ port = atoi(segments[1]);
+ if (port <= 0) {
+ purple_debug_info("QQ", "Port not define in %s, use default.\n", qd->curr_server);
+ port = QQ_DEFAULT_PORT;
+ }
+ } else {
+ purple_debug_info("QQ", "Error splitting server string: %s, setting port to default.\n", qd->curr_server);
port = QQ_DEFAULT_PORT;
}
+
g_strfreev(segments);
qd->connect_retry--;
- if ( !connect_to_server(gc, server, port) ) {
+ if ( !connect_to_server(gc, tmp_server, port) ) {
purple_connection_error_reason(gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unable to connect."));
}
+ g_free(tmp_server);
+ tmp_server = NULL;
+
qd->check_watcher = purple_timeout_add_seconds(QQ_CONNECT_CHECK, connect_check, gc);
return FALSE; /* timeout callback stops */
}
More information about the Commits
mailing list