You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expose libcurl's CURLOPT_SEEKFUNCTION as a userland callable so a request
body streamed via CURLOPT_READFUNCTION can be rewound and resent when
libcurl needs to replay it: on a redirect, on multi-pass authentication
(NTLM/Negotiate), or when a reused connection drops after bytes have been
sent. Without a seek callback those transfers fail with
CURLE_SEND_FAIL_REWIND, the gap behind bug #47204 and bug #80518.
The callback receives the CurlHandle, the offset and the origin (SEEK_SET,
SEEK_CUR or SEEK_END) and returns one of CURL_SEEKFUNC_OK,
CURL_SEEKFUNC_FAIL or CURL_SEEKFUNC_CANTSEEK. The implementation mirrors
the existing callback options: a seek FCC on php_curl_handlers, a curl_seek
trampoline that validates the return value the way curl_prereqfunction
does, registration through the HANDLE_CURL_OPTION_CALLABLE macro, and
handling in init, setopt, copy (curl_copy_handle), reset (curl_reset),
free and the cycle collector (curl_get_gc). The option and constants have
existed since libcurl 7.18.0, below the 7.61.0 configure floor, so no
version guard is needed.
Tests cover the happy-path rewind across a redirect, copy-handle
inheritance, callable validation, and the callback error paths.
0 commit comments