]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
14 months agolib: use FMT_ as prefix instead of CURL_FORMAT_ 14764/head
Daniel Stenberg [Mon, 2 Sep 2024 22:04:23 +0000 (00:04 +0200)] 
lib: use FMT_ as prefix instead of CURL_FORMAT_

For printf format defines used internally. Makes the code slighly
easier to read.

Closes #14764

14 months agoopenssl: fix the data race when sharing an SSL session between threads
Aki [Sat, 31 Aug 2024 03:48:18 +0000 (11:48 +0800)] 
openssl: fix the data race when sharing an SSL session between threads

The SSL_Session object is mutated during connection inside openssl,
and it might not be thread-safe. Besides, according to documentation
of openssl:

```
SSL_SESSION objects keep internal link information about the session
cache list, when being inserted into one SSL_CTX object's session
cache. One SSL_SESSION object, regardless of its reference count,
must therefore only be used with one SSL_CTX object (and the SSL
objects created from this SSL_CTX object).
```
If I understand correctly, it is not safe to share it even in a
single thread.

Instead, serialize the SSL_SESSION before adding it to the cache,
and deserialize it after retrieving it from the cache, so that no
concurrent write to the same object is infeasible.

Also
 - add a ci test for thread sanitizer
 - add a test for sharing ssl sessions concurrently
 - avoid redefining memory functions when not building libcurl, but
   including the soruce in libtest
 - increase the concurrent connections limit in sws

Notice that there are fix for a global data race for openssl which
is not yet release. The fix is cherry pick for the ci test with
thread sanitizer.
https://github.com/openssl/openssl/commit/d8def79838cd0d5e7c21d217aa26edb5229f0ab4

Closes #14751

14 months agohaproxy: send though next filter
Stefan Eissing [Mon, 2 Sep 2024 11:29:54 +0000 (13:29 +0200)] 
haproxy: send though next filter

Small but, instead of sending the initial data though the connection
method, send it to the next filter in the chain. While the connection
methods accomodates for such use, by ignoring unconnected filters, it is
better to follow the filter chain explicitly.

Closes #14756

14 months agoprintf: fix mingw-w64 format checks
Viktor Szakats [Thu, 22 Aug 2024 08:54:42 +0000 (10:54 +0200)] 
printf: fix mingw-w64 format checks

Change mingw-w64 printf format checks in public curl headers to use
`__MINGW_PRINTF_FORMAT` instead of `gnu_printf`. This syncs the format
checker with format string macros published via `curl/system.h`. (Also
disable format checks for mingw-w64 older than 3.0.0 (2013-09-20) and
classic-mingw, which do not support this macro.)

This fixes bogus format checker `-Wformat` warnings in 3rd party code
using curl format strings with the curl printf functions, when using
mingw-w64 7.0.0 (2019-11-10) and older (with GCC, MSVCRT).

It also allows to delete two workaounds for this within curl itself:
- setting `-D__USE_MINGW_ANSI_STDIO=1` for mingw-w64 via cmake and
  configure for `docs/examples` and `tests/http/clients`.
  Ref: c730c8549b5b67e7668ca5d2cd82c3cc183e125d #14640

The format check macro is incompatible (depending on mingw-w64 version
and configuration) with the C99 `%z` (`size_t`) format string used
internally by curl.

To work around this problem, override the format check style in curl
public headers to use `gnu_printf`. This is compatible with `%z` in all
mingw-w64 versions and allows keeping the C99 format strings internally.

Also:
- lib/ws.c: add missing space to an error message.
- docs/examples/ftpgetinfo.c: fix to use standard printf.

Ref: #14643 (take 1)
Follow-up to 3829759bd042c03225ae862062560f568ba1a231 #12489

Closes #14703

14 months agocmake: default `CURL_DISABLE_LDAPS` to the value of `CURL_DISABLE_LDAP`
Viktor Szakats [Tue, 27 Aug 2024 16:54:59 +0000 (18:54 +0200)] 
cmake: default `CURL_DISABLE_LDAPS` to the value of `CURL_DISABLE_LDAP`

After this patch LDAPS is disabled by default when LDAP is manually
disabled.

This makes it unnecessary to disable them in sync manually just to avoid
a `CMakeLists.txt` warning.

Syncs behavior with `./configure`.

Closes #14758

14 months agorand: only provide weak random when needed
Daniel Stenberg [Sat, 31 Aug 2024 21:37:00 +0000 (23:37 +0200)] 
rand: only provide weak random when needed

builds without TLS and builds using rustls

Closes #14749

14 months agolib: remove use of RANDOM_FILE
Daniel Stenberg [Sat, 31 Aug 2024 21:07:12 +0000 (23:07 +0200)] 
lib: remove use of RANDOM_FILE

It could previously be set with configure/cmake and used in rare cases
for reading randomness: with ancient mbedTLS or rustls without
arc4random.

We now get randomness in this order:

1. The TLS library's way to provide random
2. On Windows: Curl_win32_random
3. if arc4random exists, use that
4. weak non-crytographically strong pseudo-random

Closes #14749

14 months agourl: fix connection reuse for HTTP/2 upgrades
Stefan Eissing [Fri, 30 Aug 2024 11:25:26 +0000 (13:25 +0200)] 
url: fix connection reuse for HTTP/2 upgrades

Normally, when a connection's filters have all connected, the
multiplex status is determined. However, HTTP/2 Upgrade:
requests will only do this when the first server response
has been received.

The current connection reuse mechanism does not accomodate
that and when the time between connect and response is large
enough, connection reuse may not happen as desired.

See test case 2405 failures, such as in
https://github.com/curl/curl/actions/runs/10629497461/job/29467166451

Add 'conn->bits.asks_multiplex' as indicator that a connection is
still being evaluated for mulitplexing, so that new transfers
may wait on this to be cleared.

Closes #14739

14 months agocurl_easy_handler.md: fix language
наб [Sun, 1 Sep 2024 02:10:02 +0000 (04:10 +0200)] 
curl_easy_handler.md: fix language

Applications need to [...] if it needs -> The application needs to

Closes #14752

14 months agocurl.h: make CURLOPT_WRITEINFO and CURLOPT_CLOSEPOLICY compile
Daniel Stenberg [Sat, 31 Aug 2024 15:24:01 +0000 (17:24 +0200)] 
curl.h: make CURLOPT_WRITEINFO and CURLOPT_CLOSEPOLICY compile

The symbols have not been in use for 17+ years and they did not do
anything for several years before that, but apparently there are still
code using them.

Follow-up to 3b057d4b7a7
Fixes #14747
Reported-by: Kai Pastor
Closes #14748

14 months agobuild: add options to disable SHA-512/256 hash algo
Viktor Szakats [Sun, 1 Sep 2024 14:25:49 +0000 (16:25 +0200)] 
build: add options to disable SHA-512/256 hash algo

