multi: fix callback for CURLMOPT_TIMERFUNCTION not being called again when...

Issue is reproducible for me if I have made request with multi handle,
then I make request that will take very long and then I make request
that should be fast again, however what happens it is that it seems
to think that timeout was not changed and it makes it not call initial
`CURLMOPT_TIMERFUNCTION`.

Closes #15627
This commit is contained in:
Vladislavs Sokurenko 2024-11-22 17:00:14 +02:00 committed by Viktor Szakats
parent e243e73363
commit 4cded6deac
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201

View File

@ -3589,6 +3589,14 @@ static CURLMcode multi_socket(struct Curl_multi *multi,
}
}
}
else {
/* Asked to run due to time-out. Clear the 'last_expire_ts' variable to
force Curl_update_timer() to trigger a callback to the app again even
if the same timeout is still the one to run after this call. That
handles the case when the application asks libcurl to run the timeout
prematurely. */
memset(&multi->last_expire_ts, 0, sizeof(multi->last_expire_ts));
}
result = multi_run_expired(&mrc);
if(result)