Skip to content
Closed
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions ext/curl/multi.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,17 @@ static inline php_curlm *curl_multi_from_obj(zend_object *obj) {
PHP_FUNCTION(curl_multi_init)
{
php_curlm *mh;
CURLM *multi;

ZEND_PARSE_PARAMETERS_NONE();

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

RETURN_THROWS();
}
object_init_ex(return_value, curl_multi_ce);
mh = Z_CURL_MULTI_P(return_value);
mh->multi = curl_multi_init();
mh->multi = multi;

zend_llist_init(&mh->easyh, sizeof(zval), _php_curl_multi_cleanup_list, 0);
}
Expand Down