libpurple/protocols/qq/qq_network.c

changeset 25114
b3244decdb40
parent 25100
f684aa5d3297
child 25306
223bd310ae72
equal deleted inserted replaced
25102:7306fc8d6dfd 25114:b3244decdb40
374 if (buf_len < 0) { 374 if (buf_len < 0) {
375 if (errno == EAGAIN) 375 if (errno == EAGAIN)
376 /* No worries */ 376 /* No worries */
377 return; 377 return;
378 378
379 error_msg = g_strdup_printf(_("Lost connection with server: %d, %s"), errno, g_strerror(errno)); 379 error_msg = g_strdup_printf(_("Lost connection with server:\n%s"), g_strerror(errno));
380 purple_connection_error_reason(gc, 380 purple_connection_error_reason(gc,
381 PURPLE_CONNECTION_ERROR_NETWORK_ERROR, 381 PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
382 error_msg); 382 error_msg);
383 g_free(error_msg); 383 g_free(error_msg);
384 return; 384 return;
771 qd->network_watcher = purple_timeout_add_seconds(qd->itv_config.resend, network_timeout, gc); 771 qd->network_watcher = purple_timeout_add_seconds(qd->itv_config.resend, network_timeout, gc);
772 772
773 set_all_keys( gc ); 773 set_all_keys( gc );
774 774
775 if (qd->client_version >= 2007) { 775 if (qd->client_version >= 2007) {
776 purple_connection_update_progress(gc, _("Get server ..."), 2, QQ_CONNECT_STEPS); 776 purple_connection_update_progress(gc, _("Getting server"), 2, QQ_CONNECT_STEPS);
777 qq_request_get_server(gc); 777 qq_request_get_server(gc);
778 return; 778 return;
779 } 779 }
780 780
781 purple_connection_update_progress(gc, _("Request token"), 2, QQ_CONNECT_STEPS); 781 purple_connection_update_progress(gc, _("Requesting token"), 2, QQ_CONNECT_STEPS);
782 qq_request_token(gc); 782 qq_request_token(gc);
783 } 783 }
784 784
785 #ifndef purple_proxy_connect_udp 785 #ifndef purple_proxy_connect_udp
786 static void udp_can_write(gpointer data, gint source, PurpleInputCondition cond) 786 static void udp_can_write(gpointer data, gint source, PurpleInputCondition cond)
933 PURPLE_CONNECTION_ERROR_NETWORK_ERROR, 933 PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
934 _("Invalid server or port")); 934 _("Invalid server or port"));
935 return FALSE; 935 return FALSE;
936 } 936 }
937 937
938 purple_connection_update_progress(gc, _("Connecting to server ..."), 1, QQ_CONNECT_STEPS); 938 purple_connection_update_progress(gc, _("Connecting to server"), 1, QQ_CONNECT_STEPS);
939 939
940 purple_debug_info("QQ", "Connect to %s:%d\n", server, port); 940 purple_debug_info("QQ", "Connect to %s:%d\n", server, port);
941 941
942 if (qd->conn_data != NULL) { 942 if (qd->conn_data != NULL) {
943 purple_proxy_connect_cancel(qd->conn_data); 943 purple_proxy_connect_cancel(qd->conn_data);
984 qq_data *qd; 984 qq_data *qd;
985 985
986 g_return_if_fail(gc != NULL && gc->proto_data != NULL); 986 g_return_if_fail(gc != NULL && gc->proto_data != NULL);
987 qd = (qq_data *) gc->proto_data; 987 qd = (qq_data *) gc->proto_data;
988 988
989 purple_debug_info("QQ", "Disconnecting ...\n"); 989 purple_debug_info("QQ", "Disconnecting...\n");
990 990
991 if (qd->network_watcher > 0) { 991 if (qd->network_watcher > 0) {
992 purple_debug_info("QQ", "Remove network watcher\n"); 992 purple_debug_info("QQ", "Remove network watcher\n");
993 purple_timeout_remove(qd->network_watcher); 993 purple_timeout_remove(qd->network_watcher);
994 qd->network_watcher = 0; 994 qd->network_watcher = 0;

mercurial