Skip to content

test1521: verify setting options better - #14634

Closed
bagder wants to merge 4 commits into
masterfrom
bagder/1521-NULL-check
Closed

bagder wants to merge 4 commits into
masterfrom
bagder/1521-NULL-check

Conversation

@bagder

@bagder bagder commented Aug 21, 2024 •

Copy link
Copy Markdown
Member

Previously this test allowed several error values when setting options. This made this test miss #14629.

Now, errors are generally not accepted for setopts:

  • numerical setopts accept CURLE_BAD_FUNCTION_ARGUMENT for funny input
  • the first setopt to an option accepts CURLE_NOT_BUILT_IN or CURLE_UNKNOWN_OPTION for when they are disabled/not built-in
  • there is an allowlist concept for some return code for some variables, managed at the top of the mk-lib1521.pl script

In curl.h: remove the OBSOLETE named values from the setopt list.

@bagder
bagder force-pushed the bagder/1521-NULL-check branch from a6f74ad to 3da3e88 Compare August 21, 2024 13:17
@bagder
bagder marked this pull request as draft August 21, 2024 14:03
@bagder
bagder marked this pull request as ready for review August 22, 2024 07:24
@bagder
bagder force-pushed the bagder/1521-NULL-check branch from 298a135 to 7fa64c3 Compare August 22, 2024 08:08
@bagder
bagder force-pushed the bagder/1521-NULL-check branch from 7fa64c3 to 824bf82 Compare August 22, 2024 08:09
@bagder
bagder force-pushed the bagder/1521-NULL-check branch from 824bf82 to 22a32b4 Compare August 22, 2024 14:32
@bagder bagder changed the title test1521: verify setting options to NULL better test1521: verify setting options better Aug 22, 2024
@bagder
bagder marked this pull request as draft August 22, 2024 14:48
@bagder
bagder marked this pull request as ready for review August 22, 2024 21:46
bagder added 4 commits August 22, 2024 23:49
instead of returning an error code to the getinfo() call

Closes #14634
... and just move them into the accepted range.
Previously this test allowed several error values when setting options.
This made this test miss #14629.

Now, errors are generally not accepted for setopts:

 - numerical setopts accept CURLE_BAD_FUNCTION_ARGUMENT for funny input
 - the first setopt to an option accepts CURLE_NOT_BUILT_IN or
   CURLE_UNKNOWN_OPTION for when they are disabled/not built-in
 - there is an allowlist concept for some return code for some variables,
   managed at the top of the mk-lib1521.pl script

In curl.h: remove the OBSOLETE named values from the setopt list.

Closes #14634
@bagder
bagder force-pushed the bagder/1521-NULL-check branch from 9c14869 to ccdde79 Compare August 22, 2024 21:49
@bagder bagder closed this in 20d447c Aug 23, 2024
bagder added a commit that referenced this pull request Aug 23, 2024
Because NULL is documented as default and most options that take
pointers accept NULL to reset back to internal default.

Closes #14634
bagder added a commit that referenced this pull request Aug 23, 2024
... and just move them into the accepted range. Like how buffersize and
a few other options work.

Closes #14634
bagder added a commit that referenced this pull request Aug 23, 2024
Previously this test allowed several error values when setting options.
This made this test miss #14629.

Now, errors are generally not accepted for setopts:

 - numerical setopts accept CURLE_BAD_FUNCTION_ARGUMENT for funny input
 - the first setopt to an option accepts CURLE_NOT_BUILT_IN or
   CURLE_UNKNOWN_OPTION for when they are disabled/not built-in
 - there is an allowlist concept for some return code for some variables,
   managed at the top of the mk-lib1521.pl script

In curl.h: remove the OBSOLETE named values from the setopt list.

Closes #14634
@bagder
bagder deleted the bagder/1521-NULL-check branch August 25, 2024 21:32
Comment thread include/curl/curl.h
Comment on lines -1355 to +1354
/* OBSOLETE, do not use! */
CURLOPT(CURLOPT_OBSOLETE72, CURLOPTTYPE_LONG, 72),

/* 72 = OBSOLETE */

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.

Noticed in vpckg CI run on CURL HEAD:

CURLOPT_OBSOLETE72 is still used in the header for

#define CURLOPT_CLOSEPOLICY CURLOPT_OBSOLETE72

and CURLOPT_CLOSEPOLICY is used downstream in curlpp and curlcpp.

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

Development

Successfully merging this pull request may close these issues.

2 participants