diff options
author | Daniel Stenberg <daniel@haxx.se> | 2001-03-14 18:18:02 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2001-03-14 18:18:02 +0000 |
commit | b7fc1e45b52b09dd6eb78eec584eab63c6343c63 (patch) | |
tree | 3b6c53eaab704e43d295a2ecdd5d4542ed0c7099 /lib | |
parent | 3395a2fa9e6ae14d87ff4e120f3b44d6dbcb3430 (diff) |
now works with IPv6 and HTTP proxy
Diffstat (limited to 'lib')
-rw-r--r-- | lib/url.c | 22 |
1 files changed, 12 insertions, 10 deletions
@@ -766,11 +766,11 @@ CURLcode Curl_disconnect(struct connectdata *conn) if(!conn) return CURLE_OK; /* this is closed and fine already */ - infof(conn->data, "Closing live connection (#%d)\n", conn->connectindex); - - if(-1 != conn->connectindex) + if(-1 != conn->connectindex) { /* unlink ourselves! */ + infof(conn->data, "Closing live connection (#%d)\n", conn->connectindex); conn->data->connects[conn->connectindex] = NULL; + } if(conn->curl_disconnect) /* This is set if protocol-specific cleanups should be made */ @@ -1162,12 +1162,14 @@ static CURLcode ConnectPlease(struct UrlData *data, #ifdef ENABLE_IPV6 conn->firstsocket = -1; for (ai = conn->hp; ai; ai = ai->ai_next) { - conn->firstsocket = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); + conn->firstsocket = socket(ai->ai_family, + ai->ai_socktype, + ai->ai_protocol); if (conn->firstsocket < 0) continue; if (connect(conn->firstsocket, ai->ai_addr, ai->ai_addrlen) < 0) { - close(conn->firstsocket); + sclose(conn->firstsocket); conn->firstsocket = -1; continue; } @@ -1862,10 +1864,6 @@ static CURLcode Connect(struct UrlData *data, host name name, so that we can re-use an existing connection that may exist registered to the same proxy host. */ -#ifdef ENABLE_IPV6 - failf(data, "proxy yet to be supported"); - return CURLE_OUT_OF_MEMORY; -#else char *prox_portno; char *endofprot; @@ -1910,7 +1908,6 @@ static CURLcode Connect(struct UrlData *data, conn->proxyhost = strdup(proxyptr); free(proxydup); /* free the duplicate pointer and not the modified */ -#endif /* end of IPv4-section */ } /************************************************************* @@ -1990,7 +1987,12 @@ static CURLcode Connect(struct UrlData *data, if we're reusing an existing connection. */ /* resolve proxy */ +#ifdef ENABLE_IPV6 + /* it might already be set if reusing a connection */ + conn->hp = Curl_getaddrinfo(data, conn->proxyhost, conn->port); +#else conn->hp = Curl_gethost(data, conn->proxyhost, &conn->hostent_buf); +#endif if(!conn->hp) { failf(data, "Couldn't resolve proxy '%s'", conn->proxyhost); return CURLE_COULDNT_RESOLVE_PROXY; |