I was reading through some of the code and noticed this code segment in a_Http_init() (file: src/IO/http.c, line 82): gchar *env_proxy = getenv("http_proxy"); if (env_proxy && strlen(env_proxy)) HTTP_Proxy = a_Url_new(env_proxy, NULL, 0, 0, 0); if (!HTTP_Proxy && prefs.http_proxy) HTTP_Proxy = a_Url_dup(prefs.http_proxy); It appears to me that this will take first an HTTP proxy from the user's environment. Then, if one is defined in the Dillo preferences, use it to override the one from the environment. I think that the order of the tests should be reversed. The reason is that every *nix program I can think of will place precedence on settings from the environment *over* those in the configuration files. The behavior above would be confusing to an experienced *nix user. -Roberto Sanchez
On Sat, Jan 08, 2005 at 01:38:17AM -0500, Roberto Sanchez wrote:
I was reading through some of the code and noticed this code segment in a_Http_init() (file: src/IO/http.c, line 82):
gchar *env_proxy = getenv("http_proxy");
if (env_proxy && strlen(env_proxy)) HTTP_Proxy = a_Url_new(env_proxy, NULL, 0, 0, 0); if (!HTTP_Proxy && prefs.http_proxy) HTTP_Proxy = a_Url_dup(prefs.http_proxy);
It appears to me that this will take first an HTTP proxy from the user's environment. Then, if one is defined in the Dillo preferences, use it to override the one from the environment.
I think that the order of the tests should be reversed. The reason is that every *nix program I can think of will place precedence on settings from the environment *over* those in the configuration files. The behavior above would be confusing to an experienced *nix user.
It works. The "!HTTP_Proxy" avoids the oversetting. -- Cheers Jorge.-
Jorge Arellano Cid wrote:
On Sat, Jan 08, 2005 at 01:38:17AM -0500, Roberto Sanchez wrote:
I was reading through some of the code and noticed this code segment in a_Http_init() (file: src/IO/http.c, line 82):
gchar *env_proxy = getenv("http_proxy");
if (env_proxy && strlen(env_proxy)) HTTP_Proxy = a_Url_new(env_proxy, NULL, 0, 0, 0); if (!HTTP_Proxy && prefs.http_proxy) HTTP_Proxy = a_Url_dup(prefs.http_proxy);
It appears to me that this will take first an HTTP proxy from the user's environment. Then, if one is defined in the Dillo preferences, use it to override the one from the environment.
I think that the order of the tests should be reversed. The reason is that every *nix program I can think of will place precedence on settings from the environment *over* those in the configuration files. The behavior above would be confusing to an experienced *nix user.
It works. The "!HTTP_Proxy" avoids the oversetting.
Sure does :-) I guess that's what I get for trying to read source code at 2:00 am. Here is a small patch that adds a comment there and a few other places for clarification. -Roberto
participants (2)
-
Jorge Arellano Cid
-
Roberto Sanchez