diff options
author | Daniel Stenberg <daniel@haxx.se> | 2011-12-20 20:55:54 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2011-12-20 20:55:54 +0100 |
commit | 130fac6c16c4fb8a7eeec116adc479aad1e3273d (patch) | |
tree | 3cc1b901ec043d3910dfe225bf07045bbbe134c4 /lib/connect.c | |
parent | 6222ef8052fdc369977620d38d323f2f90a77011 (diff) | |
download | curl-130fac6c16c4fb8a7eeec116adc479aad1e3273d.tar.gz |
timeleft_accept: ack global timeout, moved to ftp.c
First off the timeout for accepting a server connect back must of course
respect a global timeout. Then the timeleft function is only used by ftp
code so it was moved to ftp.c and made static.
Diffstat (limited to 'lib/connect.c')
-rw-r--r-- | lib/connect.c | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/lib/connect.c b/lib/connect.c index cc835808b..bcd538406 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -99,34 +99,6 @@ singleipconnect(struct connectdata *conn, bool *connected); /* - * Curl_timeleft_accept() returns the amount of milliseconds left allowed for - * waiting server to connect. If the value is negative, the timeout time has - * already elapsed. - * - * The start time is stored in progress.t_acceptdata - as set with - * Curl_pgrsTime(..., TIMER_STARTACCEPT); - * - */ -long Curl_timeleft_accept(struct SessionHandle *data) -{ - long timeout_ms = DEFAULT_ACCEPT_TIMEOUT; - struct timeval now; - - if(data->set.accepttimeout > 0) - timeout_ms = data->set.accepttimeout; - - now = Curl_tvnow(); - - /* subtract elapsed time */ - timeout_ms -= Curl_tvdiff(now, data->progress.t_acceptdata); - if(!timeout_ms) - /* avoid returning 0 as that means no timeout! */ - return -1; - - return timeout_ms; -} - -/* * Curl_timeleft() returns the amount of milliseconds left allowed for the * transfer/connection. If the value is negative, the timeout time has already * elapsed. |