]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
6 weeks agocmake: drop redundant macro from test clients
Viktor Szakats [Tue, 17 Jun 2025 18:58:35 +0000 (20:58 +0200)] 
cmake: drop redundant macro from test clients

Not necessary now that test clients #include `curl_setup.h`.

Follow-up to 539d11297d36cff0bca7dda1f217186f060d577d #17642

Closes #17657

6 weeks agocmake: drop passing redundant `CURL_STATICLIB` in examples and clients
Viktor Szakats [Tue, 17 Jun 2025 18:30:06 +0000 (20:30 +0200)] 
cmake: drop passing redundant `CURL_STATICLIB` in examples and clients

It's set implicitly via libcurl.

Closes #17655

6 weeks agotests/http/clients: move to tests/client
Viktor Szakats [Mon, 16 Jun 2025 10:42:19 +0000 (12:42 +0200)] 
tests/http/clients: move to tests/client

To have all the tests binaries directly under the tests directory.

There seems to be no issue adding non-http test clients to this subdir.

Closes #17637

6 weeks agoGHA: update rojopolis/spellcheck-github-actions digest to 63aba94
renovate[bot] [Mon, 16 Jun 2025 20:27:00 +0000 (20:27 +0000)] 
GHA: update rojopolis/spellcheck-github-actions digest to 63aba94

Closes #17643

6 weeks agotests: make sshserver less verbose
Stefan Eissing [Tue, 17 Jun 2025 06:53:32 +0000 (08:53 +0200)] 
tests: make sshserver less verbose

Only display top of key files in verbose mode.

Follow-up to 89f306ae40b678bd91595ba41fe5f9d5ed374897 #16781

Closes #17647

6 weeks agomulti: do no expire a blocked transfer
Stefan Eissing [Mon, 16 Jun 2025 11:40:15 +0000 (13:40 +0200)] 
multi: do no expire a blocked transfer

When checking to expire a transfer with input data pending, also assess
the blocked status and do not EXPIRE_RUN_NOW a transfer that is blocked
on READ/WRITE.

Follow-up to 62349e45a818e50b5cdcd017c149f9dc87fce9fe #17636

Closes #17639

6 weeks agohttp2: do not delay RST send on aborted transfer
Stefan Eissing [Mon, 16 Jun 2025 11:05:20 +0000 (13:05 +0200)] 
http2: do not delay RST send on aborted transfer

When a transfer is done prematurely, a RST is generated to the server,
but was not send right away due to send buffering.

Flush the send buffer in a best effort when transfer is done.

Reported-by: Michael Kaufmann
Fixes #17611
Closes #17638

6 weeks agotests/http/clients: drop hack and use `curl_setup.h` again
Viktor Szakats [Mon, 16 Jun 2025 14:04:22 +0000 (16:04 +0200)] 
tests/http/clients: drop hack and use `curl_setup.h` again

Sync build properties with libtests.

This allows accessing macros from `curl_config.h`, for feature flags.
Smoothens out platform bumps, allowing to drop local replicas from
client sources. It enables using Windows wrappers, e.g. for `fopen()`.

Also fix client sources to use `curl_mfprintf()` where curl format
strings are used. (To avoid build failure with older mingw-w64, e.g.
6.4.0 in CI.)

Follow-up to 739c09c8a4111b3ee00b0004f5a3f67e00ba3aeb #17627

Closes #17642

6 weeks agoGHA/windows: avoid libtool wrapper for `tunits`
Viktor Szakats [Mon, 16 Jun 2025 11:54:28 +0000 (13:54 +0200)] 
GHA/windows: avoid libtool wrapper for `tunits`

To sync it with other test binaries.

Closes #17640

6 weeks agomulti: fix polling with pending input
Stefan Eissing [Mon, 16 Jun 2025 10:19:52 +0000 (12:19 +0200)] 
multi: fix polling with pending input