Existing C macro lacked build-level counterparts.
Add them in this patch.

- cmake: `-DCURL_DISABLE_SHA512_256=ON`
- autotools: `--disable-sha512-256`

Also drop the checker exception from `test1165.pl`.

Follow-up to cbe41d151d6a100c1f045eaf37ff06b2b2a7b382 #12897
Closes #14753

14 months agotest1165: check if `curl_config.h.cmake` lists all `DISABLED` options
Viktor Szakats [Sun, 1 Sep 2024 14:55:53 +0000 (16:55 +0200)] 
test1165: check if `curl_config.h.cmake` lists all `DISABLED` options

Also fix issues:
- cmake: fix `CURL_DISABLE_HTTP_AUTH` option
- cmake: fix `CURL_DISABLE_SHUFFLE_DNS` option

Fixes:
```
Present in CMakeLists.txt, not propagated via curl_config.h.cmake: CURL_DISABLE_HTTP_AUTH
Present in CMakeLists.txt, not propagated via curl_config.h.cmake: CURL_DISABLE_SHUFFLE_DNS
```
Ref: https://github.com/curl/curl/actions/runs/10655027540/job/29532054141?pr=14754#step:11:2090

Closes #14754

14 months agoautotools: settle with option name: `--enable-windows-unicode`
Viktor Szakats [Sat, 31 Aug 2024 13:06:44 +0000 (15:06 +0200)] 
autotools: settle with option name: `--enable-windows-unicode`

Bring the option name style in sync with cmake and with other configure
options aiming to enable something unrelated to an optional package.

(I initially named this new option `--with-windows-unicode` within this
release cycle.)

Follow-up to 9e4a2187e763dd80a1296b07fd3e073f46c4dc8f #14478

Closes #14746

14 months agoconfigure: break indentation to fix `--help` output
Viktor Szakats [Sat, 31 Aug 2024 13:39:17 +0000 (15:39 +0200)] 
configure: break indentation to fix `--help` output

For recently added/updated options:
windows-unicode, winidn, apple-idn

It looks like the second `AS_HELP_STRING()` must start in the first
column, otherwise its indentation will appear in the `--help` output,
and break unalignment with the rest.

(There must be a better way to tackle this.)

14 months agocmake: sync `CURL_DISABLE_*` behaviour with autotools
Viktor Szakats [Fri, 30 Aug 2024 18:42:54 +0000 (20:42 +0200)] 
cmake: sync `CURL_DISABLE_*` behaviour with autotools

- disable RTSP, ALTSVC, HSTS when HTTP is disabled.
  (`./configure` warning deemed unnecessary and not replicated with
  cmake.)

- disable HSTS when there is no TLS backend.

Tested via #14744
Closes #14745

14 months agocmake: allow disabling `RANDOM_FILE`
Viktor Szakats [Fri, 30 Aug 2024 15:40:33 +0000 (17:40 +0200)] 
cmake: allow disabling `RANDOM_FILE`

`./configure` allows `--random-file=no`. Allow this with CMake too,
using `-DRANDOM_FILE=OFF` (other boolean values work too: no, false, 0,
case insensitive.)

Also disable `RANDOM_FILE` detection for Windows.

Closes #14743

14 months agobuild: add `poll()` detection for cross-builds
Viktor Szakats [Thu, 29 Aug 2024 23:04:18 +0000 (01:04 +0200)] 
build: add `poll()` detection for cross-builds

For cross-builds rely on `_POSIX_C_SOURCE` to decide if `poll()` is
supported, rather than just assuming it isn't.

This may still miss to detect `poll()` support, as seen for example with
Linux MUSL cross-builds.

Also:

- GHA/curl-for-win: enable RISC-V 64 cross-target for Linux MUSL.
  (to test this case with cmake, with a false-negative.)
  The first RISC-V 64 build in curl's CI.

- GHA/curl-for-win: add arm64/intel64 job for Linux glibc.
  (to test this case with cmake, and succeed.)

- cmake: delete unnecessary `#include <sys/time.h>` from non-cross-build
  `poll()` detection snippet.
  Follow-up tp cc8b8137659e1733fdd3810c19ff5ec8db438509 #14718

Fixes #14714
Closes #14734

14 months agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 30 Aug 2024 14:16:51 +0000 (16:16 +0200)] 
RELEASE-NOTES: synced

14 months agoPOP3: fix multi-line responses
Stefan Eissing [Wed, 28 Aug 2024 09:09:43 +0000 (11:09 +0200)] 
POP3: fix multi-line responses

Some POP3 commands are multi-line, e.g. have responses terminated by a
last line with '.', but some are not. Define the known command
properties and fix response handling.

Add test case for STAT.

Fixes #14677
Reported-by: ralfjunker on github
Closes #14707

14 months agollist: clear the list pointer when a node is removed
Stefan Eissing [Fri, 30 Aug 2024 09:54:14 +0000 (11:54 +0200)] 
llist: clear the list pointer when a node is removed

Closes #14738

14 months agocmdline-opts: language fix for expect100-timeout.md and max-time.md
Daniel Stenberg [Fri, 30 Aug 2024 09:03:38 +0000 (11:03 +0200)] 
cmdline-opts: language fix for expect100-timeout.md and max-time.md

needs to **be** provided

Also a http3.md spellfix

Follow-up from 22a6a0bc6b5ab935

Closes #14737

14 months agohttp3.md: mention how the fallback can be h1 or h2
Daniel Stenberg [Fri, 30 Aug 2024 07:04:15 +0000 (09:04 +0200)] 
http3.md: mention how the fallback can be h1 or h2

Closes #14736

14 months agomailmap: Aki Sakurai
Daniel Stenberg [Fri, 30 Aug 2024 08:28:34 +0000 (10:28 +0200)] 
mailmap: Aki Sakurai

14 months agomanagen: in man output, remove the leading space from examples
Daniel Stenberg [Fri, 30 Aug 2024 06:54:19 +0000 (08:54 +0200)] 
managen: in man output, remove the leading space from examples

Leave that rendering decision to the display tool.

Closes #14735

14 months agocmake: use host OS to decide about libcurl manpage batch size
Viktor Szakats [Thu, 29 Aug 2024 22:25:46 +0000 (00:25 +0200)] 
cmake: use host OS to decide about libcurl manpage batch size

Before this patch the targe OS was used, which prevented building
libcurl manpages in larger batches in cross-builds targeting e.g.
Windows.

Update the condition to use `CMAKE_HOST_UNIX` instead of `UNIX`.

This variable has been available since CMake 2.6.0:
https://github.com/Kitware/CMake/commit/176fe63d151d60e90edd4bd01eaac7d1b74241cd

