cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Unable to retrieve some document header

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 17 Oct 2001 13:57:13 +0200 (MET DST)

On Mon, 15 Oct 2001, Yanick Pelletier wrote:

> [ what to do when HEAD doesn't work ]
>
> Ok, i agree with you with the fact that curl should not add layer to fix
> bugs from servers.
>
> First of all i work on Windows 2000.
>
> I have try your solution but i have un bug with it. Here the code that cause
> the bug:

[snip]

> When the above code is executed in it step-by-step in debug mode it run
> fine, but when i just let it run free it loop forever (in fact it loop a
> long time, a verry long time!!!) in Transfert(). What i have found so
> far its that the second request perform verry baddly if i don't "eat" all
> the data generated by the first call to curl_easy_cleanup().
>
> Does any body have a solution that i can try, except the solution to
> process all the data of the first call!

Hm, I have an idea to what the problem might be:

When you abort the first connection by returning an error from the callback,
we still have an open connection to the server as our decision to stop
reading is not signalled to the server in any way.

When you issue the second request, you'll get the same connection that was
previously in use (a persistant connection) and the server is still providing
the previous request on that.

Does this seem likely?

As an experiment, could you try to add code that close the transfer socket if
Curl_client_write() returns an error?

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2001-10-17