diff options
author | Daniel Stenberg <daniel@haxx.se> | 2006-04-10 15:00:53 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2006-04-10 15:00:53 +0000 |
commit | 686d90745be4417127050ad4b36d0a5403def200 (patch) | |
tree | 786a63b7554065aa0514440adf35fd7b639ae94c /lib/speedcheck.c | |
parent | 5dc02d53c3edebab7597cd4ada446273e3a6daa8 (diff) | |
download | curl-686d90745be4417127050ad4b36d0a5403def200.tar.gz |
First curl_multi_socket() commit. Should primarily be considered as an internal
code rearrange to fit the future better.
Diffstat (limited to 'lib/speedcheck.c')
-rw-r--r-- | lib/speedcheck.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/speedcheck.c b/lib/speedcheck.c index 273cacb5a..5ee009ee2 100644 --- a/lib/speedcheck.c +++ b/lib/speedcheck.c @@ -29,6 +29,7 @@ #include <curl/curl.h> #include "urldata.h" #include "sendf.h" +#include "multiif.h" #include "speedcheck.h" void Curl_speedinit(struct SessionHandle *data) @@ -43,13 +44,13 @@ CURLcode Curl_speedcheck(struct SessionHandle *data, data->set.low_speed_time && (Curl_tvlong(data->state.keeps_speed) != 0) && (data->progress.current_speed < data->set.low_speed_limit)) { + long howlong = Curl_tvdiff(now, data->state.keeps_speed); /* We are now below the "low speed limit". If we are below it for "low speed time" seconds we consider that enough reason to abort the download. */ - if( (Curl_tvdiff(now, data->state.keeps_speed)/1000) > - data->set.low_speed_time) { + if( (howlong/1000) > data->set.low_speed_time) { /* we have been this slow for long enough, now die */ failf(data, "Operation too slow. " @@ -58,6 +59,7 @@ CURLcode Curl_speedcheck(struct SessionHandle *data, data->set.low_speed_time); return CURLE_OPERATION_TIMEOUTED; } + Curl_expire(data, howlong); } else { /* we keep up the required speed all right */ |