]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
3 years agolib: sanitize conditional exclusion around MIME
Patrick Monnerat [Wed, 28 Sep 2022 16:12:15 +0000 (18:12 +0200)] 
lib: sanitize conditional exclusion around MIME

The introduction of CURL_DISABLE_MIME came with some additional bugs:
- Disabled MIME is compiled-in anyway if SMTP and/or IMAP is enabled.
- CURLOPT_MIMEPOST, CURLOPT_MIME_OPTIONS and CURLOPT_HTTPHEADER are
  conditioned on HTTP, although also needed for SMTP and IMAP MIME mail
  uploads.

In addition, the CURLOPT_HTTPHEADER and --header documentation does not
mention their use for MIME mail.

This commit fixes the problems above.

Closes #9610

3 years agodocs: minor grammar fixes
Thiago Suchorski [Tue, 27 Sep 2022 16:53:54 +0000 (13:53 -0300)] 
docs: minor grammar fixes

Closes #9609

3 years agoCURLSHOPT_UNLOCKFUNC.3: the callback as no 'access' argument
Daniel Stenberg [Wed, 28 Sep 2022 13:44:23 +0000 (15:44 +0200)] 
CURLSHOPT_UNLOCKFUNC.3: the callback as no 'access' argument

Probably a copy and paste error from the lock function man page.

Reported-by: Robby Simpson
Fixes #9612
Closes #9613

3 years agoCURLOPT_ACCEPT_ENCODING.3: remove "four" as they are five
Daniel Stenberg [Wed, 28 Sep 2022 14:10:46 +0000 (16:10 +0200)] 
CURLOPT_ACCEPT_ENCODING.3: remove "four" as they are five

... instead just list the supported encodings.

Reported-by: ProceduralMan on github
Fixes #9614
Closes #9615

3 years agotests: Remove a duplicated keyword
Dan Fandrich [Wed, 28 Sep 2022 17:57:10 +0000 (10:57 -0700)] 
tests: Remove a duplicated keyword

3 years agodocs: document more server names for test files
Dan Fandrich [Wed, 28 Sep 2022 17:56:31 +0000 (10:56 -0700)] 
docs: document more server names for test files

3 years agoaltsvc: reject bad port numbers
Daniel Stenberg [Tue, 27 Sep 2022 15:20:23 +0000 (17:20 +0200)] 
altsvc: reject bad port numbers

The existing code tried but did not properly reject alternative services
using negative or too large port numbers.

With this fix, the logic now also flushes the old entries immediately
before adding a new one, making a following header with an illegal entry
not flush the already stored entry.

Report from the ongoing source code audit by Trail of Bits.

Adjusted test 356 to verify.

Closes #9607

3 years agofunctypes: provide the recv and send arg and return types
Daniel Stenberg [Mon, 26 Sep 2022 09:45:18 +0000 (11:45 +0200)] 
functypes: provide the recv and send arg and return types

This header is for providing the argument types for recv() and send()
when built to not use a dedicated config-[platfor].h file.

Remove the slow brute-force checks from configure and cmake.

This change also removes the use of the types for select, as they were
not used in code.

Closes #9592

3 years agourlapi: reject more bad characters from the host name field
Daniel Stenberg [Tue, 27 Sep 2022 15:48:08 +0000 (17:48 +0200)] 
urlapi: reject more bad characters from the host name field

Extended test 1560 to verify

Report from the ongoing source code audit by Trail of Bits.

Closes #9608

3 years agoconfigure: deprecate builds with small curl_off_t
Daniel Stenberg [Tue, 27 Sep 2022 09:13:21 +0000 (11:13 +0200)] 
configure: deprecate builds with small curl_off_t

If curl_off_t turns out to be smaller than 8 bytes,
--with-n64-deprecated needs to be used to allow the build to
continue. This is to highlight the fact that support for such builds is
going away next year.

Also mentioned in DEPRECATED.md

Closes #9605

