cURL / Mailing Lists / curl-library / Single Mail

curl-library

multi interface blocking with certain ftp servers

From: Guido Berhoerster <guido+curl_at_berhoerster.name>
Date: Thu, 18 Oct 2012 11:07:51 +0200

I have a problem with the libcurl multi interface (using libcurl
7.25.0 on openSUSE 12.2) blocking when talking to certain FTP
servers until a libcurl timeout is reached after a couple of
minutes. This is problematic because it freezes the whole
application and all other running transfers. Apparently the
problem is related to passive mode, i.e. happens after switching
to passive mode, but only for certain hosts as for the vast
majority it works fine.
After tracing it with gdb it seems that libcurl gets
stuck in the while loop in ftp_easy_statemach() calling
Curl_pp_easy_statemach() -> Curl_socket_check() -> poll()
repeatedly until a timeout in Curl_pp_easy_statemach() is
reached. A minimal example (adapted from multi-app.c) that
connects to a server triggering the problem is attached. It
produces the following verbose output:

----8<----
ping
ping
ping
ping
ping
ping
ping
* About to connect() to ftp.caudium.net port 21 (#0)
* Trying 193.218.105.12...
ping
ping
ping
ping
* Connected to ftp.caudium.net (193.218.105.12) port 21 (#0)
* Connected to ftp.caudium.net (193.218.105.12) port 21 (#0)
ping
< 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
< 220-You are user number 2 of 50 allowed.
< 220-Local time is now 09:03. Server port: 21.
< 220-Only anonymous FTP is allowed here
< 220 You will be disconnected after 15 minutes of inactivity.
> USER anonymous
ping
< 230-############################################################################
< 230-
< 230- W E L C O M E A S S O C I A T I O N K A Z A R F T P S E R V E R
< 230-
< 230-############################################################################
< 230-
< 230-This public FTP is repository of some OpenSource Projects and also a
< 230-public library.
< 230-
< 230-Please notice that bandwith is limited globaly not by sessions.
< 230-If you'd like to have more bandwith, please peer with us using Public IX.
< 230-To see where we can peer, please see http://as35189.net/, or have a look
< 230-at Panap, PouIX and GeIX IX pages.
< 230-
< 230-Also see our web site : http://kazar.net/
< 230-
< 230-Thanks
< 230-
< 230- Association KAZAR Team
< 230-
< 230 Anonymous user logged in
> PWD
ping
< 257 "/" is your current location
* Entry path is '/'
> CWD caudium
ping
< 250 OK. Current directory is /caudium
> CWD source
ping
< 250 OK. Current directory is /caudium/source
> EPSV
* Connect data stream passively
ping
< 229 Extended Passive mode OK (|||60138|)
* Trying 193.218.105.12...
* Connecting to 193.218.105.12 (193.218.105.12) port 60138
> TYPE A
< 200 TYPE is now ASCII
> LIST
* server response timeout
* Failure sending ABOR command: Timeout was reached
* Closing connection #0
---->8----

-- 
Guido Berhoerster


-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html

Received on 2012-10-18