libpurple/protocols/msn/msg.c

changeset 31367
743e9d0967aa
parent 31294
73607ab89c6f
child 31563
da3f8abc7484
equal deleted inserted replaced
31366:9a87690a997f 31367:743e9d0967aa
611 611
612 body = msn_message_get_bin_data(msg, &body_len); 612 body = msn_message_get_bin_data(msg, &body_len);
613 613
614 if (msg->msnslp_message) 614 if (msg->msnslp_message)
615 { 615 {
616 g_string_append_printf(str, "Session ID: %u\r\n", msg->part->header->session_id); 616 msn_slpmsgpart_to_string(msg->part, str);
617 g_string_append_printf(str, "ID: %u\r\n", msg->part->header->id);
618 g_string_append_printf(str, "Offset: %" G_GUINT64_FORMAT "\r\n", msg->part->header->offset);
619 g_string_append_printf(str, "Total size: %" G_GUINT64_FORMAT "\r\n", msg->part->header->total_size);
620 g_string_append_printf(str, "Length: %u\r\n", msg->part->header->length);
621 g_string_append_printf(str, "Flags: 0x%x\r\n", msg->part->header->flags);
622 g_string_append_printf(str, "ACK ID: %u\r\n", msg->part->header->ack_id);
623 g_string_append_printf(str, "SUB ID: %u\r\n", msg->part->header->ack_sub_id);
624 g_string_append_printf(str, "ACK Size: %" G_GUINT64_FORMAT "\r\n", msg->part->header->ack_size);
625 617
626 if (purple_debug_is_verbose() && body != NULL) 618 if (purple_debug_is_verbose() && body != NULL)
627 { 619 {
628 if (text_body) 620 if (text_body)
629 { 621 {
636 g_string_append(str, "\r\n"); 628 g_string_append(str, "\r\n");
637 } 629 }
638 else 630 else
639 { 631 {
640 int i; 632 int i;
641 int bin_len; 633
642 634 for (i = 0; i < body_len; i++)
643 if (msg->part->footer->value == P2P_APPID_SESSION)
644 bin_len = P2P_PACKET_HEADER_SIZE;
645 else
646 bin_len = body_len;
647
648 for (i = 0; i < bin_len; i++)
649 { 635 {
650 g_string_append_printf(str, "%.2hhX ", body[i]); 636 g_string_append_printf(str, "%.2hhX ", body[i]);
651 if ((i % 16) == 15) 637 if ((i % 16) == 15)
652 g_string_append(str, "\r\n"); 638 g_string_append(str, "\r\n");
653 } 639 }
654 640
655 if (bin_len == P2P_PACKET_HEADER_SIZE)
656 g_string_append_printf(str, "%s ", body + P2P_PACKET_HEADER_SIZE);
657 g_string_append(str, "\r\n"); 641 g_string_append(str, "\r\n");
658 } 642 }
659 } 643 }
660
661 g_string_append_printf(str, "Footer: 0x%08X\r\n", msg->part->footer->value);
662 } 644 }
663 else 645 else
664 { 646 {
665 if (body != NULL) 647 if (body != NULL)
666 { 648 {

mercurial