summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcorvid <corvid@lavabit.com>2010-01-12 04:16:21 +0000
committercorvid <corvid@lavabit.com>2010-01-12 04:16:21 +0000
commit2fa3aa0931a73d9ac83ee95ebef1c66b06f708c6 (patch)
tree98d036fb7ac7637ecad3bffd1fbedb5c7db78c13 /src
parent388754c08adb5da535d94690ae327d0e2493e89c (diff)
If http_proxy pref set, but env var not set, then set env var (for wget).
http://lists.auriga.wearlab.de/pipermail/dillo-dev/2009-December/007131.html
Diffstat (limited to 'src')
-rw-r--r--src/IO/http.c6
-rw-r--r--src/prefs.c2
-rw-r--r--src/prefs.h2
-rw-r--r--src/prefsparser.cc2
4 files changed, 7 insertions, 5 deletions
diff --git a/src/IO/http.c b/src/IO/http.c
index 56a1b3a8..afeb6d71 100644
--- a/src/IO/http.c
+++ b/src/IO/http.c
@@ -82,8 +82,10 @@ int a_Http_init(void)
if (env_proxy && strlen(env_proxy))
HTTP_Proxy = a_Url_new(env_proxy, NULL);
- if (!HTTP_Proxy && prefs.http_proxy)
- HTTP_Proxy = a_Url_dup(prefs.http_proxy);
+ if (!HTTP_Proxy && prefs.http_proxy) {
+ HTTP_Proxy = a_Url_new(prefs.http_proxy, NULL);
+ setenv("http_proxy", URL_STR(HTTP_Proxy), 1);
+ }
/* This allows for storing the proxy password in "user:passwd" format
* in dillorc, but as this constitutes a security problem, it was disabled.
diff --git a/src/prefs.c b/src/prefs.c
index e65d8e1a..615256de 100644
--- a/src/prefs.c
+++ b/src/prefs.c
@@ -104,7 +104,7 @@ void a_Prefs_freeall(void)
dFree(prefs.font_serif);
a_Url_free(prefs.home);
dFree(prefs.http_language);
- a_Url_free(prefs.http_proxy);
+ dFree(prefs.http_proxy);
dFree(prefs.http_proxyuser);
dFree(prefs.http_referer);
dFree(prefs.no_proxy);
diff --git a/src/prefs.h b/src/prefs.h
index f3e0a977..463a0c8a 100644
--- a/src/prefs.h
+++ b/src/prefs.h
@@ -34,7 +34,7 @@ struct _DilloPrefs {
int xpos;
int ypos;
char *http_language;
- DilloUrl *http_proxy;
+ char *http_proxy;
char *http_proxyuser;
char *http_referer;
char *no_proxy;
diff --git a/src/prefsparser.cc b/src/prefsparser.cc
index e77aecf6..23876dd2 100644
--- a/src/prefsparser.cc
+++ b/src/prefsparser.cc
@@ -63,7 +63,7 @@ int PrefsParser::parseOption(char *name, char *value)
{ "geometry", NULL, PREFS_GEOMETRY },
{ "home", &prefs.home, PREFS_URL },
{ "http_language", &prefs.http_language, PREFS_STRING },
- { "http_proxy", &prefs.http_proxy, PREFS_URL },
+ { "http_proxy", &prefs.http_proxy, PREFS_STRING },
{ "http_proxyuser", &prefs.http_proxyuser, PREFS_STRING },
{ "http_referer", &prefs.http_referer, PREFS_STRING },
{ "limit_text_width", &prefs.limit_text_width, PREFS_BOOL },