comparison libpurple/protocols/msn/slpmsg.c @ 30946:6cadf59c5835

This function isn't used and I've been trying to find the bug in it. So I guess it needs to go!
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Mon, 22 Nov 2010 02:38:29 +0000
parents 18c5d3c482c7
children 72e6fa6caecc
comparison
equal deleted inserted replaced
30945:18c5d3c482c7 30946:6cadf59c5835
48 else 48 else
49 slpmsg->slplink = NULL; 49 slpmsg->slplink = NULL;
50 50
51 slpmsg->header = g_new0(MsnP2PHeader, 1); 51 slpmsg->header = g_new0(MsnP2PHeader, 1);
52 slpmsg->footer = NULL; 52 slpmsg->footer = NULL;
53
54 return slpmsg;
55 }
56
57 MsnSlpMessage *msn_slpmsg_new_from_data(const char *data, size_t data_len)
58 {
59 MsnSlpMessage *slpmsg;
60 MsnP2PHeader *header;
61 const char *tmp;
62 int body_len;
63
64 if (data_len < sizeof(*header)) {
65 return NULL;
66 }
67
68 tmp = data;
69 slpmsg = msn_slpmsg_new(NULL);
70
71 /* Extract the binary SLP header */
72 slpmsg->header = msn_p2p_header_from_wire((MsnP2PHeader*)tmp);
73
74 /* Extract the body */
75 body_len = data_len - (tmp - data);
76 /* msg->body_len = msg->msnslp_header.length; */
77
78 if (body_len > 0) {
79 slpmsg->size = body_len;
80 slpmsg->buffer = g_malloc(body_len);
81 memcpy(slpmsg->buffer, tmp, body_len);
82 tmp += body_len;
83 }
84
85 /* Extract the footer */
86 if (body_len >= 0)
87 slpmsg->footer = msn_p2p_footer_from_wire((MsnP2PFooter*)tmp);
88 53
89 return slpmsg; 54 return slpmsg;
90 } 55 }
91 56
92 void 57 void