fix: return CURLM_OK from intercepted curl_multi_add_handle#11
Merged
sf-cg merged 3 commits intoJul 16, 2026
Merged
Conversation
added 3 commits
July 15, 2026 16:44
The real curl_multi_add_handle() returns CURLM_OK (0) on success. The CurlHook interception was declared : void and returned null. Guzzle >= 7.13 (CurlMultiHandler::addCurlHandle) strictly checks `\CURLM_OK !== $result` and throws a RequestException otherwise. Under php-vcr this call is rewritten to CurlHook::curl_multi_add_handle, so the null return produced: Unable to add the cURL handle to the cURL multi handler: No error (0). Returning \CURLM_OK mirrors the real function's contract. Older Guzzle (<= 7.9.x) discards the return value, so this is backwards-compatible.
sf-cg
self-requested a review
July 16, 2026 00:06
sf-cg
approved these changes
Jul 16, 2026
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.
The real curl_multi_add_handle() returns CURLM_OK (0) on success. The CurlHook interception was declared : void and returned null.
Guzzle >= 7.13 (CurlMultiHandler::addCurlHandle) strictly checks
\CURLM_OK !== $resultand throws a RequestException otherwise. Under php-vcr this call is rewritten to CurlHook::curl_multi_add_handle, so the null return produced:Unable to add the cURL handle to the cURL multi handler: No error (0).
Returning \CURLM_OK mirrors the real function's contract. Older Guzzle (<= 7.9.x) discards the return value, so this change should be safely backwards-compatible.