changeset 24944:b474cd321e88

make this toggleable via env instead of #define
author Ka-Hing Cheung <khc@hxbc.us>
date Sun, 11 Jan 2009 22:31:01 +0000
parents 1eedb375c937
children b0e069922896
files libpurple/protocols/msn/soap.c
diffstat 1 files changed, 7 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/soap.c	Sun Jan 11 22:28:21 2009 +0000
+++ b/libpurple/protocols/msn/soap.c	Sun Jan 11 22:31:01 2009 +0000
@@ -68,6 +68,7 @@
 
 	GQueue *queue;
 	MsnSoapRequest *current_request;
+	gboolean unsafe_debug;
 } MsnSoapConnection;
 
 static gboolean msn_soap_connection_run(gpointer data);
@@ -79,6 +80,7 @@
 	conn->session = session;
 	conn->host = g_strdup(host);
 	conn->queue = g_queue_new();
+	conn->unsafe_debug = g_getenv("PURPLE_MSN_UNSAFE_DEBUG") != NULL;
 	return conn;
 }
 
@@ -504,12 +506,10 @@
 	if (cnt < 0 && perrno != EAGAIN)
 		purple_debug_info("soap", "read: %s\n", g_strerror(perrno));
 
-#ifndef MSN_UNSAFE_DEBUG
-	if (conn->current_request && conn->current_request->secure)
+	if (conn->current_request && conn->current_request->secure &&
+		!conn->unsafe_debug)
 		purple_debug_misc("soap", "Received secure request.\n");
-	else
-#endif
-	if (count != 0)
+	else if (count != 0)
 		purple_debug_misc("soap", "current %s\n", conn->buf->str + cursor);
 
 	/* && count is necessary for Adium, on OS X the last read always
@@ -657,12 +657,10 @@
 			g_string_append(conn->buf, "\r\n");
 			g_string_append(conn->buf, body);
 
-#ifndef MSN_UNSAFE_DEBUG
-			if (req->secure)
+			if (req->secure && !conn->unsafe_debug)
 				purple_debug_misc("soap", "Sending secure request.\n");
 			else
-#endif
-			purple_debug_misc("soap", "%s\n", conn->buf->str);
+				purple_debug_misc("soap", "%s\n", conn->buf->str);
 
 			conn->handled_len = 0;
 			conn->current_request = req;