Follow-up to bb84f82476df2b54c81693616d385e51c490c9e7 #13207

Closes #14733

14 months agomanagen: fix superfluous leading blank line in quoted sections
Daniel Stenberg [Thu, 29 Aug 2024 21:59:17 +0000 (23:59 +0200)] 
managen: fix superfluous leading blank line in quoted sections

When a markdown quoted section using 4-space indentation was converted
to nroff, managen previously caused a newline to appear after the
leading .nf. This fix makes sure that newline is inserted *before* .nf
as intended.

This is perhaps most notable in the HTML version of rendered manpages if
the quoted sections use different colors or similar.

Closes #14732

14 months agodump-ca-embed.md: set as "boolean", not "single"
Daniel Stenberg [Thu, 29 Aug 2024 21:45:10 +0000 (23:45 +0200)] 
dump-ca-embed.md: set as "boolean", not "single"

Because it is. And it makes the template manpage explanation for it make
sense.

Follow-up to 8a3740bc8e558b9a9d4a652b

Closes #14731

14 months agodocs/cmdline-opts/_VARIABLES: language polish
Daniel Stenberg [Thu, 29 Aug 2024 15:57:37 +0000 (17:57 +0200)] 
docs/cmdline-opts/_VARIABLES: language polish

Closes #14730

14 months agoruntests: remove "has_textaware"
Daniel Stenberg [Thu, 29 Aug 2024 14:00:21 +0000 (16:00 +0200)] 
runtests: remove "has_textaware"

All sections defined with the mode="text" attribute now get line endings
normalized so that comparisons become line ending agnostic. Removes the
previous problem of figuring out how exactly different Windows
environments should be treated in this regard.

Closes #14717

14 months agoftp: always offer line end conversions
Daniel Stenberg [Thu, 29 Aug 2024 12:35:21 +0000 (14:35 +0200)] 
ftp: always offer line end conversions

Previously this functionality was limited to platforms that not already
use CRLF as native line endings.

TODO: 4.5 ASCII support now considered fixed

Closes #14717

14 months agotest1050: mark as FTP
Daniel Stenberg [Thu, 29 Aug 2024 13:47:50 +0000 (15:47 +0200)] 
test1050: mark as FTP

14 months agotest476: test ASCII FTP upload where file already uses CRLF
Daniel Stenberg [Thu, 29 Aug 2024 10:32:00 +0000 (12:32 +0200)] 
test476: test ASCII FTP upload where file already uses CRLF

Closes #14717

14 months agotest475: verify a 72K ASCII FTP upload
Daniel Stenberg [Thu, 29 Aug 2024 07:53:28 +0000 (09:53 +0200)] 
test475: verify a 72K ASCII FTP upload

Extended the test format and runtest.pl so that the verify/upload part
can be marked using crlf newlines even when the client/file does not
have it.

Closes #14717

14 months agobuild: drop unused feature-detection code for Apple `poll()`
Viktor Szakats [Thu, 29 Aug 2024 08:15:26 +0000 (10:15 +0200)] 
build: drop unused feature-detection code for Apple `poll()`

Drop Apple-specific detection logic for `poll()`. This detection snippet
has been disabled for Apple in both configure and cmake, for `poll()`
being broken on Apple since 10.12 Sierra (2016).

Also replace `exit(1);` with `return 1;` in configure, to make the
snippets match.

Added in 9297ca49f5f3caca938a679b9c1feeb719e61ddb #1057 (2016-10-11).

Disabled for:
configure/darwin in a34c7ce7546f39f24692925d66c2f42324dd94e9 (2016-10-18)
cmake/macOS in 825911be587bbabc3b7e4777ed3bd1bb7c858b58 #7619
cmake/iOS in d14831233df3a15b14db563156614c9ea60fcf06 #8244
cmake/all Apple in a86254b39307af1a53735b065a382567805cd9b8 #12515

Closes #14718

14 months agoGHA: update github/codeql-action digest to 4dd1613
renovate[bot] [Thu, 29 Aug 2024 14:52:01 +0000 (14:52 +0000)] 
GHA: update github/codeql-action digest to 4dd1613

Closes #14725

14 months agoopenssl quic: fix memory leak
Stefan Eissing [Thu, 29 Aug 2024 11:06:47 +0000 (13:06 +0200)] 
openssl quic: fix memory leak

When a OpenSSL quic connection filter is aborted early, as the
server was not responding, the ssl instances where not closed
as they should.

Fixes #14720
Reported-by: ralfjunker on github
Closes #14724

14 months agognutls: send all data
Stefan Eissing [Thu, 29 Aug 2024 10:53:57 +0000 (12:53 +0200)] 
gnutls: send all data

Turns out `gnutls_record_send()` does really what the name says: it
sends exactly one TLS record. If more than 16k are there to send, it
needs to be called again with new buffer offset and length.

Continue sending record until the input is all sent or a EAGAIN (or
fatal error) is returned by gnutls.

Closes #14722

14 months agopytest: add ftp upload ascii test
Stefan Eissing [Thu, 29 Aug 2024 10:43:19 +0000 (12:43 +0200)] 
pytest: add ftp upload ascii test

Add a test the uploads a text file in ascii mode and checks
that lengths match expectations.

Closes #14721

14 months agourldata: remove crlf_conversions counter
Stefan Eissing [Wed, 28 Aug 2024 10:54:29 +0000 (12:54 +0200)] 
urldata: remove crlf_conversions counter

Since the introduction of client writers, we check the body length in
the PROTOCOL phase and do FTP lineend conversions laster in the
CONTENT_DECODING phase. This means we no longer need to count the
conversions for length checks.

Closes #14709

14 months agocmake: fix internal variable names in Rustls detection
Viktor Szakats [Thu, 29 Aug 2024 10:01:44 +0000 (12:01 +0200)] 
cmake: fix internal variable names in Rustls detection

Follow-up to ed76a23fccc1e57028f6d178fccba617b53e36ee #14534

Closes #14719

14 months agotest1013.pl: require case match for features, order match for protos, fix issue
Viktor Szakats [Wed, 28 Aug 2024 09:01:26 +0000 (11:01 +0200)] 
test1013.pl: require case match for features, order match for protos, fix issue

Update the script for test 1013 and 1014 to require:

- case-sensitive match for the curl feature list.
  (Continue to allow case-difference for protocols. They've always been
  in uppercase within curl config.)

- matching order for the protocol list.
  (Continue to allow any order for features. autotools builds on
  platforms without `sort -f` need it. E.g. Old Linux CI)

Also:

- fix casing of the `gsasl` feature in `configure`, to match `curl -V`
  and cmake.

- delete obsolete comment.

Closes #14706

