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
This commit is contained in:
Daniel Stenberg 2017-05-09 12:47:49 +02:00
parent 8dfa378e52
commit e9fd794a61
10 changed files with 98 additions and 39 deletions

View file

@ -580,10 +580,8 @@ static CURLcode AllowServerConnect(struct connectdata *conn, bool *connected)
else {
/* Add timeout to multi handle and break out of the loop */
if(!result && *connected == FALSE) {
if(data->set.accepttimeout > 0)
Curl_expire(data, data->set.accepttimeout);
else
Curl_expire(data, DEFAULT_ACCEPT_TIMEOUT);
Curl_expire(data, data->set.accepttimeout > 0 ?
data->set.accepttimeout: DEFAULT_ACCEPT_TIMEOUT, 0);
}
}