aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGokhan Sengun <gokhansengun@gmail.com>2011-12-19 14:35:20 +0100
committerDaniel Stenberg <daniel@haxx.se>2011-12-20 20:30:02 +0100
commitc834213ad52c52431e9ca597862dc81839cabe84 (patch)
tree678dfd82d3129b8aef8a0222defc55244003203b /tests
parent5527417afae062d7a2b12ee80730a0ab22b86eab (diff)
FTP: perform active connections non-blocking
1- Two new error codes are introduced. CURLE_FTP_ACCEPT_FAILED to be set whenever ACCEPTing fails because of FTP server connected. CURLE_FTP_ACCEPT_TIMEOUT to be set whenever ACCEPTing timeouts. Neither of these errors are considered fatal and control connection remains OK because it could just be a firewall blocking server to connect to the client. 2- One new setopt option was introduced. CURLOPT_ACCEPTTIMEOUT_MS It sets the maximum amount of time FTP client is going to wait for a server to connect. Internal default accept timeout is 60 seconds.
Diffstat (limited to 'tests')
-rw-r--r--tests/data/DISABLED4
-rw-r--r--tests/data/test12069
-rw-r--r--tests/data/test12079
-rw-r--r--tests/data/test12089
-rw-r--r--tests/data/test5912
-rw-r--r--tests/data/test5922
-rw-r--r--tests/data/test5932
-rw-r--r--tests/libtest/lib591.c3
8 files changed, 12 insertions, 28 deletions
diff --git a/tests/data/DISABLED b/tests/data/DISABLED
index 88336f1c0..5a0f2bf95 100644
--- a/tests/data/DISABLED
+++ b/tests/data/DISABLED
@@ -2,8 +2,6 @@
# test cases are run by runtests.pl. Just add the plain test case numbers, one
# per line.
# Lines starting with '#' letters are treated as comments.
-591
-592
-593
594
+1209
1211
diff --git a/tests/data/test1206 b/tests/data/test1206
index ba578a1e2..3f853d1d9 100644
--- a/tests/data/test1206
+++ b/tests/data/test1206
@@ -36,12 +36,6 @@ FTP PORT and 425 on download
<strippart>
s/^EPRT \|1\|(.*)/EPRT \|1\|/
</strippart>
-
-# The protocol part does not include QUIT simply because the error is
-# CURLE_OPERATION_TIMEDOUT (28) which is a generic timeout error without
-# specificly saying for which connection it concerns, and for timeouts libcurl
-# marks the control channel as "invalid". As this test case times out for the
-# data connection it could still use the control channel.
<protocol>
USER anonymous
PASS ftp@example.com
@@ -50,9 +44,10 @@ EPRT |1|
TYPE I
SIZE 1206
RETR 1206
+QUIT
</protocol>
<errorcode>
-28
+10
</errorcode>
</verify>
</testcase>
diff --git a/tests/data/test1207 b/tests/data/test1207
index 6ca713196..283e46d5b 100644
--- a/tests/data/test1207
+++ b/tests/data/test1207
@@ -36,12 +36,6 @@ FTP PORT and 421 on download
<strippart>
s/^EPRT \|1\|(.*)/EPRT \|1\|/
</strippart>
-
-# The protocol part does not include QUIT simply because the error is
-# CURLE_OPERATION_TIMEDOUT (28) which is a generic timeout error without
-# specificly saying for which connection it concerns, and for timeouts libcurl
-# marks the control channel as "invalid". As this test case times out for the
-# data connection it could still use the control channel.
<protocol>
USER anonymous
PASS ftp@example.com
@@ -50,9 +44,10 @@ EPRT |1|
TYPE I
SIZE 1207
RETR 1207
+QUIT
</protocol>
<errorcode>
-28
+10
</errorcode>
</verify>
</testcase>
diff --git a/tests/data/test1208 b/tests/data/test1208
index 725d18afa..a0d428b43 100644
--- a/tests/data/test1208
+++ b/tests/data/test1208
@@ -36,12 +36,6 @@ FTP PORT download, no data conn and no transient negative reply
<strippart>
s/^EPRT \|1\|(.*)/EPRT \|1\|/
</strippart>
-
-# The protocol part does not include QUIT simply because the error is
-# CURLE_OPERATION_TIMEDOUT (28) which is a generic timeout error without
-# specificly saying for which connection it concerns, and for timeouts libcurl
-# marks the control channel as "invalid". As this test case times out for the
-# data connection it could still use the control channel.
<protocol>
USER anonymous
PASS ftp@example.com
@@ -50,9 +44,10 @@ EPRT |1|
TYPE I
SIZE 1208
RETR 1208
+QUIT
</protocol>
<errorcode>
-28
+12
</errorcode>
</verify>
</testcase>
diff --git a/tests/data/test591 b/tests/data/test591
index 0d4bac7dd..e04ae5bcc 100644
--- a/tests/data/test591
+++ b/tests/data/test591
@@ -64,7 +64,7 @@ STOR 591
QUIT
</protocol>
<errorcode>
-28
+10
</errorcode>
<upload>
</upload>
diff --git a/tests/data/test592 b/tests/data/test592
index 4af04e31c..487290dd4 100644
--- a/tests/data/test592
+++ b/tests/data/test592
@@ -64,7 +64,7 @@ STOR 592
QUIT
</protocol>
<errorcode>
-28
+10
</errorcode>
<upload>
</upload>
diff --git a/tests/data/test593 b/tests/data/test593
index 811bf93c6..c3b1f91e5 100644
--- a/tests/data/test593
+++ b/tests/data/test593
@@ -64,7 +64,7 @@ STOR 593
QUIT
</protocol>
<errorcode>
-28
+12
</errorcode>
<upload>
</upload>
diff --git a/tests/libtest/lib591.c b/tests/libtest/lib591.c
index 101f2db26..8a55e2cd1 100644
--- a/tests/libtest/lib591.c
+++ b/tests/libtest/lib591.c
@@ -77,7 +77,8 @@ int test(char *URL)
easy_setopt(easy, CURLOPT_FTPPORT, "-");
/* server connection timeout */
- easy_setopt(easy, CURLOPT_CONNECTTIMEOUT, strtol(libtest_arg2, NULL, 10));
+ easy_setopt(easy, CURLOPT_ACCEPTTIMEOUT_MS,
+ strtol(libtest_arg2, NULL, 10)*1000);
multi_init(multi);