aboutsummaryrefslogtreecommitdiff
path: root/src/openvpn/proxy.c
diff options
context:
space:
mode:
authorArne Schwabe2013-11-21 21:08:02 +0100
committerGert Doering2013-11-22 19:18:33 +0100
commit076fd3e46bbbe6261317d58cc2442f8eccc927ce (patch)
tree89ab4c04a76ed02fed6fa55d86e6b96922eedc1d /src/openvpn/proxy.c
parente85d87523af43c5fe5188f7ee1e2fdd2861dcffc (diff)
downloadopenvpn-076fd3e46bbbe6261317d58cc2442f8eccc927ce.zip
openvpn-076fd3e46bbbe6261317d58cc2442f8eccc927ce.tar.gz
Change the type of all ports in openvpn to const char* and let getaddrinfo resolve the port together with the hostname.
This delays error reporting from config parsing to resolving of host addresses. But it allows statements like remote openvpn.example.org openvpn port https management localhost ntp Signed-off-by: Arne Schwabe <arne@rfc2549.org> Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: <1385064495-25877-1-git-send-email-arne@rfc2549.org> URL: http://article.gmane.org/gmane.network.openvpn.devel/8018 Signed-off-by: Gert Doering <gert@greenie.muc.de>
Diffstat (limited to 'src/openvpn/proxy.c')
-rw-r--r--src/openvpn/proxy.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/openvpn/proxy.c b/src/openvpn/proxy.c
index c3496e2..f7f0648 100644
--- a/src/openvpn/proxy.c
+++ b/src/openvpn/proxy.c
@@ -443,7 +443,7 @@ http_proxy_new (const struct http_proxy_options *o)
if (!o || !o->server)
msg (M_FATAL, "HTTP_PROXY: server not specified");
- ASSERT (legal_ipv4_port (o->port));
+ ASSERT ( o->port);
ALLOC_OBJ_CLEAR (p, struct http_proxy_info);
p->options = *o;
@@ -492,7 +492,7 @@ bool
add_proxy_headers (struct http_proxy_info *p,
socket_descriptor_t sd, /* already open to proxy */
const char *host, /* openvpn server remote */
- const int port /* openvpn server port */
+ const char* port /* openvpn server port */
)
{
char buf[512];
@@ -553,7 +553,7 @@ bool
establish_http_proxy_passthru (struct http_proxy_info *p,
socket_descriptor_t sd, /* already open to proxy */
const char *host, /* openvpn server remote */
- const int port, /* openvpn server port */
+ const char *port, /* openvpn server port */
struct buffer *lookahead,
volatile int *signal_received)
{
@@ -581,7 +581,7 @@ establish_http_proxy_passthru (struct http_proxy_info *p,
else
{
/* format HTTP CONNECT message */
- openvpn_snprintf (buf, sizeof(buf), "CONNECT %s:%d HTTP/%s",
+ openvpn_snprintf (buf, sizeof(buf), "CONNECT %s:%s HTTP/%s",
host,
port,
p->options.http_version);
@@ -692,7 +692,7 @@ establish_http_proxy_passthru (struct http_proxy_info *p,
/* now send the phase 3 reply */
/* format HTTP CONNECT message */
- openvpn_snprintf (buf, sizeof(buf), "CONNECT %s:%d HTTP/%s",
+ openvpn_snprintf (buf, sizeof(buf), "CONNECT %s:%s HTTP/%s",
host,
port,
p->options.http_version);
@@ -777,7 +777,7 @@ establish_http_proxy_passthru (struct http_proxy_info *p,
/* build the digest response */
- openvpn_snprintf (uri, sizeof(uri), "%s:%d",
+ openvpn_snprintf (uri, sizeof(uri), "%s:%s",
host,
port);