When multi creates the pollset of a transfer, it checks now if
a connection (FIRST/SECONDARY) socket waits on POLLIN and has input data
pending in filters (relevant to OpenSSL's new read ahead). If so, it
triggers a timeout on the transfer via EXPIRE_RUN_NOW.

This fixes sporadic stalls in test 988 when running event based.

Closes #17636

6 weeks agotests: bundle http clients, de-dupe, enable for MSVC
Viktor Szakats [Sun, 15 Jun 2025 12:48:46 +0000 (14:48 +0200)] 
tests: bundle http clients, de-dupe, enable for MSVC

To make building the http client tests faster, with no duplication, by
using the build method that other test binaries already use.

The difference compared to other tests is that these don't use internal
libcurl headers or code. With the exception of `curl_config.h`, for
a feature macro.

Before this patch, these tests were built like examples.

Also:
- de-duplicate code and give unique names to colliding symbols.
- add local getopt implementation and enable all code for MSVC.
  Adapted for curl via Public Domain source:
  https://github.com/skeeto/getopt/blob/4e618ef782dc80b2cf0307ea74b68e6a62b025de/getopt.h
Credits-to: Christopher Wellons
  Thanks!

Closes #17627

6 weeks agowindows: fixup `fopen()` in `CURLDEBUG` builds
Viktor Szakats [Mon, 16 Jun 2025 08:16:17 +0000 (10:16 +0200)] 
windows: fixup `fopen()` in `CURLDEBUG` builds

Introduce an immutable `CURL_FOPEN()` macro to store the `fopen()`
mapping on Windows. Then use that instead `(fopen)` from `memdebug.c`.
It makes CURLDEBUG builds use the correct `fopen` wrapper on Windows.
This macro is only defined on Windows, as of this patch.

This is necessary after cde81e4398f2944e60c73f38823dafa305a5a2f4,
which no longer applies the default `fopen()` override to `memdebug.c`.

Also:
- curl_setup.h: de-dupe, simplify Windows file I/O function overrides.
- curl_memory.h: fix to reset `fopen` to `curlx_win32_fopen()` on
  Windows. Before this patch it reset it to stock `fopen()`.

Follow-up to cde81e4398f2944e60c73f38823dafa305a5a2f4 #17631

Closes #16747

6 weeks agomemdebug: include in unity batch
Viktor Szakats [Mon, 16 Jun 2025 00:07:31 +0000 (02:07 +0200)] 
memdebug: include in unity batch

Before this patch `memdebug.c` was compiled as a separate source in
unity builds. This was necessary because `memdebug.c` failed to compile
if `memdebug.h` was included before it, in `CURLDEBUG` mode. This patch
fixes this issue and allows to compile `memdebug.c` as part of the unity
source batch. This removes an exception and makes builds perform a notch
better.

- introduce `CURL_SCLOSE()` macro as an immutable synonym of `sclose()`.
- memdebug: replace `sclose()` reference with `CURL_SCLOSE()` to compile
  as expected when `sclose()` is overridden by `memdebug.h`.
- memdebug: make it not break when including `memdebug.h` before it in
  `CURLDEBUG` mode. Do this by calling low-level functions as
  `(function)`.
- autotools, cmake: drop memdebug exception, include it like any other
  source file. This is now possible because `memdebug.c` doesn't break
  if `memdebug.h` was included before it, in `CURLDEBUG` builds.
- mk-unity: drop `--exclude` option. No longer used after this patch.
- drop `MEMDEBUG_NODEFINES` macro hack. No longer necessary.

Ref: #16747
Closes #16746
Closes #16738
Closes #17631

6 weeks agomk-unity: include the embedded source name in the output
Viktor Szakats [Mon, 16 Jun 2025 06:57:45 +0000 (08:57 +0200)] 
mk-unity: include the embedded source name in the output

Closes #17634

6 weeks agotests/libtest: merge `MEMPTR` into `UTILS`
Viktor Szakats [Mon, 16 Jun 2025 06:51:52 +0000 (08:51 +0200)] 
tests/libtest: merge `MEMPTR` into `UTILS`

Follow-up to ee066732963b7051a8d2fd56fa91a4ce0b444bd5 #17628

Closes #17633

6 weeks agoautotools: drop no longer necessary `--srcdir` unity options
Viktor Szakats [Mon, 16 Jun 2025 00:23:27 +0000 (02:23 +0200)] 
autotools: drop no longer necessary `--srcdir` unity options

Follow-up to ee066732963b7051a8d2fd56fa91a4ce0b444bd5 #17628

Closes #17632

6 weeks agobuild: drop unused variables in tests
Viktor Szakats [Sun, 15 Jun 2025 23:47:28 +0000 (01:47 +0200)] 
build: drop unused variables in tests

Follow-up to fffec3d7e90b032a03eee2192e68f8baf913b3b4 #17629
Follow-up to ee066732963b7051a8d2fd56fa91a4ce0b444bd5 #17628

6 weeks agotests/server: drop memdebug option
Viktor Szakats [Sun, 15 Jun 2025 21:28:08 +0000 (23:28 +0200)] 
tests/server: drop memdebug option

I added it just in case when removing enabled-by-default memdebug
from test servers. Apparently it broke after recent changes. It's
probably not a widely used feature and does not seem to be worth fixing.
It creates odd dependencies as the error message indicates:

```
[28/54] Building C object tests/server/CMakeFiles/servers.dir/__/__/lib/memdebug.c.obj
FAILED: tests/server/CMakeFiles/servers.dir/__/__/lib/memdebug.c.obj
[...]
lib/memdebug.c: In function 'curl_dbg_log':
lib/memdebug.c:465:12: error: implicit declaration of function 'mvsnprintf'; did you mean 'vsnprintf'? [-Wimplicit-function-declaration]
  465 |   nchars = mvsnprintf(buf, sizeof(buf), format, ap);
      |            ^~~~~~~~~~
      |            vsnprintf
lib/memdebug.c:465:12: warning: nested extern declaration of 'mvsnprintf' [-Wnested-externs]
```

This patch is dropping these build options:
- cmake: `ENABLE_SERVER_DEBUG`
- autotools: `--enable-server-debug` / `--disable-server-debug`

Follow-up to a16485a42ea5dabe6c327179a1678ad04d1c6b2f #16705

Closes #17629

6 weeks agobuild: sync tests unity builds between cmake and autotools
Viktor Szakats [Sun, 15 Jun 2025 19:54:20 +0000 (21:54 +0200)] 
build: sync tests unity builds between cmake and autotools

Instead of relying on CMake's built-in unity feature, use `mk-unity.pl`,
as already done with autotools. It simplified the build, shortens logs
and makes debugging easier because of the fewer build variations.
It also allows testing / fixing with cmake and those automatically apply
to autotools builds too. cmake builds can be much-much faster, esp.
when working the builds themselves.

It also enables "unity" in old cmake versions. Basically every test
target is a single generated .c source.

Also:
- drop a `lib` unity workaround for libtests with autotools after fixing
  the issue in libtests itself. It drops a few exceptions and makes
  libcurl build faster (in autotools unity).
- fix another `lib` autotools unity issue and drop the workaround for it
  from `mk-unity.pl`. `srcdir` was missing from the header path.
- simplify `mk-unity.pl` command-lines, drop exclusions.

Follow-up to 2c27a67daa1b76859c18d63e4e1f528db05b5e13 #17590

Closes #17628

6 weeks agobuild: drop `HAVE_SYS_SOCKET_H` and `HAVE_SYS_TIME_H` macros
Viktor Szakats [Wed, 11 Jun 2025 05:32:16 +0000 (07:32 +0200)] 
build: drop `HAVE_SYS_SOCKET_H` and `HAVE_SYS_TIME_H` macros

Both are available with well-known conditions, under non-Windows, and
`curl/curl.h` already uses them. `sys/time.h` is also necessary for
mingw-w64 for `gettimeofday()`.

Follow-up to 56d5982312f8360b020738cbfeefe7990991550e #17522

Closes #17581

6 weeks agotests: tidy up server main function, whitespace and README
Viktor Szakats [Sun, 15 Jun 2025 11:21:22 +0000 (13:21 +0200)] 
tests: tidy up server main function, whitespace and README

Follow-up to 2c27a67daa1b76859c18d63e4e1f528db05b5e13 #17590

Closes #17625

6 weeks agotidy-up: two comments
Viktor Szakats [Sat, 14 Jun 2025 23:21:14 +0000 (01:21 +0200)] 
tidy-up: two comments

Follow-up to 2c27a67daa1b76859c18d63e4e1f528db05b5e13 #17590
Follow-up to df1ff17f88a623b12c13ffd893ca4ac47c5f04d1 #17418

Closes #17624

6 weeks agodigest: fix build with disabled digest auth
Stefan Eissing [Fri, 13 Jun 2025 11:29:17 +0000 (13:29 +0200)] 
digest: fix build with disabled digest auth

Fix building with `--disable-digest-auth`. Make test cases run in such
a build. Add such a build to our CI jobs.

Reported-by: Tristan Perrault
Fixes #17612
Closes #17614

6 weeks agolib: avoid reusing unclean connection
Stefan Eissing [Fri, 13 Jun 2025 07:43:40 +0000 (09:43 +0200)] 
lib: avoid reusing unclean connection

When `curl_easy_cleanup()` is invoked while still being part
of a multi handle, the code will auto-remove it. But since the
connection was detached first, the code in
`curl_multi_remove_handle()` that invalidates dirty connections
did not bite.

Attach the connection *after* the possible remove from a multi
handle, so that connection reuse can be prevented.

Add test753 to reproduce and verify the fix. This required adding
the new debug env var CURL_FTP_PWD_STOP, to have a transfer return
from multi_perform() early with a connection that does not show
and pending input.

Reported-by: Brian Harris
Fixes https://github.com/curl/curl/issues/17578
Closes https://github.com/curl/curl/pull/17607

6 weeks agoopenssl: Fix openssl engines
Theodore A. Roth [Thu, 12 Jun 2025 17:36:02 +0000 (11:36 -0600)] 
openssl: Fix openssl engines

- Return CURLE_OK if the engine successfully loaded.

Prior to this change:

When loading an openssl engine, the result code is initialized to
CURLE_SSL_ENGINE_NOTFOUND, but is never set to CURLE_OK when the engine
was successfully loaded. This causes curl to error out, falsely stating
engine not found when it actually was.

Broken since f2ce6c46 (precedes 8.14.0) which added support for using
engines and providers at the same time.

Fixes https://github.com/curl/curl/issues/17617
Closes https://github.com/curl/curl/pull/17618

6 weeks agowarnless: replace `read()`/`write()` wrapper functions with macros (Windows)
Viktor Szakats [Sat, 14 Jun 2025 10:43:20 +0000 (12:43 +0200)] 
warnless: replace `read()`/`write()` wrapper functions with macros (Windows)

Map them to `_read()`/`_write()` (with underscore) to avoid recursive
mapping and to use the non-compatibility naming on Windows.

https://learn.microsoft.com/cpp/c-runtime-library/reference/read
https://learn.microsoft.com/cpp/c-runtime-library/reference/write

Follow-up to 6239146e931fd3127f6994975a56d1b4884a708a

Closes #17619

6 weeks agotidy-up: update deprecated status of some symbols/options
Viktor Szakats [Thu, 12 Jun 2025 10:09:09 +0000 (12:09 +0200)] 
tidy-up: update deprecated status of some symbols/options

`CURLOPT_SSL_FALSESTART` / `--false-start`, Secure Transport, BearSSL,
GSKit, MesaLink, NSS.

Follow-up to 1e2e808defe6850295baa002d07cde9a129ec791 #17595
Follow-up to 08a3e8e19a59d1530bfb208e187ac7c34c978dfd #16677

Closes #17605

6 weeks agolib: remove superfluous setopt break for CURLOPT_SSL_FALSESTART
Daniel McCarney [Fri, 13 Jun 2025 14:33:51 +0000 (10:33 -0400)] 
lib: remove superfluous setopt break for CURLOPT_SSL_FALSESTART

Reported-by: 4lan.m
Ref: https://github.com/curl/curl/commit/1e2e808defe6850295baa002d07cde9a129ec791#r159957160
Follow-up to 1e2e808defe6850295baa002d07cde9a129ec791 #17595

Closes #17615

6 weeks agoGHA/windows: enable H3 in the MSVC OpenSSL job
Viktor Szakats [Tue, 10 Jun 2025 15:21:56 +0000 (17:21 +0200)] 
GHA/windows: enable H3 in the MSVC OpenSSL job

Requires windows-runner 20250602.1 for ngtcp2 1.13.0.

Follow-up to c129d0b1a8769b352a3cf906fa0d3919b4a8ea3d #17561
Ref: https://github.com/curl/curl/pull/17561#issuecomment-2959583138

Closes #17577

6 weeks agoschannel: allow partial chains for manual peer verification
Rod Widdowson [Wed, 21 May 2025 19:10:36 +0000 (20:10 +0100)] 
schannel: allow partial chains for manual peer verification

- Align --cacert behaviour with OpenSSL and LibreSSL.

This changes the default behavior of Schannel manual certificate
verification, which is used when the user provides their own CA
certificates for verification, to accept partial chains. In other words,
the user may provide an intermediate certificate without having to
provide the root CA.

Win8/Server2012 widened the PKIX chain traversal API to allow
certificate traversal to terminate at an intermediate.

This behaviour (terminate at the fist matching intermediate) is the
default for LibreSSL and OpenSSL (with OpenSSL allowing control via
CURLSSLOPT_NO_PARTIALCHAIN).

This change uses the new API if it is available, and also allows the
behaviour to revert legacy if CURLSSLOPT_NO_PARTIALCHAIN is present.

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

6 weeks agocmake: make docs depend on support files
Viktor Szakats [Sat, 14 Jun 2025 13:40:04 +0000 (15:40 +0200)] 
cmake: make docs depend on support files

As in autotools.

Closes #17620

6 weeks agotests: always make bundles, adapt build and tests
Viktor Szakats [Wed, 11 Jun 2025 09:31:14 +0000 (11:31 +0200)] 
tests: always make bundles, adapt build and tests

Make test bundles the default. Drop non-bundle build mode.
Also do all the optimizations and tidy-ups this allows, simpler builds,
less bundle exceptions, streamlined build mechanics.

Also rework the init/deinit macro magic for unit tests. The new method
allows using unique init/deinit function names, and calling them with
arguments. This is in turn makes it possible to reduce the use of global
variables.

Note this drop existing build options `-DCURL_TEST_BUNDLES=` from cmake
and `--enable-test-bundles` / `--disable-test-bundles` from autotools.

Also:
- rename test entry functions to have unique names: `test_<testname>`
  This removes the last exception that was handled in the generator.
- fix `make dist` to not miss test sources with test bundles enabled.
- sync and merge `tests/mk-bundle.pl` into `scripts/mk-unity.pl`.
- mk-unity.pl: add `--embed` option and use it when `CURL_CLANG_TIDY=ON`
  to ensure that `clang-tidy` does not miss external test C sources.
  (because `clang-tidy` ignores code that's #included.)
- tests/unit: drop no-op setup/stop functions.
- tests: reduce symbol scopes, global macros, other fixes and tidy-ups.
- tool1621: fix to run, also fix it to pass.
- sockfilt: fix Windows compiler warning in certain unity include order,
  by explicitly including `warnless.h`.

Follow-up to 6897aeb10561b55c6659866fc0518dd67422f267 #17468

Closes #17590

7 weeks agoopenssl: fix handling of buffered data
Stefan Eissing [Thu, 12 Jun 2025 06:45:20 +0000 (08:45 +0200)] 
openssl: fix handling of buffered data

`SSL_pending()` only checks if the *current* TLS packet has more data.
There might be more data in SSL's buffers.

`SSL_has_pending()` only checks if there is data in buffers, but does
*not* check if there is a complete TLS packet that can be decoded.

If we only check the first, we will poll on socket events without having
processed all data and may stall. If we only check the second, we would
busy loop without SSL_read() ever giving something.

Add the flag `connssl->input_pending` that is set on incoming data in
the BIO receive. Clear the flag when encountering a CURLE_AGAIN on
the filters receive (via SSL_read()) or see an EOF.

Ref: #17596
Closes #17601

7 weeks agohttp: split http_header into sub functions
Daniel Stenberg [Thu, 12 Jun 2025 09:36:14 +0000 (11:36 +0200)] 
http: split http_header into sub functions

Closes #17603

7 weeks agoasyn-thrdd: free the previous name before strdup'ing the new
Daniel Stenberg [Thu, 12 Jun 2025 09:46:51 +0000 (11:46 +0200)] 
asyn-thrdd: free the previous name before strdup'ing the new

Fixes #17602
Reported-by: hiimmat on github
Closes #17604

7 weeks agoGHA/non-native: skip test 2707 instead of all WebSocket tests on OpenBSD
Viktor Szakats [Wed, 11 Jun 2025 09:17:55 +0000 (11:17 +0200)] 
GHA/non-native: skip test 2707 instead of all WebSocket tests on OpenBSD

Narrowing down the test which may be causing the flaky 6-minute long
delays and CI failures.

Suggested-by: Calvin Ruocco
Ref: https://github.com/curl/curl/pull/17562#issuecomment-2961629713

Follow-up to 05db18e0541851a6fa71fb61e9c37bba4f56bce8 #17562
Follow-up to d3594be6531df3d5eafcdd09f84ad9dee1777028 #17136

Closes #17588

7 weeks agotls: remove Curl_ssl false_start
Daniel McCarney [Wed, 11 Jun 2025 12:59:11 +0000 (08:59 -0400)] 
tls: remove Curl_ssl false_start

The secure transport vTLS backend was the only Curl_ssl struct instance
that populated the false_start field. Since its removed, we can now
remove that field entirely. This was a protocol feature specific to TLS
1.2 that has been replaced by the more widely adopted TLS 1.3 early data
mechanisms.

--false-start is now deprecated

Closes #17595

7 weeks agotests/libtest: simplify Makefile.inc
Daniel Stenberg [Wed, 11 Jun 2025 12:30:22 +0000 (14:30 +0200)] 
tests/libtest: simplify Makefile.inc

Remove all custom LDADD lines

Plus: a few minor tidy-ups in libtest code.

Closes #17594

7 weeks agohttp_ntlm: remove unreachable code
Daniel Stenberg [Wed, 11 Jun 2025 09:14:15 +0000 (11:14 +0200)] 
http_ntlm: remove unreachable code

Since the code now checks for NULL and returns before this point, 'ntlm'
cannot be NULL at this point in the code. Pointed out by Coverity.

Follow-up to 55865207457ba860956aea7a31a

Closes #17587

7 weeks agolibtests: stop building the sames source multiple times
Viktor Szakats [Wed, 11 Jun 2025 14:28:42 +0000 (16:28 +0200)] 
libtests: stop building the sames source multiple times

After this patch there is no more double/multiple compile of the same
libtest source under a different libtest ID. Each libtest is compiled
once, and changing behavior at runtime based on test ID.

- drop recently added physical clones for two prevously multi-compiled
  tests:
  - merge lib587 into lib554 again, branch at runtime.
  - merge lib645 into lib643 again, branch at runtime.

- replace existing dynamic branching to use `testnum` instead of
  a manually rolled `testno` based on an extra command-line argument.
  lib1571, lib1576.

- mk-bundle.pl: stop defining `LIB*` macros. No longer used.

- libtests: drop all `LIB*_C` guards.

- Make these tests branch at runtime, stop building copies:
  - lib585, based on lib500
  - lib565, based on lib510
  - lib529, based on lib525
  - lib527, lib532, based on lib526
  - lib545, based on lib544
  - lib548, based on lib547
  - lib696, based on lib556
  - lib584, based on lib589
  - lib1539, based on lib1514
  - lib1543, based on lib1518
  - lib1917, based on lib1916
  - lib1946, based on lib1940
  - lib671, 672, 673, based on lib670

Follow-up to 02dd471bbf8e04fc595ad0f28c965c278ffcefd0 #17591
Follow-up to 6897aeb10561b55c6659866fc0518dd67422f267 #17468

Closes #17598

7 weeks agolibtests: make test 1503,1504,1505 use the 1502 binary
Daniel Stenberg [Wed, 11 Jun 2025 09:58:27 +0000 (11:58 +0200)] 
libtests: make test 1503,1504,1505 use the 1502 binary

Adjust the differences at runtime instead of build-time, to avoid
extra buillds.

Set the `CURL_TESTNUM` env variable to pass test numbers to tests.

Make libtest/first.c use that env variable to set the `testnum` global
variable to allow tests to differ based on which test that runs it.

Closes #17591

7 weeks agoopenssl: enable readahead
Edwin Török [Fri, 6 Jun 2025 15:23:29 +0000 (16:23 +0100)] 
openssl: enable readahead

Speeds up TLS operations up to ~%13.

Closes #17548

Signed-off-by: Edwin Török <edwin.torok@cloud.com>
7 weeks agolib: unify recv/send function signatures
Stefan Eissing [Wed, 11 Jun 2025 08:18:15 +0000 (10:18 +0200)] 
lib: unify recv/send function signatures

cfilter/conn: change send/recv function signatures. Unify the
calling/return conventions in our send/receive handling.

Curl_conn_recv(), adjust pnread type

Parameter `pnread` was a `ssize_t *`, but `size_t *` is better since the
function returns any error in its `CURLcode` return value.

Closes #17546

7 weeks agotidy-up: drop BearSSL and Secure Transport reference remains
Viktor Szakats [Wed, 11 Jun 2025 06:16:33 +0000 (08:16 +0200)] 
tidy-up: drop BearSSL and Secure Transport reference remains

Follow-up to 08a3e8e19a59d1530bfb208e187ac7c34c978dfd #16677

Closes #17582

7 weeks agoopenssl: error on SSL_ERROR_SYSCALL
Stefan Eissing [Wed, 4 Jun 2025 09:12:28 +0000 (11:12 +0200)] 
openssl: error on SSL_ERROR_SYSCALL

Convert the debug-only handling of SSL_ERROR_SYSCALL so that it is
enabled in all builds with openssl. This should not make a difference in
supported OpenSSL versions, but if whatever version or fork we link
against *does* return SSL_ERROR_SYSCALL, handle this as a fatal error.

Fixes #17471
Reported-by: Michael Kaufmann
Closes #17531

7 weeks agohttp_ntlm: protect against null deref
Daniel Stenberg [Wed, 11 Jun 2025 07:33:04 +0000 (09:33 +0200)] 
http_ntlm: protect against null deref

Closes #17585

7 weeks agopytest test_07_70, weaken early data check
Stefan Eissing [Tue, 10 Jun 2025 15:14:00 +0000 (17:14 +0200)] 
pytest test_07_70, weaken early data check

Since the amount of early data sent in the upload test_07_70 varies
much with how fast the server respondes and completes the handshake,
assert that we did sent at least *some* early data instead of relying
on a specific amount.

Closes #17575

7 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 11 Jun 2025 07:25:01 +0000 (09:25 +0200)] 
RELEASE-NOTES: synced

Bump to 8.15.0

7 weeks agoRELEASE-PROCEDURE.md: update docs/VERSIONS
Daniel Stenberg [Wed, 11 Jun 2025 06:56:12 +0000 (08:56 +0200)] 
RELEASE-PROCEDURE.md: update docs/VERSIONS

Add it as an item to fix in each release

Closes #17584

7 weeks agoVERSIONS.md: update
Orgad Shaneh [Wed, 11 Jun 2025 06:38:59 +0000 (09:38 +0300)] 
VERSIONS.md: update

Closes #17583

7 weeks agourl: fix connection lifetime checks
Stefan Eissing [Tue, 10 Jun 2025 08:11:40 +0000 (10:11 +0200)] 
url: fix connection lifetime checks

The checks for a connection being "too long idle" or "too old" where
rounding down the elapsed time to seconds before comparing to the
configured max values. This caused connections to be reused for up to
999ms longer than intended.

Change the compares to scale the configured seconds up to ms, so
connection will properly be "too old" 1 ms after the coonfigured values.

Fixes sporadic failures of test1542 on platforms where "sleep(2)"
returnes before 2 full seconds on the internal clock where passed.

Reported-by: Christian Weisgerber
URL: https://curl.se/mail/lib-2025-06/0004.html
Closes #17571

7 weeks agourlapi: simplify and split into sub functions
Daniel Stenberg [Mon, 9 Jun 2025 15:22:28 +0000 (17:22 +0200)] 
urlapi: simplify and split into sub functions

Closes #17565

7 weeks agolibssh: de-complex myssh_statemach_act()
Stefan Eissing [Tue, 10 Jun 2025 12:43:09 +0000 (14:43 +0200)] 
libssh: de-complex myssh_statemach_act()

Make static functions for the largest state handling code
with a common signature and naming scheme.

Closes #17573

7 weeks agoTLS: remove support for Secure Transport and BearSSL
Daniel Stenberg [Mon, 9 Jun 2025 12:07:21 +0000 (14:07 +0200)] 
TLS: remove support for Secure Transport and BearSSL

These libraries do not support TLS 1.3 and have been marked for removal
for over a year. We want to help users select a TLS dependency that is
future-proof and reliable, and not supporting TLS 1.3 in 2025 does not
infer confidence. Users who build libcurl are likely to be served better
and get something more future-proof with a TLS library that supports
1.3.

Closes #16677

7 weeks agocmake: replace `cmakelint` with `cmake-lint` from `cmakelang`, fix issues
Viktor Szakats [Tue, 10 Jun 2025 16:25:57 +0000 (18:25 +0200)] 
cmake: replace `cmakelint` with `cmake-lint` from `cmakelang`, fix issues

This linter detects formatting and naming issues with minimal amount of
noise. It seems to be an improvement over the existing linter which was
only detecting line width overruns.

Also: fix to exclude `CurlTests.c` from linter.

Ref: https://cmake-format.readthedocs.io/en/latest/cmake-lint.html
Ref: https://github.com/cheshirekow/cmake_format

Closes #17576

7 weeks agobuild: assume `sys/socket.h`, `sys/time.h` on non-Windows (as in `curl/curl.h`)
Viktor Szakats [Mon, 2 Jun 2025 15:06:08 +0000 (17:06 +0200)] 
build: assume `sys/socket.h`, `sys/time.h` on non-Windows (as in `curl/curl.h`)

Public `curl/curl.h` includes these headers for non-Windows platforms
without further conditions. This makes it safe to assume these headers
do exist, allowing to save two feature checks for non-Windows targets.

`sys/time.h` is also assumed on Windows with mingw-w64, for declaring
`gettimeofday()`.

Closes #17522

7 weeks agocmake: drop never propagated C macros
Viktor Szakats [Tue, 10 Jun 2025 16:25:31 +0000 (18:25 +0200)] 
cmake: drop never propagated C macros

Delete macros from `curl_config.h.cmake` that were never set by
the CMake script: `_LARGE_FILES`, `_THREAD_SAFE`, `const`, `size_t`.

Also:
- lib/config-riscos.h: drop `#undef _LARGE_FILES`. This is an
  IBM-specific macro, no need to unset it on other platforms.

Cherry-picked from #17576

Closes #17580

7 weeks agoDockerfile: update debian:bookworm-slim Docker digest to e5865e6
renovate[bot] [Wed, 11 Jun 2025 03:40:30 +0000 (03:40 +0000)] 
Dockerfile: update debian:bookworm-slim Docker digest to e5865e6

Closes #17579

7 weeks agoGHA/non-native: skip OpenBSD WebSocket tests to mitigate job timeouts
Viktor Szakats [Mon, 9 Jun 2025 16:30:48 +0000 (18:30 +0200)] 
GHA/non-native: skip OpenBSD WebSocket tests to mitigate job timeouts

Trying to avoid the occasional ~6-minute long delays seen in the OpenBSD
since last week. The long delay causes the CI job to timeout and fail:
https://github.com/curl/curl/actions/workflows/non-native.yml?page=2&query=branch%3Amaster

The exact reason is or test number is unknown. I base this attempt on
looking at the first occurrences and possible patches that may be
related.

The issue was first seen in CI within PR #17136:
```
[...]
Wed, 07 May 2025 07:10:30 GMT test 3014...[Check if %{num_headers} returns correct number of headers]
Wed, 07 May 2025 07:10:30 GMT s-p----e--- OK (1743 out of 1778, remaining: 00:02, took 0.195s, duration: 01:43)
Wed, 07 May 2025 07:10:30 GMT test 3016...[GET a directory using file://]
[long delay here]
Wed, 07 May 2025 07:16:17 GMT -------
Wed, 07 May 2025 07:16:17 GMT Error: The operation was canceled.
```
Ref: https://github.com/curl/curl/actions/runs/14877264415/job/41776966626#step:3:5566
Ref: https://github.com/curl/curl/actions/runs/14900320627/job/41850699301#step:3:5561 (next in PR)

Then in master, shortly after merging it via d3594be6531df3d5eafcdd09f84ad9dee1777028:
```
[...]
Mon, 02 Jun 2025 09:23:55 GMT test 3201...[HTTP GET when PROXY Protocol enabled and spoofed client IP]
Mon, 02 Jun 2025 09:23:55 GMT --p----e--- OK (1777 out of 1788, remaining: 00:00, took 0.222s, duration: 01:42)
Mon, 02 Jun 2025 09:23:55 GMT RUN: failed to start the HTTP/2 server
Mon, 02 Jun 2025 09:23:55 GMT test 3202...[HTTP-IPv6 GET with PROXY protocol with spoofed client IP]
[long delay here]
Mon, 02 Jun 2025 09:29:48 GMT --p----e--- OK (1778 out of 1788, remaining: 00:00, took 0.1
Mon, 02 Jun 2025 09:29:48 GMT Error: The operation was canceled.
```
Ref: https://github.com/curl/curl/actions/runs/15388587165/job/43292652793#step:3:5097
Ref: https://github.com/curl/curl/actions/runs/15390589464/job/43298911578#step:3:5097 (next in master)

Closes #17562

7 weeks agotests: drop mk-bundle exceptions
Viktor Szakats [Tue, 27 May 2025 19:20:36 +0000 (21:20 +0200)] 
tests: drop mk-bundle exceptions

Using a mixture of techniques to avoid symbols collisions:
- reduce scope.
- add `t*_` / `T*_` prefix.
- move shared functions to `testutil.c`.
  (`suburl()`, `rlim2str()`)
- clone re-used lib*.c sources.
  (lib587, lib645)
- include shared symbols just once in re-used `lib*.c` sources.
  (using `LIB*_C` guards.)
- drop re-used `lib*.c` sources where they were identical or
  unused.
- make macros global.
- #undef macros before use.

What remain is the entry functions `test`, and `unit_setup`,
`unit_stop` in unit tests.

Also:
- fix formatting and other minor things along the way.
- add `const` where possible.
- sync some symbol names between tests.
- drop `mk-bundle-hints.sh` that's no longer necessary.

Closes #17468

7 weeks agoschannel: drop Windows 2000 compatibility logic
Viktor Szakats [Sun, 25 May 2025 11:42:22 +0000 (13:42 +0200)] 
schannel: drop Windows 2000 compatibility logic

curl requires Windows XP as a minimum.

Co-authored-by: Jay Satiro
Closes #17447

7 weeks agowindows: reduce/stop loading DLLs at runtime
Viktor Szakats [Wed, 21 May 2025 17:37:55 +0000 (19:37 +0200)] 
windows: reduce/stop loading DLLs at runtime

- replace dynamic `InitSecurityInterface()` call with early binding and
  link `secur32` system DLL.
  The library and function are available in all supported curl Windows
  targets, meaning WinXP or newer.  Add small hack for mingw32ce to
  make it build.

- detect and use `if_nametoindex()` on Windows when available. Link
  `iphlpapi` system DLL. Requires targeting Vista or newer.
  Replacing the dynamic call and the pre-load optimization for lib3026.

Suggested-by: Jay Satiro
Closes #17413

7 weeks agoGHA/windows: make MSVC jobs use MSYS2 libraries: psl, OpenSSL, H2, libssh2
Viktor Szakats [Mon, 9 Jun 2025 14:07:05 +0000 (16:07 +0200)] 
GHA/windows: make MSVC jobs use MSYS2 libraries: psl, OpenSSL, H2, libssh2

Extend MSVC jobs with the option to use MSYS2 binary package as DLL
dependencies. Allow to use them alone (without vcpkg) or combined with
vcpkg packages. This saves the trouble of building these packages from
source and cache them manually.

This solution requires two tricks:
- workaround for zlib which installs a target-specific `zconf.h` that's
  not portable between platforms and C compilers.
- manual dependency configuration in CMake to ensure linking against
  the MSYS2 DLLs (and not it static libs). Static libs aren't portable
  to MSVC due to missing symbols `__chkstk_ms`, `_stack_chk_fail`,
  `_memcpy_chk`, `_stack_chk_guard`, and potentially other issues. CMake
  in MSVC mode, `linker.exe` and `pkg-config` pick the static libs by
  default. To pick `.dll.a` in favour of `.a`, these tools would have
  to be taught about this convention. An alternative is deleting static
  libs and see if `.dll.a` are picked-up automatically.

Using MSYS2 packages adds an install step taking 15-45 seconds per job.

It allowed to:
- re-enable libpsl for all MSVC jobs.
- convert the Intel 64-bit job to use MSYS2 without vcpkg, enabling
  brotli, zstd, OpenSSL 3.5.0, libssh2 (with OpenSSL cryprography) and
  nghttp2.

Using the same technique it's possible to re-enable more features
in MSVC builds, e.g. GnuTLS (also with H3), LibreSSL, mbedTLS, nghttp3,
ngtcp2, libssh, c-ares, gsasl, and replace vcpkg zlib, for faster runs.
What's missing compared to vcpkg is BoringSSL and wolfSSL
(the MSYS2-supplied build doesn't fit curl's requirements IIRC). These
could be built and cached manually.

Also:
- add workaround for zlib (classic) which uses a generated `zconf.h`,
  rendering the MSYS2 zlib header incompatible with MSVC.
- set the correct `msystem` for arm64.
- allow using MSVC without vcpkg.

Follow-up to cd0ec4784c1c0f873939f33ec1a73c8739f276b9 #17089

Closes #17561

7 weeks agocmake: document OpenSSL and ngtcp2 crypto lib custom variables
Viktor Szakats [Tue, 10 Jun 2025 08:42:26 +0000 (10:42 +0200)] 
cmake: document OpenSSL and ngtcp2 crypto lib custom variables

Cherry-picked from #17561

Closes #17574

7 weeks agoGHA/checksrc: `yq` is pre-installed, drop manual install
Viktor Szakats [Mon, 9 Jun 2025 14:26:58 +0000 (16:26 +0200)] 
GHA/checksrc: `yq` is pre-installed, drop manual install

Follow-up to 17a669426f36b467dfd945b4b35f6211598b7977 #17537

Cherry-picked from #17561

7 weeks agovauth: move auth structs to conn meta data
Stefan Eissing [Mon, 9 Jun 2025 13:09:28 +0000 (15:09 +0200)] 
vauth: move auth structs to conn meta data

Remove structs for negotiate, krb5, ntlm and gsasl from connectdata and
store them as connection meta data with auto cleanup.

De-complexify sasl mech selection by moving code into static functions.

Closes #17557

7 weeks agotests: fail torture if !valgrind&threaded resolver
Yedaya Katsman [Sat, 7 Jun 2025 18:44:35 +0000 (21:44 +0300)] 
tests: fail torture if !valgrind&threaded resolver

We don't check the memory debug output with the threaded resolver, so
the only way to do it with with valgrind.

Also move the disabling of memory tracking to where we log that we're
doing it.

Closes #17501

7 weeks agotests: torture: don't duplicate valgrind command
Yedaya Katsman [Wed, 4 Jun 2025 18:22:35 +0000 (21:22 +0300)] 
tests: torture: don't duplicate valgrind command

When running torture tests with valgrind enabled, the torture function
got a command line that already had the valgrind invocation in it. It
added another, at the end resulting in an empty valgrind log file.

Remove the duplicate logic adding valgrind, which already had a bit of
different logic that wasn't updated when the other one was.

Closes #17501

7 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 10 Jun 2025 05:48:17 +0000 (07:48 +0200)] 
RELEASE-NOTES: synced