3 years agohttp, vauth: always provide Curl_allow_auth_to_host() functionality
Patrick Monnerat [Mon, 26 Sep 2022 23:01:16 +0000 (01:01 +0200)] 
http, vauth: always provide Curl_allow_auth_to_host() functionality

This function is currently located in the lib/http.c module and is
therefore disabled by the CURL_DISABLE_HTTP conditional token.

As it may be called by TLS backends, disabling HTTP results in an
undefined reference error at link time.

Move this function to vauth/vauth.c to always provide it and rename it
as Curl_auth_allowed_to_host() to respect the vauth module naming
convention.

Closes #9600

3 years agongtcp2: fix C89 compliance nit
Daniel Stenberg [Tue, 27 Sep 2022 07:06:37 +0000 (09:06 +0200)] 
ngtcp2: fix C89 compliance nit

3 years agoopenssl: make certinfo available for QUIC
Daniel Stenberg [Mon, 26 Sep 2022 14:19:50 +0000 (16:19 +0200)] 
openssl: make certinfo available for QUIC

Curl_ossl_certchain() is now an exported function in lib/vtls/openssl.c that
can also be used from quiche.c and ngtcp2.c to get the cert chain for QUIC
connections as well.

The *certchain function was moved to the top of the file for this reason.

Reported-by: Eloy Degen
Fixes #9584
Closes #9597

3 years agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 27 Sep 2022 11:09:44 +0000 (13:09 +0200)] 
RELEASE-NOTES: synced

3 years agoDEPRECATE.md: Support for systems without 64 bit data types
Daniel Stenberg [Tue, 27 Sep 2022 08:42:36 +0000 (10:42 +0200)] 
DEPRECATE.md: Support for systems without 64 bit data types

Closes #9604

3 years agotests: skip mime/form tests when mime is not built-in
Patrick Monnerat [Mon, 26 Sep 2022 13:38:41 +0000 (15:38 +0200)] 
tests: skip mime/form tests when mime is not built-in

Closes #9596

3 years agourl: rename function due to name-clash in Watt-32
Daniel Stenberg [Tue, 27 Sep 2022 07:32:20 +0000 (09:32 +0200)] 
url: rename function due to name-clash in Watt-32

Follow-up to 2481dbe5f4f58 and applies the change the way it was
intended.

3 years agowindows: adjust name of two internal public functions
Viktor Szakats [Mon, 26 Sep 2022 22:31:09 +0000 (22:31 +0000)] 
windows: adjust name of two internal public functions

According to `docs/INTERNALS.md`, internal function names spanning source
files start with uppercase `Curl_`. Bring these two functions in
alignment with this.

This also stops exporting them from `libcurl.dll` in autotools builds.

Reviewed-by: Daniel Stenberg
Closes #9598

3 years agourl: rename function due to name-clash in Watt-32
Gisle Vanem [Sat, 24 Sep 2022 18:58:09 +0000 (20:58 +0200)] 
url: rename function due to name-clash in Watt-32

Since the commit 764c958c52edb427f39, there was a new function called
resolve_ip(). This clashes with an internal function in Watt-32.

Closes #9585

3 years agoschannel: ban server ALPN change during recv renegotiation
Jay Satiro [Fri, 9 Sep 2022 19:33:47 +0000 (15:33 -0400)] 
schannel: ban server ALPN change during recv renegotiation

By the time schannel_recv is renegotiating the connection, libcurl has
already decided on a protocol and it is too late for the server to
select a protocol via ALPN except for the originally selected protocol.

Ref: https://github.com/curl/curl/issues/9451

Closes https://github.com/curl/curl/pull/9463

3 years agourl: a zero-length userinfo part in the URL is still a (blank) user
Daniel Stenberg [Sun, 25 Sep 2022 09:17:04 +0000 (11:17 +0200)] 
url: a zero-length userinfo part in the URL is still a (blank) user

Adjusted test 1560 to verify