14 months agoGHA/windows: vcpkg GnuTLS started breaking CI, temp drop it
Viktor Szakats [Wed, 28 Aug 2024 12:07:03 +0000 (14:07 +0200)] 
GHA/windows: vcpkg GnuTLS started breaking CI, temp drop it

Starting today vcpkg wants to rebuild GnuTLS but fails:
```
error: building shiftmedia-libgnutls:x64-windows failed with: BUILD_FAILED
```
Ref: https://github.com/curl/curl/actions/runs/10594890318/job/29359499149#step:5:144

Temporary solution:
- drop it from the MultiSSL job.
- replace with mbedTLS job. This job still tests libssh and I could
  not find a better place for it right away.

GnuTLS to be restored once it builds again. Possibly when this hash
reaches the GHA `windows-latest` runner:
https://github.com/microsoft/vcpkg/commit/f5ec6f30ff70f04f841436a0f36600bdbabfcfbf

Also:
- switch to Debug for the mbedTLS job. Should also work now with
  GnuTLS, once it's back:
  Ref: https://github.com/microsoft/vcpkg/pull/40473

Closes #14710

14 months agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 28 Aug 2024 12:09:12 +0000 (14:09 +0200)] 
RELEASE-NOTES: synced

14 months agotests/http: add HTTP/2 Upgrade and prior knowledge tests
Stefan Eissing [Mon, 26 Aug 2024 14:17:45 +0000 (16:17 +0200)] 
tests/http: add HTTP/2 Upgrade and prior knowledge tests

Adds test cases to check that plain http: with HTTP/2 works
via 'Upgrade: h2c' or --http2-prior-knowledge'.

Also added tests to check connection reused in these situations.

Closes #14694

14 months agourldata: remove proxy_connect_closed bit
Stefan Eissing [Wed, 28 Aug 2024 10:26:19 +0000 (12:26 +0200)] 
urldata: remove proxy_connect_closed bit

The connections 'proxy_connect_closed' bit was not used any more. Remove
it.

Closes #14708

14 months agocookie: add more debug tracing to set-cookie handling
Stefan Eissing [Wed, 28 Aug 2024 08:06:54 +0000 (10:06 +0200)] 
cookie: add more debug tracing to set-cookie handling

Might help us see why test977 fails occasionally.

Closes #14705

14 months agoconnect: limit update IP info
Stefan Eissing [Tue, 27 Aug 2024 10:12:37 +0000 (12:12 +0200)] 
connect: limit update IP info

Update IP related information at the connection and the transfer in two
places only: once the filter chain connects and when a transfer is added
to a connection. The latter only updates on reuse when the filters
already are connected.

The only user of that information before a full connect is the HAProxy
filter. Add cfilter CF_QUERY_IP_INFO query to let it find the
information from the filters "below".

This solves two issues with the previous version:
- updates where often done twice with the same info
- happy eyeballing filter "forks" could overwrite each others
  updates before the full winner was determined.

Closes #14699

14 months agoHTTP3.md: cleanup markup and language
mbuhl [Tue, 27 Aug 2024 07:28:58 +0000 (09:28 +0200)] 
HTTP3.md: cleanup markup and language

Closes #14698

14 months agopytest: tweak counts
Stefan Eissing [Mon, 26 Aug 2024 09:58:18 +0000 (11:58 +0200)] 
pytest: tweak counts

Lower some iteration counts for tests where they do not seem to add
value. Raise speed limits somewhat to shave off a second or two.

Closes #14689

14 months agotransfer: skip EOS read when download done
Stefan Eissing [Mon, 26 Aug 2024 08:56:28 +0000 (10:56 +0200)] 
transfer: skip EOS read when download done

When we downloaded all we wanted, and we did not want a response body,
and no Trailer: has been announced, and the receive gives EAGAIN, do not
hang around unnecessarily.

Some servers are buggy in HEAD processing and fail to send the HTTP/2
EOS. Since we do not need any more data, end the request right there.
This will cause us to send a RST_STREAM to the server.

Fixes #14670
Reported-by: Gruber Glass
Closes #14685

14 months agocpool: rename "connection cache/conncache" to "Connection Pools/cpool"
Stefan Eissing [Fri, 23 Aug 2024 11:58:41 +0000 (13:58 +0200)] 
cpool: rename "connection cache/conncache" to "Connection Pools/cpool"

This is a better match for what they do and the general "cpool"
var/function prefix works well.

The pool now handles very long hostnames correctly.

The following changes have been made:

* 'struct connectdata', e.g. connections, keep new members
  named `destination` and ' destination_len' that fully specifies
  interface+port+hostname of where the connection is going to.
  This is used in the pool for "bundling" of connections with
  the same destination. There is no limit on the length any more.
* Locking: all locks are done inside conncache.c when calling
  into the pool and released on return. This eliminates hazards
  of the callers keeping track.
* 'struct connectbundle' is now internal to the pool. It is no
  longer referenced by a connection.
* 'bundle->multiuse' no longer exists. HTTP/2 and 3 and TLS filters
  no longer need to set it. Instead, the multi checks on leaving
  MSTATE_CONNECT or MSTATE_CONNECTING if the connection is now
  multiplexed and new, e.g. not conn->bits.reuse. In that case
  the processing of pending handles is triggered.
* The pool's init is provided with a callback to invoke on all
  connections being discarded. This allows the cleanups in
  `Curl_disconnect` to run, wherever it is decided to retire
  a connection.
* Several pool operations can now be fully done with one call.
  Pruning dead connections, upkeep and checks on pool limits
  can now directly discard connections and need no longer return
  those to the caller for doing that (as we have now the callback
  described above).
* Finding a connection for reuse is now done via `Curl_cpool_find()`
  and the caller provides callbacks to evaluate the connection
  candidates.
* The 'Curl_cpool_check_limits()' now directly uses the max values
  that may be set in the transfer's multi. No need to pass them
  around. Curl_multi_max_host_connections() and
  Curl_multi_max_total_connections() are gone.
* Add method 'Curl_node_llist()' to get the llist a node is in.
  Used in cpool to verify connection are indeed in the list (or
  not in any list) as they need to.

I left the conncache.[ch] as is for now and also did not touch the
documentation. If we update that outside the feature window, we can
do this in a separate PR.

Multi-thread safety is not achieved by this PR, but since more details
on how pools operate are now "internal" it is a better starting
point to go for this in the future.

Closes #14662

14 months agoconfigure: remove USE_EXPLICIT_LIB_DEPS
Daniel Stenberg [Mon, 26 Aug 2024 21:17:51 +0000 (23:17 +0200)] 
configure: remove USE_EXPLICIT_LIB_DEPS

Added a long time ago for something that libtool should handle for us.

Closes #14697

14 months agoCI: add test timeouts, more cmake build tests, fix VS2010 C warning
Viktor Szakats [Tue, 27 Aug 2024 10:32:56 +0000 (12:32 +0200)] 
CI: add test timeouts, more cmake build tests, fix VS2010 C warning

