Mercurial > pidgin
comparison libgaim/protocols/qq/im.c @ 14632:108152f29f37
[gaim-migrate @ 17378]
There's no reason to generate our session_md5 more than once. This probably doesn't fix the bug from Adium crash 215722, but if it happens again, it'll be a bit easier to track down.
Also, I was wrong about the login scheme. Nothing significant is different, so remove the comment.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Huetsch <markhuetsch> |
---|---|
date | Wed, 27 Sep 2006 00:31:39 +0000 |
parents | 6b8bc59414f0 |
children | d1a76ccb93c4 |
comparison
equal
deleted
inserted
replaced
14631:622931ca5622 | 14632:108152f29f37 |
---|---|
423 | 423 |
424 /* send an IM to to_uid */ | 424 /* send an IM to to_uid */ |
425 void qq_send_packet_im(GaimConnection *gc, guint32 to_uid, gchar *msg, gint type) | 425 void qq_send_packet_im(GaimConnection *gc, guint32 to_uid, gchar *msg, gint type) |
426 { | 426 { |
427 qq_data *qd; | 427 qq_data *qd; |
428 guint8 *cursor, *raw_data, *send_im_tail, *md5; | 428 guint8 *cursor, *raw_data, *send_im_tail; |
429 guint16 client_tag, normal_im_type; | 429 guint16 client_tag, normal_im_type; |
430 gint msg_len, raw_len, font_name_len, tail_len, bytes; | 430 gint msg_len, raw_len, font_name_len, tail_len, bytes; |
431 time_t now; | 431 time_t now; |
432 gchar *msg_filtered; | 432 gchar *msg_filtered; |
433 GData *attribs; | 433 GData *attribs; |
481 | 481 |
482 gaim_debug(GAIM_DEBUG_INFO, "QQ_MESG", "send mesg: %s\n", msg); | 482 gaim_debug(GAIM_DEBUG_INFO, "QQ_MESG", "send mesg: %s\n", msg); |
483 msg_filtered = gaim_markup_strip_html(msg); | 483 msg_filtered = gaim_markup_strip_html(msg); |
484 msg_len = strlen(msg_filtered); | 484 msg_len = strlen(msg_filtered); |
485 now = time(NULL); | 485 now = time(NULL); |
486 md5 = _gen_session_md5(qd->uid, qd->session_key); | |
487 | 486 |
488 font_name_len = (font_name) ? strlen(font_name) : DEFAULT_FONT_NAME_LEN; | 487 font_name_len = (font_name) ? strlen(font_name) : DEFAULT_FONT_NAME_LEN; |
489 tail_len = font_name_len + QQ_SEND_IM_AFTER_MSG_HEADER_LEN + 1; | 488 tail_len = font_name_len + QQ_SEND_IM_AFTER_MSG_HEADER_LEN + 1; |
490 | 489 |
491 raw_len = QQ_SEND_IM_BEFORE_MSG_LEN + msg_len + tail_len; | 490 raw_len = QQ_SEND_IM_BEFORE_MSG_LEN + msg_len + tail_len; |
502 /* 010-013: receiver uid */ | 501 /* 010-013: receiver uid */ |
503 bytes += create_packet_dw(raw_data, &cursor, qd->uid); | 502 bytes += create_packet_dw(raw_data, &cursor, qd->uid); |
504 /* 014-017: sender uid */ | 503 /* 014-017: sender uid */ |
505 bytes += create_packet_dw(raw_data, &cursor, to_uid); | 504 bytes += create_packet_dw(raw_data, &cursor, to_uid); |
506 /* 018-033: md5 of (uid+session_key) */ | 505 /* 018-033: md5 of (uid+session_key) */ |
507 bytes += create_packet_data(raw_data, &cursor, md5, 16); | 506 bytes += create_packet_data(raw_data, &cursor, qd->session_md5, 16); |
508 /* 034-035: message type */ | 507 /* 034-035: message type */ |
509 bytes += create_packet_w(raw_data, &cursor, normal_im_type); | 508 bytes += create_packet_w(raw_data, &cursor, normal_im_type); |
510 /* 036-037: sequence number */ | 509 /* 036-037: sequence number */ |
511 bytes += create_packet_w(raw_data, &cursor, qd->send_seq); | 510 bytes += create_packet_w(raw_data, &cursor, qd->send_seq); |
512 /* 038-041: send time */ | 511 /* 038-041: send time */ |