Reported-by: Jay Satiro
Fixes #9088
Closes #9590

3 years agoautotools: allow --enable-symbol-hiding with windows
Viktor Szakats [Sun, 25 Sep 2022 22:19:13 +0000 (22:19 +0000)] 
autotools: allow --enable-symbol-hiding with windows

This local autotools logic was put in place in
9e24b9c7afbcb81120af4cf3f6cdee49a06d8224 (in 2012) which disabled it for
Windows unconditionally. Testing reveals that it actually works with
tested toolchains (mingw-w64 and CI ones), so let's allow this build
feature on that platform. Bringing this in sync with CMake, which already
supported this.

Reviewed-by: Jay Satiro
Closes #9586

3 years agoautotools: reduce brute-force when detecting recv/send arg list
Viktor Szakats [Sun, 25 Sep 2022 21:58:21 +0000 (21:58 +0000)] 
autotools: reduce brute-force when detecting recv/send arg list

autotools uses brute-force to detect `recv`/`send`/`select` argument
lists, by interating through _all_ argument type combinations on each
`./configure` run. This logic exists since
01fa02d0b545e1433dced2430561f8c0c72b74a9 (from 2006) and was a bit later
extended with Windows support.

This results in a worst-case number of compile + link cycles as below:
- `recv`: 96
- `send`: 192
- `select`: 60
Total: 348 (the number of curl C source files is 195, for comparison)

Notice that e.g. curl-for-win autotools builds require two `./configure`
invocations, doubling these numbers.

`recv` on Windows was especially unlucky because `SOCKET` (the correct
choice there) was listed _last_ in one of the outer trial loops. This
resulted in lengthy waits while autotools was trying all invalid
combinations first, wasting cycles, disk writes and slowing down
iteration.

This patch reduces the amount of idle work by reordering the tests in
a way to succeed first on a well-known platform such as Windows, and
also on non-Windows by testing for POSIX prototypes first, on the
assumption that these are the most likely candidates these days. (We do
not touch `select`, where the order was already optimal for these
platforms.)

For non-Windows, this means to try a return value of `ssize_t` first,
then `int`, reordering the buffer argument type to try `void *` first,
then `byte *`, and prefer the `const` flavor with `send`. If we are
here, also stop testing for `SOCKET` type in non-Windows builds.

After the patch, detection on Windows is instantaneous. It should also be
faster on popular platforms such as Linux and BSD-based ones.

If there are known-good variations for other platforms, they can also be
fast-tracked like above, given a way to check for that platform inside
the autotools logic.

Reviewed-by: Daniel Stenberg
Closes #9591

3 years agoTODO: Provide the error body from a CONNECT response
Daniel Stenberg [Fri, 23 Sep 2022 12:10:10 +0000 (14:10 +0200)] 
TODO: Provide the error body from a CONNECT response

Spellchecked-by: Jay Satiro
Closes #9513
Closes #9581

3 years agowindows: autotools .rc warnings fixup
Viktor Szakats [Fri, 23 Sep 2022 19:39:18 +0000 (19:39 +0000)] 
windows: autotools .rc warnings fixup

Move `LT_LANG([Windows Resource])` after `XC_LIBTOOL`, fixing:

- Warnings when running `autoreconf -fi`.

- Warning when compiling .rc files:
  libtool: compile: unable to infer tagged configuration
  libtool:   error: specify a tag with '--tag'

Follow up to 6de7322c03d5b4d91576a7d9fc893e03cc9d1057
Ref: https://github.com/curl/curl/pull/9521#issuecomment-1256291156

Suggested-by: Patrick Monnerat
Closes #9582

3 years agocurl_setup: disable use of FLOSS for 64-bit NonStop builds
Randall S. Becker [Thu, 22 Sep 2022 14:49:13 +0000 (08:49 -0600)] 
curl_setup: disable use of FLOSS for 64-bit NonStop builds

Older 32-bit builds currently need FLOSS. This dependency may be removed
in future OS releases.

