Skip to content

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

Closed
wants to merge 4 commits into from

Conversation

divinity76
Copy link
Contributor

unsure if it should return false (like curl_init()) or throw (like most constructors do on failure) though..

unsure if it should return false (like curl_init()) or throw (like most constructors do on failure) though..
@divinity76
Copy link
Contributor Author

.. come to think of it, if it's a vote, I'm voting to throw

Copy link
Member

@nielsdos nielsdos left a 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");
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Member

@adoy adoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm :) thanks

@nielsdos nielsdos closed this in 9814d4a Jan 16, 2024
@nielsdos
Copy link
Member

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants