libpurple/protocols/mxit/login.c

changeset 33817
5c8caea5bd66
parent 33796
4854740e5277
parent 33815
094a4b10e8d5
child 33843
20d3040431eb
child 34111
85b5efb9a873
--- a/libpurple/protocols/mxit/login.c	Sun Mar 03 20:01:23 2013 -0800
+++ b/libpurple/protocols/mxit/login.c	Wed Mar 06 10:34:45 2013 -0500
@@ -393,6 +393,9 @@
 	purple_debug_info( MXIT_PLUGIN_ID, "HTTP RESPONSE: '%s'\n", url_text );
 #endif
 
+	/* remove request from the async outstanding calls list */
+	session->async_calls = g_slist_remove( session->async_calls, url_data );
+
 	if ( !url_text ) {
 		/* no reply from the WAP site */
 		purple_connection_error( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "Error contacting the MXit WAP site. Please try again later." ) );
@@ -568,8 +571,9 @@
 			MXIT_CAPTCHA_WIDTH,
 			time( NULL )
 	);
-	/* FIXME: This should be cancelled somewhere if not needed. */
 	url_data = purple_util_fetch_url_request( session->acc, url, TRUE, MXIT_HTTP_USERAGENT, TRUE, NULL, FALSE, -1, mxit_cb_clientinfo2, session );
+	if ( url_data )
+		session->async_calls = g_slist_prepend( session->async_calls, url_data );
 
 #ifdef	DEBUG_PROTOCOL
 	purple_debug_info( MXIT_PLUGIN_ID, "HTTP REQUEST: '%s'\n", url );
@@ -627,6 +631,9 @@
 	purple_debug_info( MXIT_PLUGIN_ID, "RESPONSE: %s\n", url_text );
 #endif
 
+	/* remove request from the async outstanding calls list */
+	session->async_calls = g_slist_remove( session->async_calls, url_data );
+
 	if ( !url_text ) {
 		/* no reply from the WAP site */
 		purple_connection_error( session->con, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _( "Error contacting the MXit WAP site. Please try again later." ) );
@@ -733,8 +740,9 @@
 
 	/* reference: "libpurple/util.h" */
 	url = g_strdup_printf( "%s/res/?type=challenge&getcountries=true&getlanguage=true&getimage=true&h=%i&w=%i&ts=%li", wapserver, MXIT_CAPTCHA_HEIGHT, MXIT_CAPTCHA_WIDTH, time( NULL ) );
-	/* FIXME: This should be cancelled somewhere if not needed. */
 	url_data = purple_util_fetch_url_request( session->acc, url, TRUE, MXIT_HTTP_USERAGENT, TRUE, NULL, FALSE, -1, mxit_cb_clientinfo1, session );
+	if ( url_data )
+		session->async_calls = g_slist_prepend( session->async_calls, url_data );
 
 #ifdef	DEBUG_PROTOCOL
 	purple_debug_info( MXIT_PLUGIN_ID, "HTTP REQUEST: '%s'\n", url );

mercurial