Signed-off-by: Randall S. Becker <randall.becker@nexbridge.ca>
Closes #9575

3 years agotool: remove dead code
Patrick Monnerat [Fri, 23 Sep 2022 09:51:06 +0000 (11:51 +0200)] 
tool: remove dead code

Add a debug assertion to verify protocols included/excluded in a set
are always tokenized.

Follow-up to commit 677266c.

Closes #9576

3 years agolib: prepare the incoming of additional protocols
Patrick Monnerat [Thu, 22 Sep 2022 13:27:04 +0000 (15:27 +0200)] 
lib: prepare the incoming of additional protocols

Move the curl_prot_t to its own conditional block. Introduce symbol
PROTO_TYPE_SMALL to control it.

Fix a cast in a curl_prot_t assignment.
Remove an outdated comment.

Follow-up to cd5ca80.

Closes #9534

3 years agomsh3: change the static_assert to make the code C89
Daniel Stenberg [Wed, 21 Sep 2022 08:36:41 +0000 (10:36 +0200)] 
msh3: change the static_assert to make the code C89

3 years agobearssl: make it proper C89 compliant
Daniel Stenberg [Wed, 21 Sep 2022 08:32:54 +0000 (10:32 +0200)] 
bearssl: make it proper C89 compliant

3 years agocurl-compilers.m4: for gcc + want warnings, set gnu89 standard
Daniel Stenberg [Tue, 20 Sep 2022 08:56:44 +0000 (10:56 +0200)] 
curl-compilers.m4: for gcc + want warnings, set gnu89 standard

To better verify that the code is C89

Closes #9542

3 years agolib517: fix C89 constant signedness
Patrick Monnerat [Thu, 22 Sep 2022 10:35:52 +0000 (12:35 +0200)] 
lib517: fix C89 constant signedness

In C89, positive integer literals that overflow an int but not an
unsigned int may be understood as a negative int.

lib517.c:129:3: warning: this decimal constant is unsigned only in ISO C90
   {"Sun, 06 Nov 2044 08:49:37 GMT", 2362034977 },
   ^

Closes #9572

3 years agomprintf: use snprintf if available
Daniel Stenberg [Thu, 22 Sep 2022 09:52:08 +0000 (11:52 +0200)] 
mprintf: use snprintf if available

This is the single place in libcurl code where it uses the "native"
s(n)printf() function. Used for writing floats. The use has been
reviewed and vetted and uses a HUGE target buffer, but switching to
snprintf() still makes this safer and removes build-time warnings.

Reported-by: Philip Heiduck
Fixes #9569
Closes #9570

3 years agodocs: tag curl options better in man pages
Daniel Stenberg [Thu, 22 Sep 2022 15:07:09 +0000 (17:07 +0200)] 
docs: tag curl options better in man pages

As it makes them links in the HTML versions.

Verified by the extended test 1176

3 years agosymbols-in-versions: CURLOPT_ENCODING is deprecated since 7.21.6
Daniel Stenberg [Thu, 22 Sep 2022 15:06:49 +0000 (17:06 +0200)] 
symbols-in-versions: CURLOPT_ENCODING is deprecated since 7.21.6

3 years agomanpage-syntax.pl: all libcurl option symbols should be \fI-tagged
Daniel Stenberg [Thu, 22 Sep 2022 15:05:35 +0000 (17:05 +0200)] 
manpage-syntax.pl: all libcurl option symbols should be \fI-tagged

... as that makes them links to their corresponding man page.

This script is used for test 1173.

Closes #9574

3 years agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 22 Sep 2022 12:14:28 +0000 (14:14 +0200)] 
RELEASE-NOTES: synced

3 years agotool: remove protocol count limitation
Patrick Monnerat [Wed, 21 Sep 2022 08:41:22 +0000 (10:41 +0200)] 
tool: remove protocol count limitation

