soc.2010.msn-tlc: ef492fed: Remove replaced code.
masca at cpw.pidgin.im
masca at cpw.pidgin.im
Fri Jun 11 12:52:12 EDT 2010
-----------------------------------------------------------------
Revision: ef492fed05ca0246b8619c35e5c2b7c0b3639eef
Ancestor: f483541110cc65c870ddbd5f48726949dfa5f6f4
Author: masca at cpw.pidgin.im
Date: 2010-06-09T22:59:16
Branch: im.pidgin.soc.2010.msn-tlc
URL: http://d.pidgin.im/viewmtn/revision/info/ef492fed05ca0246b8619c35e5c2b7c0b3639eef
Modified files:
libpurple/protocols/msn/msg.c libpurple/protocols/msn/msg.h
ChangeLog:
Remove replaced code.
-------------- next part --------------
============================================================
--- libpurple/protocols/msn/msg.c f68e3e8ffa29733b9d4b1c9f97c89c6231d78d96
+++ libpurple/protocols/msn/msg.c 88db0d7df39a36a39fa3b2c1cad25a6952d0bdb9
@@ -161,46 +161,7 @@ msn_message_new_nudge(void)
return msg;
}
-#if 0
void
-msn_message_parse_slp_body(MsnMessage *msg, const char *body, size_t len)
-{
- MsnP2PHeader *header;
- MsnP2PHeader wire;
- const char *tmp;
- int body_len;
-
- tmp = body;
-
- if (len < sizeof(wire)) {
- g_return_if_reached();
- }
-
- /* Extract the binary SLP header */
- memcpy(&wire, tmp, sizeof(wire));
- tmp += sizeof(wire);
-
- header = msn_p2p_header_from_wire(&wire);
-
- memcpy(&msg->msnslp_header, (char*)header, sizeof(*header));
-
- g_free(header);
-
- /* Extract the body */
- body_len = len - (tmp - body);
- /* msg->body_len = msg->msnslp_header.length; */
-
- if (body_len > 0) {
- msg->body_len = len - (tmp - body);
- msg->body = g_malloc(msg->body_len + 1);
- memcpy(msg->body, tmp, msg->body_len);
- msg->body[msg->body_len] = '\0';
- tmp += body_len;
- }
-}
-#endif
-
-void
msn_message_parse_payload(MsnMessage *msg,
const char *payload, size_t payload_len,
const char *line_dem,const char *body_dem)
@@ -301,71 +262,22 @@ msn_message_parse_payload(MsnMessage *ms
msg->slpmsg = msn_slpmsg_new_from_data(tmp, payload_len - (tmp - tmp_base));
}
-#if 0
- {
- MsnP2PHeader *header;
- MsnP2PHeader wire;
- MsnP2PFooter footer;
- int body_len;
-
- if (payload_len - (tmp - tmp_base) < sizeof(header)) {
- g_free(tmp_base);
- g_return_if_reached();
- }
-
- msg->msnslp_message = TRUE;
-
- /* Extract the binary SLP header */
- memcpy(&wire, tmp, sizeof(wire));
- tmp += sizeof(wire);
-
- header = msn_p2p_header_from_wire(&wire);
-
- memcpy(&msg->msnslp_header, (char*)header, sizeof(*header));
-
- g_free(header);
-
- body_len = payload_len - (tmp - tmp_base) - sizeof(footer);
-
- /* Extract the body */
- if (body_len > 0) {
- msg->body_len = body_len;
- g_free(msg->body);
- msg->body = g_malloc(msg->body_len + 1);
- memcpy(msg->body, tmp, msg->body_len);
- msg->body[msg->body_len] = '\0';
- tmp += body_len;
- }
-
- /* Extract the footer */
- if (body_len >= 0) {
- memcpy(&footer, tmp, sizeof(footer));
- tmp += sizeof(footer);
- msg->msnslp_footer.value = GUINT32_FROM_BE(footer.value);
- }
+ if (payload_len - (tmp - tmp_base) > 0) {
+ msg->body_len = payload_len - (tmp - tmp_base);
+ g_free(msg->body);
+ msg->body = g_malloc(msg->body_len + 1);
+ memcpy(msg->body, tmp, msg->body_len);
+ msg->body[msg->body_len] = '\0';
}
- else
- {
-#endif
- if (payload_len - (tmp - tmp_base) > 0) {
- msg->body_len = payload_len - (tmp - tmp_base);
- g_free(msg->body);
- msg->body = g_malloc(msg->body_len + 1);
- memcpy(msg->body, tmp, msg->body_len);
- msg->body[msg->body_len] = '\0';
- }
- if ((!content_type || !strcmp(content_type, "text/plain"))
+ if ((!content_type || !strcmp(content_type, "text/plain"))
&& msg->charset == NULL) {
- char *body = g_convert(msg->body, msg->body_len, "UTF-8",
- "ISO-8859-1", NULL, &msg->body_len, NULL);
- g_free(msg->body);
- msg->body = body;
- msg->charset = g_strdup("UTF-8");
- }
-#if 0
+ char *body = g_convert(msg->body, msg->body_len, "UTF-8",
+ "ISO-8859-1", NULL, &msg->body_len, NULL);
+ g_free(msg->body);
+ msg->body = body;
+ msg->charset = g_strdup("UTF-8");
}
-#endif
g_free(tmp_base);
}
@@ -389,39 +301,6 @@ msn_message_gen_slp_body(MsnMessage *msg
char *
msn_message_gen_slp_body(MsnMessage *msg, size_t *ret_size)
{
-#if 0
- MsnP2PHeader *header;
-
- char *tmp, *base;
- const void *body;
- size_t len, body_len;
-
- g_return_val_if_fail(msg != NULL, NULL);
-
- len = MSN_BUF_LEN;
-
- base = tmp = g_malloc(len + 1);
-
- body = msn_message_get_bin_data(msg, &body_len);
-
- header = msn_p2p_header_to_wire(&(msg->msnslp_header));
-
- memcpy(tmp, header, 48);
- tmp += 48;
-
- g_free(header);
-
- if (body != NULL)
- {
- memcpy(tmp, body, body_len);
- tmp += body_len;
- }
-
- if (ret_size != NULL)
- *ret_size = tmp - base;
-
- return base;
-#endif
char *tmp;
tmp = msn_slpmsg_serialize(msg->slpmsg, ret_size);
@@ -487,29 +366,6 @@ msn_message_gen_payload(MsnMessage *msg,
memcpy(n, body, siz);
n += siz;
-#if 0
- MsnP2PHeader *header;
- MsnP2PFooter footer;
-
- header = msn_p2p_header_to_wire(&(msg->msnslp_header));
-
- memcpy(n, header, 48);
- n += 48;
-
- g_free(header);
-
- if (body != NULL)
- {
- memcpy(n, body, body_len);
-
- n += body_len;
- }
-
- footer.value = GUINT32_TO_BE(msg->msnslp_footer.value);
-
- memcpy(n, &footer, 4);
- n += 4;
-#endif
}
else
{
============================================================
--- libpurple/protocols/msn/msg.h 7c034264171cab1d93018fb274b9ab6ba9758a20
+++ libpurple/protocols/msn/msg.h 56760f9c0b0dd2d7bc99c3fccf5e28bb9a7bf136
@@ -307,9 +307,6 @@ void msn_message_show_readable(MsnMessag
void msn_message_show_readable(MsnMessage *msg, const char *info,
gboolean text_body);
-void msn_message_parse_slp_body(MsnMessage *msg, const char *body,
- size_t len);
-
char *msn_message_gen_slp_body(MsnMessage *msg, size_t *ret_size);
char *msn_message_to_string(MsnMessage *msg);
More information about the Commits
mailing list