Mercurial > pidgin
comparison libgaim/protocols/qq/send_file.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 | acd886ea473e |
comparison
equal
deleted
inserted
replaced
14631:622931ca5622 | 14632:108152f29f37 |
---|---|
279 static gint _qq_create_packet_file_header | 279 static gint _qq_create_packet_file_header |
280 (guint8 *raw_data, guint8 **cursor, guint32 to_uid, guint16 message_type, qq_data *qd, gboolean seq_ack) | 280 (guint8 *raw_data, guint8 **cursor, guint32 to_uid, guint16 message_type, qq_data *qd, gboolean seq_ack) |
281 { | 281 { |
282 gint bytes; | 282 gint bytes; |
283 time_t now; | 283 time_t now; |
284 guint8 *md5; | |
285 guint16 seq; | 284 guint16 seq; |
286 ft_info *info; | 285 ft_info *info; |
287 | 286 |
288 bytes = 0; | 287 bytes = 0; |
289 now = time(NULL); | 288 now = time(NULL); |
290 md5 = _gen_session_md5(qd->uid, qd->session_key); | |
291 if (!seq_ack) seq = qd->send_seq; | 289 if (!seq_ack) seq = qd->send_seq; |
292 else { | 290 else { |
293 info = (ft_info *) qd->xfer->data; | 291 info = (ft_info *) qd->xfer->data; |
294 seq = info->send_seq; | 292 seq = info->send_seq; |
295 } | 293 } |
303 /* 010-013: receiver uid */ | 301 /* 010-013: receiver uid */ |
304 bytes += create_packet_dw (raw_data, cursor, qd->uid); | 302 bytes += create_packet_dw (raw_data, cursor, qd->uid); |
305 /* 014-017: sender uid */ | 303 /* 014-017: sender uid */ |
306 bytes += create_packet_dw (raw_data, cursor, to_uid); | 304 bytes += create_packet_dw (raw_data, cursor, to_uid); |
307 /* 018-033: md5 of (uid+session_key) */ | 305 /* 018-033: md5 of (uid+session_key) */ |
308 bytes += create_packet_data (raw_data, cursor, md5, 16); | 306 bytes += create_packet_data (raw_data, cursor, qd->session_md5, 16); |
309 /* 034-035: message type */ | 307 /* 034-035: message type */ |
310 bytes += create_packet_w (raw_data, cursor, message_type); | 308 bytes += create_packet_w (raw_data, cursor, message_type); |
311 /* 036-037: sequence number */ | 309 /* 036-037: sequence number */ |
312 bytes += create_packet_w (raw_data, cursor, seq); | 310 bytes += create_packet_w (raw_data, cursor, seq); |
313 /* 038-041: send time */ | 311 /* 038-041: send time */ |
330 bytes += create_packet_w (raw_data, cursor, 0x0000); | 328 bytes += create_packet_w (raw_data, cursor, 0x0000); |
331 bytes += create_packet_b (raw_data, cursor, 0x00); | 329 bytes += create_packet_b (raw_data, cursor, 0x00); |
332 /* 063: transfer_type, 0x65: FILE 0x6b: FACE */ | 330 /* 063: transfer_type, 0x65: FILE 0x6b: FACE */ |
333 bytes += create_packet_b (raw_data, cursor, QQ_FILE_TRANSFER_FILE); /* FIXME */ | 331 bytes += create_packet_b (raw_data, cursor, QQ_FILE_TRANSFER_FILE); /* FIXME */ |
334 | 332 |
335 g_free (md5); | |
336 return bytes; | 333 return bytes; |
337 } | 334 } |
338 | 335 |
339 #if 0 | 336 #if 0 |
340 in_addr_t get_real_ip() | 337 in_addr_t get_real_ip() |