cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: cURL process hangs on ftp upload/download operations.

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 24 May 2012 22:33:37 +0200 (CEST)

On Thu, 24 May 2012, Yura Kaidalov wrote:

> cURL process hangs on ftp upload/download operations on Windows. Such hangs
> happens several times per day.

Out of how may tries?

> command line is: curl.exe -u uname:password --connect-timeout 180 --trace
> __trace.out -T source.dat ftp://hostname/target.dat

I don't remember off-hand how good windows is at keepalives, but
--keepalive-time might be a good option to append to that command line

> 0000: 31 32 35 20 44 61 74 61 20 63 6f 6e 6e 65 63 74 125 Data connect
> 0010: 69 6f 6e 20 61 6c 72 65 61 64 79 20 6f 70 65 6e ion already open
> 0020: 3b 20 54 72 61 6e 73 66 65 72 20 73 74 61 72 74 ; Transfer start
> 0030: 69 6e 67 2e 0d 0a ing...
> => Send data, 4 bytes (0x4)
> 0000: 74 65 73 74 data
>
> My questions are: why does cURL hangs? and how can I prevent these hangs?

libcurl will sit waiting for the "connection" to accept more data to send and
until that happens it won't do anything. The mystery to me is why your
network/server somehow dies or otherwise makes the connection stall like this.

I don't think we had any such bug in that curl version, but I can of course be
wrong.

Another option combo to use to work around the hang is
--speed-limit/--speed-time.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-05-24