Commit Graph

29352 Commits

Author SHA1 Message Date
Daniel Stenberg
fb11e45f9c
test972: verify the output without using external tool
It seems too restrictive to assume and use an external tool to verify
the JSON. This now verifies the outut byte per byte. We could consider
building a local "JSON verifyer" in a future.

Remove 'jsonlint' from the CI job.

Reported-by: Marcel Raad
Fixes #9563
Closes #9564
2022-09-22 13:46:40 +02:00
Daniel Stenberg
46f3fe0e75
hostip: lazily wait to figure out if IPv6 works until needed
The check may take many milliseconds, so now it is performed once the
value is first needed. Also, this change makes sure that the value is
not used if the resolve is set to be IPv4-only.

Closes #9553
2022-09-22 09:47:59 +02:00
Daniel Stenberg
7295e62c66
curl.h: fix mention of wrong error code in comment
The same error and comment were also used and is now corrected in
CURLOPT_SSH_KEYFUNCTION.3
2022-09-22 09:43:39 +02:00
Daniel Stenberg
34c598a9b3
symbol-scan.pl: scan and verify .3 man pages
This script now also finds all .3 man pages in docs/include and
docs/include/opts, extracts all uses of CURL* symbols and verifies that all
symbols mentioned in docs are defined in public headers.

A "global symbol" is one of those matching a known prefix and the script makes
an attempt to check all/most of them. Just using *all* symbols that match
CURL* proved matching a little too many other references as well and turned
difficult turning into something useful.

Closes #9544
2022-09-22 09:43:34 +02:00
Daniel Stenberg
16814d8f8c
symbols-in-versions: add missing LIBCURL* symbols 2022-09-22 09:43:34 +02:00
Daniel Stenberg
c3feb8e165
symbol-scan.pl: also check for LIBCURL* symbols
Closes #9544
2022-09-22 09:43:30 +02:00
Daniel Stenberg
4c8d180354
docs/libcurl/symbols-in-versions: add several missing symbols 2022-09-22 09:43:22 +02:00
Daniel Stenberg
6c951c427f
test1119: scan all public headers
Previously this test only scanned a subset of the headers, which made us
accidentally miss symbols that were provided in the others. Now, the script
iterates over all headers present in include/curl.

Closes #9544
2022-09-22 09:43:13 +02:00
Patrick Monnerat
c3e634d066
examples/chkspeed: improve portability
The example program chkspeed uses strncasecmp() which is not portable
across systems. Replace calls to this function by tests on characters.

Closes #9562
2022-09-21 23:52:34 +02:00
Daniel Stenberg
1998f34d54
easy: fix the #include order
The mentioned "last 3 includes" order should be respected. easy_lock.h should
be included before those three.

Reported-by: Yuriy Chernyshov
Fixes #9560
Closes #9561
2022-09-21 23:15:15 +02:00
Daniel Stenberg
fd1ce3d4b0
docs: spellfixes
Pointed by the new CI job
2022-09-21 15:20:08 +02:00
Daniel Stenberg
72c41f7c8b
GHA: spellcheck
This spellchecker checks markdown files. For this reason this job
converts all man pages in the repository to markdown with pandoc before
the check runs.

The perl script 'cleanspell' filters out details from the man page in
the process, to avoid the spellchecker trying to spellcheck things it
can't. Like curl specific symbols and the SYNOPSIS and EXAMPLE sections
of libcurl man pages.

The spell checker does not check words in sections that are within pre,
strong and em tags.

'spellcheck.words' is a custom word list with additional accepted words.

Closes #9523
2022-09-21 15:20:07 +02:00
Daniel Stenberg
6267244161
connect: fix the wrong error message on connect failures
The "Failed to connect to" message after a connection failure would
include the strerror message based on the presumed previous socket
error, but in times it seems that error number is not set when reaching
this code and therefore it would include the wrong error message.

The strerror message is now removed from here and the curl_easy_strerror
error is used instead.

Reported-by: Edoardo Lolletti
Fixes #9549
Closes #9554
2022-09-21 14:23:37 +02:00
Daniel Stenberg
9eec75452c
httpput-postfields.c: shorten string for C89 compliance
httpput-postfields.c:41:3: error: string length ‘522’ is greater than the length ‘509’ ISO C90 compilers are required to support [-Woverlength-strings]
   41 |   "this chapter.";
      |   ^~~~~~~~~~~~~~~

Closes #9555
2022-09-21 09:59:40 +02:00
Daniel Stenberg
a2fa5f86d6
ws: fix a C89 compliance nit
Closes #9541
2022-09-21 09:19:42 +02:00
Patrick Monnerat
6fbf7d34b5
unit test 1655: make it C89-compliant
Initializations performed in unit test 1655 use automatic variables in
aggregates and thus can only be computed at run-time. Using gcc in C89
dialect mode produces warning messages like:

unit1655.c:96:7: warning: initializer element is not computable at load time [-Wpedantic]
   96 |     { toolong, DOH_DNS_NAME_TOO_LONG },  /* expect early failure */
      |       ^~~~~~~

