From c834213ad52c52431e9ca597862dc81839cabe84 Mon Sep 17 00:00:00 2001 From: Gokhan Sengun Date: Mon, 19 Dec 2011 14:35:20 +0100 Subject: 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. --- tests/libtest/lib591.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/libtest') 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); -- cgit v1.2.3