diff libpurple/protocols/msn/soap.c @ 20489:321d25932f5e

Fix a bug where we were g_strdup'ing a previously freed pointer. Thanks to khc for the debugging.
author Carlos Silva <typ0@pidgin.im>
date Mon, 03 Sep 2007 20:32:57 +0000
parents eb93710aec4d
children 2d8999540239
line wrap: on
line diff
--- a/libpurple/protocols/msn/soap.c	Mon Sep 03 06:15:55 2007 +0000
+++ b/libpurple/protocols/msn/soap.c	Mon Sep 03 20:32:57 2007 +0000
@@ -634,6 +634,8 @@
 void
 msn_soap_post_head_request(MsnSoapConn *soapconn)
 {
+	purple_debug_info("MSN SOAP", "Posting new request from head of the queue\n");
+	
 	g_return_if_fail(soapconn->soap_queue != NULL);
 
 	if(!g_queue_is_empty(soapconn->soap_queue)){
@@ -641,8 +643,10 @@
 		if((request = g_queue_pop_head(soapconn->soap_queue)) != NULL){
 			msn_soap_post_request(soapconn,request);
 		}
+	} else {
+		purple_debug_info("MSN SOAP", "No requests to process found.\n");
+		msn_soap_set_process_step(soapconn,MSN_SOAP_CONNECTED_IDLE);
 	}
-	msn_soap_set_process_step(soapconn,MSN_SOAP_CONNECTED_IDLE);
 }
 
 /*post the soap request ,
@@ -670,11 +674,9 @@
 	 * we just waiting...
 	 * If we send the request this time,error may occure
 	 */
-#if 0
-	if(soapconn->step == MSN_SOAP_CONNECTED_IDLE){
+	if (soapconn->step == MSN_SOAP_CONNECTED_IDLE){
 		msn_soap_post_head_request(soapconn);
 	}
-#endif
 }
 
 /*Post the soap request action*/
@@ -690,7 +692,7 @@
 	purple_debug_misc("MSN SOAP","msn_soap_post_request()\n");
 #endif
 
-	msn_soap_set_process_step(soapconn,MSN_SOAP_PROCESSING);
+	msn_soap_set_process_step(soapconn, MSN_SOAP_PROCESSING);
 	soap_head = g_strdup_printf(
 					"POST %s HTTP/1.1\r\n"
 					"SOAPAction: %s\r\n"