-
Notifications
You must be signed in to change notification settings - Fork 7.9k
fix missing error check in curl_multi_init() #13157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
unsure if it should return false (like curl_init()) or throw (like most constructors do on failure) though..
.. come to think of it, if it's a vote, I'm voting to throw |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, leaving the final review for the codeowner though
ext/curl/multi.c
Outdated
|
||
multi = curl_multi_init(); | ||
if(UNEXPECTED(multi == NULL)) { | ||
zend_throw_error(NULL, "Could not initialize a new cURL multi handle"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this should be an error or exception, looking at interface.c these kinds of failures throw an exception with a wording like "Failed to ..." (see interface.c)
Anyway, I'll let @adoy have the final say as he maintains ext/curl.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
made the error message more interface.c-like
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm :) thanks
Merged, thanks! |
unsure if it should return false (like curl_init()) or throw (like most constructors do on failure) though..