]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
4 months agoruntests: remove server verification after start bagder/runtests-no-verify 17005/head
Daniel Stenberg [Wed, 9 Apr 2025 13:22:28 +0000 (15:22 +0200)] 
runtests: remove server verification after start

Since we start on our own port we know the server running is us. By
removing unnecessary verification we speed up tests a little.

4 months agobuild: check required rustls-ffi version
Daniel McCarney [Wed, 2 Apr 2025 13:09:57 +0000 (09:09 -0400)] 
build: check required rustls-ffi version

Try to enforce that the Rustls vTLS backend is only used with
rustls-ffi 0.15 - the documentation already describes this as
the required version.

Follow-up from https://github.com/curl/curl/issues/16890

Closes #16922

4 months agocmake: use `INCLUDE_DIRECTORIES` prop to specify local header dirs
Viktor Szakats [Tue, 8 Apr 2025 09:01:09 +0000 (11:01 +0200)] 
cmake: use `INCLUDE_DIRECTORIES` prop to specify local header dirs

To use more modern cmake, and make it somewhat more obvious where these
header directories should apply.

Also move setting the directory property _before_ defining targets,
to make them inherit this directory property.

Ref: https://cmake.org/cmake/help/latest/command/include_directories.html
Ref: https://cmake.org/cmake/help/latest/prop_dir/INCLUDE_DIRECTORIES.html

Follow-up to 45f7cb7695b0fe0c61f71bdfbe31d161d50a5f51 #16238

Closes #16993

4 months agolib: include files using known path
Daniel Stenberg [Tue, 8 Apr 2025 06:00:12 +0000 (08:00 +0200)] 
lib: include files using known path

by including headers using "../[header]" when done from C files in
subdirectories, we do not need to specify the lib source dir as an
include path and we reduce the risk of header name collisions with
headers in the SDK using the same file names.

Idea-by: Kai Pastor
Ref: #16949
Closes #16991

4 months agoGHA: bump rojopolis/spellcheck-github-actions to 0.48.0
dependabot[bot] [Mon, 7 Apr 2025 15:59:10 +0000 (15:59 +0000)] 
GHA: bump rojopolis/spellcheck-github-actions to 0.48.0

