diff options
author | Daniel Stenberg <daniel@haxx.se> | 2017-05-09 12:47:49 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2017-05-10 11:02:47 +0200 |
commit | e9fd794a616c10bd0d017a76f8fdccaf4cc76851 (patch) | |
tree | 26c659c7681db2b9bfcec3f0dadc302823376856 /lib/multiif.h | |
parent | 8dfa378e528917fd253780fd8414795ed868ab0f (diff) | |
download | curl-e9fd794a616c10bd0d017a76f8fdccaf4cc76851.tar.gz |
multi: assign IDs to all timers and make each timer singleton
A) reduces the timeout lists drastically
B) prevents a lot of superfluous loops for timers that expires "in vain"
when it has actually already been extended to fire later on
Diffstat (limited to 'lib/multiif.h')
-rw-r--r-- | lib/multiif.h | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/lib/multiif.h b/lib/multiif.h index e5de1fc49..a9a7a5577 100644 --- a/lib/multiif.h +++ b/lib/multiif.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -25,9 +25,29 @@ /* * Prototypes for library-wide functions provided by multi.c */ -void Curl_expire(struct Curl_easy *data, time_t milli); + +/* Timers */ +typedef enum { + EXPIRE_SPEEDCHECK, + EXPIRE_H2DATA, + EXPIRE_PIPELINE_SEND, + EXPIRE_PIPELINE_READ, + EXPIRE_ADD_HANDLE, + EXPIRE_TOOFAST, + EXPIRE_UNPAUSE, + EXPIRE_ARES, + EXPIRE_MULTI_PENDING, + EXPIRE_DNS_PER_NAME, + EXPIRE_HAPPY_EYEBALLS, + EXPIRE_100_TIMEOUT, + EXPIRE_TIMEOUT, + EXPIRE_CONNECTTIMEOUT, + EXPIRE_LAST /* not an actual timer, used as a marker only */ +} expire_id; + +void Curl_expire(struct Curl_easy *data, time_t milli, expire_id); void Curl_expire_clear(struct Curl_easy *data); -void Curl_expire_latest(struct Curl_easy *data, time_t milli); +void Curl_expire_latest(struct Curl_easy *data, time_t milli, expire_id); bool Curl_pipeline_wanted(const struct Curl_multi* multi, int bits); void Curl_multi_handlePipeBreak(struct Curl_easy *data); |