--- a/ChangeLog.win32 Wed Aug 03 20:57:44 2005 -0400
+++ b/ChangeLog.win32 Sat Aug 06 00:00:30 2005 -0400
@@ -1,6 +1,8 @@
* The installer now supports downloading and installing
+ * Environmental proxy settings will now default to the Internet Explorer + http proxy, if one is present. version 1.4.0 (7/7/2005):
* On Windows XP or newer, the non-debug version of gaim will attempt
--- a/src/win_gaim.c Wed Aug 03 20:57:44 2005 -0400
+++ b/src/win_gaim.c Sat Aug 06 00:00:30 2005 -0400
@@ -39,6 +39,8 @@
# define ATTACH_PARENT_PROCESS -1
+#define WIN32_PROXY_REGKEY "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings" typedef int (CALLBACK* LPFNGAIMMAIN)(HINSTANCE, int, char**);
typedef void (CALLBACK* LPFNSETDLLDIRECTORY)(LPCTSTR);
typedef BOOL (CALLBACK* LPFNATTACHCONSOLE)(DWORD);
@@ -73,7 +75,7 @@
sub_key, val_name, retv, szBuf);
@@ -272,6 +274,46 @@
+static void wgaim_set_proxy() { + DWORD reglen = sizeof(DWORD); + /* If the proxy server environment variables are already set, + * we shouldn't override them */ + if (getenv("HTTP_PROXY") || getenv("http_proxy") || getenv("HTTPPROXY")) + if (read_reg_string(HKEY_CURRENT_USER, WIN32_PROXY_REGKEY, "ProxyEnable", + (LPBYTE) ®val, ®len) && (regval & 1)) { + char proxy_server[2048]; + reglen = sizeof(proxy_server); + if (!read_reg_string(HKEY_CURRENT_USER, WIN32_PROXY_REGKEY , "ProxyServer", + (LPBYTE) &proxy_server, ®len)) + if ((reglen > strlen("http=")) && (c = strstr(proxy_server, "http="))) { + /* c now points the proxy server (and port) */ + const char envstr_prefix[] = "HTTP_PROXY=http://"; + char envstr[sizeof(envstr_prefix) + strlen(c) + 1]; + snprintf(envstr, sizeof(envstr), "%s%s", envstr_prefix, c); + printf("Setting HTTP Proxy: %s\n", envstr); # define _stdcall __attribute__((stdcall))
@@ -325,9 +367,11 @@
if(!getenv("GAIM_NO_DLL_CHECK"))
- if(!getenv("GAIM_MULTI_INST") && !wgaim_set_running())
+ if(!getenv("GAIM_MULTI_INST") && !wgaim_set_running()) /* Now we are ready for Gaim .. */
if((hmod=LoadLibrary("gaim.dll"))) {