7 weeks agocurl.h: remove the "RESERVED" error codes 17563/head
Daniel Stenberg [Mon, 9 Jun 2025 20:36:12 +0000 (22:36 +0200)] 
curl.h: remove the "RESERVED" error codes

Return codes for tests should be kept private.

Follow-up to 9465327084c920deee7ba5abbcd

Closes #17563

7 weeks agolib: make curlx_inet_ntop()
Daniel Stenberg [Mon, 9 Jun 2025 07:39:40 +0000 (09:39 +0200)] 
lib: make curlx_inet_ntop()

move function to curlx/, change all callers

Closes #17560

7 weeks agoGHA/hacktoberfest-accepted: prefer `GH_TOKEN`
Viktor Szakats [Sun, 8 Jun 2025 11:02:44 +0000 (13:02 +0200)] 
GHA/hacktoberfest-accepted: prefer `GH_TOKEN`

For the `gh` tool, over `GITHUB_TOKEN`. It accepts both, of which
the former seems to be preferred according to the source code and
documentation.

GHA/appveyor-status already uses `GH_TOKEN`.

Closes #17556

7 weeks agocurl_path: make SFTP handle a path like /~ properly.
Carlos Henrique Lima Melara [Thu, 5 Jun 2025 12:29:06 +0000 (14:29 +0200)] 
curl_path: make SFTP handle a path like /~ properly.

