cURL / Mailing Lists / curl-users / Single Mail

curl-users

libcurl

From: Giaslas Georgios <giaslas_at_ceid.upatras.gr>
Date: Mon, 28 Jan 2002 20:24:41 +0200 (EET)

hi guys,
i have some notes about libcurl:

1) i have developed a program with libcurl 7.9.2 and it worked fine,
but when i upgraded to version 7.9.3 i get a segmentation fault when i
execute curl_easy_perform(). I don't have changed anyhing to my
source code.

2) a nice feature that doesn't exist (yet?) is to get the content-type of
the downloaded object with curl_easy_getinfo(). i have already patched the
libcurl source to do that so if you want i can send you the path.

3) when i set the option CURLOPT_FAILONERROR on, there is a problem
sometimes. For example, if i request the URL:

http://uk.adserver.yahoo.com/a?f=150508014:LREC&p=mail_ukie&
l=LREC&c=hm&bg=ffffff&site-country=uk&t=1003662209

via a proxy (Microsoft ISA) it returns to me HTTP 404 Not Found and
immediately the proxy closes the connection.
The library then, returns from the Curl_readwrite() function without
setting the size of the header (conn->headerbytecount). Transfer() returns
also with the error code CURL_HTTP_NOT_FOUND.Then, when Curl_done() is
called within Curl_perform() it calls curl_http_done and returns
CURL_GOT_NOTHING since the size of the header is zero. Next, at
url.c, line 2317
the check:

if (data->set.reuse_forbid || ((CURLE_OK == result) && conn->bits.close))

fails, since 'result' is CURL_GOT_NOTHING, and the connection to the
proxy doesn't close.
So, if libcurl reuses the connection to the proxy, ALL the subsequent
requests fail. libcurl doesn't understand that the proxy has closed
the connection in order to make a new one, and tries to send the requests
over it and of course all of them fail returning "Failed to send request".

I hope I helped you
George Giaslas
Received on 2002-01-28