Skip to content

Show curl option name in error message#22705

Closed
Sjord wants to merge 1 commit into
php:masterfrom
Sjord:curl-error-option-name
Closed

Show curl option name in error message#22705
Sjord wants to merge 1 commit into
php:masterfrom
Sjord:curl-error-option-name

Conversation

@Sjord

@Sjord Sjord commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

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.

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.
@Sjord Sjord requested a review from adoy as a code owner July 12, 2026 10:49
@Sjord

Sjord commented Jul 12, 2026

Copy link
Copy Markdown
Contributor Author

This is somewhat related to #22662.

const SOURCE_FILE = __DIR__ . '/curl_arginfo.h';

const MIN_SUPPORTED_CURL_VERSION = '7.61.0';
const MIN_SUPPORTED_CURL_VERSION = '7.73.0';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This change requires an RFC.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Because it violates the policy of supporting the cURL version that ships with a popular OS.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

7.61.1 is as high as we can go as far as I'm aware, and I want us to do that: #22232.

@Sjord

Sjord commented Jul 12, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, I'll come back to this when RHEL 8 maintenance support expires.

@Sjord Sjord closed this Jul 12, 2026
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.

2 participants