pidgin: c6f48a02: Don't print SOAP messages to debug log f...
qulogic at pidgin.im
qulogic at pidgin.im
Tue Jul 29 03:11:18 EDT 2008
-----------------------------------------------------------------
Revision: c6f48a020334f1614d2363fdc8f52c3ea71a0018
Ancestor: ac4ea8dd7d88b80021aa72a43b686f2bdc5514d3
Author: qulogic at pidgin.im
Date: 2008-07-29T07:01:30
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/c6f48a020334f1614d2363fdc8f52c3ea71a0018
Modified files:
libpurple/protocols/msn/contact.c
libpurple/protocols/msn/nexus.c
libpurple/protocols/msn/oim.c libpurple/protocols/msn/soap.c
libpurple/protocols/msn/soap.h
ChangeLog:
Don't print SOAP messages to debug log for "secure" requests. This is
really just for the login requests so that people don't accidentally
post their username and passwords.
Fixes #6445.
-------------- next part --------------
============================================================
--- libpurple/protocols/msn/contact.c aae823c63df3e5127a428d4483972333ffabb8f9
+++ libpurple/protocols/msn/contact.c a595e1136c24e79aeed249ea889ff1501dfc693b
@@ -228,8 +228,8 @@ msn_create_address_book(MsnSession *sess
msn_soap_message_send(session,
msn_soap_message_new(MSN_ADD_ADDRESSBOOK_SOAP_ACTION,
xmlnode_from_str(body, -1)),
- MSN_CONTACT_SERVER, MSN_ADDRESS_BOOK_POST_URL, msn_create_address_cb,
- session);
+ MSN_CONTACT_SERVER, MSN_ADDRESS_BOOK_POST_URL, FALSE,
+ msn_create_address_cb, session);
g_free(body);
}
@@ -415,7 +415,7 @@ msn_get_contact_list(MsnSession *session
msn_soap_message_send(session,
msn_soap_message_new(MSN_GET_CONTACT_SOAP_ACTION,
xmlnode_from_str(body, -1)),
- MSN_CONTACT_SERVER, MSN_GET_CONTACT_POST_URL,
+ MSN_CONTACT_SERVER, MSN_GET_CONTACT_POST_URL, FALSE,
msn_get_contact_list_cb, g_memdup(&cb_data, sizeof(cb_data)));
g_free(update_str);
@@ -815,8 +815,8 @@ msn_get_address_book(MsnSession *session
msn_soap_message_send(session,
msn_soap_message_new(MSN_GET_ADDRESS_SOAP_ACTION,
xmlnode_from_str(body, -1)),
- MSN_CONTACT_SERVER, MSN_ADDRESS_BOOK_POST_URL, msn_get_address_cb,
- session);
+ MSN_CONTACT_SERVER, MSN_ADDRESS_BOOK_POST_URL, FALSE,
+ msn_get_address_cb, session);
g_free(update_str);
g_free(body);
@@ -917,7 +917,8 @@ msn_contact_request(MsnCallbackState *st
msn_nexus_get_token_str(state->session->nexus, MSN_AUTH_CONTACTS), -1);
msn_soap_message_send(state->session,
msn_soap_message_new(state->post_action, xmlnode_copy(state->body)),
- MSN_CONTACT_SERVER, state->post_url, msn_contact_request_cb, state);
+ MSN_CONTACT_SERVER, state->post_url, FALSE,
+ msn_contact_request_cb, state);
return FALSE;
}
============================================================
--- libpurple/protocols/msn/nexus.c fabbea9a7e5fb9741d3c407c606602ef9e676b71
+++ libpurple/protocols/msn/nexus.c c9fa9911faf55797d8249a045192e879ca971dcc
@@ -411,7 +411,7 @@ msn_nexus_connect(MsnNexus *nexus)
soap = msn_soap_message_new(NULL, xmlnode_from_str(request, -1));
g_free(request);
- msn_soap_message_send(session, soap, MSN_SSO_SERVER, SSO_POST_URL,
+ msn_soap_message_send(session, soap, MSN_SSO_SERVER, SSO_POST_URL, TRUE,
nexus_got_response_cb, nexus);
}
@@ -597,7 +597,7 @@ msn_nexus_update_token(MsnNexus *nexus,
soap = msn_soap_message_new(NULL, xmlnode_from_str(request, -1));
g_free(request);
- msn_soap_message_send(session, soap, MSN_SSO_SERVER, SSO_POST_URL,
+ msn_soap_message_send(session, soap, MSN_SSO_SERVER, SSO_POST_URL, TRUE,
nexus_got_update_cb, ud);
}
============================================================
--- libpurple/protocols/msn/oim.c e9de21ec6181704104a6655a93a184e2056fc3e8
+++ libpurple/protocols/msn/oim.c 08f139bb159e8a73f2ea8e8c4b71a422331a6f83
@@ -219,7 +219,8 @@ msn_oim_request_helper(MsnOimRequestData
msn_soap_message_send(session,
msn_soap_message_new(data->action, xmlnode_copy(data->body)),
- data->host, data->url, msn_oim_request_cb, data);
+ data->host, data->url, FALSE,
+ msn_oim_request_cb, data);
}
============================================================
--- libpurple/protocols/msn/soap.c 8178ba07dceaf5900e45f1b09986a7bad1ceb2c4
+++ libpurple/protocols/msn/soap.c 8ad01aed24409a684d8f9ab04f32ea4dbb97f6b0
@@ -42,6 +42,7 @@ typedef struct _MsnSoapRequest {
typedef struct _MsnSoapRequest {
char *path;
MsnSoapMessage *message;
+ gboolean secure;
MsnSoapCallback cb;
gpointer cb_data;
} MsnSoapRequest;
@@ -76,8 +77,8 @@ static void msn_soap_connection_destroy(
static void msn_soap_connection_handle_next(MsnSoapConnection *conn);
static void msn_soap_connection_destroy(MsnSoapConnection *conn);
-static void msn_soap_message_send_internal(MsnSession *session,
- MsnSoapMessage *message, const char *host, const char *path,
+static void msn_soap_message_send_internal(MsnSession *session, MsnSoapMessage *message,
+ const char *host, const char *path, gboolean secure,
MsnSoapCallback cb, gpointer cb_data, gboolean first);
static void msn_soap_request_destroy(MsnSoapRequest *req, gboolean keep_message);
@@ -187,8 +188,8 @@ msn_soap_handle_redirect(MsnSoapConnecti
char *path;
if (purple_url_parse(url, &host, NULL, &path, NULL, NULL)) {
- msn_soap_message_send_internal(conn->session,
- conn->current_request->message, host, path,
+ msn_soap_message_send_internal(conn->session, conn->current_request->message,
+ host, path, conn->current_request->secure,
conn->current_request->cb, conn->current_request->cb_data, TRUE);
msn_soap_request_destroy(conn->current_request, TRUE);
@@ -309,6 +310,11 @@ msn_soap_process(MsnSoapConnection *conn
char *cursor;
char *linebreak;
+#ifndef MSN_UNSAFE_DEBUG
+ if (conn->current_request->secure)
+ purple_debug_info("soap", "Received secure request.\n");
+ else
+#endif
purple_debug_info("soap", "current %s\n", conn->buf->str);
cursor = conn->buf->str + conn->handled_len;
@@ -506,6 +512,11 @@ msn_soap_connection_run(gpointer data)
g_string_append(conn->buf, "\r\n");
g_string_append(conn->buf, body);
+#ifndef MSN_UNSAFE_DEBUG
+ if (req->secure)
+ purple_debug_info("soap", "Sending secure request.\n");
+ else
+#endif
purple_debug_info("soap", "%s\n", conn->buf->str);
conn->handled_len = 0;
@@ -534,16 +545,16 @@ msn_soap_message_send(MsnSession *sessio
void
msn_soap_message_send(MsnSession *session, MsnSoapMessage *message,
- const char *host, const char *path,
+ const char *host, const char *path, gboolean secure,
MsnSoapCallback cb, gpointer cb_data)
{
- msn_soap_message_send_internal(session, message, host, path, cb, cb_data,
- FALSE);
+ msn_soap_message_send_internal(session, message, host, path, secure,
+ cb, cb_data, FALSE);
}
static void
-msn_soap_message_send_internal(MsnSession *session,
- MsnSoapMessage *message, const char *host, const char *path,
+msn_soap_message_send_internal(MsnSession *session, MsnSoapMessage *message,
+ const char *host, const char *path, gboolean secure,
MsnSoapCallback cb, gpointer cb_data, gboolean first)
{
MsnSoapConnection *conn = msn_soap_get_connection(session, host);
@@ -551,6 +562,7 @@ msn_soap_message_send_internal(MsnSessio
req->path = g_strdup(path);
req->message = message;
+ req->secure = secure;
req->cb = cb;
req->cb_data = cb_data;
============================================================
--- libpurple/protocols/msn/soap.h 57f6d9b66c452a4a12d6651944c78d3423685402
+++ libpurple/protocols/msn/soap.h 6d89bc9e7b63447a6ed6f5fbf438479be95a59eb
@@ -47,8 +47,8 @@ void msn_soap_message_add_header(MsnSoap
void msn_soap_message_add_header(MsnSoapMessage *req,
const char *name, const char *value);
-void msn_soap_message_send(MsnSession *session,
- MsnSoapMessage *message, const char *host, const char *path,
+void msn_soap_message_send(MsnSession *session, MsnSoapMessage *message,
+ const char *host, const char *path, gboolean secure,
MsnSoapCallback cb, gpointer cb_data);
void msn_soap_message_destroy(MsnSoapMessage *message);
More information about the Commits
mailing list