... without a trailing slash.

Fixes #17534
Closes #17542

7 weeks agopingpong: on disconnect, check for unflushed pingpong state
Stefan Eissing [Sun, 8 Jun 2025 10:00:00 +0000 (12:00 +0200)] 
pingpong: on disconnect, check for unflushed pingpong state

When a pingpong based protocol tries to perform a connection disconnect,
it sends a sort of "logout" command to the server, unless the connection
is deemed dead.

But the disconnect might happen before pingpong data has been completely
sent, in which case sending the "logout" will not work. Check the
pingpong state and do not "logout" when data is pending.

This was detected as a condition in fuzzing that triggered a debug
assert in the pingpong sending.

Closes #17555

7 weeks agotool_operate: fix return code when --retry is used but not triggered
Daniel Stenberg [Mon, 9 Jun 2025 06:37:49 +0000 (08:37 +0200)] 
tool_operate: fix return code when --retry is used but not triggered

Verify with test 752

Reported-by: fjaell on github
Fixes #17554
Closes #17559

7 weeks agoGHA: enclose `if` expressions in `${{ }}` where missing
Viktor Szakats [Fri, 6 Jun 2025 21:29:22 +0000 (23:29 +0200)] 
GHA: enclose `if` expressions in `${{ }}` where missing

Enclosing expressions in `${{ }}` is optional, but sometimes required.
It seems more straighforward to use it always rather than decide on
a case-by-case basis. Before this patch 71 `if`s were enclosed and 49
were not. Enclosing these makes it easy to grep and recognize these
whereever used.

