Mercurial > pidgin
comparison libpurple/protocols/qq/qq_network.c @ 23881:69c218fd5d54
applied changes from 5688199e261449d33b5803dafff50d860896ebcb
through 5316525f53e27f838d18a6a08b82c7d55f674591
Reapplied 5316525f53e27f838d18a6a08b82c7d55f674591
2008.09.11 - csyfek <csyfek(at)gmail.com>
* Commit to Pidgin
2008.09.05 - ccpaging <ccpaging(at)gmail.com>
* Filter chars 0x01-0x20 in nickname
2008.09.05 - ccpaging <ccpaging(at)gmail.com>
* Fixed compilation even pidgin-udp-patch not applied
* Place and analysis 'before login packet' after login. packages will be updated slowly and server may send
lots of 'server command packet', while 'before login packet' is placed after 'finished update'
committer: Daniel Atallah <daniel.atallah@gmail.com>
author | SHiNE CsyFeK <csyfek@gmail.com> |
---|---|
date | Mon, 15 Sep 2008 03:03:11 +0000 |
parents | 1a0caf9983fa |
children | bcfc98c7a55f |
comparison
equal
deleted
inserted
replaced
23880:1a0caf9983fa | 23881:69c218fd5d54 |
---|---|
247 | 247 |
248 g_return_val_if_fail(buf != NULL && buf_len > 0, TRUE); | 248 g_return_val_if_fail(buf != NULL && buf_len > 0, TRUE); |
249 | 249 |
250 qd = (qq_data *) gc->proto_data; | 250 qd = (qq_data *) gc->proto_data; |
251 | 251 |
252 qd->net_stat.rcved++; | |
253 if (qd->net_stat.rcved <= 0) memset(&(qd->net_stat), 0, sizeof(qd->net_stat)); | |
254 | |
252 /* Len, header and tail tag have been checked before */ | 255 /* Len, header and tail tag have been checked before */ |
253 bytes = 0; | 256 bytes = 0; |
254 bytes += packet_get_header(&header_tag, &source_tag, &cmd, &seq, buf + bytes); | 257 bytes += packet_get_header(&header_tag, &source_tag, &cmd, &seq, buf + bytes); |
255 | 258 |
256 #if 1 | 259 #if 1 |
273 } | 276 } |
274 return TRUE; | 277 return TRUE; |
275 } | 278 } |
276 | 279 |
277 if (qq_trans_is_dup(trans)) { | 280 if (qq_trans_is_dup(trans)) { |
281 qd->net_stat.rcved_dup++; | |
278 purple_debug_info("QQ", "dup [%05d] %s, discard...\n", seq, qq_get_cmd_desc(cmd)); | 282 purple_debug_info("QQ", "dup [%05d] %s, discard...\n", seq, qq_get_cmd_desc(cmd)); |
279 return TRUE; | 283 return TRUE; |
280 } | 284 } |
281 | 285 |
282 update_class = qq_trans_get_class(trans); | 286 update_class = qq_trans_get_class(trans); |
1044 buf_len = packet_encap(qd, buf, MAX_PACKET_SIZE, cmd, seq, data, data_len); | 1048 buf_len = packet_encap(qd, buf, MAX_PACKET_SIZE, cmd, seq, data, data_len); |
1045 if (buf_len <= 0) { | 1049 if (buf_len <= 0) { |
1046 return -1; | 1050 return -1; |
1047 } | 1051 } |
1048 | 1052 |
1053 qd->net_stat.sent++; | |
1049 if (qd->use_tcp) { | 1054 if (qd->use_tcp) { |
1050 bytes_sent = tcp_send_out(gc, buf, buf_len); | 1055 bytes_sent = tcp_send_out(gc, buf, buf_len); |
1051 } else { | 1056 } else { |
1052 bytes_sent = udp_send_out(gc, buf, buf_len); | 1057 bytes_sent = udp_send_out(gc, buf, buf_len); |
1053 } | 1058 } |