- GHA/macos: set timeout for test runs.
  Double the value for autotools to fit torture tests.
- GHA/cygwin: reduce test run timeout for autotools.
- GHA/cygwin: enable building tests with cmake.
- GHA/windows: enable building tests with MSYS cmake.
- GHA/windows: enable building tests with MSVC UWP.
- appveyor: enable building tests with VS2008 x86 and VS2010 x64.
- tests: add workaround compiler warnings when building with VS2010:
  ```
  tests\server\util.c(482): warning C4306: 'type cast' : conversion from 'int' to 'void (__cdecl *)(int)' of greater size
  tests\server\util.c(486): warning C4306: 'type cast' : conversion from 'int' to 'void (__cdecl *)(int)' of greater size
  tests\server\util.c(490): warning C4306: 'type cast' : conversion from 'int' to 'void (__cdecl *)(int)' of greater size
  tests\server\util.c(720): warning C4306: 'type cast' : conversion from 'int' to 'void (__cdecl *)(int)' of greater size
  tests\server\util.c(726): warning C4306: 'type cast' : conversion from 'int' to 'void (__cdecl *)(int)' of greater size
  tests\server\util.c(732): warning C4306: 'type cast' : conversion from 'int' to 'void (__cdecl *)(int)' of greater size
  tests\server\util.c(781): warning C4306: 'type cast' : conversion from 'int' to 'void (__cdecl *)(int)' of greater size
  tests\server\util.c(785): warning C4306: 'type cast' : conversion from 'int' to 'void (__cdecl *)(int)' of greater size
  tests\server\util.c(789): warning C4306: 'type cast' : conversion from 'int' to 'void (__cdecl *)(int)' of greater size
  ```
  Ref: https://ci.appveyor.com/project/curlorg/curl/builds/50485633/job/4ujlwxod3cexmn2q#L1535

With this, tests are built in all GHA cygwin/windows jobs.

Timeouts avoid long runs with runaway issues, example:
https://github.com/curl/curl/actions/runs/10575522173

Closes #14700

14 months agoconfigure: fix WinIDN builds targeting old Windows
Viktor Szakats [Sun, 25 Aug 2024 17:32:10 +0000 (19:32 +0200)] 
configure: fix WinIDN builds targeting old Windows

1. GHA/windows: enable WinIDN in Linux cross-builds.
   (to reveal the issue in CI.)

2. fix compiler warning when building with mingw-w64 supporting
   WinIDN, while targeting pre-Vista Windows, with a `WINVER` set to
   target Vista or newer. (Such was Ubuntu's mingw-w64 with the
   classic-mingw-specific trick in point 3 of this PR.)
   ```
   ../../lib/idn.c:154:23: error: redundant redeclaration of ‘IdnToAscii’ [-Werror=redundant-decls]
     154 | WINBASEAPI int WINAPI IdnToAscii(DWORD dwFlags,
         |                       ^~~~~~~~~~
   In file included from /usr/share/mingw-w64/include/windows.h:73,
                    from /usr/share/mingw-w64/include/winsock2.h:23,
                    from ../../lib/setup-win32.h:91,
                    from ../../lib/curl_setup.h:308,
                    from ../../lib/idn.c:29:
   /usr/share/mingw-w64/include/winnls.h:1075:30: note: previous declaration of ‘IdnToAscii’ was here
    1075 |   WINNORMALIZEAPI int WINAPI IdnToAscii (DWORD dwFlags, LPCWSTR lpUnicodeCharStr, int cchUnicodeChar, LPWSTR lpASCIICharStr, int cchASCIIChar);
         |                              ^~~~~~~~~~
   [...same for IdnToUnicode...]
   ```
   Ref: https://github.com/curl/curl/actions/runs/10542832783/job/29210098553#step:7:89

3. drop `WINVER` override for classic-mingw. curl no longer supports
   building with classic-mingw.
   Reverts 37f1c21cb9c809ec870803fc40e1ed2afd9534ac #7581

4. sync `if IdnToUnicode can be linked` detection snippet with the live
   code in `lib/idn.c`. It fixes detection for the scenario in point 2.

5. delete unused `WINIDN_DIR` variable.

Bug: https://github.com/curl/curl/pull/12606#issuecomment-1885381038
Previous abandoned attempt: #12684
Reviewed-by: Jay Satiro
Closes #14680

14 months agotests: delete `libhostname.so` and `chkhostname`
Viktor Szakats [Mon, 26 Aug 2024 12:26:29 +0000 (14:26 +0200)] 
tests: delete `libhostname.so` and `chkhostname`

Before this patch, `libhostname.so` and `chkhostname` were a test
facility for overriding `gethostname()` in non-debug builds on
Linux and other Unix platforms supporting `LD_PRELOAD`.

`gethostname()` has a single use with SMTP.

The alternative way to override `gethostname()` is building in debug
mode, which allows to do this via the `CURL_GETHOSTNAME` env, on all
platforms.

Drop the `LD_PRELOAD` solution in favour of the above.

Also:
- delete inactive NTLM code with a `gethostname()` call made from it.
- streamline NTLM code by dropping a `printf()` and a macro.
- tests: stop setting `CURL_GETHOSTNAME` where unnecessary.

Closes #14695

14 months agoCI: add a script and job to run cmakelint
Dan Fandrich [Fri, 23 Aug 2024 07:07:32 +0000 (00:07 -0700)] 
CI: add a script and job to run cmakelint

A number of checks don't match our style or are buggy and so are disabled.

Co-authored-by: Viktor Szakats <vszakats@users.noreply.github.com>
Fixes #14580
Closes #14665

14 months agomailmap: add Moritz Buhl
Daniel Stenberg [Tue, 27 Aug 2024 12:03:47 +0000 (14:03 +0200)] 
mailmap: add Moritz Buhl

14 months agongtcp2/osslq: remove NULL pointer dereferences
mbuhl [Tue, 27 Aug 2024 10:38:31 +0000 (12:38 +0200)] 
ngtcp2/osslq: remove NULL pointer dereferences

If data is NULL, then it does not make sense to pass it to failf.

Closes #14701

14 months agoshare: don't reinitialize conncache
Eric Norris [Mon, 26 Aug 2024 19:13:46 +0000 (15:13 -0400)] 
share: don't reinitialize conncache

Before this change, calling curl_share_setopt w/ CURL_LOCK_DATA_CONNECT
a second time would re-initialize the connection cache, rather than use
the existing one.

After this change, calling curl_share_setopt w/ CURL_LOCK_DATA_CONNECT
multiple times will have no effect after the first call.

Closes #14696

