summaryrefslogtreecommitdiffstats
path: root/init.c
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2005-12-12 19:46:10 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2005-12-12 19:46:10 +0000
commitf214bb2115994cc6b4123f3d06db0452f17f2e99 (patch)
tree7a09094e169f4097ceb033204c171eba2a51ae59 /init.c
parentdf5722cc68307206c5edcc94fd7ae333d3212b59 (diff)
downloadopenvpn-f214bb2115994cc6b4123f3d06db0452f17f2e99.tar.gz
openvpn-f214bb2115994cc6b4123f3d06db0452f17f2e99.tar.xz
openvpn-f214bb2115994cc6b4123f3d06db0452f17f2e99.zip
Added --auto-proxy directive to auto-detect HTTP or SOCKS
proxy settings (currently Windows only). git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@850 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'init.c')
-rw-r--r--init.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/init.c b/init.c
index ea1acc3..c90cb5d 100644
--- a/init.c
+++ b/init.c
@@ -102,6 +102,12 @@ init_remote_list (struct context *c)
void
context_init_1 (struct context *c)
{
+#ifdef ENABLE_HTTP_PROXY
+ bool did_http = false;
+#else
+ const bool did_http = false;
+#endif
+
context_clear_1 (c);
packet_id_persist_init (&c->c1.pid_persist);
@@ -145,20 +151,24 @@ context_init_1 (struct context *c)
#endif
#ifdef ENABLE_HTTP_PROXY
- if (c->options.http_proxy_options)
+ if (c->options.http_proxy_options || c->options.auto_proxy_info)
{
/* Possible HTTP proxy user/pass input */
c->c1.http_proxy = new_http_proxy (c->options.http_proxy_options,
+ c->options.auto_proxy_info,
&c->gc);
+ if (c->c1.http_proxy)
+ did_http = true;
}
#endif
#ifdef ENABLE_SOCKS
- if (c->options.socks_proxy_server)
+ if (!did_http && (c->options.socks_proxy_server || c->options.auto_proxy_info))
{
c->c1.socks_proxy = new_socks_proxy (c->options.socks_proxy_server,
c->options.socks_proxy_port,
c->options.socks_proxy_retry,
+ c->options.auto_proxy_info,
&c->gc);
}
#endif