https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/using-conditions-to-control-job-execution

Closes #17550

7 weeks agotool_getparam: fix --ftp-pasv
Dan Fandrich [Fri, 6 Jun 2025 17:21:09 +0000 (10:21 -0700)] 
tool_getparam: fix --ftp-pasv

This boolean option was moved to the wrong handling function. Make it
an ARG_NONE and move it to the correct handler and add a test to
verify that the option works.

Follow-up to 698491f44

Reported-by: fjaell on github
Fixes #17545
Closes #17547

7 weeks agoGHA: tidy up single-line `run` blocks
Viktor Szakats [Fri, 6 Jun 2025 20:15:02 +0000 (22:15 +0200)] 
GHA: tidy up single-line `run` blocks

Also double quote a shell variable.

Closes #17552

7 weeks agotests/servers.pm: add more ways to figure out current user
Daniel Stenberg [Thu, 5 Jun 2025 21:37:59 +0000 (23:37 +0200)] 
tests/servers.pm: add more ways to figure out current user

Some CI tests fail due to "Can't start ssh server due to lack of USER name" -
add more ways to try to figure it out if no environment variable works: the
whoami and id commands.

Closes #17544

7 weeks agoGHA/hacktoberfest-accepted: tidy up item order
Viktor Szakats [Fri, 6 Jun 2025 20:30:12 +0000 (22:30 +0200)] 
GHA/hacktoberfest-accepted: tidy up item order

