ext/curl: show curl option name in error message - #22908
Conversation
|
@GrahamCampbell What do you think about this fallback in case curl_easy_option_by_id is not available? |
|
I think this is currently OK and can probably be fixed in the future. I am also wondering if it makes sense to loop through zend_constants as a fallback when curl_easy_option_by_id returns null, but I can't think of a situation where that would result in anything. |
|
Should this get a short Curl entry in |
|
@GrahamCampbell Thanks, great feedback. |
0c92a07 to
37c402b
Compare
Use curl_easy_option_by_id to retrieve the name of the option, and also show the name of the option in the case where strings contain a null byte. curl_easy_option_by_id simplifies the code, but was introduced in curl 7.73.0, so this also bumps the minimum version of curl. 7.73.0 was released in 2020, so I think that's acceptable. Showing the option name is especially useful when using curl_setopt_array. A user may specify many options, and this change makes it clear which option is wrong exactly.
- Add line to NEWS - Test more values for writable file handles - Fallback to zend_constants if curl_easy_option_by_id fails
37c402b to
040221c
Compare
|
This is ready. |
|
@arnaud-lb Could you take a look at this, and perhaps merge it? |
|
Thank you! |
Retrieve the option name by using curl_easy_option_by_id or by walking zend_constants, depending on whether the curl version used has curl_easy_option_by_id.
Showing the option name is especially useful when using curl_setopt_array. A user may specify many options, and this change makes it clear which option is wrong exactly.
Related to #10097, #22705.