cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: CURLOPT_WRITEFUNCTION callback not called when If-Modified-Since not obeyed

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 1 Jun 2011 10:35:45 +0200 (CEST)

On Wed, 25 May 2011, Steve Liao wrote:

>> One thing we should verify carefully is that libcurl treats a follow-up
>> request on that same host/connection properly. I don't see that it forcibly
>> closes the connection when it returns - I don't see how it can re-use this
>> connection successfully.
>
> I tried the follow-up request as you suggested. The follow-up request again
> includes if-modified-since and the HTTP server again responds with 200 and
> file contents. I see that the function I had registered against
> CURLOPT_HEADERFUNCTION is not getting called, so content-length isn't
> getting extracted. And the call to curl_easy_getinfo( curlEasyHandle,
> CURLINFO_RESPONSE_CODE, &responseCode) is returning 0 for the responseCode.
>
> Is this the kind of behavior you expect to see arise from the connection not
> getting closed as you mention above?

Possibly, yes. I think it would behave wrongly and your description sure makes
it sound as if it at least doesn't act the way you'd think.

When "manually" aborting a request due to the time condition match, we must
make sure the connection gets closed so that the subsequent request on the
same server will work fine. We should write up a test case for this first and
then make sure we do the change.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-06-01