`if`, then `env`, then `run`.

Also tidy up quotes in env entries.

Closes #17551

7 weeks agoCI: fix zizmor 1.9.0 warnings, shellcheck verify CI shell code, fix fallouts
Viktor Szakats [Thu, 5 Jun 2025 07:58:34 +0000 (09:58 +0200)] 
CI: fix zizmor 1.9.0 warnings, shellcheck verify CI shell code, fix fallouts

zizmor 1.9.0 effectively bans using GHA macros within shell script
snippets. Rework them to pass GHA macro values via envs and use those
envs in shell snippets. `${{ env.* }}` macros could be converted
to native env references after making their names shell-compatible.

Envs and shell commands can no longer be used in GHA macro values. Most
cases could be fixed by using literals. Passing quoted values with
spaces combined with other args also doesn't work anymore. This was
replaced by passing them separately.

Despite the initial complications, avoiding GHA macros in scripts does
seems to make the CI code reasonable cleaner. It also makes it possible
to analyze the scripts with shellcheck, finding subtle issues that went
unnoticed till now.

Also:
- un-ignore and fix three existing zizmor `template-injection` issues.
- add script to extract and shellcheck all shell code stored within GHA
  and Circle CI YAML files.
- add CI job to run this script.
- fix shellcheck issues discovered.
- fix minor differences between cmake and autotools FreeBSD jobs.
- merge cmake/autotools FreeBSD jobs to avoid developing unwanted
  differences again.
