comparison src/gaimrc.c @ 1936:f0b54f592486

[gaim-migrate @ 1946] use env vars if set committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Fri, 01 Jun 2001 18:39:51 +0000
parents a84a41ecf380
children c9db54d8d8dc
comparison
equal deleted inserted replaced
1935:22a3b4b52971 1936:f0b54f592486
775 { 775 {
776 char buf[2048]; 776 char buf[2048];
777 struct parse *p; 777 struct parse *p;
778 778
779 buf[0] = 0; 779 buf[0] = 0;
780 proxyhost[0] = 0;
780 781
781 while (buf[0] != '}') { 782 while (buf[0] != '}') {
782 if (buf[0] == '#') 783 if (buf[0] == '#')
783 continue; 784 continue;
784 785
796 } else if (!strcmp(p->option, "user")) { 797 } else if (!strcmp(p->option, "user")) {
797 g_snprintf(proxyuser, sizeof(proxyuser), "%s", p->value[0]); 798 g_snprintf(proxyuser, sizeof(proxyuser), "%s", p->value[0]);
798 } else if (!strcmp(p->option, "pass")) { 799 } else if (!strcmp(p->option, "pass")) {
799 g_snprintf(proxypass, sizeof(proxypass), "%s", p->value[0]); 800 g_snprintf(proxypass, sizeof(proxypass), "%s", p->value[0]);
800 } 801 }
802 }
803 if (!proxyhost[0]) {
804 if (g_getenv("HTTP_PROXY"))
805 g_snprintf(proxyhost, sizeof(proxyhost), "%s", g_getenv("HTTP_PROXY"));
806 else if (g_getenv("HTTPPROXY"))
807 g_snprintf(proxyhost, sizeof(proxyhost), "%s", g_getenv("HTTPPROXY"));
808
809 if (g_getenv("HTTP_PROXY_PORT"))
810 proxyport = atoi(g_getenv("HTTP_PROXY_PORT"));
811 else if (g_getenv("HTTPPROXYPORT"))
812 proxyport = atoi(g_getenv("HTTPPROXYPORT"));
813
814 if (g_getenv("HTTP_PROXY_USER"))
815 g_snprintf(proxyuser, sizeof(proxyuser), "%s", g_getenv("HTTP_PROXY_USER"));
816 else if (g_getenv("HTTPPROXYUSER"))
817 g_snprintf(proxyuser, sizeof(proxyuser), "%s", g_getenv("HTTPPROXYUSER"));
818
819 if (g_getenv("HTTP_PROXY_PASS"))
820 g_snprintf(proxypass, sizeof(proxypass), "%s", g_getenv("HTTP_PROXY_PASS"));
821 else if (g_getenv("HTTPPROXYPASS"))
822 g_snprintf(proxypass, sizeof(proxypass), "%s", g_getenv("HTTPPROXYPASS"));
823
824 if (proxyhost[0])
825 proxytype = PROXY_HTTP;
801 } 826 }
802 } 827 }
803 828
804 static void gaimrc_write_proxy(FILE *f) 829 static void gaimrc_write_proxy(FILE *f)
805 { 830 {