Repository navigation
Make TimerCallbackTest match libcurl 8.5 timer updates - #1
Merged
projectsaturnstudios merged 1 commit intoOct 14, 2026
Merged
Conversation
Ubuntu 24.04's libcurl 8.5 does not invoke CURLMOPT_TIMERFUNCTION on every curl_multi_socket_action(CURL_SOCKET_TIMEOUT): it clears timer_lastcall first, then skips the callback when the new timeout is -1. Localhost transfers with no CURLOPT_TIMEOUT look like that after EXPIRE_RUN_NOW is consumed, so the suite's socket-action and completion-cancel assertions never saw a callback. Give those easies CURLOPT_TIMEOUT_MS so 8.5 has an expire left to report (and still reports -1 at completion). The C trampoline was already 1:1. Co-authored-by: Angel Gonzalez <usftechacg@gmail.com>
projectsaturnstudios
marked this pull request as ready for review
October 14, 2026 13:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ubuntu 24.04 CI (libcurl 8.5.0) failed four
TimerCallbackTestcases while macOS (Homebrew libcurl 8.22) was green. This is libcurl behavior, not a pcurl trampoline bug.What failed.
CURLMOPT_TIMERFUNCTIONnever ran when the tests calledcurlMultiSocketAction($multi, CURL_SOCKET_TIMEOUT, 0)after swapping the callback, and a completed localhost transfer never delivered-1.curl_multi_add_handleandcurl_multi_execstill fired the callback on 8.5.Why. libcurl only calls the timer callback when the timeout it wants changes. On 8.5,
curl_multi_socket_action(CURL_SOCKET_TIMEOUT)memsetstimer_lastcallto{0,0}first.Curl_update_timerthen treats “new timeout is -1” as “already told the app there is no timer” and skips the callback. A localhost easy with noCURLOPT_TIMEOUTlooks like that afterEXPIRE_RUN_NOWis consumed: add_handle reports0, the TIMEOUT action reports nothing, completion never sends-1.libcurl 8.11 (
a58b50f) split that bookkeeping intolast_expire_ts(still cleared on TIMEOUT) andlast_timeout_ms(kept). The same TIMEOUT call then reports-1. That is why Homebrew 8.22 and the Pi’s 8.14.1 were green.Fix. The failing tests now set
CURLOPT_TIMEOUT_MSon the easy so 8.5 still has an expire in the tree. TIMEOUT then reports the remaining ms; completion reports-1. C is unchanged.Verified locally on Ubuntu 24.04 / PHP 8.3 NTS / libcurl 8.5.0: 72 passed, 1 skipped (the existing pre-8.16
add_handleabort skip).