Fix the problem by converting these automatic pointer variables to
static arrays.

Closes #9551
2022-09-21 09:14:34 +02:00
Tobias Schaefer
8e5b1b66c1
curl_strequal.3: fix typo
Closes #9548
2022-09-20 23:21:47 +02:00
Dmitry Karpov
1902e8fc51
resolve: make forced IPv4 resolve only use A queries
This protects IPv4-only transfers from undesired bad IPv6-related side
effects and make IPv4 transfers in dual-stack libcurl behave the same
way as in IPv4 single-stack libcurl.

Closes #9540
2022-09-20 15:43:27 +02:00
Daniel Stenberg
ae9e713c4e
RELEASE-NOTES: synced 2022-09-20 08:48:18 +02:00
Daniel Stenberg
8bc6a38cef
winbuild/MakefileBuild.vc: handle spaces in libssh(2) include paths
Patched-by: Mark Itzcovitz
Bug: https://curl.se/mail/lib-2022-09/0038.html

Closes #9536
2022-09-20 08:37:27 +02:00
Daniel Stenberg
e9a85c4623
TODO: Reduce CA certificate bundle reparsing
By adding some sort of cache.

Reported-by: Michael Drake
Closes #9379
Closes #9538
2022-09-20 08:35:52 +02:00
Marc Hoersken
4e6893307b
CI/GHA: cancel outdated CI runs on new PR changes
Avoid letting outdated CI runs continue if a PR receives
new changes. Outside a PR we let them continue running
by tying the concurrency to the commit hash instead.

Also only let one CodeQL or Hacktoberfest job run at a time.

Other CI platforms we use have this build in, but GitHub
unfortunately neither by default nor with a simple option.

This saves CI resources and therefore a little energy.

Approved-by: Daniel Stenberg
Approved-by: Max Dymond
Closes #9533
2022-09-19 21:21:04 +02:00
Daniel Stenberg
fda897f5a1
docs: fix proselint complaints 2022-09-19 17:32:12 +02:00
Daniel Stenberg
6e0dbe84e2
GHA: run proselint on markdown files
Co-authored-by: Marc Hörsken

Closes #9520
2022-09-19 17:32:04 +02:00
Daniel Stenberg
660cf3d4ed
lib: the number four in a sequence is the "fourth"
Spelling is hard

Closes #9535
2022-09-19 08:48:49 +02:00
John Bampton
a46e412464
misc: fix spelling in two source files
Closes #9529
2022-09-19 08:47:55 +02:00
Viktor Szakats
6de7322c03
windows: add .rc support to autotools builds
After this update autotools builds will compile and link `.rc` resources
to Windows executables. Bringing this feature on par with CMake and
Makefile.m32 builds. And also making it unnecessary to improvise these
steps manually, while monkey patching build files, e.g. [0].

You can customize the resource compiler via the `RC` envvar, and its
options via `RCFLAGS`.

This harmless warning may appear throughout the build, even though the
autotools manual documents [1] `RC` as a valid tag, and it fails when
omitting one:
`libtool:   error: ignoring unknown tag RC`

[0] 535f19060d/curl-autotools.sh (L376-L382)
[1] https://www.gnu.org/software/libtool/manual/html_node/Tags.html

Closes #9521
2022-09-18 12:05:35 +00:00
Marc Hoersken
e3a533f51b
CI/linkcheck: only run if a Markdown file is changed
This saves CI resources and therefore a little energy.

Reviewed-by: Max Dymond
Closes #9531
2022-09-18 08:53:34 +02:00
Marc Hoersken
f315b54000
README.md: add GHA status badges for Linux and macOS builds
This makes sense now that Linux builds are being consolidated.

Approved-by: Daniel Stenberg
Closes #9530

[skip ci]
2022-09-17 23:58:37 +02:00
Daniel Stenberg
307b7543ea
misc: null-terminate
Make use of this term consistently.

Closes #9527
2022-09-17 23:19:29 +02:00
Marc Hoersken
db02e0e980
CI/GHA: merge intel CC and more TLS libs into linux workflow
Continue work on merging all Linux workflows into one file.

Reviewed-by: Max Dymond
Follow up to #9501
Closes #9514
2022-09-17 21:49:55 +02:00
Patrick Monnerat
7ca36f4956
lib1597: make it C89-compliant again
Automatic variable addresses cannot be used in an initialisation
aggregate.

Follow-up to 9d51329

Reported-by: Daniel Stenberg
Fixes: #9524
Closes #9525
2022-09-17 17:26:43 +02:00
Daniel Stenberg
9eccc613a2
tool_libinfo: silence "different 'const' qualifiers" in qsort()
MSVC 15.0.30729.1 warned about it

Follow-up to dd2a024323

