diff options
author | Daniel Stenberg <daniel@haxx.se> | 2017-05-09 12:47:49 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2017-05-10 12:55:36 +0200 |
commit | 31b39c40cf909d34f27dc655755f346482f57089 (patch) | |
tree | 4fcf5799aebdf1573b6789f1a19ef3ac8aa0e279 /lib/urldata.h | |
parent | e9fd794a616c10bd0d017a76f8fdccaf4cc76851 (diff) |
multi: use a fixed array of timers instead of malloc
... since the total amount is low this is faster, easier and reduces
memory overhead.
Also, Curl_expire_done() can now mark an expire timeout as done so that
it never times out.
Closes #1472
Diffstat (limited to 'lib/urldata.h')
-rw-r--r-- | lib/urldata.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/urldata.h b/lib/urldata.h index 84124b658..d4a4a98dc 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -1314,6 +1314,30 @@ struct tempbuf { Curl_client_write() */ }; +/* Timers */ +typedef enum { + EXPIRE_100_TIMEOUT, + EXPIRE_ASYNC_NAME, + EXPIRE_CONNECTTIMEOUT, + EXPIRE_DNS_PER_NAME, + EXPIRE_HAPPY_EYEBALLS, + EXPIRE_MULTI_PENDING, + EXPIRE_RUN_NOW, + EXPIRE_SPEEDCHECK, + EXPIRE_TIMEOUT, + EXPIRE_TOOFAST, + EXPIRE_LAST /* not an actual timer, used as a marker only */ +} expire_id; + +/* + * One instance for each timeout an easy handle can set. + */ +struct time_node { + struct curl_llist_element list; + struct timeval time; + expire_id eid; +}; + struct UrlState { /* Points to the connection cache */ @@ -1382,6 +1406,7 @@ struct UrlState { struct timeval expiretime; /* set this with Curl_expire() only */ struct Curl_tree timenode; /* for the splay stuff */ struct curl_llist timeoutlist; /* list of pending timeouts */ + struct time_node expires[EXPIRE_LAST]; /* nodes for each expire type */ /* a place to store the most recently set FTP entrypath */ char *most_recent_ftp_entrypath; |