Replace bit mask protocol sets by null-terminated arrays of protocol
tokens. These are the addresses of the protocol names returned by
curl_version_info().

Protocol names are sorted case-insensitively before output to satisfy CI
tests matches consistency.

The protocol list returned by curl_version_info() is augmented with all
RTMP protocol variants.

Test 1401 adjusted for new alpha ordered output.

Closes #9546

3 years agotest972: verify the output without using external tool
Daniel Stenberg [Wed, 21 Sep 2022 10:32:16 +0000 (12:32 +0200)] 
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

3 years agohostip: lazily wait to figure out if IPv6 works until needed
Daniel Stenberg [Wed, 21 Sep 2022 06:52:57 +0000 (08:52 +0200)] 
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

3 years agocurl.h: fix mention of wrong error code in comment
Daniel Stenberg [Tue, 20 Sep 2022 12:53:08 +0000 (14:53 +0200)] 
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

3 years agosymbol-scan.pl: scan and verify .3 man pages
Daniel Stenberg [Tue, 20 Sep 2022 12:50:09 +0000 (14:50 +0200)] 
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

3 years agosymbols-in-versions: add missing LIBCURL* symbols
Daniel Stenberg [Tue, 20 Sep 2022 12:10:13 +0000 (14:10 +0200)] 
symbols-in-versions: add missing LIBCURL* symbols

3 years agosymbol-scan.pl: also check for LIBCURL* symbols
Daniel Stenberg [Tue, 20 Sep 2022 11:52:33 +0000 (13:52 +0200)] 
symbol-scan.pl: also check for LIBCURL* symbols

Closes #9544

3 years agodocs/libcurl/symbols-in-versions: add several missing symbols
Daniel Stenberg [Tue, 20 Sep 2022 11:48:21 +0000 (13:48 +0200)] 
docs/libcurl/symbols-in-versions: add several missing symbols

3 years agotest1119: scan all public headers
Daniel Stenberg [Tue, 20 Sep 2022 11:32:58 +0000 (13:32 +0200)] 
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

3 years agoexamples/chkspeed: improve portability
Patrick Monnerat [Wed, 21 Sep 2022 09:18:27 +0000 (11:18 +0200)] 
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

3 years agoeasy: fix the #include order
Daniel Stenberg [Wed, 21 Sep 2022 09:17:32 +0000 (11:17 +0200)] 
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

3 years agodocs: spellfixes
Daniel Stenberg [Tue, 20 Sep 2022 21:30:19 +0000 (23:30 +0200)] 
docs: spellfixes

Pointed by the new CI job

3 years agoGHA: spellcheck
Daniel Stenberg [Tue, 20 Sep 2022 21:30:02 +0000 (23:30 +0200)] 
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

3 years agoconnect: fix the wrong error message on connect failures
Daniel Stenberg [Wed, 21 Sep 2022 07:06:49 +0000 (09:06 +0200)] 
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

3 years agohttpput-postfields.c: shorten string for C89 compliance
Daniel Stenberg [Wed, 21 Sep 2022 07:32:12 +0000 (09:32 +0200)] 
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

3 years agows: fix a C89 compliance nit
Daniel Stenberg [Tue, 20 Sep 2022 08:54:22 +0000 (10:54 +0200)] 
ws: fix a C89 compliance nit

Closes #9541

3 years agounit test 1655: make it C89-compliant
Patrick Monnerat [Wed, 21 Sep 2022 01:00:30 +0000 (03:00 +0200)] 
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

3 years agocurl_strequal.3: fix typo
Tobias Schaefer [Tue, 20 Sep 2022 19:04:23 +0000 (21:04 +0200)] 
curl_strequal.3: fix typo

Closes #9548

3 years agoresolve: make forced IPv4 resolve only use A queries
Dmitry Karpov [Mon, 19 Sep 2022 20:59:35 +0000 (13:59 -0700)] 
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

3 years agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 20 Sep 2022 06:48:18 +0000 (08:48 +0200)] 
RELEASE-NOTES: synced

