summaryrefslogtreecommitdiff
path: root/lib/connect.h
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 /lib/connect.h
parent5527417afae062d7a2b12ee80730a0ab22b86eab (diff)
downloadcurl-c834213ad52c52431e9ca597862dc81839cabe84.tar.gz
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 'lib/connect.h')
-rw-r--r--lib/connect.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/connect.h b/lib/connect.h
index f84361f2e..4e905bdf5 100644
--- a/lib/connect.h
+++ b/lib/connect.h
@@ -43,7 +43,12 @@ long Curl_timeleft(struct SessionHandle *data,
struct timeval *nowp,
bool duringconnect);
+/* function that returns how much time there's left to wait for incoming
+ server connect */
+long Curl_timeleft_accept(struct SessionHandle *data);
+
#define DEFAULT_CONNECT_TIMEOUT 300000 /* milliseconds == five minutes */
+#define DEFAULT_ACCEPT_TIMEOUT 60000 /* milliseconds == one minute */
/*
* Used to extract socket and connectdata struct for the most recent