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".

drh 2008-05-05 17:30 trunk
Commit 387cbeda3f269ff686b5a7f08ede95fe85f430e5
2 files changed +4 -1 +3
+4 -1
--- src/db.c
+++ src/db.c
@@ -1086,11 +1086,14 @@
10861086
** unrestricted access to the repository.
10871087
**
10881088
** omitsign When enabled, fossil will not attempt to sign any
10891089
** commit with gpg. All commits will be unsigned.
10901090
**
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.
10921095
**
10931096
** diff-command External command to run when performing a diff.
10941097
** If undefined, the internal text diff will be used.
10951098
**
10961099
** gdiff-command External command to run when performing a graphical
10971100
--- 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 @@
130130
** If the "proxy" setting is defined, then change the URL to refer
131131
** to the proxy server.
132132
*/
133133
void url_enable_proxy(const char *zMsg){
134134
const char *zProxy = db_get("proxy", 0);
135
+ if( zProxy==0 || zProxy[0] || is_false(zProxy) ){
136
+ zProxy = getenv("http_proxy");
137
+ }
135138
if( zProxy && zProxy[0] && !is_false(zProxy) ){
136139
char *zOriginalUrl = g.urlCanonical;
137140
if( zMsg ) printf("%s%s\n", zMsg, zProxy);
138141
url_parse(zProxy);
139142
g.urlPath = zOriginalUrl;
140143
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button