14 months agocmake: `Libs.private` improvements
Viktor Szakats [Fri, 23 Aug 2024 15:42:08 +0000 (17:42 +0200)] 
cmake: `Libs.private` improvements

- skip adding pkg-config libdirs if they are system locations.
- replace custom regexes with `get_filename_component()`.
- collect `-L` and `-framework` separately.
  It means these will appear before libs in the `Libs.private` entry,
  syncing it with `./configure`.
- collect in a list variable (was: string).
- use `list(REMOVE_DUPLICATES)` to deduplicate libdirs.
- rename internal variable that is now solely used for system libdirs.

Follow-up to 7c0b6eb3bd1680e43e0688677c41b11a39b41962 #14652

Closes #14668

14 months agoGHA/macos: drop options no longer necessary
Viktor Szakats [Mon, 26 Aug 2024 13:55:46 +0000 (15:55 +0200)] 
GHA/macos: drop options no longer necessary

Follow-up to 7673c1292955f1c4dc0d19acd3051b5acfb349aa #14674

Closes #14693

14 months agoGHA/windows: enable HTTPS tests with stunnel
Aki [Sun, 11 Aug 2024 05:54:25 +0000 (13:54 +0800)] 
GHA/windows: enable HTTPS tests with stunnel

- install stunnel

Closes #14488

14 months agoGHA/configure-vs-cmake: drop disabling dependency tracking [ci skip]
Viktor Szakats [Mon, 26 Aug 2024 14:29:17 +0000 (16:29 +0200)] 
GHA/configure-vs-cmake: drop disabling dependency tracking [ci skip]

Recently added, but it's not saving anything at the configure stage,
the only stage in this workflow.

Follow-up to aaacd02466f77d03b8fdc19e91a0a3ec72f4c38a #14678

14 months agotransfer: remove comments, add asserts
Daniel Stenberg [Mon, 26 Aug 2024 09:56:32 +0000 (11:56 +0200)] 
transfer: remove comments, add asserts

Curl_xfer_send and Curl_xfer_recv had commented FIXMEs about protocol
setting up the transfers badly, but in reality these functions are too
low-level to be able to depend on the protocol transfer setups having
been done yet. Removed.

The functions had checks for data and data->conn that I convered to
asserts since they SHOULD always be valid in this function. The same
goes for the runtime check for buffer_size > 0 that I also converted to
an assert since that should never be set to an invalid value.

Closes #14688

14 months agoCONTRIBUTE: polished
Daniel Stenberg [Mon, 26 Aug 2024 12:35:08 +0000 (14:35 +0200)] 
CONTRIBUTE: polished

- rewrite the keywords section to use less quoted texts
- add "When the pull request is approved"
- change some titles

Closes #14691

14 months agopop3: use the protocol handler ->write_resp
Daniel Stenberg [Mon, 26 Aug 2024 08:39:28 +0000 (10:39 +0200)] 
pop3: use the protocol handler ->write_resp

Remove the "hardcoded" logic for the pop3 transfer handler and instead
use the generic protocol handler write_resp function.

Remove the check for 'data->req.ignorebody' because I cannot find a code
flow where this is set for POP3.

Closes #14684

14 months agoGHA/configure-vs-cmake: delete stray backslash [ci skip]
Viktor Szakats [Mon, 26 Aug 2024 10:38:21 +0000 (12:38 +0200)] 
GHA/configure-vs-cmake: delete stray backslash [ci skip]

14 months agoconfigure: fix indentation more
Viktor Szakats [Mon, 26 Aug 2024 00:11:05 +0000 (02:11 +0200)] 
configure: fix indentation more

Follow-up to 0052b4b52dfbd6455a24dd95837e5236dc8e1f5d #14628

Closes #14682

14 months agoGHA/configure-vs-cmake: add Windows build, fix issues
Viktor Szakats [Sun, 25 Aug 2024 11:16:49 +0000 (13:16 +0200)] 
GHA/configure-vs-cmake: add Windows build, fix issues

- configure: disable pthreads by default on Windows.
- configure: disable detecting `fseeko()` on Windows.
  (It exists in mingw-w64 2.0.0 and newer, but it's permanently ignored
  in CMake, as this function is never necessary on Windows.)
- extend existing exceptions with their Windows variants.
- `lib/formdata.c`: prioritize `_fseeki64()` over `fseeko()`.
  To reduce the difference between Windows builds, which now all use
  `_fseeki64()`.
- cmake: perm-enable `HAVE_DIRENT_H` and `HAVE_OPENDIR` for mingw-w64,
  to match configure.
  Follow-up to bfe54b0e88239da542493321e795cd71c14af9cc #13137
  This in theory could make the dir listing feature work in mingw-w64
  build, but in my tests (on WINE) it failed at the preceding `open()`
  call.
- cmake: perm-enable `HAVE_STRINGS_H` and `HAVE_UTIME_H` for mingw-w64,
  to match configure. (They are wrappers and make no difference in the build.)

Also:
- configure: sync `USE_MANUAL` macro with cmake, by only setting it for
  `src`. Drop checker exception.
- CI: use `--disable-dependency-tracking` in existing jobs.
- CI: install packages before git checkout, in existing jobs.

Closes #14678

14 months agobuild: check OS-native IDN first, then libidn2
Viktor Szakats [Sat, 24 Aug 2024 19:14:02 +0000 (21:14 +0200)] 
build: check OS-native IDN first, then libidn2

If AppleIDN or WinIDN is selected, don't look for libidn2. Do this by
moving libidn2 detection after AppleIDN/WinIDN and skipping it if any
of them was selected.

Also:
- disable AppleIDN by default with autotools to sync behaviour with
  CMake.
- limit WinIDN checks to native Windows with autotools, as with CMake.

Before this patch libidn2 was detected by default even if AppleIDN or
WinIDN was explicitly selected. libidn2 wasn't used in the build, but
it was left enabled as a dependency and appeared in `libcurl.pc` and
`curl-config`.

Closes #14674

14 months agoconfigure: delete unused `CURL_DEFINE_UNQUOTED` function
Viktor Szakats [Sat, 24 Aug 2024 00:10:02 +0000 (02:10 +0200)] 
configure: delete unused `CURL_DEFINE_UNQUOTED` function

Unused since ee6992c66a3dd7a1a1e2fbf66ba8d446a28acc8c #12502

Closes #14673

14 months agoconfigure: delete unused `HAVE_OPENSSL3` macro
Viktor Szakats [Sat, 24 Aug 2024 01:22:34 +0000 (03:22 +0200)] 
configure: delete unused `HAVE_OPENSSL3` macro

Closes #14672

14 months agobuild: delete unused `REQUIRE_LIB_DEPS`
Viktor Szakats [Sat, 24 Aug 2024 09:29:12 +0000 (11:29 +0200)] 
build: delete unused `REQUIRE_LIB_DEPS`

