Mercurial > pidgin
comparison libpurple/protocols/msn/slplink.c @ 30826:f4c86572e745
Fix debug_*_to_file to process SlpMessages instead of MsnMessages.
author | masca@cpw.pidgin.im |
---|---|
date | Tue, 22 Jun 2010 23:09:36 +0000 |
parents | 07a9356ad2e0 |
children | 471e9b81da41 |
comparison
equal
deleted
inserted
replaced
30825:91ba047e838c | 30826:f4c86572e745 |
---|---|
32 #include "sbconn.h" | 32 #include "sbconn.h" |
33 #include "switchboard.h" | 33 #include "switchboard.h" |
34 #include "slp.h" | 34 #include "slp.h" |
35 #include "p2p.h" | 35 #include "p2p.h" |
36 | 36 |
37 #if 0 | |
38 #ifdef MSN_DEBUG_SLP_FILES | 37 #ifdef MSN_DEBUG_SLP_FILES |
39 static int m_sc = 0; | 38 static int m_sc = 0; |
40 static int m_rc = 0; | 39 static int m_rc = 0; |
41 | 40 |
42 static void | 41 static void |
43 debug_msg_to_file(MsnMessage *msg, gboolean send) | 42 debug_part_to_file(MsnSlpMessage *msg, gboolean send) |
44 { | 43 { |
45 char *tmp; | 44 char *tmp; |
46 char *dir; | 45 char *dir; |
47 char *pload; | 46 char *data; |
48 int c; | 47 int c; |
49 gsize pload_size; | 48 gsize data_size; |
50 | 49 |
51 dir = send ? "send" : "recv"; | 50 dir = send ? "send" : "recv"; |
52 c = send ? m_sc++ : m_rc++; | 51 c = send ? m_sc++ : m_rc++; |
53 tmp = g_strdup_printf("%s/msntest/%s/%03d", g_get_home_dir(), dir, c); | 52 tmp = g_strdup_printf("%s/msntest/%s/%03d", g_get_home_dir(), dir, c); |
54 pload = msn_message_gen_payload(msg, &pload_size); | 53 data = msn_slpmsg_serialize(msg, &data_size); |
55 if (!purple_util_write_data_to_file_absolute(tmp, pload, pload_size)) | 54 if (!purple_util_write_data_to_file_absolute(tmp, data, data_size)) |
56 { | 55 { |
57 purple_debug_error("msn", "could not save debug file\n"); | 56 purple_debug_error("msn", "could not save debug file\n"); |
58 } | 57 } |
59 g_free(tmp); | 58 g_free(tmp); |
60 } | 59 } |
61 #endif | 60 #endif |
62 #endif /* 0 */ | |
63 | 61 |
64 /************************************************************************** | 62 /************************************************************************** |
65 * Main | 63 * Main |
66 **************************************************************************/ | 64 **************************************************************************/ |
67 | 65 |
333 | 331 |
334 #if 0 | 332 #if 0 |
335 /* TODO: port this function to SlpMessageParts */ | 333 /* TODO: port this function to SlpMessageParts */ |
336 if (purple_debug_is_verbose()) | 334 if (purple_debug_is_verbose()) |
337 msn_message_show_readable(msg, slpmsg->info, slpmsg->text_body); | 335 msn_message_show_readable(msg, slpmsg->info, slpmsg->text_body); |
336 #endif | |
338 | 337 |
339 #ifdef MSN_DEBUG_SLP_FILES | 338 #ifdef MSN_DEBUG_SLP_FILES |
340 debug_msg_to_file(msg, TRUE); | 339 debug_part_to_file(slpmsg, TRUE); |
341 #endif | |
342 #endif | 340 #endif |
343 | 341 |
344 slpmsg->parts = g_list_append(slpmsg->parts, part); | 342 slpmsg->parts = g_list_append(slpmsg->parts, part); |
345 msn_slplink_send_part(slplink, part); | 343 msn_slplink_send_part(slplink, part); |
346 | 344 |