Mercurial > pidgin
comparison libpurple/protocols/qq/send_file.c @ 23051:55f986ccbb6a
patch-05-reconnect-and-code-cleanup
author | SHiNE CsyFeK <csyfek@gmail.com> |
---|---|
date | Tue, 24 Jun 2008 12:28:38 +0000 |
parents | 51dbe83ebbd3 |
children | 5c70d953a497 |
comparison
equal
deleted
inserted
replaced
23050:51dbe83ebbd3 | 23051:55f986ccbb6a |
---|---|
474 bytes += qq_put8 (raw_data + bytes, 0x1f); | 474 bytes += qq_put8 (raw_data + bytes, 0x1f); |
475 /* file length */ | 475 /* file length */ |
476 bytes += qq_putdata (raw_data + bytes, (guint8 *) filelen_str, filelen_strlen); | 476 bytes += qq_putdata (raw_data + bytes, (guint8 *) filelen_str, filelen_strlen); |
477 | 477 |
478 if (packet_len == bytes) | 478 if (packet_len == bytes) |
479 qq_send_cmd (gc, QQ_CMD_SEND_IM, TRUE, 0, TRUE, raw_data, bytes); | 479 qq_send_cmd (qd, QQ_CMD_SEND_IM, raw_data, bytes); |
480 else | 480 else |
481 purple_debug (PURPLE_DEBUG_INFO, "qq_send_packet_file_request", | 481 purple_debug (PURPLE_DEBUG_INFO, "qq_send_packet_file_request", |
482 "%d bytes expected but got %d bytes\n", | 482 "%d bytes expected but got %d bytes\n", |
483 packet_len, bytes); | 483 packet_len, bytes); |
484 | 484 |
515 | 515 |
516 info->local_minor_port = minor_port; | 516 info->local_minor_port = minor_port; |
517 info->local_real_ip = real_ip; | 517 info->local_real_ip = real_ip; |
518 | 518 |
519 if (packet_len == bytes) | 519 if (packet_len == bytes) |
520 qq_send_cmd (gc, QQ_CMD_SEND_IM, TRUE, 0, TRUE, raw_data, bytes); | 520 qq_send_cmd (qd, QQ_CMD_SEND_IM, raw_data, bytes); |
521 else | 521 else |
522 purple_debug (PURPLE_DEBUG_INFO, "qq_send_packet_file_accept", | 522 purple_debug (PURPLE_DEBUG_INFO, "qq_send_packet_file_accept", |
523 "%d bytes expected but got %d bytes\n", | 523 "%d bytes expected but got %d bytes\n", |
524 packet_len, bytes); | 524 packet_len, bytes); |
525 } | 525 } |
542 | 542 |
543 purple_debug(PURPLE_DEBUG_INFO, "QQ", "<== sending qq file notify ip packet\n"); | 543 purple_debug(PURPLE_DEBUG_INFO, "QQ", "<== sending qq file notify ip packet\n"); |
544 bytes += _qq_create_packet_file_header(raw_data + bytes, to_uid, QQ_FILE_TRANS_NOTIFY, qd, TRUE); | 544 bytes += _qq_create_packet_file_header(raw_data + bytes, to_uid, QQ_FILE_TRANS_NOTIFY, qd, TRUE); |
545 bytes += qq_fill_conn_info(raw_data + bytes, info); | 545 bytes += qq_fill_conn_info(raw_data + bytes, info); |
546 if (packet_len == bytes) | 546 if (packet_len == bytes) |
547 qq_send_cmd (gc, QQ_CMD_SEND_IM, TRUE, 0, TRUE, raw_data, bytes); | 547 qq_send_cmd (qd, QQ_CMD_SEND_IM, raw_data, bytes); |
548 else | 548 else |
549 purple_debug (PURPLE_DEBUG_INFO, "qq_send_packet_file_notify", | 549 purple_debug (PURPLE_DEBUG_INFO, "qq_send_packet_file_notify", |
550 "%d bytes expected but got %d bytes\n", | 550 "%d bytes expected but got %d bytes\n", |
551 packet_len, bytes); | 551 packet_len, bytes); |
552 | 552 |
570 bytes = 0; | 570 bytes = 0; |
571 | 571 |
572 bytes += _qq_create_packet_file_header(raw_data + bytes, to_uid, QQ_FILE_TRANS_DENY_UDP, qd, TRUE); | 572 bytes += _qq_create_packet_file_header(raw_data + bytes, to_uid, QQ_FILE_TRANS_DENY_UDP, qd, TRUE); |
573 | 573 |
574 if (packet_len == bytes) | 574 if (packet_len == bytes) |
575 qq_send_cmd (gc, QQ_CMD_SEND_IM, TRUE, 0, TRUE, raw_data, bytes); | 575 qq_send_cmd (qd, QQ_CMD_SEND_IM, raw_data, bytes); |
576 else | 576 else |
577 purple_debug (PURPLE_DEBUG_INFO, "qq_send_packet_file", | 577 purple_debug (PURPLE_DEBUG_INFO, "qq_send_packet_file", |
578 "%d bytes expected but got %d bytes\n", | 578 "%d bytes expected but got %d bytes\n", |
579 packet_len, bytes); | 579 packet_len, bytes); |
580 } | 580 } |
597 bytes += _qq_create_packet_file_header(raw_data + bytes, to_uid, QQ_FILE_TRANS_CANCEL, qd, TRUE); | 597 bytes += _qq_create_packet_file_header(raw_data + bytes, to_uid, QQ_FILE_TRANS_CANCEL, qd, TRUE); |
598 purple_debug(PURPLE_DEBUG_INFO, "_qq_send_packet_file_cancel", "end create header\n"); | 598 purple_debug(PURPLE_DEBUG_INFO, "_qq_send_packet_file_cancel", "end create header\n"); |
599 | 599 |
600 if (packet_len == bytes) { | 600 if (packet_len == bytes) { |
601 purple_debug(PURPLE_DEBUG_INFO, "_qq_send_packet_file_cancel", "before send cmd\n"); | 601 purple_debug(PURPLE_DEBUG_INFO, "_qq_send_packet_file_cancel", "before send cmd\n"); |
602 qq_send_cmd (gc, QQ_CMD_SEND_IM, TRUE, 0, TRUE, raw_data, bytes); | 602 qq_send_cmd (qd, QQ_CMD_SEND_IM, raw_data, bytes); |
603 } | 603 } |
604 else | 604 else |
605 purple_debug (PURPLE_DEBUG_INFO, "qq_send_packet_file", | 605 purple_debug (PURPLE_DEBUG_INFO, "qq_send_packet_file", |
606 "%d bytes expected but got %d bytes\n", | 606 "%d bytes expected but got %d bytes\n", |
607 packet_len, bytes); | 607 packet_len, bytes); |
936 } | 936 } |
937 | 937 |
938 /* | 938 /* |
939 static void qq_send_packet_request_key(PurpleConnection *gc, guint8 key) | 939 static void qq_send_packet_request_key(PurpleConnection *gc, guint8 key) |
940 { | 940 { |
941 qq_send_cmd(gc, QQ_CMD_REQUEST_KEY, TRUE, 0, TRUE, &key, 1); | 941 qq_send_cmd(gc, QQ_CMD_REQUEST_KEY, &key, 1); |
942 } | 942 } |
943 | 943 |
944 static void qq_process_recv_request_key(PurpleConnection *gc) | 944 static void qq_process_recv_request_key(PurpleConnection *gc) |
945 { | 945 { |
946 } | 946 } |