comparison libpurple/protocols/msn/msg.c @ 30845:6e7a0e87d589

Print SLP data as text if it's a negociating session message.
author masca@cpw.pidgin.im
date Tue, 06 Jul 2010 18:51:44 +0000
parents 721653babbbe
children e0c374ad8fd3
comparison
equal deleted inserted replaced
30844:7b1b7a4e0bb4 30845:6e7a0e87d589
650 g_string_append(str, "\r\n"); 650 g_string_append(str, "\r\n");
651 } 651 }
652 else 652 else
653 { 653 {
654 int i; 654 int i;
655 for (i = 0; i < msg->body_len; i++) 655 int bin_len;
656
657 if (msg->part->footer->value == P2P_APPID_SESION)
658 bin_len = P2P_PACKET_HEADER_SIZE;
659 else
660 bin_len = body_len;
661
662 for (i = 0; i < bin_len; i++)
656 { 663 {
657 g_string_append_printf(str, "%.2hhX ", body[i]); 664 g_string_append_printf(str, "%.2hhX ", body[i]);
658 if ((i % 16) == 15) 665 if ((i % 16) == 15)
659 g_string_append(str, "\r\n"); 666 g_string_append(str, "\r\n");
660 } 667 }
668
669 if (bin_len == P2P_PACKET_HEADER_SIZE)
670 g_string_append_printf(str, "%s ", body + P2P_PACKET_HEADER_SIZE);
661 g_string_append(str, "\r\n"); 671 g_string_append(str, "\r\n");
662 } 672 }
663 } 673 }
664 674
665 g_string_append_printf(str, "Footer: %u\r\n", msg->part->footer->value); 675 g_string_append_printf(str, "Footer: 0x%08X\r\n", msg->part->footer->value);
666 } 676 }
667 else 677 else
668 { 678 {
669 if (body != NULL) 679 if (body != NULL)
670 { 680 {