cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl_multi_perform blocking

From: <farr_at_metservice.com>
Date: Wed, 24 Mar 2004 09:29:50 +1200

At 04:14 AM 3/24/2004, you wrote:
>Joe Halpin wrote:
>>Daniel Stenberg wrote:
>>
>>>On Mon, 22 Mar 2004 farr_at_metservice.com wrote:
>>>
>>>>Unfortunately I cant cant install tcpdump on either the server or any
>>>>of the
>>>>systems that seem to curl exception problem. I have attached a pcap file
>>>>that shows another strange problem that requires me to retry the same file.
>>>
>>>Sorry, but I can't readily inspect pcap files. It would be a lot easier
>>>if you
>>>converted it to some kind of textual data.
>>I looked at it with ethereal. The client issues a RETR and the server
>>starts sending a file. The client data port closes before the transfer is
>>complete (the server doesn't notice this so there are a bunch of RST
>>responses).
>>When the server has sent the whole file it sends the 226 message, which
>>results in a RST being returned on the control connection.
>>It looks to me like the client crashed during the transfer. One I start
>>seeing RST on the data connection there isn't any response of any kind
>>from the client. TCP just keeps sending RST.
>
>Sorry this isn't right. If the client crashed its TCP would have sent a
>FIN to the server, but I don't see that in the output. The only thing I
>can think of to explain this is that the client aborted the control
>connection using SO_LINGER.

>Mike, earlier on you said you "do a cleanup of the curl_handle and create
>a new one to continue the download". Are you using SO_LINGER when doing
>this? If not, how are you cleaning up the handle?

The following code is how I retry my current file. I only do that when I
already received a curl message on the easy_handle saying that the transfer
failed ie (curlMessage==CURLMSG_DONE && curlCode != CURLE_OK).

Retry:
         curl_multi_remove_handle(curlMultiHandle, _curlHandle);
         curl_easy_cleanup(_curlHandle);
         _curlHandle = curl_easy_init();
         InitialiseCallbacks();
         curl_multi_remove_handle(curlMultiHandle, GetCurlHandle());
           curl_multi_add_handle(curlMultiHandle, GetCurlHandle());

Mike
Received on 2004-03-23