aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2007-10-22 09:25:45 +0000
committerDaniel Stenberg <daniel@haxx.se>2007-10-22 09:25:45 +0000
commit1056dc9a26db39bdb31f5f0b49080b13df3cb528 (patch)
tree4e6f40fb1d45be17ac3d82c02ac11e151f8ff71c /lib
parent053654dc4dbb7616d92abea47bfcd3a27c91479a (diff)
Bug report #1815530 (http://curl.haxx.se/bug/view.cgi?id=1815530) points out
that specifying a proxy with a trailing slash didn't work (unless it also contained a port number).
Diffstat (limited to 'lib')
-rw-r--r--lib/url.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/url.c b/lib/url.c
index 8685c61a2..212e184f7 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -3339,10 +3339,17 @@ static CURLcode parse_proxy(struct SessionHandle *data,
/* now set the local port number */
conn->port = atoi(prox_portno);
}
- else if(data->set.proxyport) {
- /* None given in the proxy string, then get the default one if it is
- given */
- conn->port = data->set.proxyport;
+ else {
+ /* without a port number after the host name, some people seem to use
+ a slash so we strip everything from the first slash */
+ atsign = strchr(proxyptr, '/');
+ if(atsign)
+ *atsign = 0x0; /* cut off path part from host name */
+
+ if(data->set.proxyport)
+ /* None given in the proxy string, then get the default one if it is
+ given */
+ conn->port = data->set.proxyport;
}
/* now, clone the cleaned proxy host name */
@@ -3357,7 +3364,8 @@ static CURLcode parse_proxy(struct SessionHandle *data,
}
/* Extract the user and password from the authentication string */
-static CURLcode parse_proxy_auth(struct SessionHandle *data, struct connectdata *conn)
+static CURLcode parse_proxy_auth(struct SessionHandle *data,
+ struct connectdata *conn)
{
char proxyuser[MAX_CURL_USER_LENGTH]="";
char proxypasswd[MAX_CURL_PASSWORD_LENGTH]="";