pidgin.next.minor: 2dd22d23: disapproval of revision 'cf02e7f6a3488e7...

rlaager at pidgin.im rlaager at pidgin.im
Mon Dec 1 12:25:45 EST 2008


-----------------------------------------------------------------
Revision: 2dd22d23da4543b04174ef30edee6b709b5ae552
Ancestor: cf02e7f6a3488e78b81601065f32c8eee8a19b4c
Author: rlaager at pidgin.im
Date: 2008-11-28T00:31:28
Branch: im.pidgin.pidgin.next.minor
URL: http://d.pidgin.im/viewmtn/revision/info/2dd22d23da4543b04174ef30edee6b709b5ae552

Modified files:
        libpurple/proxy.c

ChangeLog: 

disapproval of revision 'cf02e7f6a3488e78b81601065f32c8eee8a19b4c'
Comments: 

It turns out we do need to care about stderr with g_spawn_command_line_sync()
because if we don't pass a variable, it won't get captured, meaning it'll
go to the terminal, which we don't want.

-------------- next part --------------
============================================================
--- libpurple/proxy.c	0b3dd65b628a97f07c093459526f415b1af50b44
+++ libpurple/proxy.c	d66709a168339a364681abcc819b8a67dc5f4669
@@ -212,7 +212,7 @@ purple_gnome_proxy_get_info(void)
 {
 	static PurpleProxyInfo info = {0, NULL, 0, NULL, NULL};
 	gboolean use_same_proxy = FALSE;
-	gchar *tmp;
+	gchar *tmp, *err = NULL;
 
 	tmp = g_find_program_in_path("gconftool-2");
 	if (tmp == NULL)
@@ -223,8 +223,10 @@ purple_gnome_proxy_get_info(void)
 
 	/* Check whether to use a proxy. */
 	if (!g_spawn_command_line_sync("gconftool-2 -g /system/proxy/mode",
-			&tmp, NULL, NULL, NULL))
+			&tmp, &err, NULL, NULL))
 		return purple_global_proxy_get_info();
+	g_free(err);
+	err = NULL;
 
 	if (!strcmp(tmp, "none\n")) {
 		info.type = PURPLE_PROXY_NONE;
@@ -256,8 +258,10 @@ purple_gnome_proxy_get_info(void)
 	}
 
 	if (!g_spawn_command_line_sync("gconftool-2 -g /system/http_proxy/use_same_proxy",
-			&tmp, NULL, NULL, NULL))
+			&tmp, &err, NULL, NULL))
 		return purple_global_proxy_get_info();
+	g_free(err);
+	err = NULL;
 
 	if (!strcmp(tmp, "true\n"))
 		use_same_proxy = TRUE;
@@ -266,8 +270,10 @@ purple_gnome_proxy_get_info(void)
 
 	if (!use_same_proxy) {
 		if (!g_spawn_command_line_sync("gconftool-2 -g /system/proxy/socks_host",
-			&info.host, NULL, NULL, NULL))
+			&info.host, &err, NULL, NULL))
 			return purple_global_proxy_get_info();
+		g_free(err);
+		err = NULL;
 	}
 
 	if(info.host != NULL)
@@ -276,19 +282,22 @@ purple_gnome_proxy_get_info(void)
 	if (!use_same_proxy && (info.host != NULL) && (*info.host != '\0')) {
 		info.type = PURPLE_PROXY_SOCKS5;
 		if (!g_spawn_command_line_sync("gconftool-2 -g /system/proxy/socks_port",
-				&tmp, NULL, NULL, NULL))
+				&tmp, &err, NULL, NULL))
 		{
 			g_free(info.host);
 			info.host = NULL;
 			return purple_global_proxy_get_info();
 		}
+		g_free(err);
 		info.port = atoi(tmp);
 		g_free(tmp);
 	} else {
 		g_free(info.host);
 		if (!g_spawn_command_line_sync("gconftool-2 -g /system/http_proxy/host",
-					&info.host, NULL, NULL, NULL))
+					&info.host, &err, NULL, NULL))
 			return purple_global_proxy_get_info();
+		g_free(err);
+		err = NULL;
 
 		/* If we get this far then we know we're using an HTTP proxy */
 		info.type = PURPLE_PROXY_HTTP;
@@ -305,16 +314,18 @@ purple_gnome_proxy_get_info(void)
 		}
 
 		if (!g_spawn_command_line_sync("gconftool-2 -g /system/http_proxy/authentication_user",
-					&info.username, NULL, NULL, NULL))
+					&info.username, &err, NULL, NULL))
 		{
 			g_free(info.host);
 			info.host = NULL;
 			return purple_global_proxy_get_info();
 		}
+		g_free(err);
+		err = NULL;
 		g_strchomp(info.username);
 
 		if (!g_spawn_command_line_sync("gconftool-2 -g /system/http_proxy/authentication_password",
-					&info.password, NULL, NULL, NULL))
+					&info.password, &err, NULL, NULL))
 		{
 			g_free(info.host);
 			info.host = NULL;
@@ -322,10 +333,12 @@ purple_gnome_proxy_get_info(void)
 			info.username = NULL;
 			return purple_global_proxy_get_info();
 		}
+		g_free(err);
+		err = NULL;
 		g_strchomp(info.password);
 
 		if (!g_spawn_command_line_sync("gconftool-2 -g /system/http_proxy/port",
-					&tmp, NULL, NULL, NULL))
+					&tmp, &err, NULL, NULL))
 		{
 			g_free(info.host);
 			info.host = NULL;
@@ -335,6 +348,7 @@ purple_gnome_proxy_get_info(void)
 			info.password = NULL;
 			return purple_global_proxy_get_info();
 		}
+		g_free(err);
 		info.port = atoi(tmp);
 		g_free(tmp);
 	}


More information about the Commits mailing list