- fix/sync quote use across shell code.
- replace `$HOME` with `~` or literal where it made sense.
- replace most `brew --prefix` with literals.
- move all curl install tests to the `curl-install*` prefix.
- add missing curl install tests to cygwin/msys/mingw/*bsd.
- pipe to `tar` instead of storing downloads on disk.
- drop unnecessary `PKG_CONFIG_PATH` when building nghttp3.

Ref: https://github.com/curl/curl/actions/runs/15461461371/job/43523546041
Ref: https://github.com/zizmorcore/zizmor/releases/tag/v1.9.0

Follow-up to e522f47986bb72f194636e155191d7dccdc2d4fc #17278

Closes #17537

8 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 5 Jun 2025 11:54:53 +0000 (13:54 +0200)] 
RELEASE-NOTES: synced

Bump to 8.14.2 - a tentative version we probably will not release.

8 weeks agopytest: adapt for runs with openssl-1.1.1
Stefan Eissing [Thu, 5 Jun 2025 08:37:24 +0000 (10:37 +0200)] 
pytest: adapt for runs with openssl-1.1.1

Fix use of nghttpx fixture to be present even when h3 is not
available in curl. Fix TLS protocol versions expectations for
older openssl versions.

Closes #17538

8 weeks agopytest: disable test_07_37 and test_07_36 with openssl's quic
Stefan Eissing [Thu, 5 Jun 2025 08:44:32 +0000 (10:44 +0200)] 
pytest: disable test_07_37 and test_07_36 with openssl's quic

These tests fail often in CI and I have no motivation to find out why.
Disable the tests for openssl's own QUIC.

Closes #17539

8 weeks agofuzzer: get the deadlock unstuck
Stefan Eissing [Thu, 5 Jun 2025 11:17:02 +0000 (13:17 +0200)] 
fuzzer: get the deadlock unstuck

Change the workflow name to change the concurrency lock name so
that the invoked Fuzzer workflow does no longer lock the same name.

Closes #17541

8 weeks agocurl.h: make CURLSSLOPT_* symbols defined as longs
Daniel Stenberg [Thu, 5 Jun 2025 06:07:04 +0000 (08:07 +0200)] 
curl.h: make CURLSSLOPT_* symbols defined as longs

Help users get them used right.

Closes #17535

8 weeks agoINSTALL.md: cygwin details and add source code link
John Haugabook [Thu, 29 May 2025 23:51:10 +0000 (19:51 -0400)] 
INSTALL.md: cygwin details and add source code link

Added more details to help with cygwin install, adding links to curl
source code where relevant to help save people a little time.

Closes #17485

8 weeks agodocs/examples: add ftp-delete.c
Daniel Stenberg [Thu, 5 Jun 2025 09:05:38 +0000 (11:05 +0200)] 
docs/examples: add ftp-delete.c

To show how to delete a single file after a transfer

Closes #17540

8 weeks agosystem.h: remove some macros
Daniel Stenberg [Sat, 31 May 2025 16:47:23 +0000 (18:47 +0200)] 
system.h: remove some macros

Since curl_off_t is always 64 bit these days, we can simplify and avoid
using some macros.

Closes #17498

8 weeks agoCI: fix OpenBSD tests stall
Stefan Eissing [Wed, 4 Jun 2025 12:32:12 +0000 (14:32 +0200)] 
CI: fix OpenBSD tests stall

impacket could not be used as it neeeds package six

- openbsd does not find python3, add package six
- http2-server.pl: only warn about unknown parameter if not empty string

Closes #17532

8 weeks agoSCP/SFTP: avoid busy loop after EAGAIN
Stefan Eissing [Wed, 4 Jun 2025 13:26:55 +0000 (15:26 +0200)] 
SCP/SFTP: avoid busy loop after EAGAIN

The ssh libraries do not reveal if they still have data buffered from
the peer. Only when their buffers are read empty can curl be sure that
it is safe to rely on socket polling.

This change adds detection of EGAIN on receive in the transfer loop and
allows SFTP/SCP transfers to avoid a busy loop in such a case (which
should happen often when CPU exceeds network bandwidth).

Closes #17533

8 weeks agotest1117: reduce write delays
Stefan Eissing [Wed, 4 Jun 2025 07:40:32 +0000 (09:40 +0200)] 
test1117: reduce write delays

Test1117 seems to verify that a response, incoming slowly, is read
completely before sending another request on the same connection.

The previsou write delay of 1000ms made the test last 23+ seconds.
A delay of 100ms seems to achieve the same test on modern machines, but
the overall run time is less than 3 seconds.

Closes #17530

8 weeks agoRELEASE-NOTES: synced curl-8_14_1
Daniel Stenberg [Wed, 4 Jun 2025 05:40:18 +0000 (07:40 +0200)] 
RELEASE-NOTES: synced

8.14.1 release

8 weeks agoTHANKS: add names from 8.14.1 release
Daniel Stenberg [Wed, 4 Jun 2025 05:40:18 +0000 (07:40 +0200)] 
THANKS: add names from 8.14.1 release

8 weeks agocmake: enable `-std=gnu99` for Windows CE CeGCC
Viktor Szakats [Mon, 2 Jun 2025 19:15:45 +0000 (21:15 +0200)] 
cmake: enable `-std=gnu99` for Windows CE CeGCC

To sync with autotools, which auto-detects this option and enables it by
default.

It also makes it possible to compile unsuffixed long long integer
literals correctly, allowing to drop some legacy macros without bumping
into build errors like:
```
lib/vtls/schannel.c: In function 'schannel_send':
lib/vtls/schannel.c:1815: error: integer constant is too large for 'long' type
```
Ref: https://github.com/curl/curl/actions/runs/15374705821/job/43286736583?pr=17498#step:9:20

Bug: https://github.com/curl/curl/pull/17498#issuecomment-2925507481
Reported-by: Daniel Stenberg
Closes #17523

8 weeks agodllmain: exclude from Cygwin builds
Jeremy Drake [Tue, 3 Jun 2025 17:35:46 +0000 (10:35 -0700)] 
dllmain: exclude from Cygwin builds

On Cygwin, it is unsafe to call POSIX functions from DllMain, which
OPENSSL_thread_stop does.  Additionally, it should be unnecessary as
OpenSSL uses pthread_key_create to register a thread destructor to do
thread cleanup in a POSIX way.

Reported-by: Yuyi Wang
Ref: https://cygwin.com/pipermail/cygwin/2025-June/258235.html

Fixes #17262
Closes https://github.com/curl/curl/pull/17528

8 weeks agotls BIOs: handle BIO_CTRL_EOF correctly
Stefan Eissing [Tue, 3 Jun 2025 09:54:40 +0000 (11:54 +0200)] 
tls BIOs: handle BIO_CTRL_EOF correctly

Needs to return 1 if EOF from underlying filter has been seen.

Fixes #17471
Reported-by: Michael Kaufmann
Closes #17526

8 weeks agocurl: make -N handled correctly
Daniel Stenberg [Tue, 3 Jun 2025 11:34:08 +0000 (13:34 +0200)] 
curl: make -N handled correctly

Options marked ARG_NO should have their 'toggle' value reverted when the
short option is used as it implies using the --no- prefix.

-N happens be the only short option flag for a --no- long option.

Reported-by: Stefan Eissing
Closes #17527

8 weeks agoautotools: recognize more Linux targets when setting `-D_GNU_SOURCE`
Viktor Szakats [Mon, 2 Jun 2025 22:38:20 +0000 (00:38 +0200)] 
autotools: recognize more Linux targets when setting `-D_GNU_SOURCE`

To set `-D_GNU_SOURCE`.

Required to declare `accept4` on uclibc targets. `host_os` can have
the value `uclinux-uclibcgnueabi` in this case.

Fixing:
```
cf-socket.c: In function 'cf_tcp_accept_connect':
cf-socket.c:2141:18: error: implicit declaration of function 'accept4'; did you mean 'accept'? [-Werror=implicit-function-declaration]
 2141 |     s_accepted = accept4(ctx->sock, (struct sockaddr *) &add, &size,
```

Follow-up to 3d02872be7cfe6dcdef4b02321b47af19e1ce268 #16979

Reported-by: Kadambini Nema
Fixes #17512
Closes #17524

8 weeks agocmdline-docs: mention HTTP resumed uploads to be shaky
Daniel Stenberg [Mon, 2 Jun 2025 12:16:25 +0000 (14:16 +0200)] 
cmdline-docs: mention HTTP resumed uploads to be shaky

In the documentation for the --continue-at and --range options.

A future version could implement support for the new standard HTTP resumed
uploads mechanism.

Ref: #17510
Closes #17521