/pidgin/main: cd43092f4731: Merged in CMaiku/pidgin (pull reques...

Gary Kramlich grim at reaperworld.com
Sat Jan 23 14:06:34 EST 2016


Changeset: cd43092f4731e9e4187e6a51d376230e9b301464
Author:	 Gary Kramlich <grim at reaperworld.com>
Date:	 2016-01-23 12:54 -0600
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/cd43092f4731

Description:

Merged in CMaiku/pidgin (pull request #13)

Don't have proxy code call callbacks if connect data disposed

diffstat:

 libpurple/proxy.c |  52 +++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 37 insertions(+), 15 deletions(-)

diffs (76 lines):

diff --git a/libpurple/proxy.c b/libpurple/proxy.c
--- a/libpurple/proxy.c
+++ b/libpurple/proxy.c
@@ -732,11 +732,19 @@ connect_to_host_cb(GObject *source, GAsy
 	conn = g_socket_client_connect_to_host_finish(G_SOCKET_CLIENT(source),
 			res, &error);
 	if (conn == NULL) {
-		purple_debug_error("proxy",
-				"Unable to connect to destination host: %s\n",
-				error->message);
-		purple_proxy_connect_data_disconnect(connect_data,
-				"Unable to connect to destination host.\n");
+		/* Ignore cancelled error as that signifies connect_data has
+		 * been freed
+		 */
+		if (!g_error_matches(error, G_IO_ERROR,
+				G_IO_ERROR_CANCELLED)) {
+			purple_debug_error("proxy", "Unable to connect to "
+					"destination host: %s\n",
+					error->message);
+			purple_proxy_connect_data_disconnect(connect_data,
+					"Unable to connect to destination "
+					"host.\n");
+		}
+
 		g_clear_error(&error);
 		return;
 	}
@@ -817,11 +825,19 @@ socks5_proxy_connect_cb(GObject *source,
 	stream = g_proxy_connect_finish(G_PROXY(source), res, &error);
 
 	if (stream == NULL) {
-		purple_debug_error("proxy",
-				"Unable to connect to destination host: %s\n",
-				error->message);
-		purple_proxy_connect_data_disconnect(connect_data,
-				"Unable to connecto to destination host.\n");
+		/* Ignore cancelled error as that signifies connect_data has
+		 * been freed
+		 */
+		if (!g_error_matches(error, G_IO_ERROR,
+				G_IO_ERROR_CANCELLED)) {
+			purple_debug_error("proxy", "Unable to connect to "
+					"destination host: %s\n",
+					error->message);
+			purple_proxy_connect_data_disconnect(connect_data,
+					"Unable to connect to destination "
+					"host.\n");
+		}
+
 		g_clear_error(&error);
 		return;
 	}
@@ -869,11 +885,17 @@ socks5_connect_to_host_cb(GObject *sourc
 	conn = g_socket_client_connect_to_host_finish(G_SOCKET_CLIENT(source),
 			res, &error);
 	if (conn == NULL) {
-		purple_debug_error("proxy",
-				"Unable to connect to SOCKS5 host: %s\n",
-				error->message);
-		purple_proxy_connect_data_disconnect(connect_data,
-				"Unable to connect to SOCKS5 host.\n");
+		/* Ignore cancelled error as that signifies connect_data has
+		 * been freed
+		 */
+		if (!g_error_matches(error, G_IO_ERROR,
+				G_IO_ERROR_CANCELLED)) {
+			purple_debug_error("proxy", "Unable to connect to "
+					"SOCKS5 host: %s\n", error->message);
+			purple_proxy_connect_data_disconnect(connect_data,
+					"Unable to connect to SOCKS5 host.\n");
+		}
+
 		g_clear_error(&error);
 		return;
 	}



More information about the Commits mailing list