Closes #9522
2022-09-17 13:54:56 +02:00
Patrick Monnerat
5261efaed8
docs: tell about disabled protocols in CURLOPT_*PROTOCOLS_STR.
Disabled protocols are now handled as if they were unknown.
Also update the possible protocol list.
2022-09-16 23:29:09 +02:00
Patrick Monnerat
dd2a024323
cli tool: do not use disabled protocols
As they are now rejected by the library, take care of not passing
disabled protocol names to CURLOPT_PROTOCOLS_STR and
CURLOPT_REDIR_PROTOCOLS_STR.

Rather than using the CURLPROTO_* constants, dynamically assign protocol
numbers based on the order they are listed by curl_version_info().

New type proto_set_t implements prototype bit masks: it should therefore
be large enough to accomodate all library-enabled protocols. If not,
protocol numbers beyond the bit count of proto_set_t are recognized but
"inaccessible": when used, a warning is displayed and the value is
ignored. Should proto_set_t overflows, enabled protocols are reordered to
force those having a public CURLPROTO_* representation to be accessible.

Code has been added to subordinate RTMP?* protocols to the presence of
RTMP in the enabled protocol list, being returned by curl_version_info()
or not.
2022-09-16 23:29:08 +02:00
Patrick Monnerat
9d51329047
setopt: use the handler table for protocol name to number conversions
This also returns error CURLE_UNSUPPORTED_PROTOCOL rather than
CURLE_BAD_FUNCTION_ARGUMENT when a listed protocol name is not found.

A new schemelen parameter is added to Curl_builtin_scheme() to support
this extended use.

Note that disabled protocols are not recognized anymore.

Tests adapted accordingly.

Closes #9472
2022-09-16 23:29:01 +02:00
Daniel Stenberg
1bbffa0833
altsvc: use 'h3' for h3
Since the official and real version has been out for a while now and servers
are deployed out there using it, there is no point in sticking to h3-29.

Reported-by: ウさん
Fixes #9515
Closes #9516
2022-09-16 22:31:25 +02:00
chemodax
8a7ecb57e7 winbuild: Use NMake batch-rules for compilation
- Invoke cl compiler once for each group of .c files.

This is significantly improves compilation time. For example in my
environment: 40 s --> 20 s.

Prior to this change cl was invoked per .c file.

Closes https://github.com/curl/curl/pull/9512
2022-09-16 16:13:08 -04:00
Daniel Stenberg
ec51f00480
ws: the infof() flags should be %zu
Follow-up to e5e9e0c5e4

Closes #9518
2022-09-16 21:35:15 +02:00
Daniel Stenberg
79e404d039
curl: warn for --ssl use, considered insecure
Closes #9519
2022-09-16 21:27:20 +02:00
Sergey Bronnikov
62b8a4dd1c
curl_escape.3: fix typo
lengthf -> length

Closes #9517
2022-09-16 16:50:36 +02:00
Daniel Stenberg
29a6cf968e
mailmap: merge Philip Heiduck's two addresses into one 2022-09-16 16:46:32 +02:00
Daniel Stenberg
1edb15925e
test1948: verify PUT + POST reusing the same handle
Reproduced #9507, verifies the fix
2022-09-15 23:44:15 +02:00
Daniel Stenberg
a64e3e5993
setopt: when POST is set, reset the 'upload' field
Reported-by: RobBotic1 on github
Fixes #9507
Closes #9511
2022-09-15 23:44:15 +02:00
Marc Hoersken
c04c78ac87
github: initial CODEOWNERS setup for CI configuration
Reviewed-by: Daniel Stenberg
Reviewed-by: Marcel Raad
Reviewed-by: Max Dymond

Closes #9505

[skip ci]
2022-09-15 22:40:40 +02:00
Philip Heiduck
80a4a848df
CI: optimize some more dependencies install
Signed-off-by: Philip Heiduck <pheiduck@Philips-MBP.lan>

Closes #9500
2022-09-15 20:38:39 +02:00
Marc Hoersken
94445e7977
CI/GHA: merge event-based and NSS into new linux workflow
Continue work on merging all Linux workflows into one file.

Follow up to #9501
Closes #9506
2022-09-15 20:38:23 +02:00
Daniel Stenberg
f71b79feb5
include/curl/websockets.h: add extern "C" for C++
Reported-by: n0name321 on github
Fixes #9509
Closes #9510
2022-09-15 11:18:37 +02:00
Daniel Stenberg
c4768f168c
lib1560: extended to verify detect/reject of unknown schemes
... when no guessing is allowed.
2022-09-15 09:31:45 +02:00
Daniel Stenberg
846678541b
urlapi: detect scheme better when not guessing
When the parser is not allowed to guess scheme, it should consider the
word ending at the first colon to be the scheme, independently of number
of slashes.

The parser now checks that the scheme is known before it counts slashes,
to improve the error messge for URLs with unknown schemes and maybe no
slashes.

When following redirects, no scheme guessing is allowed and therefore
this change effectively prevents redirects to unknown schemes such as
"data".

Fixes #9503
2022-09-15 09:31:40 +02:00