3 years agowinbuild/MakefileBuild.vc: handle spaces in libssh(2) include paths
Daniel Stenberg [Mon, 19 Sep 2022 10:43:41 +0000 (12:43 +0200)] 
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

3 years agoTODO: Reduce CA certificate bundle reparsing
Daniel Stenberg [Mon, 19 Sep 2022 12:55:30 +0000 (14:55 +0200)] 
TODO: Reduce CA certificate bundle reparsing

By adding some sort of cache.

Reported-by: Michael Drake
Closes #9379
Closes #9538

3 years agoCI/GHA: cancel outdated CI runs on new PR changes
Marc Hoersken [Sat, 17 Sep 2022 21:45:32 +0000 (23:45 +0200)] 
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

3 years agodocs: fix proselint complaints 9520/head
Daniel Stenberg [Mon, 19 Sep 2022 15:30:30 +0000 (17:30 +0200)] 
docs: fix proselint complaints

3 years agoGHA: run proselint on markdown files
Daniel Stenberg [Mon, 19 Sep 2022 15:30:05 +0000 (17:30 +0200)] 
GHA: run proselint on markdown files

Co-authored-by: Marc Hörsken
Closes #9520

3 years agolib: the number four in a sequence is the "fourth"
Daniel Stenberg [Sun, 18 Sep 2022 21:23:42 +0000 (23:23 +0200)] 
lib: the number four in a sequence is the "fourth"

Spelling is hard

Closes #9535

3 years agomisc: fix spelling in two source files
John Bampton [Sat, 17 Sep 2022 19:48:43 +0000 (05:48 +1000)] 
misc: fix spelling in two source files

Closes #9529

3 years agowindows: add .rc support to autotools builds
Viktor Szakats [Sun, 18 Sep 2022 12:05:35 +0000 (12:05 +0000)] 
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] https://github.com/curl/curl-for-win/blob/535f19060d4b708f72e75dd849409ce50baa1b84/curl-autotools.sh#L376-L382
[1] https://www.gnu.org/software/libtool/manual/html_node/Tags.html

Closes #9521

3 years agoCI/linkcheck: only run if a Markdown file is changed
Marc Hoersken [Sat, 17 Sep 2022 19:58:58 +0000 (21:58 +0200)] 
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

3 years agoREADME.md: add GHA status badges for Linux and macOS builds
Marc Hoersken [Sat, 17 Sep 2022 19:53:50 +0000 (21:53 +0200)] 
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]

3 years agomisc: null-terminate
Daniel Stenberg [Sat, 17 Sep 2022 15:32:21 +0000 (17:32 +0200)] 
misc: null-terminate

Make use of this term consistently.

Closes #9527

3 years agoCI/GHA: merge intel CC and more TLS libs into linux workflow
Marc Hoersken [Thu, 15 Sep 2022 19:20:10 +0000 (21:20 +0200)] 
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

3 years agolib1597: make it C89-compliant again
Patrick Monnerat [Sat, 17 Sep 2022 12:09:07 +0000 (14:09 +0200)] 
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

3 years agotool_libinfo: silence "different 'const' qualifiers" in qsort()
Daniel Stenberg [Sat, 17 Sep 2022 09:38:59 +0000 (11:38 +0200)] 
tool_libinfo: silence "different 'const' qualifiers" in qsort()

MSVC 15.0.30729.1 warned about it

Follow-up to dd2a024323dcc

Closes #9522

3 years agodocs: tell about disabled protocols in CURLOPT_*PROTOCOLS_STR.
Patrick Monnerat [Tue, 13 Sep 2022 17:47:18 +0000 (19:47 +0200)] 
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.

3 years agocli tool: do not use disabled protocols
Patrick Monnerat [Thu, 15 Sep 2022 12:31:36 +0000 (14:31 +0200)] 
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.

3 years agosetopt: use the handler table for protocol name to number conversions
Patrick Monnerat [Thu, 15 Sep 2022 11:30:09 +0000 (13:30 +0200)] 
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

