cURL / Mailing Lists / curl-library / Single Mail


HTTP URL sent to wrong IP -- cache problem?

From: Jim Freeman <>
Date: Thu, 9 Apr 2009 14:26:29 -0700

I have single thread, doing HTTP operations via curl_easy_xxx to two
different URLs using the same curl handle. I have a situation where it
is sending to the wrong server IP. Here's the sequence:


1) Do curl_easy_reset().

2) Do curl_easy_setopt (CURLOPT_URL) to set URL #1, plus set some other

3) Do HTTP operations to URL #1.

4) Do curl_easy_reset().

5) Do curl_easy_setopt (CURLOPT_URL) to set URL #2, plus set some other

6) Do curl_easy_perform to do HTTP GET. If not first time here, then
GET incorrectly sends URL #2 string to the IP address of URL #1 instead
of URL #2.

7) goto step 1


It always works the first time through the loop, and fails as explained
at step 6 on every loop thereafter. I verified wrong IP behavior using
a network sniffer. If I put breakpoints in (i.e. cause a time delay)
after step 4, it often works. Or if I add in "curl_easy_setopt (xxx,
CURLOPT_FRESH_CONNECT, 1)" after step 4 then the problem is fixed, but
then of course I don't get a keepalive connection.


I'm using curl lib 7.19.2 on Windows.


Any idea what's wrong? Thanks...



This electronic mail message, including any attachments or embedded documents, is intended
only for the addressee and may contain privileged and/or confidential information. Unless
expressly indicated, this electronic mail message is confidential and privileged information
of Nirvanix, Inc. Any use, dissemination, copying or distribution in any form, and any action
taken based up this email is strictly prohibited unless expressly indicated. If you have
received this message by error, please immediately delete it and any copies of it, including
any attachments hereto, and notify the sender at Nirvanix, Inc. by reply electronic mail
message or phone. Thank you.
Received on 2009-04-09