From 7cc00d9a832c42a330888aa5c11a2abad1bd5ac0 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 5 Aug 2013 23:49:53 +0200 Subject: FTP: when EPSV gets a 229 but fails to connect, retry with PASV This is a regression as this logic used to work. It isn't clear when it broke, but I'm assuming in 7.28.0 when we went all-multi internally. This likely never worked with the multi interface. As the failed connection is detected once the multi state has reached DO_MORE, the Curl_do_more() function was now expanded somewhat so that the ftp_do_more() function can request to go "back" to the previous state when it makes another attempt - using PASV. Added test case 1233 to verify this fix. It has the little issue that it assumes no service is listening/accepting connections on port 1... Reported-by: byte_bucket in the #curl IRC channel --- tests/data/Makefile.am | 2 +- tests/data/test1233 | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 tests/data/test1233 (limited to 'tests/data') diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 8e952115a..eaaf7eca2 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -93,7 +93,7 @@ test1200 test1201 test1202 test1203 test1204 test1205 test1206 test1207 \ test1208 test1209 test1210 test1211 test1212 test1213 test1214 test1215 \ test1216 test1217 test1218 test1219 \ test1220 test1221 test1222 test1223 test1224 test1225 test1226 test1227 \ -test1228 test1229 test1230 test1231 test1232 \ +test1228 test1229 test1230 test1231 test1232 test1233 \ \ test1300 test1301 test1302 test1303 test1304 test1305 test1306 test1307 \ test1308 test1309 test1310 test1311 test1312 test1313 test1314 test1315 \ diff --git a/tests/data/test1233 b/tests/data/test1233 new file mode 100644 index 000000000..caf0527f2 --- /dev/null +++ b/tests/data/test1233 @@ -0,0 +1,46 @@ + + + +FTP + + + +# Server-side + + +# Assuming there's nothing listening on port 1 +REPLY EPSV 229 Entering Passiv Mode (|||1|) + + +here are some bytes + + + +# Client-side + + +ftp + + +FTP failing to connect to EPSV port, switching to PASV + + +ftp://%HOSTIP:%FTPPORT/1233 + + + +# Verify data after the test has been "shot" + + +USER anonymous +PASS ftp@example.com +PWD +EPSV +PASV +TYPE I +SIZE 1233 +RETR 1233 +QUIT + + + -- cgit v1.2.3