cURL / Mailing Lists / curl-library / Single Mail

curl-library

The opntion "CURLOPT_FORBID_REUSE" seems not work at all

From: sh.diao <sh.diao_at_gmail.com>
Date: Wed, 29 Nov 2006 18:18:44 +0800

Hi, all
There is a problem when I use the libcurl. And I am confused. It seems that
the opntion "CURLOPT_FORBID_REUSE" does not work at all.

like this: (version curl-7.16.0/)
1. curl_global_init(CURL_GLOBAL_DEFAULT);
2. url_easy_setopt(curl, CURLOPT_URL, "some url");
3. curl_easy_setopt(curl,CURLOPT_VERBOSE,1);
4. curl_easy_setopt(curl,CURLOPT_AUTOREFERER,1);
5. curl_easy_setopt(curl,CURLOPT_ENCODING,"gzip");
6. curl_easy_setopt(curl,CURLOPT_NOBODY,1); // only get head
7. curl_easy_setopt(curl,CURLOPT_FORBID_REUSE,1); // forbid reuse
8. res = curl_easy_perform(curl); // perfom
9. curl_easy_setopt(curl,CURLOPT_HTTPGET,1);// get all info
10. res = curl_easy_perform(curl); // perfom

and look at the head info, I find it still reusing the connection
there are some output info like this:
.....
* Connection #0 to host www.google.com left intact
* Examining connection #0 for reuse
* Re-using existing connection! (#0) with host www.google.com
* Connected to www.google.com (66.249.89.99) port 80 (#0)
.....

if I dont set the opntion "CURLOPT_FORBID_REUSE", it still have the same
action like following
.....
* Connection #0 to host www.google.com left intact
* Examining connection #0 for reuse
* Re-using existing connection! (#0) with host www.google.com
* Connected to www.google.com (66.249.89.99) port 80 (#0)
.....

What I expect is that when the option "CURLOPT_FORBID_REUSE" is setted, the
second _easy_perform should not reuse the fommer one, no matter whether they
have the same url. Is it right?
Regards.
-----------------------------------------------
stan diao
sh.diao_at_gmail.com
Received on 2006-11-29