2 ===================================================================
3 RCS file: /cvsroot/curl/curl/lib/url.c,v
4 retrieving revision 1.463
6 --- lib/url.c 19 May 2005 07:21:18 -0000 1.463
7 +++ lib/url.c 31 May 2005 12:35:45 -0000
8 @@ -2943,25 +2943,44 @@
10 /* We use 'proxyptr' to point to the proxy name from now on... */
11 char *proxyptr=proxydup;
14 if(NULL == proxydup) {
15 failf(data, "memory shortage");
16 return CURLE_OUT_OF_MEMORY;
19 - /* Daniel Dec 10, 1998:
20 - We do the proxy host string parsing here. We want the host name and the
21 - port name. Accept a protocol:// prefix, even though it should just be
23 + /* We do the proxy host string parsing here. We want the host name and the
24 + * port name. Accept a protocol:// prefix, even though it should just be
28 - /* 1. skip the protocol part if present */
29 + /* Skip the protocol part if present */
30 endofprot=strstr(proxyptr, "://");
33 proxyptr = endofprot+3;
35 + /* start scanning for port number at this point */
38 + /* detect and extract RFC2732-style IPv6-addresses */
39 + if(*proxyptr == '[') {
40 + char *ptr = ++proxyptr; /* advance beyond the initial bracket */
41 + while(*ptr && (isxdigit((int)*ptr) || (*ptr == ':')))
44 + /* yeps, it ended nicely with a bracket as well */
48 + /* Note that if this didn't end with a bracket, we still advanced the
49 + * proxyptr first, but I can't see anything wrong with that as no host
50 + * name nor a numeric can legally start with a bracket.
54 - /* allow user to specify proxy.server.com:1080 if desired */
55 - prox_portno = strchr (proxyptr, ':');
56 + /* Get port number off proxy.server.com:1080 */
57 + prox_portno = strchr(portptr, ':');
59 *prox_portno = 0x0; /* cut off number from host name */