changeset 8207:aa44049e8891

[gaim-migrate @ 8930] This doesn't fix HTTP method, but it does add debug info and prevent sending PNGs when using HTTP method, since that would cause a disconnect. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Wed, 04 Feb 2004 06:26:54 +0000
parents e0d16895a0e3
children bfbba1a7710a
files src/protocols/msn/httpmethod.c src/protocols/msn/msn.c src/protocols/msn/switchboard.c
diffstat 3 files changed, 15 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/msn/httpmethod.c	Tue Feb 03 16:31:39 2004 +0000
+++ b/src/protocols/msn/httpmethod.c	Wed Feb 04 06:26:54 2004 +0000
@@ -50,14 +50,14 @@
 {
 	MsnServConn *servconn = data;
 
-#if 0	
 	gaim_debug_info("msn", "Polling server %s.\n",
 					servconn->http_data->gateway_ip);
-#endif
 	msn_http_servconn_poll(servconn);
 
 	servconn->http_data->timer = 0;
 
+	gaim_debug(GAIM_DEBUG_INFO, "msn", "Returning from http_poll\n");
+
 	return FALSE;
 }
 
@@ -66,6 +66,7 @@
 {
 	if (servconn->http_data->timer)
 	{
+		gaim_debug(GAIM_DEBUG_INFO, "msn", "Stopping timer\n");
 		g_source_remove(servconn->http_data->timer);
 		servconn->http_data->timer = 0;
 	}
@@ -76,6 +77,7 @@
 {
 	stop_timer(servconn);
 
+	gaim_debug(GAIM_DEBUG_INFO, "msn", "Starting timer\n");
 	servconn->http_data->timer = g_timeout_add(5000, http_poll, servconn);
 }
 
@@ -162,7 +164,7 @@
 
 	s = 0;
 	needed = strlen(temp);
-	
+
 	do {
 		res = write(servconn->fd, temp, needed);
 		if (res >= 0)
@@ -174,7 +176,7 @@
 			return -1;
 		}
 	} while (s < needed);
-		 
+
 	g_free(temp);
 
 	servconn->http_data->waiting_response = TRUE;
@@ -217,9 +219,7 @@
 		servconn->http_data->session_id,
 		servconn->http_data->gateway_ip);
 
-#if 0
 	gaim_debug_misc("msn", "Writing to HTTP: {%s}\n", temp);
-#endif
 
 	s = write(servconn->fd, temp, strlen(temp));
 
@@ -252,9 +252,7 @@
 	g_return_val_if_fail(ret_size != NULL, FALSE);
 	g_return_val_if_fail(error    != NULL, FALSE);
 
-#if 0	
 	gaim_debug_info("msn", "parsing data {%s} from fd %d\n", buf, servconn->fd);
-#endif	
 	servconn->http_data->waiting_response = FALSE;
 
 	gc = gaim_account_get_connection(servconn->session->account);
@@ -300,9 +298,7 @@
 	s += 4; /* Skip \r\n */
 	body = g_strndup(s, size - (s - buf));
 
-#if 0
 	gaim_debug_misc("msn", "Incoming HTTP buffer: {%s\r\n%s}", headers, body);
-#endif
 
 	if ((s = strstr(headers, "Content-Length: ")) != NULL)
 	{
--- a/src/protocols/msn/msn.c	Tue Feb 03 16:31:39 2004 +0000
+++ b/src/protocols/msn/msn.c	Wed Feb 04 06:26:54 2004 +0000
@@ -1061,13 +1061,16 @@
 	MsnSession *session = gc->proto_data;
 	char buf[MSN_BUF_LEN];
 
-	g_snprintf(buf, sizeof(buf), "PNG\r\n");
+	if (!session->http_method)
+	{
+		g_snprintf(buf, sizeof(buf), "PNG\r\n");
 
-	if (msn_servconn_write(session->notification_conn,
-						   buf, strlen(buf)) < 0) {
+		if (msn_servconn_write(session->notification_conn,
+							   buf, strlen(buf)) < 0) {
 
-		gaim_connection_error(gc, _("Write error"));
-		return;
+			gaim_connection_error(gc, _("Write error"));
+			return;
+		}
 	}
 }
 
--- a/src/protocols/msn/switchboard.c	Tue Feb 03 16:31:39 2004 +0000
+++ b/src/protocols/msn/switchboard.c	Wed Feb 04 06:26:54 2004 +0000
@@ -17,7 +17,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 #include "msn.h"
 #include "msnslp.h"