From b2954e66e87be7414a4508f8167ca531e653bea8 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 4 Nov 2012 18:22:48 +0100 Subject: FTP: prevent the multi interface from blocking As pointed out in Bug report #3579064, curl_multi_perform() would wrongly use a blocking mechanism internally for some commands which could lead to for example a very long block if the LIST response never showed. The solution was to make sure to properly continue to use the multi interface non-blocking state machine. The new test 1501 verifies the fix. Bug: http://curl.haxx.se/bug/view.cgi?id=3579064 Reported by: Guido Berhoerster --- tests/data/Makefile.am | 2 +- tests/data/test1501 | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++ tests/data/test591 | 3 ++- tests/data/test592 | 5 +++-- 4 files changed, 59 insertions(+), 4 deletions(-) create mode 100644 tests/data/test1501 (limited to 'tests/data') diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index d188d1909..382e4b105 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -93,7 +93,7 @@ test1379 test1380 test1381 test1382 test1383 test1384 test1385 test1386 \ test1387 test1388 test1389 test1390 test1391 test1392 test1393 \ test1400 test1401 test1402 test1403 test1404 test1405 test1406 test1407 \ test1408 test1409 test1410 test1411 \ -test1500 \ +test1500 test1501 \ test2000 test2001 test2002 test2003 test2004 test2005 test2006 test2007 \ test2008 test2009 test2010 test2011 test2012 test2013 test2014 test2015 \ test2016 test2017 test2018 test2019 test2020 test2021 test2022 \ diff --git a/tests/data/test1501 b/tests/data/test1501 new file mode 100644 index 000000000..8c7e13af7 --- /dev/null +++ b/tests/data/test1501 @@ -0,0 +1,53 @@ + + + +FTP +RETR +multi +LIST + + + +# Server-side + + + + +DELAY LIST 2 +DELAY TYPE 2 + + + +# Client-side + + +ftp + + +lib1501 + + +FTP with multi interface and slow LIST response + + +ftp://%HOSTIP:%FTPPORT/1501/ + + +# Verify data after the test has been "shot" + + +0 + + +USER anonymous +PASS ftp@example.com +PWD +CWD 1501 +EPSV +TYPE A +LIST +QUIT + + + + diff --git a/tests/data/test591 b/tests/data/test591 index e04ae5bcc..42a227112 100644 --- a/tests/data/test591 +++ b/tests/data/test591 @@ -63,8 +63,9 @@ TYPE I STOR 591 QUIT +# CURLE_UPLOAD_FAILED = 25 -10 +25 diff --git a/tests/data/test592 b/tests/data/test592 index 487290dd4..23aa6c465 100644 --- a/tests/data/test592 +++ b/tests/data/test592 @@ -52,6 +52,7 @@ Moooooooooooo for 592 s/^PORT (.*)/PORT/ s/^EPRT \|1\|(.*)/EPRT \|1\|/ +# a 421 response must prevent further commands from being sent USER anonymous PASS ftp@example.com @@ -61,10 +62,10 @@ EPRT |1| PORT TYPE I STOR 592 -QUIT +# 28 == CURLE_OPERATION_TIMEDOUT -10 +28 -- cgit v1.2.3