3 years agoaltsvc: use 'h3' for h3
Daniel Stenberg [Fri, 16 Sep 2022 13:01:57 +0000 (15:01 +0200)] 
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

3 years agowinbuild: Use NMake batch-rules for compilation
chemodax [Thu, 15 Sep 2022 16:41:17 +0000 (19:41 +0300)] 
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

3 years agows: the infof() flags should be %zu
Daniel Stenberg [Fri, 16 Sep 2022 15:18:16 +0000 (17:18 +0200)] 
ws: the infof() flags should be %zu

Follow-up to e5e9e0c5e49ae0

Closes #9518

3 years agocurl: warn for --ssl use, considered insecure
Daniel Stenberg [Fri, 16 Sep 2022 17:03:49 +0000 (19:03 +0200)] 
curl: warn for --ssl use, considered insecure

Closes #9519

3 years agocurl_escape.3: fix typo
Sergey Bronnikov [Fri, 16 Sep 2022 13:32:57 +0000 (16:32 +0300)] 
curl_escape.3: fix typo

lengthf -> length

Closes #9517

3 years agomailmap: merge Philip Heiduck's two addresses into one
Daniel Stenberg [Fri, 16 Sep 2022 14:46:32 +0000 (16:46 +0200)] 
mailmap: merge Philip Heiduck's two addresses into one

3 years agotest1948: verify PUT + POST reusing the same handle
Daniel Stenberg [Thu, 15 Sep 2022 07:23:33 +0000 (09:23 +0200)] 
test1948: verify PUT + POST reusing the same handle

Reproduced #9507, verifies the fix

3 years agosetopt: when POST is set, reset the 'upload' field
Daniel Stenberg [Thu, 15 Sep 2022 07:22:45 +0000 (09:22 +0200)] 
setopt: when POST is set, reset the 'upload' field

Reported-by: RobBotic1 on github
Fixes #9507
Closes #9511

3 years agogithub: initial CODEOWNERS setup for CI configuration
Marc Hoersken [Wed, 14 Sep 2022 18:09:54 +0000 (20:09 +0200)] 
github: initial CODEOWNERS setup for CI configuration

Reviewed-by: Daniel Stenberg
Reviewed-by: Marcel Raad
Reviewed-by: Max Dymond
Closes #9505

[skip ci]

3 years agoCI: optimize some more dependencies install
Philip Heiduck [Tue, 13 Sep 2022 14:15:12 +0000 (16:15 +0200)] 
CI: optimize some more dependencies install

Signed-off-by: Philip Heiduck <pheiduck@Philips-MBP.lan>
Closes #9500

3 years agoCI/GHA: merge event-based and NSS into new linux workflow
Marc Hoersken [Wed, 14 Sep 2022 20:24:39 +0000 (22:24 +0200)] 
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

3 years agoinclude/curl/websockets.h: add extern "C" for C++
Daniel Stenberg [Thu, 15 Sep 2022 06:40:59 +0000 (08:40 +0200)] 
include/curl/websockets.h: add extern "C" for C++

Reported-by: n0name321 on github
Fixes #9509
Closes #9510

3 years agolib1560: extended to verify detect/reject of unknown schemes
Daniel Stenberg [Wed, 14 Sep 2022 07:21:49 +0000 (09:21 +0200)] 
lib1560: extended to verify detect/reject of unknown schemes

... when no guessing is allowed.

3 years agourlapi: detect scheme better when not guessing
Daniel Stenberg [Wed, 14 Sep 2022 07:18:30 +0000 (09:18 +0200)] 
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

3 years agostrerror: improve two URL API error messages
Daniel Stenberg [Wed, 14 Sep 2022 07:17:28 +0000 (09:17 +0200)] 
strerror: improve two URL API error messages

