aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-04-25 19:18:19 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-04-25 19:18:19 +0000
commit00e4f814467d42dabc6eef19289b6dcc8b34900e (patch)
tree228c2ec422f081b89a4987a60bf7ffd782d4cc81
parent8927ddec1687a438354eae6c527da92c6c63b50b (diff)
prevent persistant connections to do name resolves
-rw-r--r--lib/url.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/url.c b/lib/url.c
index 553c67e74..06fe51ca5 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -1308,7 +1308,8 @@ static void verboseconnect(struct connectdata *conn,
{
struct in_addr in;
(void) memcpy(&in.s_addr, &conn->serv_addr.sin_addr, sizeof (in.s_addr));
- infof(data, "Connected to %s (%s) port %d\n", hostaddr->h_name,
+ infof(data, "Connected to %s (%s) port %d\n",
+ hostaddr?hostaddr->h_name:"[re-used]",
#if defined(HAVE_INET_NTOA_R)
inet_ntoa_r(in, ntoa_buf, sizeof(ntoa_buf)),
#else
@@ -2176,7 +2177,11 @@ static CURLcode CreateConnection(struct SessionHandle *data,
/*************************************************************
* Resolve the name of the server or proxy
*************************************************************/
- if(!data->change.proxy) {
+ if(conn->bits.reuse) {
+ /* re-used connection, no resolving is necessary */
+ hostaddr = NULL;
+ }
+ else if(!data->change.proxy) {
/* If not connecting via a proxy, extract the port from the URL, if it is
* there, thus overriding any defaults that might have been set above. */
conn->port = conn->remote_port; /* it is the same port */