# HG changeset patch # User Eric Warmenhoven # Date 991420791 0 # Node ID f0b54f592486eaf7bf7465390114d5249b8d3298 # Parent 22a3b4b529713e4a7e12b9419809b70f2fa78971 [gaim-migrate @ 1946] use env vars if set committer: Tailor Script diff -r 22a3b4b52971 -r f0b54f592486 src/gaimrc.c --- a/src/gaimrc.c Fri Jun 01 18:31:30 2001 +0000 +++ b/src/gaimrc.c Fri Jun 01 18:39:51 2001 +0000 @@ -777,6 +777,7 @@ struct parse *p; buf[0] = 0; + proxyhost[0] = 0; while (buf[0] != '}') { if (buf[0] == '#') @@ -799,6 +800,30 @@ g_snprintf(proxypass, sizeof(proxypass), "%s", p->value[0]); } } + if (!proxyhost[0]) { + if (g_getenv("HTTP_PROXY")) + g_snprintf(proxyhost, sizeof(proxyhost), "%s", g_getenv("HTTP_PROXY")); + else if (g_getenv("HTTPPROXY")) + g_snprintf(proxyhost, sizeof(proxyhost), "%s", g_getenv("HTTPPROXY")); + + if (g_getenv("HTTP_PROXY_PORT")) + proxyport = atoi(g_getenv("HTTP_PROXY_PORT")); + else if (g_getenv("HTTPPROXYPORT")) + proxyport = atoi(g_getenv("HTTPPROXYPORT")); + + if (g_getenv("HTTP_PROXY_USER")) + g_snprintf(proxyuser, sizeof(proxyuser), "%s", g_getenv("HTTP_PROXY_USER")); + else if (g_getenv("HTTPPROXYUSER")) + g_snprintf(proxyuser, sizeof(proxyuser), "%s", g_getenv("HTTPPROXYUSER")); + + if (g_getenv("HTTP_PROXY_PASS")) + g_snprintf(proxypass, sizeof(proxypass), "%s", g_getenv("HTTP_PROXY_PASS")); + else if (g_getenv("HTTPPROXYPASS")) + g_snprintf(proxypass, sizeof(proxypass), "%s", g_getenv("HTTPPROXYPASS")); + + if (proxyhost[0]) + proxytype = PROXY_HTTP; + } } static void gaimrc_write_proxy(FILE *f)