1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

Todd Kulesza reported a flaw in the proxy option, since a numerical IPv6

address was not possible to use. It is now, but requires it written
RFC2732-style, within brackets - which incidently is how you enter numerical
IPv6 addresses in URLs. Test case 263 added to verify.
This commit is contained in:
Daniel Stenberg 2005-05-31 13:03:26 +00:00
parent 52071f3476
commit 300b4a9158
5 changed files with 91 additions and 12 deletions

View File

@ -7,6 +7,12 @@
Changelog Changelog
Daniel (31 May 2005)
- Todd Kulesza reported a flaw in the proxy option, since a numerical IPv6
address was not possible to use. It is now, but requires it written
RFC2732-style, within brackets - which incidently is how you enter numerical
IPv6 addresses in URLs. Test case 263 added to verify.
Daniel (30 May 2005) Daniel (30 May 2005)
- Eric Cooper reported about a problem with HTTP servers that responds with - Eric Cooper reported about a problem with HTTP servers that responds with
binary zeroes within the headers. They confused libcurl to do wrong so the binary zeroes within the headers. They confused libcurl to do wrong so the

View File

@ -5,7 +5,7 @@ Curl and libcurl 7.14.1
Available command line options: 107 Available command line options: 107
Available curl_easy_setopt() options: 122 Available curl_easy_setopt() options: 122
Number of public functions in libcurl: 46 Number of public functions in libcurl: 46
Amount of public web site mirrors: 23 Amount of public web site mirrors: 24
Number of known libcurl bindings: 31 Number of known libcurl bindings: 31
Number of contributors: 437 Number of contributors: 437
@ -15,10 +15,11 @@ This release includes the following changes:
This release includes the following bugfixes: This release includes the following bugfixes:
o proxy host set with numerical IPv6 address
o better treatment of binary zeroes in HTTP response headers o better treatment of binary zeroes in HTTP response headers
o fixed the notorius FTP server failure in the test suite o fixed the notorius FTP server failure in the test suite
o better checking of text output in the test suite on windows o better checking of text output in the test suite on windows
o TYPE response check less strict o FTP servers' TYPE command response check made less strict
o URL-without-slash as in http://somehost?data o URL-without-slash as in http://somehost?data
o strerror_r() configure check for HP-UX 10.20 (and others) o strerror_r() configure check for HP-UX 10.20 (and others)
o time parse work-around on HP-UX 10.20 since its gmtime_r() is broken o time parse work-around on HP-UX 10.20 since its gmtime_r() is broken
@ -30,6 +31,6 @@ Other curl-related news since the previous public release:
This release would not have looked like this without help, code, reports and This release would not have looked like this without help, code, reports and
advice from friends like these: advice from friends like these:
John McGowan, Georg Wicherski, Andres Garcia, Eric Cooper John McGowan, Georg Wicherski, Andres Garcia, Eric Cooper, Todd Kulesza
Thanks! (and sorry if I forgot to mention someone) Thanks! (and sorry if I forgot to mention someone)

View File

@ -2943,25 +2943,44 @@ static CURLcode CreateConnection(struct SessionHandle *data,
/* We use 'proxyptr' to point to the proxy name from now on... */ /* We use 'proxyptr' to point to the proxy name from now on... */
char *proxyptr=proxydup; char *proxyptr=proxydup;
char *portptr;
if(NULL == proxydup) { if(NULL == proxydup) {
failf(data, "memory shortage"); failf(data, "memory shortage");
return CURLE_OUT_OF_MEMORY; return CURLE_OUT_OF_MEMORY;
} }
/* Daniel Dec 10, 1998: /* We do the proxy host string parsing here. We want the host name and the
We do the proxy host string parsing here. We want the host name and the * port name. Accept a protocol:// prefix, even though it should just be
port name. Accept a protocol:// prefix, even though it should just be * ignored.
ignored. */ */
/* 1. skip the protocol part if present */ /* Skip the protocol part if present */
endofprot=strstr(proxyptr, "://"); endofprot=strstr(proxyptr, "://");
if(endofprot) { if(endofprot)
proxyptr = endofprot+3; proxyptr = endofprot+3;
/* start scanning for port number at this point */
portptr = proxyptr;
/* detect and extract RFC2732-style IPv6-addresses */
if(*proxyptr == '[') {
char *ptr = ++proxyptr; /* advance beyond the initial bracket */
while(*ptr && (isxdigit((int)*ptr) || (*ptr == ':')))
ptr++;
if(*ptr == ']') {
/* yeps, it ended nicely with a bracket as well */
*ptr = 0;
portptr = ptr+1;
}
/* Note that if this didn't end with a bracket, we still advanced the
* proxyptr first, but I can't see anything wrong with that as no host
* name nor a numeric can legally start with a bracket.
*/
} }
/* allow user to specify proxy.server.com:1080 if desired */ /* Get port number off proxy.server.com:1080 */
prox_portno = strchr (proxyptr, ':'); prox_portno = strchr(portptr, ':');
if (prox_portno) { if (prox_portno) {
*prox_portno = 0x0; /* cut off number from host name */ *prox_portno = 0x0; /* cut off number from host name */
prox_portno ++; prox_portno ++;

View File

@ -32,4 +32,4 @@ EXTRA_DIST = test1 test108 test117 test127 test20 test27 test34 test46 \
test231 test232 test228 test229 test233 test234 test235 test236 test520 \ test231 test232 test228 test229 test233 test234 test235 test236 test520 \
test237 test238 test239 test243 test245 test246 test247 test248 test249 \ test237 test238 test239 test243 test245 test246 test247 test248 test249 \
test250 test251 test252 test253 test254 test255 test521 test522 test523 \ test250 test251 test252 test253 test254 test255 test521 test522 test523 \
test256 test257 test258 test259 test260 test261 test262 test256 test257 test258 test259 test260 test261 test262 test263

53
tests/data/test263 Normal file
View File

@ -0,0 +1,53 @@
<info>
<keywords>
HTTP
HTTP GET
IPv6
HTTP proxy
</keywords>
</info>
#
# Server-side
<reply>
<data>
HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 6
Content-Type: text/html
hello
</data>
</reply>
#
# Client-side
<client>
<features>
ipv6
</features>
<server>
http-ipv6
</server>
<name>
HTTP-IPv6 GET with proxy specified using IPv6-numerical address
</name>
<command>
-g -x "http://%HOST6IP:%HTTP6PORT" http://veryveryremotesite.com/263
</command>
</client>
#
# Verify data after the test has been "shot"
<verify>
<strip>
^User-Agent:
</strip>
<protocol>
GET http://veryveryremotesite.com/263 HTTP/1.1
Host: veryveryremotesite.com
Pragma: no-cache
Accept: */*
Proxy-Connection: Keep-Alive
</protocol>
</verify>