pidgin.openq: f3709d5a: Fixed: purple_circ_buffer not created be...

ccpaging at pidgin.im ccpaging at pidgin.im
Wed Dec 3 23:21:52 EST 2008


-----------------------------------------------------------------
Revision: f3709d5a83ad1a2737a11302a3cce822dc0fc196
Ancestor: 6ac99f1bd22867f43df93ba3a410086fd0242f8b
Author: ccpaging at pidgin.im
Date: 2008-11-11T07:20:48
Branch: im.pidgin.pidgin.openq
URL: http://d.pidgin.im/viewmtn/revision/info/f3709d5a83ad1a2737a11302a3cce822dc0fc196

Modified files:
        libpurple/protocols/qq/qq_network.c

ChangeLog: 

Fixed: purple_circ_buffer not created before append
Change QQ number to unsigned long

-------------- next part --------------
============================================================
--- libpurple/protocols/qq/qq_network.c	fe598869feaa04ec752adfb630fd4c083d7c5042
+++ libpurple/protocols/qq/qq_network.c	bf5fac0e315f2e508072e22f35b03a8a9124da1a
@@ -324,7 +324,7 @@ static gboolean packet_process(PurpleCon
 			room_cmd = qq_trans_get_room_cmd(trans);
 			room_id = qq_trans_get_room_id(trans);
 #if 1
-			purple_debug_info("QQ", "%s (0x%02X) for room %d, len %d\n",
+			purple_debug_info("QQ", "%s (0x%02X) for room %u, len %d\n",
 					qq_get_room_cmd_desc(room_cmd), room_cmd, room_id, buf_len);
 #endif
 			qq_proc_room_cmds(gc, seq, room_cmd, room_id, buf + bytes, bytes_not_read, update_class, ship32);
@@ -638,6 +638,9 @@ static gint tcp_send_out(PurpleConnectio
 		if (conn->can_write_handler == 0) {
 			conn->can_write_handler = purple_input_add(qd->fd, PURPLE_INPUT_WRITE, tcp_can_write, gc);
 		}
+		if (conn->tcp_txbuf == NULL) {
+			conn->tcp_txbuf = purple_circ_buffer_new(4096);
+		}
 		purple_circ_buffer_append(conn->tcp_txbuf, data + ret, data_len - ret);
 	}
 	return ret;
@@ -710,7 +713,7 @@ static void set_all_keys(PurpleConnectio
 	qd->send_seq = rand() & 0xffff;
 
 	qd->is_login = FALSE;
-	qd->uid = strtol(purple_account_get_username(purple_connection_get_account(gc)), NULL, 10);
+	qd->uid = strtoul(purple_account_get_username(purple_connection_get_account(gc)), NULL, 10);
 
 #ifdef DEBUG
 	memset(qd->ld.random_key, 0x01, sizeof(qd->ld.random_key));


More information about the Commits mailing list