Bumps [rojopolis/spellcheck-github-actions](https://github.com/rojopolis/spellcheck-github-actions) from 0.47.0 to 0.48.0.
- [Release notes](https://github.com/rojopolis/spellcheck-github-actions/releases)
- [Changelog](https://github.com/rojopolis/spellcheck-github-actions/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rojopolis/spellcheck-github-actions/compare/ed0756273a1658136c36d26e3d0353de35b98c8b...23dc186319866e1de224f94fe1d31b72797aeec7)

---
updated-dependencies:
- dependency-name: rojopolis/spellcheck-github-actions
  dependency-version: 0.48.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Closes #16988

4 months agoGHA: update openssl/openssl to v3.5.0
renovate[bot] [Tue, 8 Apr 2025 14:12:32 +0000 (14:12 +0000)] 
GHA: update openssl/openssl to v3.5.0

Closes #16997

4 months agodocs: fix incorrect shell substitution in docker run example command
Johan Eliasson [Mon, 7 Apr 2025 20:20:29 +0000 (22:20 +0200)] 
docs: fix incorrect shell substitution in docker run example command

Corrected the volume mount path in the Docker run example by replacing
`(pwd)` with the shell substitution syntax `$(pwd)`. This ensures the
current working directory is properly mounted into the container.

Closes #16990

4 months agoDockerfile: update debian:bookworm-slim Docker digest to 4b44499
renovate[bot] [Tue, 8 Apr 2025 06:09:44 +0000 (06:09 +0000)] 
Dockerfile: update debian:bookworm-slim Docker digest to 4b44499

Closes #16992

4 months agomk-ca-bundle.pl: follow redirects
Daniel Stenberg [Tue, 8 Apr 2025 09:30:17 +0000 (11:30 +0200)] 
mk-ca-bundle.pl: follow redirects

The Mozilla hosted files have started to redirect. Follow them to restore
script functionality.

Reported-by: Harry Sintonen
Closes #16995

4 months agotests/tunit: make a separate directory for tool-based unit tests
Daniel Stenberg [Sat, 5 Apr 2025 20:42:09 +0000 (22:42 +0200)] 
tests/tunit: make a separate directory for tool-based unit tests

Separated from library based unit tests to not confuse memory management
etc. Move 1394 and 1604 there.

Closes #16983

4 months agocurl_multibyte: fixup low-level calls, include in unity builds
Viktor Szakats [Sun, 16 Mar 2025 13:19:38 +0000 (14:19 +0100)] 
curl_multibyte: fixup low-level calls, include in unity builds

Also adjust `()` around low-level calls preventing macro overrides via
e.g. `memdebug.h`:
- add for `malloc` and `free`.
- drop for `_open`. (We do not override `_open` in curl.)

Tidy-up: also sync libcurlu custom macro order in cmake with autotools.

Follow-up to f42a279ee32d3db3ab529da8dfb833edb5a088ca #11928

Closes #16742

4 months agosocketpair: support pipe2 where available
Andy Pan [Sun, 6 Apr 2025 12:37:10 +0000 (20:37 +0800)] 
socketpair: support pipe2 where available

By replacing pipe with pipe2, it would save us 4 extra system calls of
setting O_NONBLOCK and O_CLOEXEC. This system call is widely supported
across UNIX-like OS's: Linux, *BSD, and SunOS derivatives - Solaris,
illumos, etc.

Ref:
https://man7.org/linux/man-pages/man2/pipe.2.html
https://man.freebsd.org/cgi/man.cgi?query=pipe
https://man.dragonflybsd.org/?command=pipe2
https://man.netbsd.org/pipe.2
https://man.openbsd.org/pipe.2
https://docs.oracle.com/cd/E88353_01/html/E37841/pipe2-2.html
https://illumos.org/man/2/pipe2
https://www.gnu.org/software/gnulib/manual/html_node/pipe2.html

Closes #16987

4 months agotests: Add https-mtls server to force client auth
Yedaya Katsman [Thu, 3 Apr 2025 18:51:32 +0000 (21:51 +0300)] 
tests: Add https-mtls server to force client auth

- test2088 verifies that mutual tls works

This adds a new certificate to generate which has the clientAuth key
usage enabled, and uses it to connect to a https-mtls server.

Closes #16923

4 months agotests: removes CApath in stunnel
Yedaya Katsman [Thu, 3 Apr 2025 18:47:32 +0000 (21:47 +0300)] 
tests: removes CApath in stunnel

It wasn't used, and didn't do anything since the folder it got didn't
have files with names of the hash of the subjects. [1]

[1] https://www.stunnel.org/static/stunnel.html#CApath-CA_DIRECTORY

Closes #16923

4 months agoKNOWN_BUGS: wolfssh: all tests fail
Daniel Stenberg [Sun, 6 Apr 2025 11:19:30 +0000 (13:19 +0200)] 
KNOWN_BUGS: wolfssh: all tests fail

Closes #16794

4 months agomake: clean tests better
Daniel Stenberg [Sun, 6 Apr 2025 10:04:33 +0000 (12:04 +0200)] 
make: clean tests better

1. 'make clean' in the root dir now also invokes 'make clean' in the
tests subdir so that it cleans up better recursively. The Makefile.am
does not list 'tests' as a normal subdir to avoid building that
directory for a normal make invoke.

2. 'make clean' in the tests/libtest and tests/unit directories now
*explicitly* remove the unity build executables even if this is not a
unit build. This, because those files may be leftovers from previous
builds and such leftovers can otherwise linger around and since
'runtests.pl' dynamically acts differently based on the mere *presence*
of those files, they can keep you fooled for a while until you
realize...

Closes #16986

4 months agoRELEASE-NOTES: synced
Daniel Stenberg [Sun, 6 Apr 2025 11:11:26 +0000 (13:11 +0200)] 
RELEASE-NOTES: synced

4 months agosocket: use accept4 when available
Andy Pan [Sat, 5 Apr 2025 15:55:32 +0000 (23:55 +0800)] 
socket: use accept4 when available

Linux, *BSD, and Solaris support accept4 system call that enables the
caller to assign additional flags and save some extra system calls. It
can come in handy when O_NONBLOCK or/and FD_CLOEXEC is/are required on a
socket after being accepted.

Ref:
https://man7.org/linux/man-pages/man2/accept.2.html
https://man.freebsd.org/cgi/man.cgi?query=accept4
https://man.dragonflybsd.org/?command=accept&section=2
https://man.openbsd.org/accept.2
https://man.netbsd.org/accept.2
https://docs.oracle.com/cd/E88353_01/html/E37843/accept4-3c.html
https://www.gnu.org/software/gnulib/manual/html_node/accept4.html

Closes #16979

4 months agoscripts: completion.pl: sort the completion file for all shells
Carlos Henrique Lima Melara [Sat, 5 Apr 2025 22:53:51 +0000 (19:53 -0300)] 
scripts: completion.pl: sort the completion file for all shells

The reproducible builds effort in Debian has caught a regression in curl
8.13.0-rc1 but we were a bit slow to realize it. The ordering of the
completion file for fish is not deterministic so it can differ between
builds. Since there is no restriction about the order of the completion
file for fish, let's just sort it too.

Closes #16985

4 months agoCURLOPT_HTTP_TRANSFER_DECODING: fixed
Daniel Stenberg [Sat, 5 Apr 2025 22:40:56 +0000 (00:40 +0200)] 
CURLOPT_HTTP_TRANSFER_DECODING: fixed

The fix in b8bd019c6a02182 (#16959) broke the
CURLOPT_HTTP_TRANSFER_DECODING handling, shown in test 319 and curl's
--raw option.

This is a follow-up that restores the functionality.

Enable test 319 again.

Fixes #16974
Closes #16984

4 months agoGHA/configure-vs-cmake: dump generated configs to log
Viktor Szakats [Sat, 5 Apr 2025 18:23:17 +0000 (20:23 +0200)] 
GHA/configure-vs-cmake: dump generated configs to log

Sometimes it's useful to have a look at the generated `libcurl.pc` and
`curl-config` files.

`cmp-config.pl` normalizes them before diffing, thus doesn't show their
original content.

Closes #16981

4 months agocmake/FindNGTCP2: simplify multi-pkg-config detection
Viktor Szakats [Sat, 5 Apr 2025 18:09:50 +0000 (20:09 +0200)] 
cmake/FindNGTCP2: simplify multi-pkg-config detection

Use a single `pkg_check_modules` call to detect the main & crypto libs.

Follow-up to 3b501976a9adcf20218ffb96d9041806432227e4 #16479
Closes #16980

4 months agotest1658: add unit test for the HTTPS RR decoder
Daniel Stenberg [Fri, 4 Apr 2025 21:21:41 +0000 (23:21 +0200)] 
test1658: add unit test for the HTTPS RR decoder

Made the HTTPS-RR parser a little stricter while at it.

Drop the ALPN escape handling, that was not needed.

Make the hode handle (and ignore) duplicate ALPN entries.

Closes #16972

4 months agowinbuild: add the deprecation warning to the README
Jay Satiro [Fri, 4 Apr 2025 07:50:15 +0000 (03:50 -0400)] 
winbuild: add the deprecation warning to the README

- Mention in README.md and INSTALL-CMAKE.md that the winbuild build
  system is going to be removed in September 2025.

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

4 months agotests/globalconfig.pm: remove the qw
Daniel Stenberg [Sat, 5 Apr 2025 14:54:38 +0000 (16:54 +0200)] 
tests/globalconfig.pm: remove the qw

Fixes the warning.

Fixes #16976
Closes #16977

4 months agocontent_encoding: Transfer-Encoding parser improvements
Daniel Stenberg [Fri, 4 Apr 2025 07:54:49 +0000 (09:54 +0200)] 
content_encoding: Transfer-Encoding parser improvements

- allow and ignore "identity" as an encoding

- fail if any other encoder than chunked follows after chunked

- fail on unsolicited encodings - when the server encodes but curl did
  not ask for it

Add test 1493 to 1496 to verify.

Disable test 319 as that is now broken: issue #16974

Reported-by: Jonathan Rosa
Fixes #16956
Closes #16959

4 months agolibtest/first: stop defining MEMDEBUG_NODEFINES
Daniel Stenberg [Sat, 5 Apr 2025 15:53:02 +0000 (17:53 +0200)] 
libtest/first: stop defining MEMDEBUG_NODEFINES

It causes problems in unity builds, in particular when this file is used
for unit tests.

Bonus: switch to plain getenv() instead of curl_getenv() to avoid extra
malloc/free rounds.

Closes #16978

4 months agoranddisable: build randomizer
Daniel Stenberg [Fri, 4 Apr 2025 12:34:10 +0000 (14:34 +0200)] 
randdisable: build randomizer

This script makes a "random" build using configure and verifies that it
builds curl correctly. It randomly adds a number of the available
--disable-* flags to configure. When it detects a problem the script
stops, otherwise it continues trying more combinations.

Closes #16962

4 months agohttp2: fix stream window size after unpausing
Stefan Eissing [Fri, 4 Apr 2025 08:43:13 +0000 (10:43 +0200)] 
http2: fix stream window size after unpausing

When pausing a HTTP/2 transfer, the stream's local window size
is reduced to 0 to prevent the server from sending further data
which curl cannot write out to the application.

When unpausing again, the stream's window size was not correctly
increased again. The attempt to trigger a window update was
ignored by nghttp2, the server never received it and the transfer
stalled.

Add a debug feature to allow use of small window sizes which
reproduces this bug in test_02_21.

Fixes #16955
Closes #16960

4 months agotests: remove some unused test case sections
Dan Fandrich [Fri, 4 Apr 2025 19:24:12 +0000 (12:24 -0700)] 
tests: remove some unused test case sections

4 months agotests: unify test case keywords
Dan Fandrich [Fri, 4 Apr 2025 18:35:33 +0000 (11:35 -0700)] 
tests: unify test case keywords

Unify the case, punctuation and name of test case keywords so they can
be more easily selected or skipped when desired. Add a few keywords that
were missing. Fix a couple of typos in test names.

4 months agorand: update comment on Curl_rand_bytes weak random
Yedaya Katsman [Fri, 4 Apr 2025 14:04:21 +0000 (17:04 +0300)] 
rand: update comment on Curl_rand_bytes weak random

From what I understand both rustls and mbedTLS expose a strong random
function, so as long as you have a TLS library random will be strong.

Followup 89728451234a "vtls/rustls: support strong CSRNG data"
Followup a90a5bccd47b "mbedtls: implement CTR-DRBG and HAVEGE random generators"

Closes #16965

4 months agohttps-connect, fix httpsrr target check
Stefan Eissing [Fri, 4 Apr 2025 16:10:28 +0000 (18:10 +0200)] 
https-connect, fix httpsrr target check

The HTTPSRR check on the record's target was not working as it used the
wrong index on the NUL byte if the target was not NULL.

Fixes #16966
Reported-by: Pavel Kropachev
Closes #16968

4 months agotests: fix some test tag mismatches
Dan Fandrich [Fri, 4 Apr 2025 16:17:08 +0000 (09:17 -0700)] 
tests: fix some test tag mismatches

4 months agotests: move a boolean variable out of the path section
Dan Fandrich [Fri, 4 Apr 2025 15:42:43 +0000 (08:42 -0700)] 
tests: move a boolean variable out of the path section

4 months agohostip: show the correct name on proxy resolve error
Daniel Stenberg [Fri, 4 Apr 2025 10:34:09 +0000 (12:34 +0200)] 
hostip: show the correct name on proxy resolve error

Regression, probably from 8ded8e5f3f4b6586399 (#16451)

Fixes #16958
Reported-by: Jean-Christophe Amiel
Closes #16961

4 months agotests: use a more portable null device path
Jay Satiro [Thu, 3 Apr 2025 03:16:49 +0000 (23:16 -0400)] 
tests: use a more portable null device path

- Use File::Spec->devnull() to get the null device path.

Prior to this change we used NUL for Windows native perl and /dev/null
otherwise.

Bug: https://github.com/curl/curl/pull/16929#discussion_r2025718160
Reported-by: Viktor Szakats
Closes https://github.com/curl/curl/pull/16930

4 months agohttp_aws_sigv4: add additional verbose log statements
Nigel Brittain [Thu, 3 Apr 2025 22:42:04 +0000 (22:42 +0000)] 
http_aws_sigv4: add additional verbose log statements

To use curl as a tool for troubleshooting SigV4 signing, it is useful to
have the 'Canonical Request', 'String To Sign' and 'Signature'
calculations output.

Closes #16952

4 months agocmake: use absolute paths for completion targets
Viktor Szakats [Thu, 3 Apr 2025 23:54:46 +0000 (01:54 +0200)] 
cmake: use absolute paths for completion targets

Fixing potential:
```
CMake Error at scripts/CMakeLists.txt:72 (install):
  install FILES given directory "/usr/ports/ftp/curl/work/.build/scripts/" to
  install.
```

Reported-by: Daniel Engberg
Fixes #16946
Follow-up to c8b0f0c9ad78eafc6c8f0005113de346ee797c21 #16833
Closes #16954

4 months agoscripts: fix --opts-dir help in completion.pl
Dan Fandrich [Thu, 3 Apr 2025 23:12:45 +0000 (16:12 -0700)] 
scripts: fix --opts-dir help in completion.pl

The help text gave the wrong option name.

Reported-by: Daniel Engberg
Ref: #16946

4 months agorustls: make max size of cert and key reasonable
Yedaya Katsman [Thu, 3 Apr 2025 20:36:05 +0000 (23:36 +0300)] 
rustls: make max size of cert and key reasonable

SIZE_MAX is an very overkill size for certificates or keys, lower it to
100KiB for both certificate and keys. The default max size of openssl is
100KiB for the entire chain [1], and it seems firefox fails at ~60kb
[2].

Found by https://github.com/curl/curl/pull/16923

[0] https://docs.openssl.org/3.2/man3/SSL_CTX_set_max_cert_list/#notes
[2] https://0x00.cl/blog/2024/exploring-tls-certs/

Closes #16951

4 months agoGHA/curl-for-win: switch to `podman` (from `docker`)
Viktor Szakats [Fri, 24 Jan 2025 13:42:15 +0000 (14:42 +0100)] 
GHA/curl-for-win: switch to `podman` (from `docker`)

Closes #16727

4 months agotests: prefer `--insecure` over `-k`
Viktor Szakats [Sat, 29 Mar 2025 02:41:45 +0000 (03:41 +0100)] 
tests: prefer `--insecure` over `-k`

To make it uniform in all tests, and greppability.

Also:
- replace `-k` flag with `-q` in test 1268. (the actual flag doesn't
  matter in this test)
- keep `-k` in test 300 to test its short form.
  (also verified to fail without a working `-k`)

Closes #16878

4 months agolib: make Curl_easyopts const 16950/head
Dan Fandrich [Thu, 3 Apr 2025 20:41:50 +0000 (13:41 -0700)] 
lib: make Curl_easyopts const

Also, make the optiontable rule work in an out-of-tree build.

Closes #16950

4 months agolib: add const to clientwriter tables
Dan Fandrich [Thu, 3 Apr 2025 19:42:06 +0000 (12:42 -0700)] 
lib: add const to clientwriter tables

Unlike the connection filter tables that hold a writable log level, the
client writer tables can be const.

4 months agoINSTALL.md: update the minimal libcurl size example
Dan Fandrich [Thu, 3 Apr 2025 19:04:56 +0000 (12:04 -0700)] 
INSTALL.md: update the minimal libcurl size example

It's only gone up by 7 KiB over the dozen releases in the last year.

4 months agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 3 Apr 2025 18:37:17 +0000 (20:37 +0200)] 
RELEASE-NOTES: synced

4 months agotests: mark ipfs tests to require ipfs
Daniel Stenberg [Thu, 3 Apr 2025 17:34:33 +0000 (19:34 +0200)] 
tests: mark ipfs tests to require ipfs

Fixes #16947
Reported-by: Daniel Engberg
Closes #16948

4 months agoGHA: update cloudflare/quiche to v0.23.5
renovate[bot] [Wed, 2 Apr 2025 02:03:30 +0000 (02:03 +0000)] 
GHA: update cloudflare/quiche to v0.23.5

Closes #16913

4 months agotests/README.md: document --test-duphandle
Daniel Stenberg [Thu, 3 Apr 2025 14:30:42 +0000 (16:30 +0200)] 
tests/README.md: document --test-duphandle

Follow-up to cbafcec50bc99ba0dd0490e6

Closes #16944

4 months agoasyn-thread: fix build without socketpair
Daniel Stenberg [Thu, 3 Apr 2025 14:47:41 +0000 (16:47 +0200)] 
asyn-thread: fix build without socketpair

Follow-up to 9b6148e9d95db54a752b03b571296c40d66e97fe

Closes #16945

4 months agoasync-threaded resolver: use ref counter
Stefan Eissing [Wed, 2 Apr 2025 10:25:21 +0000 (12:25 +0200)] 
async-threaded resolver: use ref counter

Allocate the data shared between a transfer and an aync resolver thread
separately and use a reference counter to determine its release.

Change `Curl_thread_destroy()` to clear the thread handle, so that the
thread is considered "gone" and we do not try to join (and fail to)
afterwards.

Retake of the revert in fb15a986c0d947ae6b9dd6

Closes #16916

4 months agodnscache: slight refactoring
Stefan Eissing [Thu, 3 Apr 2025 11:11:32 +0000 (13:11 +0200)] 
dnscache: slight refactoring

Slight refactoring around dnscache, e.g. hostcache

- eliminate `data->state.hostcache`. Always look up
  relevant dnscache at share/multi.
- unify naming to "dnscache", replacing "hostcache"
- use `struct Curl_dnscache`, even though it just
  contains a `Curl_hash` for now.
- add `Curl_dnscache_destroy()` for cleanup in
  share/multi.

Closes #16941

4 months agotests/README.md: list the openssl tool among the prerequisites
Daniel Stenberg [Thu, 3 Apr 2025 12:28:37 +0000 (14:28 +0200)] 
tests/README.md: list the openssl tool among the prerequisites

Used for test cert generation since 8.13.0

Closes #16942

4 months agoparsedate: provide Curl_wkday also for GnuTLS builds
Daniel Stenberg [Thu, 3 Apr 2025 13:39:44 +0000 (15:39 +0200)] 
parsedate: provide Curl_wkday also for GnuTLS builds

Otherwise --disable-dateparse + --with-gnutls builds might fail.

Found with randdisable

Closes #16943

4 months agogenserv.pl: fail with a message if `openssl` is missing or failing
Viktor Szakats [Wed, 2 Apr 2025 21:40:14 +0000 (23:40 +0200)] 
genserv.pl: fail with a message if `openssl` is missing or failing

Reported-by: Tomas Volf
Fixes #16926
Follow-up to 44341e736a3e2f7a2b25a774be3a9796e81abab9 #16824
Ref: #16928
Co-authored-by: Daniel Stenberg
Closes #16929

4 months agoconncache: make Curl_cpool_init return void
Daniel Stenberg [Thu, 3 Apr 2025 08:48:25 +0000 (10:48 +0200)] 
conncache: make Curl_cpool_init return void

Since it cannot fail, removing the return code simplifies the code paths
calling this function.

Closes #16936

4 months agohttp: fix a build error when all auths are disabled
Daniel Stenberg [Thu, 3 Apr 2025 10:10:45 +0000 (12:10 +0200)] 
http: fix a build error when all auths are disabled

error: â€˜result’ undeclared (first use in this function)

Found with randdisable

Closes #16939

4 months agohostip: fix build without threaded-resolver and without DoH
Daniel Stenberg [Thu, 3 Apr 2025 09:35:06 +0000 (11:35 +0200)] 
hostip: fix build without threaded-resolver and without DoH

Closes #16938

4 months agovtls: fix build with ssl but without http
Stefan Eissing [Thu, 3 Apr 2025 09:09:01 +0000 (11:09 +0200)] 
vtls: fix build with ssl but without http

Fixes #16935
Closes #16937

4 months agoif2ip: build the function also if FTP is present
Daniel Stenberg [Thu, 3 Apr 2025 07:26:01 +0000 (09:26 +0200)] 
if2ip: build the function also if FTP is present

Previously it was not compiled if CURL_DISABLE_BINDLOCAL is set, but the
FTP code is also using this function.

Easily found by using configure --disable-bindlocal without disabling
FTP.

Closes #16933

4 months agoconfigure: fix --disable-rt
Daniel Stenberg [Thu, 3 Apr 2025 08:12:53 +0000 (10:12 +0200)] 
configure: fix --disable-rt

This option now better only prevents the actual -lrt to be used, and
thus has no effect if the system does not need -lt for the monotonic
clock etc.

Fixes #16932
Closes #16934

4 months agocurl_krb5: only use functions if FTP is still enabled
Daniel Stenberg [Thu, 3 Apr 2025 06:49:20 +0000 (08:49 +0200)] 
curl_krb5: only use functions if FTP is still enabled

Reported-by: x1sc0 on github
Fixes #16925
Closes #16931

4 months agoVERSIONS: list all past releases
Daniel Stenberg [Tue, 1 Apr 2025 15:41:08 +0000 (17:41 +0200)] 
VERSIONS: list all past releases

This document now lists all previous releases.

This allows us to verify that documentation refers to actual release
versions.

Test 971 now verifies options-in-versions and all command line options
documentation individually. Fixed a few discrepancies.

Test 1488 verifies libcurl options "Added-in" to exist. Fixed a few
discrepancies there as well.

Closes #16907

4 months agohttp_negotiate: fix non-SSL build with GSSAPI
Andrew [Wed, 2 Apr 2025 12:45:21 +0000 (13:45 +0100)] 
http_negotiate: fix non-SSL build with GSSAPI

Fixes #16919
Closes #16921

4 months agoeventfd: fix feature guards
Viktor Szakats [Tue, 1 Apr 2025 21:32:16 +0000 (23:32 +0200)] 
eventfd: fix feature guards

Enable eventfd code consistently when both `HAVE_EVENTFD` and
`HAVE_SYS_EVENTFD_H` macros are defined.

Before this patch `HAVE_EVENTFD` guarded it alone, though the code
also required the header, which was guarded by `HAVE_SYS_EVENTFD_H`.

These should normally be detected in pairs. When they aren't, omit using
`eventfd()` to avoid calling it without a known matching header.

If this disables valid cases (e.g. some system declares this function
via a different header), feature detection and the code may be extended
for those cases. If these are known to come in pairs, always, another
option is detect them both at build stage, and forward a single macro
to C.

Reported-by: Abhinav Singhal
Bug: https://curl.se/mail/lib-2025-04/0000.html
Closes #16909

4 months agoconfigure: restore link checks
Viktor Szakats [Wed, 2 Apr 2025 10:24:43 +0000 (12:24 +0200)] 
configure: restore link checks

The omitted link checks were not what I though they were. Omitting one
caused a mis-detection on Solaris, where the compile check alone
mis-detects `CloseSocket` as present.

Restore link checks for these functions:
`closesocket`, `ioctlsocket`, `socket`, `freeaddrinfo`, `getaddrinfo`,
`gethostname`, `getpeername`, `getsockname`,
`CloseSocket` (AmigaOS), `IoctlSocket` (AmigaOS).

Also re-sync link check code snippets with the ones in current master.

Partial revert of, regression from bd9f9b085aa242a5e93be0b2da96ce498d7813c4 #16377
Reported-by: Dagobert Michelsen
Bug: https://curl.se/mail/lib-2025-04/0004.html
Fixes #16915
Closes #16917

4 months agoINSTALL-CMAKE.md: fix typo
Jay Satiro [Wed, 2 Apr 2025 21:45:57 +0000 (17:45 -0400)] 
INSTALL-CMAKE.md: fix typo

4 months agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 2 Apr 2025 20:51:06 +0000 (22:51 +0200)] 
RELEASE-NOTES: synced

and bump to 8.13.1 for now

4 months agotests/serverhelp: remove last remnants of http-pipe server
Yedaya Katsman [Wed, 2 Apr 2025 13:59:42 +0000 (16:59 +0300)] 
tests/serverhelp: remove last remnants of http-pipe server

Followup on https://github.com/curl/curl/pull/5921

Closes #16924

4 months agolib1960: revert the use of libcurl's inet_pton
Daniel Stenberg [Mon, 31 Mar 2025 21:47:23 +0000 (23:47 +0200)] 
lib1960: revert the use of libcurl's inet_pton

Since it now uses hex conversion code from strparse as well.

Closes #16888

4 months agolib: unify conversions to/from hex
Daniel Stenberg [Mon, 31 Mar 2025 21:12:09 +0000 (23:12 +0200)] 
lib: unify conversions to/from hex

Curl_hexbyte - output a byte as a two-digit ASCII hex number

Curl_hexval - convert an ASCII hex digit to its binary value

... instead of duplicating similar code and hexdigit strings in numerous
places.

Closes #16888

4 months agotest: make unittest 1308 into a libtest
Daniel Stenberg [Tue, 1 Apr 2025 07:18:33 +0000 (09:18 +0200)] 
test: make unittest 1308 into a libtest

Test 1308 was wrongly marked a unit test when in reality it is a
libtest.

Closes #16891

4 months agoprocesshelp.pm: avoid potential endless loop, log more (Windows)
Viktor Szakats [Tue, 1 Apr 2025 20:46:19 +0000 (22:46 +0200)] 
processhelp.pm: avoid potential endless loop, log more (Windows)

`pidwait()` is a function to wait for a PID to disappear from the list
of processes. On Windows change this function to:

- reduce the frequency of calling the external command `tasklist` to
  query the list of processes, including Windows-native ones, to 0.2s
  (from 0.01s).

- print a message when the wait exceeds 5 second marks.

- give up after 20 seconds of total wait, and print a message.

Also log `taskkill` commands to stdout instead of the log.

To potentially avoid hangs seen in CI, and make these spots more
transparent through the log.

Ref: #16840
Ref: #14854

Closes #16908

4 months agocontrithanks.sh: drop set -e
Daniel Stenberg [Wed, 2 Apr 2025 07:41:49 +0000 (09:41 +0200)] 
contrithanks.sh: drop set -e

Makes the script work again

Closes #16914

4 months agoRELEASE-NOTES: synced curl-8_13_0
Daniel Stenberg [Wed, 2 Apr 2025 05:46:30 +0000 (07:46 +0200)] 
RELEASE-NOTES: synced

4 months agoTHANKS: new contributors from 8.13.0 release
Daniel Stenberg [Wed, 2 Apr 2025 05:46:30 +0000 (07:46 +0200)] 
THANKS: new contributors from 8.13.0 release

4 months agoGHA/windows: move libssh job from vcpkg to MSYS2
Viktor Szakats [Tue, 1 Apr 2025 22:04:56 +0000 (00:04 +0200)] 
GHA/windows: move libssh job from vcpkg to MSYS2

To avoid upstream issue where libssh no longer builds with vcpkg:
```
error: building libssh:x64-windows failed with: BUILD_FAILED
```
Ref: https://github.com/curl/curl/actions/runs/14206672441/job/39805869213?pr=16909#step:5:64

Bug: https://github.com/curl/curl/pull/16909#issuecomment-2770792320

Closes #16910

4 months agoGHA/windows: make libssh2 install a per job config
Viktor Szakats [Tue, 1 Apr 2025 22:29:56 +0000 (00:29 +0200)] 
GHA/windows: make libssh2 install a per job config

To allow making per-job variations for SSH backends.

Also:
- fix Cygwin builds to not ignore per-job `install:` items.
  It worked by accident before this patch.
  Follow-up to 66313cc036671cd4d3e72db65a79a715c7b8f154 #16629

Closes #16911

4 months agovtls_scache: remove "Unreachable Call"
Daniel Stenberg [Tue, 1 Apr 2025 08:46:07 +0000 (10:46 +0200)] 
vtls_scache: remove "Unreachable Call"

The condition required to reach this call could not happen, because
cf_ssl_scache_get() already checks the same condition and returns NULL
for 'scache' prior to this.

Found by CodeSonar

Closes #16896

4 months agotool_getparam: avoid redundant condition in set_rate
Daniel Stenberg [Tue, 1 Apr 2025 08:25:41 +0000 (10:25 +0200)] 
tool_getparam: avoid redundant condition in set_rate

When the number parsing fails, the pointer is never moved so there's no
point in checking that.

Pointed out by CodeSonar

Closes #16895

4 months agomulti_ev: remove redundant check from mev_get_last_pollset
Daniel Stenberg [Tue, 1 Apr 2025 08:16:04 +0000 (10:16 +0200)] 
multi_ev: remove redundant check from mev_get_last_pollset

Pointed out by CodeSonar

Closes #16894

4 months agohttp2: fix stream assignemnt for pushes
Stefan Eissing [Tue, 1 Apr 2025 11:44:24 +0000 (13:44 +0200)] 
http2: fix stream assignemnt for pushes

When a PUSH_PROMISE was received, the h2_stream object was assigned
to the wrong `newhandle->mid` and was thereafter not found. This led
to internal confusion, because the nghttp2 stream user_data was not
cleared and an invalid easy handle was use for trace messages,
resulting in a crash.

Reported-by: Viktor Szakats
Fixes #16881
Closes #16905

4 months agoGHA/windows: drop GnuTLS-fork from vcpkg MultiSSL job
Viktor Szakats [Tue, 1 Apr 2025 10:36:06 +0000 (12:36 +0200)] 
GHA/windows: drop GnuTLS-fork from vcpkg MultiSSL job

curl now has a working GnuTLS CI job, with tests, with MSYS2.
The MultiSSL build scenario is now tested on macOS.

The vcpkg GnuTLS package seems to have a deep dependency tree with large
packages that need to be rebuilt relatively frequently. Since they can't
fit into to the time limit, these cause CI failures.

To stabilize CI, drop the `shiftmedia-libgnutls` dependency.

Partial revert of e86f99824c4de0024cc90bca53efe205fd1c1dcc #16623
Ref: https://github.com/curl/curl/actions/runs/14192680124/job/39760753274?pr=16902

Closes #16904

4 months agotests/README: document test bundles
Viktor Szakats [Tue, 1 Apr 2025 09:42:25 +0000 (11:42 +0200)] 
tests/README: document test bundles

Closes #16902

4 months agoruntests: fix bundled test invocation with `-g` option
Viktor Szakats [Tue, 1 Apr 2025 09:02:57 +0000 (11:02 +0200)] 
runtests: fix bundled test invocation with `-g` option

Fixes:
```
$ ./runtests.pl -g 1940
./libtest/libtests lib1940: No such file or directory.
Argument list to give program being debugged when it is started is "http://127.0.0.1:44547/1940".
```

Reported-by: Daniel Stenberg
Fixes #16893
Closes #16898

4 months agoGHA: run random curl command lines for N seconds in CI
Daniel Stenberg [Mon, 31 Mar 2025 11:49:18 +0000 (13:49 +0200)] 
GHA: run random curl command lines for N seconds in CI

In the memory and address sanitizer builds.

Verify that nothing unexpected happens.

Starting out with 60 second runs.

The script does not set any seed so it runs with a new random every
time, meaning that if it fails in a single CI run it might not fail in a
subsequent one: but it should still show the full command that failed to
enable us to reproduce it locally. We can work on improving the seed
situation later if this script turns useful.

Closes #16884

4 months agotool_paramhlp: make proto2num skip leading commas better
Daniel Stenberg [Tue, 1 Apr 2025 07:36:47 +0000 (09:36 +0200)] 
tool_paramhlp: make proto2num skip leading commas better

Closes #16892

4 months agotests/certs/Makefile.am: avoid superfluous cert re-generation
Daniel Stenberg [Tue, 1 Apr 2025 09:06:27 +0000 (11:06 +0200)] 
tests/certs/Makefile.am: avoid superfluous cert re-generation

Fixes #16897
Closes #16899

4 months agolibssh2: show crypto backend in the verbose connect log
Viktor Szakats [Fri, 21 Mar 2025 23:47:07 +0000 (00:47 +0100)] 
libssh2: show crypto backend in the verbose connect log

With libssh2 1.11.0 or newer.

Different crypto backends may offer different features, e.g. in the keys
and algos they support.

Examples:
```
*   Trying 127.0.0.1:22...
* Connected to localhost (127.0.0.1) port 22
* libssh2 crypto backend: openssl compatible
[or]
* libssh2 crypto backend: WinCNG
```

Also fix indentation and drop redundant curly braces.

Closes #16790

4 months agoprox/preproxy.md: document argument within <brackets>
Daniel Stenberg [Mon, 31 Mar 2025 11:17:22 +0000 (13:17 +0200)] 
prox/preproxy.md: document argument within <brackets>

... as the argument is mandatory and we use that symbol for all other
options.

Closes #16883

4 months agoRevert "async-threaded resolver: use ref counter"
Daniel Stenberg [Mon, 31 Mar 2025 07:09:53 +0000 (09:09 +0200)] 
Revert "async-threaded resolver: use ref counter"

This reverts commit 19226f9bb106347e21d1dd113f2e2aeff53ca925.

Due to flaky macos CI builds

Fixes #16880
Closes #16882

4 months agourlapi: remove percent encoded dot sequences from the URL path
Daniel Stenberg [Sat, 29 Mar 2025 18:10:40 +0000 (19:10 +0100)] 
urlapi: remove percent encoded dot sequences from the URL path

Treat %2e and %2E to be "dot equivalents" in the function and remove
such sequences as well, according to RFC 3986 section 5.2.4. That is
also what the browsers do.

This DOES NOT consider %2f sequences in the path to be actual slashes,
so there is no removal of dots for those.

This function does not decode nor encode any percent sequences.

Also switched the code to use dynbuf.

Extends test 1395 and 1560 to verify.

Assisted-by: Demi Marie Obenour
Fixes #16869
Closes #16870

4 months agoasyn-thread: repair build with disabled socketpair
Daniel Stenberg [Sun, 30 Mar 2025 21:18:32 +0000 (23:18 +0200)] 
asyn-thread: repair build with disabled socketpair

Reported-by: Abhinav Singhal
Bug: https://curl.se/mail/lib-2025-03/0031.html
Closes #16877

4 months agodocs/cmdline-opts: use imperative form
Daniel Stenberg [Sun, 30 Mar 2025 22:52:07 +0000 (00:52 +0200)] 
docs/cmdline-opts: use imperative form

Use 'set', not 'sets' etc. For consistency.

Closes #16879

4 months agoaws_sigv4: merge repeated headers in canonical request
Austin Moore [Wed, 19 Mar 2025 03:58:56 +0000 (23:58 -0400)] 
aws_sigv4: merge repeated headers in canonical request

When multiple headers share the same name, AWS SigV4 expects them to be
merged into a single header line, with values comma-delimited in the
order they appeared.

Add libtest 1978 to verify.

Closes #16743

4 months agobuild: drop `build-certs` as a test-run dependency
Viktor Szakats [Sun, 30 Mar 2025 20:34:26 +0000 (22:34 +0200)] 
build: drop `build-certs` as a test-run dependency

After adding it as a test executables dependency, it run twice in
MSBuild jobs. Also there is little reason to try building them in both
build and run tests targets.

(The reason MSBuild building it twice, is our use of
`TrackFileAccess=false` to improve build performance.)

https://github.com/curl/curl/actions/runs/14156797251/job/39662914155?pr=16840#step:15:31

Follow-up to 68609f0e334359875a2f62735377174ab6b873dd #16866
Follow-up to 0c1ad21f978c8f5acf3d0c1708d83a93635d9df3 #16845

Closes #16876

4 months agogenserv.pl: detect `openssl` in `PATH`, omit `command -v`
Viktor Szakats [Sat, 29 Mar 2025 13:43:10 +0000 (14:43 +0100)] 
genserv.pl: detect `openssl` in `PATH`, omit `command -v`

Before this patch the script relied on Perl `system()` finding `openssl`
in `PATH`, plus tried to display the full path of `openssl` by using
`command -v` (or `which` on Windows). `command -v` did not work in CI
for unknown reasons. To resolve it, this patch detects `openssl` in
`PATH` manually, displays the detected full path and calls `openssl`
with the detected full path, and stops relying on `system` for this.

It also follows how `sshhelp.pm` is detecting executables. Though this
patch uses Perl `-f` instead of `-e && -d` used there .

Silencing this in CI logs:
```
Can't exec "command": No such file or directory at ../../../tests/certs/genserv.pl line 51.
```
Ref: https://github.com/curl/curl/actions/runs/14145795884/job/39632942668?pr=16865#step:39:108

Closes #16868

4 months agolib1560: test set path containing LR or CR
Daniel Stenberg [Sun, 30 Mar 2025 14:47:42 +0000 (16:47 +0200)] 
lib1560: test set path containing LR or CR

Ref: #16874
Closes #16875

4 months agoeasy: drop `break` after `return`
Viktor Szakats [Sun, 30 Mar 2025 11:27:13 +0000 (13:27 +0200)] 
easy: drop `break` after `return`

Also some whitespace tidy-ups.

Closes #16873