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.
This commit is contained in:
committed by
Daniel Stenberg
parent
5527417afa
commit
c834213ad5
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -64,7 +64,7 @@ STOR 591
|
||||
QUIT
|
||||
</protocol>
|
||||
<errorcode>
|
||||
28
|
||||
10
|
||||
</errorcode>
|
||||
<upload>
|
||||
</upload>
|
||||
|
||||
@@ -64,7 +64,7 @@ STOR 592
|
||||
QUIT
|
||||
</protocol>
|
||||
<errorcode>
|
||||
28
|
||||
10
|
||||
</errorcode>
|
||||
<upload>
|
||||
</upload>
|
||||
|
||||
@@ -64,7 +64,7 @@ STOR 593
|
||||
QUIT
|
||||
</protocol>
|
||||
<errorcode>
|
||||
28
|
||||
12
|
||||
</errorcode>
|
||||
<upload>
|
||||
</upload>
|
||||
|
||||
Reference in New Issue
Block a user