Unused since 97aca0971dbe8e1aa7c9660d1e94af3b1298d9ed #5808

Closes #14671

14 months agolib, src: delete stray `curl_` prefix from printf calls
Viktor Szakats [Fri, 23 Aug 2024 12:44:16 +0000 (14:44 +0200)] 
lib, src: delete stray `curl_` prefix from printf calls

Also:
- unit1398: delete redundant `curl/mprintf.h` include.

Closes #14664

14 months agocmake: minor tidy-ups
Viktor Szakats [Mon, 19 Aug 2024 19:05:25 +0000 (21:05 +0200)] 
cmake: minor tidy-ups

- show `OpenSSL v3+` when detected (as in `./configure`).
  (this string also makes its way to `curl-config`.)
- prefer `unset(VAR)` over `set(VAR)`.
  Same effect, but `unset()` tells the intent unambiguously.
  https://cmake.org/cmake/help/latest/command/set.html
- drop "implementation" from an `option()` description.
- FindGSS: replace legacy keyword alias with modern alternative.
  https://cmake.org/cmake/help/latest/command/get_filename_component.html
- move `CURL_STATIC_CRT` logic next to its `option()`.
- improve order of `libcurl.pc`/`curl-config` variable init lines.
- tests: drop/shorten custom target names.
  They inflated generated make files by 550KB.
  Keep target name logic for sync between code snippets.
  Follow-up to a2ef5d36b3cdec8120a4a9b782d18d58a70d4236 #14660
- clear a variable after use.
- restore `STATUS` for `Features:`/`Protocols:` `message()`s:
  Without it the output goes to stderr, and appears in red in CMake GUI.
  It doesn't seem possible to show a line on stdout without leading
  underscores to match `curl -V` and `./configure` output.
  Partial revert of acbc6b703f6b0ee568d053f6f2565fbc107b5fd3 #14197
- WindowsCache: move `HAVE_LINUX_TCP_H` into the header group.
- move strings to the same line as their `STRING` keyword.
- formatting in generated code.
- delete bogus comment.
- unfold lines for readability.
- fix a too long line. (for cmakelint)
- missing quotes, whitespace, comments.

Closes #14610

14 months agoGHA: update CI dependencies
renovate[bot] [Sat, 24 Aug 2024 21:33:05 +0000 (21:33 +0000)] 
GHA: update CI dependencies

- update github/codeql-action digest to 2c779ab
- update awslabs/aws-lc to v1.34.2
- update ngtcp2/nghttp3 to v1.5.0
- update ngtcp2/ngtcp2 to v1.7.0

Closes #14638
Closes #14639
Closes #14675
Closes #14676

14 months agoREADME: refresh
Daniel Stenberg [Fri, 23 Aug 2024 12:31:33 +0000 (14:31 +0200)] 
README: refresh

- call them "manpages", not "man pages" and drop the .1 and .3
- replace link to "manual" with a link to everything curl
- remove the link to the FAQ
- add a new "open source "subtitle for the license link, and rephrase
- mention and link GitHub services in the contact section
- rename the "git" subtitle to "source code"
- shorten the source code section somewhat

Closes #14663

14 months agotests: tweak use of impacket in smbserver 14669/head
Dan Fandrich [Fri, 23 Aug 2024 23:09:17 +0000 (16:09 -0700)] 
tests: tweak use of impacket in smbserver

The missing message only uses a single line now and has a consistent
prefix making it easier for log parsers to skip. Remove a precheck test
looking for impacket in test1451 because it's incomplete, unnecessary
and in the wrong layer; the test harness will automatically discover
that the smbserver won't start and the test was only checking a single
dependency.  Also update the tests README to no longer mention Python 2.
The servers were switched to Python 3 several years ago and no attempt
is being made to maintain Python 2 compatibility

Closes #14669

14 months agoGHA/macos: ignore flaky tests 2041 and 2037
Viktor Szakats [Fri, 23 Aug 2024 17:20:07 +0000 (19:20 +0200)] 
GHA/macos: ignore flaky tests 2041 and 2037

- FAIL 2037: 'simple HTTPS GET with PEM public key pinning' HTTPS, HTTP GET, PEM certificate
  https://github.com/curl/curl/actions/runs/10529314166/job/29176801513?pr=14658

- FAIL 2041: 'simple HTTPS GET with base64-sha256 public key pinning' HTTPS, HTTP GET, PEM certificate
  https://github.com/curl/curl/actions/runs/10529181645/job/29176408976#step:16:4363
  https://github.com/curl/curl/actions/runs/10529019749/job/29175882809#step:13:5235
  https://github.com/curl/curl/actions/runs/10528920874/job/29175559070#step:16:4363
  https://github.com/curl/curl/actions/runs/10528759817/job/29175043048#step:16:4274
  https://github.com/curl/curl/actions/runs/10525250422/job/29163662307#step:16:4366
  https://github.com/curl/curl/actions/runs/10525250422/job/29163662602#step:13:3569

  Happened with cmake, autotools, gcc, clang and various TLS backends.

Follow-up to fa461b4eff52b413f88debf543b5350a6cef4724 #14486

Closes #14667

14 months agoGHA/windows: add Linux -> mingw-w64 cross-build (cmake, autotools)
Viktor Szakats [Fri, 23 Aug 2024 10:58:51 +0000 (12:58 +0200)] 
GHA/windows: add Linux -> mingw-w64 cross-build (cmake, autotools)

Also:
- add a line to CMake log output showing the host and target OS and CPU
  when doing cross-builds.
- reduce excessive timeout for `curl -V` steps.

Closes #14661

14 months agocmake: sync code between test/example targets
Viktor Szakats [Thu, 22 Aug 2024 07:10:07 +0000 (09:10 +0200)] 
cmake: sync code between test/example targets

- reuse local variable names.
- sync `PROJECT_LABEL`, add where missing.
- namespace all target names.
- bind header directories to each target.
- tests/server: limit `CURL_STATICLIB` to Windows (as in autotools.)
- drop functions with a single caller.

Closes #14660

14 months agoGHA: add yamlcheck
Viktor Szakats [Thu, 22 Aug 2024 18:14:17 +0000 (20:14 +0200)] 
GHA: add yamlcheck

Uses `yamllint`.

Also:
- fix warning for existing YAML files:
  ```
  [truthy] truthy value should be one of [false, true]
  ```

Closes #14650

14 months agoCI: consolidate workflows for source and docs check
Dan Fandrich [Fri, 23 Aug 2024 04:24:03 +0000 (21:24 -0700)] 
CI: consolidate workflows for source and docs check

A bunch of tiny jobs that run various source or documentation checks are
consolidated into two workflow files: checksrc.yml and checkdocs.yml.
This reduces the proliferation of new files containing one-line checks
and brings those that operate similarly together for better reasoning
about them. The man-examples check is also now running again for the
first time in 7 months.

