Check-in [387cbeda3f]
Not logged in
Overview

SHA1 Hash:387cbeda3f269ff686b5a7f08ede95fe85f430e5
Date: 2008-05-05 17:30:12
User: drh
Comment:Honor the http_proxy environment variable as another source for the URL of the HTTP proxy if the "proxy" setting is undefined or is "off".
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified src/db.c from [2d2f919945] to [cbb81a64fd].

@@ -1086,11 +1086,14 @@
 **                     unrestricted access to the repository.
 **
 **    omitsign         When enabled, fossil will not attempt to sign any
 **                     commit with gpg. All commits will be unsigned.
 **
-**    proxy            URL of the HTTP proxy to use
+**    proxy            URL of the HTTP proxy.  If undefined or "off" then
+**                     the "http_proxy" environment variable is consulted.
+**                     If the http_proxy environment variable is undefined
+**                     then a direct HTTP connection is used.
 **
 **    diff-command     External command to run when performing a diff.
 **                     If undefined, the internal text diff will be used.
 **
 **    gdiff-command    External command to run when performing a graphical

Modified src/url.c from [7c8f0faf01] to [51a49c89b2].

@@ -130,12 +130,15 @@
 ** If the "proxy" setting is defined, then change the URL to refer
 ** to the proxy server.
 */
 void url_enable_proxy(const char *zMsg){
   const char *zProxy = db_get("proxy", 0);
+  if( zProxy==0 || zProxy[0] || is_false(zProxy) ){
+    zProxy = getenv("http_proxy");
+  }
   if( zProxy && zProxy[0] && !is_false(zProxy) ){
     char *zOriginalUrl = g.urlCanonical;
     if( zMsg ) printf("%s%s\n", zMsg, zProxy);
     url_parse(zProxy);
     g.urlPath = zOriginalUrl;
   }
 }