3 years agoCI/GHA: merge bearssl and hyper into initial linux workflow
Marc Hoersken [Tue, 13 Sep 2022 19:13:17 +0000 (21:13 +0200)] 
CI/GHA: merge bearssl and hyper into initial linux workflow

Begin work on merging all Linux workflows into one file.

Closes #9501

3 years agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 14 Sep 2022 07:58:50 +0000 (09:58 +0200)] 
RELEASE-NOTES: synced

3 years agocmake: define BUILDING_LIBCURL in lib/CMakeLists, not config.h
Daniel Stenberg [Tue, 13 Sep 2022 12:43:40 +0000 (14:43 +0200)] 
cmake: define BUILDING_LIBCURL in lib/CMakeLists, not config.h

Since the config file might also get included by the tool code at times.
This syncs with how other builds do it.

Closes #9498

3 years agotool_hugehelp: make hugehelp a blank macro when disabled
Daniel Stenberg [Tue, 13 Sep 2022 08:25:26 +0000 (10:25 +0200)] 
tool_hugehelp: make hugehelp a blank macro when disabled

Closes #9485

3 years agogetparameter: return PARAM_MANUAL_REQUESTED for -M even when disabled
Daniel Stenberg [Mon, 12 Sep 2022 14:28:32 +0000 (16:28 +0200)] 
getparameter: return PARAM_MANUAL_REQUESTED for -M even when disabled

... to improve the output in this situation. Now it doesn't say "option
unknown" anymore.

Closes #9485

3 years agosetopt: fix compiler warning
Daniel Stenberg [Tue, 13 Sep 2022 20:56:31 +0000 (22:56 +0200)] 
setopt: fix compiler warning

Follow-up to cd5ca80f00d2

closes #9502

3 years agoCI: skip make, do make install at once for dependencies
Philip Heiduck [Sun, 11 Sep 2022 22:04:32 +0000 (00:04 +0200)] 
CI: skip make, do make install at once for dependencies

Signed-off-by: Philip Heiduck <pheiduck@Philips-MBP.lan>
Closes #9477

3 years agoformdata: typecast the va_arg return value
Daniel Stenberg [Tue, 13 Sep 2022 12:52:33 +0000 (14:52 +0200)] 
formdata: typecast the va_arg return value

To avoid "enumerated type mixed with another type" warnings

Follow-up from 0f52dd5fd5aa3592691a

Closes #9499

3 years agoRELEASE-PROCEDURE.md: mention patch releases
Daniel Stenberg [Tue, 13 Sep 2022 06:37:01 +0000 (08:37 +0200)] 
RELEASE-PROCEDURE.md: mention patch releases

- When to make them and how to argue for them
- Refreshed the release date list

Closes #9495

3 years agourldata: use a curl_prot_t type for storing protocol bits
Daniel Stenberg [Mon, 12 Sep 2022 07:57:01 +0000 (09:57 +0200)] 
urldata: use a curl_prot_t type for storing protocol bits

This internal-use-only storage type can be bumped to a curl_off_t once
we need to use bit 32 as the previous 'unsigned int' can no longer hold
them all then.

The websocket protocols take bit 30 and 31 so they are the last ones
that fit within 32 bits - but cannot properly be exported through APIs
since those use *signed* 32 bit types (long) in places.

Closes #9481

3 years agoformdata: fix warning: 'CURLformoption' is promoted to 'int'
zhanghu [Thu, 22 Apr 2021 09:10:00 +0000 (17:10 +0800)] 
formdata: fix warning: 'CURLformoption' is promoted to 'int'

curl/lib/formdata.c: In function 'FormAdd':
curl/lib/formdata.c:249:31: warning: 'CURLformoption' is promoted to 'int' when passed through '...'
  249 |       option = va_arg(params, CURLformoption);
      |                               ^
curl/lib/formdata.c:249:31: note: (so you should pass 'int' not 'CURLformoption' to 'va_arg')
curl/lib/formdata.c:249:31: note: if this code is reached, the program will abort

Closes #9484