Fossil SCM
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".
Commit
387cbeda3f269ff686b5a7f08ede95fe85f430e5
Parent
4e683ef07b04f5f…
2 files changed
+4
-1
+3
M
src/db.c
+4
-1
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1086,11 +1086,14 @@ | ||
| 1086 | 1086 | ** unrestricted access to the repository. |
| 1087 | 1087 | ** |
| 1088 | 1088 | ** omitsign When enabled, fossil will not attempt to sign any |
| 1089 | 1089 | ** commit with gpg. All commits will be unsigned. |
| 1090 | 1090 | ** |
| 1091 | -** proxy URL of the HTTP proxy to use | |
| 1091 | +** proxy URL of the HTTP proxy. If undefined or "off" then | |
| 1092 | +** the "http_proxy" environment variable is consulted. | |
| 1093 | +** If the http_proxy environment variable is undefined | |
| 1094 | +** then a direct HTTP connection is used. | |
| 1092 | 1095 | ** |
| 1093 | 1096 | ** diff-command External command to run when performing a diff. |
| 1094 | 1097 | ** If undefined, the internal text diff will be used. |
| 1095 | 1098 | ** |
| 1096 | 1099 | ** gdiff-command External command to run when performing a graphical |
| 1097 | 1100 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1086,11 +1086,14 @@ | |
| 1086 | ** unrestricted access to the repository. |
| 1087 | ** |
| 1088 | ** omitsign When enabled, fossil will not attempt to sign any |
| 1089 | ** commit with gpg. All commits will be unsigned. |
| 1090 | ** |
| 1091 | ** proxy URL of the HTTP proxy to use |
| 1092 | ** |
| 1093 | ** diff-command External command to run when performing a diff. |
| 1094 | ** If undefined, the internal text diff will be used. |
| 1095 | ** |
| 1096 | ** gdiff-command External command to run when performing a graphical |
| 1097 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1086,11 +1086,14 @@ | |
| 1086 | ** unrestricted access to the repository. |
| 1087 | ** |
| 1088 | ** omitsign When enabled, fossil will not attempt to sign any |
| 1089 | ** commit with gpg. All commits will be unsigned. |
| 1090 | ** |
| 1091 | ** proxy URL of the HTTP proxy. If undefined or "off" then |
| 1092 | ** the "http_proxy" environment variable is consulted. |
| 1093 | ** If the http_proxy environment variable is undefined |
| 1094 | ** then a direct HTTP connection is used. |
| 1095 | ** |
| 1096 | ** diff-command External command to run when performing a diff. |
| 1097 | ** If undefined, the internal text diff will be used. |
| 1098 | ** |
| 1099 | ** gdiff-command External command to run when performing a graphical |
| 1100 |
+3
| --- src/url.c | ||
| +++ src/url.c | ||
| @@ -130,10 +130,13 @@ | ||
| 130 | 130 | ** If the "proxy" setting is defined, then change the URL to refer |
| 131 | 131 | ** to the proxy server. |
| 132 | 132 | */ |
| 133 | 133 | void url_enable_proxy(const char *zMsg){ |
| 134 | 134 | const char *zProxy = db_get("proxy", 0); |
| 135 | + if( zProxy==0 || zProxy[0] || is_false(zProxy) ){ | |
| 136 | + zProxy = getenv("http_proxy"); | |
| 137 | + } | |
| 135 | 138 | if( zProxy && zProxy[0] && !is_false(zProxy) ){ |
| 136 | 139 | char *zOriginalUrl = g.urlCanonical; |
| 137 | 140 | if( zMsg ) printf("%s%s\n", zMsg, zProxy); |
| 138 | 141 | url_parse(zProxy); |
| 139 | 142 | g.urlPath = zOriginalUrl; |
| 140 | 143 |
| --- src/url.c | |
| +++ src/url.c | |
| @@ -130,10 +130,13 @@ | |
| 130 | ** If the "proxy" setting is defined, then change the URL to refer |
| 131 | ** to the proxy server. |
| 132 | */ |
| 133 | void url_enable_proxy(const char *zMsg){ |
| 134 | const char *zProxy = db_get("proxy", 0); |
| 135 | if( zProxy && zProxy[0] && !is_false(zProxy) ){ |
| 136 | char *zOriginalUrl = g.urlCanonical; |
| 137 | if( zMsg ) printf("%s%s\n", zMsg, zProxy); |
| 138 | url_parse(zProxy); |
| 139 | g.urlPath = zOriginalUrl; |
| 140 |
| --- src/url.c | |
| +++ src/url.c | |
| @@ -130,10 +130,13 @@ | |
| 130 | ** If the "proxy" setting is defined, then change the URL to refer |
| 131 | ** to the proxy server. |
| 132 | */ |
| 133 | void url_enable_proxy(const char *zMsg){ |
| 134 | const char *zProxy = db_get("proxy", 0); |
| 135 | if( zProxy==0 || zProxy[0] || is_false(zProxy) ){ |
| 136 | zProxy = getenv("http_proxy"); |
| 137 | } |
| 138 | if( zProxy && zProxy[0] && !is_false(zProxy) ){ |
| 139 | char *zOriginalUrl = g.urlCanonical; |
| 140 | if( zMsg ) printf("%s%s\n", zMsg, zProxy); |
| 141 | url_parse(zProxy); |
| 142 | g.urlPath = zOriginalUrl; |
| 143 |