Various calls to find, xargs and git ls-files are changed where possible
to use NUL line terminators in pipes to avoid issues with oddly-named
files that might find their way into the repo.

Closes #14654

14 months agodocs: fix some examples in man pages
Dan Fandrich [Fri, 23 Aug 2024 05:17:43 +0000 (22:17 -0700)] 
docs: fix some examples in man pages

The man-examples job hasn't been running for a few months to verify
that these compile, so some mistakes slipped in.

Ref: #14654

14 months agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 23 Aug 2024 12:08:26 +0000 (14:08 +0200)] 
RELEASE-NOTES: synced

14 months agourlapi: verify URL *decoded* hostname when set
Daniel Stenberg [Fri, 23 Aug 2024 08:41:26 +0000 (10:41 +0200)] 
urlapi: verify URL *decoded* hostname when set

It was previously wrongly verifying the input in its URL encoded format
when setting the hostname component with curl_url_set(), so it wrongly
rejected '%'.

Now it URL decodes the name appropriately before the check.

Added tests to lib1560 to verify that a fine %-code is okay and that a
bad %-code (that decodes to '%') is rejected.

Regression from 0a0c9b6dfa0de4a4c, shipped in 8.0.0

Fixes #14656
Reported-by: Venkat Krishna R
Closes #14657

14 months agoGHA/macos: enable HTTPS tests with stunnel
Aki [Wed, 7 Aug 2024 14:57:43 +0000 (22:57 +0800)] 
GHA/macos: enable HTTPS tests with stunnel

- Install stunnel.

- Regenerate certificates (as SecureTransport requires a validity period
  less than 398 days).

- Restart server if it is unresponsive.

- Do not hardcode the SHA-256 base64 public pinned key.

- Ignore test 313 as SecureTransport does not support crl file.

- Ignore tests 1631 and 1632 as SecureTransport is not yet able to shut
  down FTP over HTTPS gracefully.

- Add a CMake target for generating certificates.

Closes #14486

14 months agocmake: respect cflags/libdirs of native pkg-config detections
Viktor Szakats [Thu, 22 Aug 2024 15:05:54 +0000 (17:05 +0200)] 
cmake: respect cflags/libdirs of native pkg-config detections

In Find modules with native pkg-config detection (libgsasl, libidn2,
libssh, libuv, nettle) use the C compiler flags returned by pkg-config.
Also use the library paths, and return the pathless library names.

Also:
- add these library paths to `libcurl.pc`/`curl-config`.
- fix libgsasl detection to use the detected header directory.

FindGSS already did this before this patch.

Fixes #14641

Closes #14652

14 months agocmake/FindGSS: bring closer to other Find modules
Viktor Szakats [Thu, 22 Aug 2024 14:14:44 +0000 (16:14 +0200)] 
cmake/FindGSS: bring closer to other Find modules

- add pkg-config-specific 'Found' message to the Find module.

- update non-pkg-config 'Found' message to show the flavour instead of
  the library name. (= the first value listed after `REQUIRED_VARS`)

- delete extra 'Found' message from `CMakeLists.txt`.

- rename internal result variables to match with default pkg-config
  names, in preparation of introducing them in other Find modules:
  - `GSS_LINK_DIRECTORIES` -> `GSS_LIBRARY_DIRS`
  - `GSS_LINKER_FLAGS` -> `GSS_LDFLAGS`
  - `GSS_COMPILER_FLAGS` -> `GSS_CFLAGS`

  Ref: #14652

Closes #14651

14 months agogha labeler: make labeler.yml human-readable
Jan Venekamp [Fri, 23 Aug 2024 01:33:39 +0000 (03:33 +0200)] 
gha labeler: make labeler.yml human-readable

Split the strings containing the globs over multiple lines, with
each line having one glob.

Closes #14649

14 months agoFEATURES.md: fix typo
Daniel Stenberg [Fri, 23 Aug 2024 06:25:32 +0000 (08:25 +0200)] 
FEATURES.md: fix typo

Fixes #14653
Reported-by: Jason Hood
Closes #14655

14 months agotest1521: verify setting options to NULL better
Daniel Stenberg [Wed, 21 Aug 2024 12:58:57 +0000 (14:58 +0200)] 
test1521: verify setting options to NULL better

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

14 months agosetopt: make CURLOPT_TFTP_BLKSIZE accept bad values
Daniel Stenberg [Thu, 22 Aug 2024 13:55:09 +0000 (15:55 +0200)] 
setopt: make CURLOPT_TFTP_BLKSIZE accept bad values

... and just move them into the accepted range. Like how buffersize and
a few other options work.

Closes #14634

14 months agosetopt: let CURLOPT_ECH set to NULL reset to default
Daniel Stenberg [Thu, 22 Aug 2024 11:17:27 +0000 (13:17 +0200)] 
setopt: let CURLOPT_ECH set to NULL reset to default

Because NULL is documented as default and most options that take
pointers accept NULL to reset back to internal default.

Closes #14634

14 months agogetinfo: return zero for unsupported options (when disabled)
Daniel Stenberg [Wed, 21 Aug 2024 21:21:26 +0000 (23:21 +0200)] 
getinfo: return zero for unsupported options (when disabled)

instead of returning an error code to the getinfo() call. Like other
info variables work.

Closes #14634

14 months agosrc: replace copy of printf mappings with an include
Viktor Szakats [Thu, 22 Aug 2024 15:12:09 +0000 (17:12 +0200)] 
src: replace copy of printf mappings with an include

Closes #14648

14 months agocmake: pkg-config 'found' message sync with native CMake
Viktor Szakats [Thu, 22 Aug 2024 14:39:50 +0000 (16:39 +0200)] 
cmake: pkg-config 'found' message sync with native CMake

Cherry-picked from #14610

14 months agoGHA: trim markdown headers before proselinting
Daniel Stenberg [Thu, 22 Aug 2024 10:47:16 +0000 (12:47 +0200)] 
GHA: trim markdown headers before proselinting

Allow interface.md to use more exclamation marks.

Closes #14645

14 months agoGHA: add a checksrc job
Daniel Stenberg [Wed, 21 Aug 2024 07:19:27 +0000 (09:19 +0200)] 
GHA: add a checksrc job

This job unconditionally runs checksrc on ALL .c and .h files present in
git.

checksrc.pl: fixed to look for ".checksrc" in the same directory from
where it loads the file to check so that it an be invoked like this

Closes #14625

14 months agomisc: general C style cleanups
Daniel Stenberg [Thu, 22 Aug 2024 09:04:17 +0000 (11:04 +0200)] 
misc: general C style cleanups

... in code that previously was not checksrc'ed

Closes #14625