cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl_multi_perform blocking

From: <farr_at_metservice.com>
Date: Mon, 22 Mar 2004 15:02:31 +1200

At 07:54 PM 3/19/2004, you wrote:
>On Fri, 19 Mar 2004 farr_at_metservice.com wrote:
>
> > I seem to be having a very strange problem with curl_multi_perform where it
> > blocks for a very very long time (greater than 30 seconds) when the server
> > provides a strange response. Other programs, such as ncftp, crash when
> > asked to do the same set of downloads, so this is probably not a
> > particularly common problem.
> >
> > Has anyone experienced using libcurl in a network where the responses
> > received from the server are messed up?
>
>Do you have any network tracesor similar of more details on this "server
>messing up" ?

As a clean room test of the server, I created a Ruby Script to do the
download (nothing to do with Curl or the rest of our code base). The Ruby
script that throws an exception with "500 Syntax Error" when downloading
from the server.

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. I get a curl DONE message with value CURLE_WRITE_ERROR (but I am
sure I return the correct value to the callback). When I retry ftping the
same fail straight away, the operation completes successfully. I assume
that the server (or something dodgy about the connection) returned
something invalid for that transaction.

The pcap file shows the unsuccessful download of a file ( I got
CURLE_WRITE_ERROR ). Packet 48 shows Response 226, then Packet 49 shows
ftp[RST]. Packet 57 Shows a reconnection to the FTP server. The reset and
the reconnect is because I do a cleanup of the curl_handle and create a new
one to continue the download.

It looks like the server sent 226 too early ... but that cant be right ...
can you see what is going on here?

>libcurl still reads FTP responses in a blocking manner, even when using the
>multi interface, which can be the explanation to this.

Ya, I get that now. If it were the problem in this case then I would
expect to get the "timeout" error a lot more often.

Mike

Received on 2004-03-22