]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
5 weeks agotests: constify, make consts static
Viktor Szakats [Tue, 24 Jun 2025 14:50:23 +0000 (16:50 +0200)] 
tests: constify, make consts static

- lib509: constify an input string.
- add `static` to const data, where missing.
- tool1394: fix indentation.

Closes #17736

5 weeks agotests/server: move memory init to `memptr.c`
Viktor Szakats [Tue, 24 Jun 2025 14:42:17 +0000 (16:42 +0200)] 
tests/server: move memory init to `memptr.c`

To sync with tests/libtest.

Closes #17735

5 weeks agomk-lib1521: replace `printf` with `curl_mprintf`
Viktor Szakats [Tue, 24 Jun 2025 12:14:11 +0000 (14:14 +0200)] 
mk-lib1521: replace `printf` with `curl_mprintf`

Ref: #17731

Closes #17732

5 weeks agomulti: xfer table/bitset, handle limits
Stefan Eissing [Tue, 24 Jun 2025 10:57:04 +0000 (12:57 +0200)] 
multi: xfer table/bitset, handle limits

* calculate capacity growth on multi's xfer table and bitsets to
  work correctly when approaching UINT_MAX
* uint-bset: track the first 64bit slot used. This avoids slot scans
  on empty sets.
* uint-tbl: remove restriction to grow ot UINT_MAX, it is multi's
  job to enforce limits suitable for its use
* test751: use curl_mfprintf() for error messages

Closes #17731

5 weeks agobufq: remove the unused Curl_bufq_unwrite function
Daniel Stenberg [Tue, 24 Jun 2025 07:15:45 +0000 (09:15 +0200)] 
bufq: remove the unused Curl_bufq_unwrite function

Follow-up to 02edae54e8

Closes #17730

5 weeks agocmake: check USE_WINDOWS_SSPI when adding secur32 to CURL_LIBS
Joel Depooter [Tue, 24 Jun 2025 01:14:24 +0000 (18:14 -0700)] 
cmake: check USE_WINDOWS_SSPI when adding secur32 to CURL_LIBS

Instead of CURL_WINDOWS_SSPI.

When running CMake on Windows with no additional parameters (ie default
build configuration), the generated project files do not include the
`secur32.lib` library in the linker settings. This is because
the relevant check was looking at `CURL_WINDOWS_SSPI` instead of
`USE_WINDOWS_SSPI`.

`USE_WINDOWS_SSPI` is enabled when building with SChannel (the default
on Windows), or if `CURL_WINDOWS_SSPI` is specified on the command line.

Follow-up to 0d71b18153c8edb996738f8a362373fc72d0013b #17413

Closes #17728

5 weeks agoappveyor: move old cmake from VS2008 to VS2010
Viktor Szakats [Mon, 23 Jun 2025 19:29:47 +0000 (21:29 +0200)] 
appveyor: move old cmake from VS2008 to VS2010

In preparation of dropping the VS2008 job. To keep testing old cmake
(3.12.2) after that.

Closes #17725

5 weeks agobuild: stop checking for `sys/stat.h`
Viktor Szakats [Mon, 23 Jun 2025 17:48:19 +0000 (19:48 +0200)] 
build: stop checking for `sys/stat.h`

It has been used unconditionally in `src` and `tests` since at least
2011-09-19 via fdecb56cbfcafe5b770c4181133655b89973f41e. There are
earlier unguarded references in `tests`.

Also de-duplicate to include it just once.

Ref: https://github.com/curl/curl/pull/17717#issuecomment-2996631026

Closes #17724

5 weeks agotidy-up: replace `<memdebug.h>` with `"memdebug.h"` (src, units)
Viktor Szakats [Mon, 23 Jun 2025 14:53:33 +0000 (16:53 +0200)] 
tidy-up: replace `<memdebug.h>` with `"memdebug.h"` (src, units)

Closes #17722

5 weeks agounit1302: expand the base64 encode/decode tests
Daniel Stenberg [Mon, 23 Jun 2025 20:53:30 +0000 (22:53 +0200)] 
unit1302: expand the base64 encode/decode tests

Closes #17726

5 weeks agotests/server: de-dupe/merge three `sockdaemon()` clones into one
Viktor Szakats [Mon, 23 Jun 2025 12:51:37 +0000 (14:51 +0200)] 
tests/server: de-dupe/merge three `sockdaemon()` clones into one

Also: tidy up `if()` expressions here and there.

Follow-up to f4f25505df1d2ede727071eb0c518368a206f64b #15000

Closes #17719

5 weeks agobuild: drop explicit curlx from hdr paths, refer headers with `curlx/` prefix
Viktor Szakats [Fri, 20 Jun 2025 07:20:45 +0000 (09:20 +0200)] 
build: drop explicit curlx from hdr paths, refer headers with `curlx/` prefix

To make all src and test code refer to curlx headers the same way.

Also:
- src: move `curlx.h` include to `tool_setup.h`.
- src/tool_setup.h: drop stray `curlx/timeval.h`.
- servers: de-duplicate `curlx.h` and `curl_setup.h` includes.
- libtests, units: drop stray curlx sub-headers in favor of
  `<curlx/curlx.h>`.
- tests: include `curlx.h` with `<>` instead of `""`. To match
  other parts of the codebase.

Closes #17680

5 weeks agotests: use %b64[] to base64 data
Daniel Stenberg [Mon, 23 Jun 2025 13:53:54 +0000 (15:53 +0200)] 
tests: use %b64[] to base64 data

... instead of storing the data base64 encoded.

Closes #17721

5 weeks agoasyn-ares: remove redundant NULL check
NINIKA [Mon, 23 Jun 2025 14:12:57 +0000 (17:12 +0300)] 
asyn-ares: remove redundant NULL check

Closes #17720

5 weeks agotests: drop unused or redundant includes
Viktor Szakats [Mon, 23 Jun 2025 08:15:16 +0000 (10:15 +0200)] 
tests: drop unused or redundant includes

Closes #17717

5 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 23 Jun 2025 11:41:12 +0000 (13:41 +0200)] 
RELEASE-NOTES: synced

5 weeks agomulti: clear the dirty set of transfers no longer processing
Stefan Eissing [Mon, 23 Jun 2025 08:02:36 +0000 (10:02 +0200)] 
multi: clear the dirty set of transfers no longer processing

When a transfer is no longer processed, it might still apear in the
dirty bitset. Clear the dirty bit when this condition is encountered.

Closes #17718

5 weeks agotests/libtest: use `curltime` from curlx
Viktor Szakats [Mon, 23 Jun 2025 07:01:02 +0000 (09:01 +0200)] 
tests/libtest: use `curltime` from curlx

Replacing the local implementation.

Closes #17716

5 weeks agotests/libtest: call `curlx_now_init()` for unit 1399, 2600 (Windows)
Viktor Szakats [Mon, 23 Jun 2025 06:52:21 +0000 (08:52 +0200)] 
tests/libtest: call `curlx_now_init()` for unit 1399, 2600 (Windows)

Follow-up to 35d0c047ce713298f15771649ffe7662404628f0 #17641

Closes #17714

5 weeks agotests/dnsd: read config from file
Daniel Stenberg [Thu, 5 Jun 2025 20:59:24 +0000 (22:59 +0200)] 
tests/dnsd: read config from file

Make the <dns> tag in a test case control what is stored there. Also
documented. Make test 2102 and 2103 use the new tag.

Lets the test case config the A and AAAA contents the server replies
with. Initial work for the HTTPS RR exists, but does not yet work.

Closes #17543

5 weeks agolibcurl-env.md: drop LOGNAME, USER and NTLMUSER
Daniel Stenberg [Sun, 22 Jun 2025 22:25:00 +0000 (00:25 +0200)] 
libcurl-env.md: drop LOGNAME, USER and NTLMUSER

They were used for NTLM-WB, which support was removed for back in 8.8.0

Closes #17713

5 weeks agocmake: sync tests scripts with each other and autotools (more)
Viktor Szakats [Sun, 22 Jun 2025 20:19:20 +0000 (22:19 +0200)] 
cmake: sync tests scripts with each other and autotools (more)

Closes #17711

5 weeks agocmake: replace the way clang-tidy verifies tests, fix issues found
Viktor Szakats [Sun, 22 Jun 2025 01:17:33 +0000 (03:17 +0200)] 
cmake: replace the way clang-tidy verifies tests, fix issues found

Replace existing `mk-unity.pl` `--embed` workaround with running
`clang-tidy` manually on individual test source instead. This aligns
with how clang-tidy works and removes `mk-unity.pl` from the solution.

Also:
- mqttd: fix potentially uninitialized buffer by zero filling it.
  ```
  tests/server/mqttd.c:484:41: error: The left operand of '<<' is a garbage value
    [clang-analyzer-core.UndefinedBinaryOperatorResult,-warnings-as-errors]
    484 |       payload_len = (size_t)(buffer[10] << 8) | buffer[11];
        |                                         ^
  [...]
  tests/server/mqttd.c:606:45: error: The left operand of '<<' is a garbage value
    [clang-analyzer-core.UndefinedBinaryOperatorResult,-warnings-as-errors]
    606 |       topiclen = (size_t)(buffer[1 + bytes] << 8) | buffer[2 + bytes];
        |                                             ^
  ```
- sockfilt: fix potential out-of-bound pointer:
  ```
  tests/server/sockfilt.c:1128:33: error: The 2nd argument to 'send' is a buffer
     with size 17010 but should be a buffer with size equal to or greater than
     the value of the 3rd argument (which is 18446744073709551615)
     [clang-analyzer-unix.StdCLibraryFunctions,-warnings-as-errors]
   1128 |         ssize_t bytes_written = swrite(sockfd, buffer, buffer_len);
        |                                 ^
  ```
- clang-tidy: suppress bogus `bzero()` warnings that happens
  inside the notorious `FD_ZERO()` macros, on macOS.

Ref: https://github.com/curl/curl/pull/17680#issuecomment-2991730158

Closes #17705

5 weeks agoGHA/windows: drop MSYS2 runtime downgrades
Viktor Szakats [Sun, 22 Jun 2025 20:44:24 +0000 (22:44 +0200)] 
GHA/windows: drop MSYS2 runtime downgrades

No longer necessary after bumping the default runtime to a version
fixing the previously experienced performance drop.

Thanks to MSYS2/Cygwin teams for the help and fix.

Follow-up to 9a26be1e6ad45eb6c46af1d7a5e0be273b14fe1b #17708
Follow-up to d4896d94f2e9530d47bf519c9d9b790720bf10a4 #16424

Closes #17710

5 weeks agoGHA: update msys2/setup-msys2 digest to 40677d3
renovate[bot] [Sun, 22 Jun 2025 19:42:02 +0000 (19:42 +0000)] 
GHA: update msys2/setup-msys2 digest to 40677d3

After:
MINGW64_NT-10.0-20348 runnervmdy573 3.6.3-1f8def9f.x86_64 2025-06-18 07:19 UTC x86_64 Msys

Before:
MINGW64_NT-10.0-20348 runnervmdy573 3.5.7-2644508f.x86_64 2025-02-06 19:32 UTC x86_64 Msys

Closes #17708

5 weeks agorustls: don't try printing the not provided file
Yedaya Katsman [Sun, 22 Jun 2025 13:02:28 +0000 (16:02 +0300)] 
rustls: don't try printing the not provided file

Caught by gcc (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0:
```
vtls/rustls.c: In function ‘cr_connect’:
vtls/rustls.c:857:61: warning: ‘%s’ directive argument is null [-Wformat-overflow=]
  857 |     failf(data, "rustls: must provide certificate with key '%s'",
      |                                                             ^~
```

Closes #17704

5 weeks agoh2_serverpush: fix file handle leaks reported by clang-tidy
Viktor Szakats [Sun, 22 Jun 2025 08:18:12 +0000 (10:18 +0200)] 
h2_serverpush: fix file handle leaks reported by clang-tidy

clang-tidy (20.1.6) found it locally consistently. Missed in CI.

Closes #17706

5 weeks agocmake: configure c-ares header directory in project root (was: lib)
Viktor Szakats [Sun, 22 Jun 2025 18:10:55 +0000 (20:10 +0200)] 
cmake: configure c-ares header directory in project root (was: lib)

The c-ares header directory was added to the header path within `lib`,
as opposed to every other dependency which added them in the root
`CMakeLists.txt`. Such exception is no longer necessary. This patch
aligns c-ares header setup with the rest of dependencies. And also with
autotools, which also makes no exception here.

Cherry-picked from #17705
Cherry-picked from #16973

Closes #17707

5 weeks agotests: make individual test sources compile cleanly
Viktor Szakats [Sat, 21 Jun 2025 23:10:59 +0000 (01:10 +0200)] 
tests: make individual test sources compile cleanly

Tidy up headers and includes to ensure all individual test source
compile cleanly (but not link). To allow running clang-tidy (and
possibly other static analyzers) on them. It also improves readability
and allows to verify them locally, without the bundle logic.

clang-tidy ignores #included C files, so it's blind to bundle C files
the include these tests. The current workaround of embedding has
a couple of downsides:. meaningless filenames and line numbers,
missing issues, messing up self header paths. Thus, running it on
individual sources would be beneficial.

Also:
- de-duplicate includes.
- untangle some includes.
- formatting/indentation fixes.
- merge `getpart.h` into `first.h`.

Ref: https://github.com/curl/curl/pull/17680#issuecomment-2991730158

Closes #17703

5 weeks agocmake: drop reference to future variable [ci skip]
Viktor Szakats [Sun, 22 Jun 2025 11:19:07 +0000 (13:19 +0200)] 
cmake: drop reference to future variable [ci skip]

Follow-up to 855acb3bb07e0dd06b5722218eb5fded333f7ce0 #17701

5 weeks agotests/libtest: drop `TEST_HANG_TIMEOUT` redefinition hack
Viktor Szakats [Sun, 22 Jun 2025 09:17:07 +0000 (11:17 +0200)] 
tests/libtest: drop `TEST_HANG_TIMEOUT` redefinition hack

Before this patch the code relied on re-initializing `TEST_HANG_TIMEOUT`
macro before compiling each test, to allow them each to override it to
a custom value for single tests. Thie required re-including `test.h`
into each test.

After this patch this macro becomes a global, immutable, default. Tests
which want to override it can now use alternate macros that do accept
a custom timeout. The only test currently affected is lib1501.

Follow-up to 2c27a67daa1b76859c18d63e4e1f528db05b5e13 #17590

Closes #17702

5 weeks agocmake: add target property dumper helper function
Viktor Szakats [Sun, 22 Jun 2025 08:30:07 +0000 (10:30 +0200)] 
cmake: add target property dumper helper function

It's pretty rough and a giant hack, but helps debugging and findind ways
while navigating the CMake maze. I find it sad CMake doesn't have
a built-in function for this that works correctly in all situations.
It's invaluable to be able to see what properties and values an object
has.

It's also possible there is a better solution to this, but I could not
find it.

Cherry-picked from #16973

Closes #17701

5 weeks agocurl_get_line: make sure lines end with newline
Daniel Stenberg [Sat, 21 Jun 2025 20:35:41 +0000 (22:35 +0200)] 
curl_get_line: make sure lines end with newline

Verify with test 792 and 793

Reported-by: z2_
Closes #17697

5 weeks agotests/server: drop `memdebug.h`
Viktor Szakats [Sat, 21 Jun 2025 22:56:10 +0000 (00:56 +0200)] 
tests/server: drop `memdebug.h`

It's no longer used in any build configuration.

Follow-up to fffec3d7e90b032a03eee2192e68f8baf913b3b4 #17629

Closes #17700

5 weeks agodocs: mention that the netrc file works without port numbers
Daniel Stenberg [Sat, 21 Jun 2025 21:34:52 +0000 (23:34 +0200)] 
docs: mention that the netrc file works without port numbers

Closes #17698

5 weeks agotests/server/util.c: include netinet/in6.h
Daniel Stenberg [Sat, 21 Jun 2025 15:12:14 +0000 (17:12 +0200)] 
tests/server/util.c: include netinet/in6.h

for sockaddr_in6

Reported-by: Randall S. Becker
Bug: https://curl.se/mail/lib-2025-06/0016.html
Closes #17695

5 weeks agocf: replace the method get_host with query
Stefan Eissing [Thu, 22 May 2025 13:09:58 +0000 (15:09 +0200)] 
cf: replace the method get_host with query

Connection filters had a method `get_host()` which had not really been
documented. Since then, the cf had the `query()` method added. Replace
the separate get_host with query.

Add `CF_QUERY_HOST_PORT` as query to connection filters to retrieve
which remote hostname and port the filter (or its sub-filter) is talking
to. The query is implemented by HTTP and SOCKS filters, all others pass
it through.

Add `Curl_conn_get_current_host()` to retrieve the remote host and port
for a connection. During connect, this will return the host the
connection is talking to right now. Before/After connect, this will
return `conn->host.name`.

This is used by SASL authentication.

Closes #17419

5 weeks agomulti: add dirty bitset
Stefan Eissing [Wed, 18 Jun 2025 10:34:43 +0000 (12:34 +0200)] 
multi: add dirty bitset

Add a bitset `dirty` to the multi handle. The presence of a transfer int
he "dirty" set means: this transfer has something to do ASAP.

"dirty" is set by multiplexing protocols like HTTP/2 and 3 when
encountering response data for another transfer than the current one.
"dirty" is set by protocols that want to be called.

Implementation:

* just an additional `uint_bset` in the multi handle
* `Curl_multi_mark_dirty()` to add a transfer to the dirty set.
* `multi_runsingle()` clears the dirty bit of the transfer at
   start. Without new dirty marks, this empties the set after
   al dirty transfers have been run.
* `multi_timeout()` immediately gives the current time and
   timeout_ms == 0 when dirty transfers are present.
* multi_event: marks all transfers tracked for a socket as dirty.
  Then marks all expired transfers as dirty. Then it runs
  all dirty transfers.

With this mechanism:

* Most uses of `EXPIRE_RUN_NOW` are replaced by `Curl_multi_mark_dirty()`
* `Curl_multi_mark_dirty()` is cheaper than querying if a transfer is
  already dirty or set for timeout. There is no need to check, just do it.
* `data->state.select_bits` is eliminated. We need no longer to
  simulate a poll event to make a transfer run.

Closes #17662

5 weeks agobuild: tidy up `Makefile.inc` use in lib and src
Viktor Szakats [Sat, 21 Jun 2025 09:03:54 +0000 (11:03 +0200)] 
build: tidy up `Makefile.inc` use in lib and src

- cmake: use `CURL_RCFILES` instead of literal.
- cmake: use `LIB_RCFILES` instead of literal.
- cmake: fix comments.
- autotools: use `CURL_RCFILES` in `EXTRA_DIST`.
- autotools: use `LIB_RCFILES` in `EXTRA_DIST`.
- autotools: fix comments.
- autotools: fix indentation.

Closes #17694

5 weeks agoRELEASE-NOTES: synced rc-8_15_0-1
Daniel Stenberg [Sat, 21 Jun 2025 09:10:05 +0000 (11:10 +0200)] 
RELEASE-NOTES: synced

5 weeks agocurl: implement non-blocking STDIN read on Windows
DoI [Tue, 10 Jun 2025 11:13:35 +0000 (23:13 +1200)] 
curl: implement non-blocking STDIN read on Windows

Implements a seperate read thread for STDIN on Windows when curl is run
with -T/--upload-file .

This uses a similar technique to the nmap/ncat project, spawning a
seperate thread which creates a loop-back bound socket, sending STDIN
into this socket, and reading from the other end of said TCP socket in a
non-blocking way in the rest of curl.

Fixes #17451
Closes #17572

5 weeks agotop-complexity: lower max allowed complexity threshold to 90
Daniel Stenberg [Fri, 20 Jun 2025 21:31:33 +0000 (23:31 +0200)] 
top-complexity: lower max allowed complexity threshold to 90

Down from 100. Also make it show all functions with complexity > 65
(down from 70).

Closes #17689

5 weeks agolibssh: fix incorrect return value in myssh_in_AUTH_PKEY_INIT
Joel Depooter [Fri, 20 Jun 2025 22:44:02 +0000 (15:44 -0700)] 
libssh: fix incorrect return value in myssh_in_AUTH_PKEY_INIT

In the unlikely case that no SSH auth methods are supported, the
previous code would return 0 from myssh_in_AUTH_PKEY_INIT. However,
following the code path, it seems like it should be returning SSH_ERROR,
as set in myssh_to_ERROR (through myssh_to_GSSAPI_AUTH,
myssh_to_KEY_AUTH and myssh_to_PASSWD_AUTH).

In actuality, this is unlikely to occur, as the similar code in
myssh_in_AUTHLIST would have already returned an error in this scenario.
However setting a return value and then ignoring it is a bit fishy and
should be documented if this is intended.

I believe this used to return an error, but was changed in the recent
re-factoring of this code.

Closes #17691

5 weeks agotests: drop `BUNDLE_SRC` variable
Viktor Szakats [Sat, 21 Jun 2025 00:22:04 +0000 (02:22 +0200)] 
tests: drop `BUNDLE_SRC` variable

Derive it from `$BUNDLE` instead. autotools seems to be already relying
on `$BUNDLE_SRC` being equal to `$BUNDLE.c`. (I haven't realized this
before aaebb45f58b3f62876a68c17c71ac37d98f1b3bb.)

Also drop redundant `nodist_<target>_SOURCE` lines in tunits and units.

Follow-up to aaebb45f58b3f62876a68c17c71ac37d98f1b3bb #17688
Follow-up to 2c27a67daa1b76859c18d63e4e1f528db05b5e13 #17590

Closes #17692

5 weeks agocmake: omit clang-tidy on internal libs curlu and curltool
Viktor Szakats [Sat, 21 Jun 2025 08:00:22 +0000 (10:00 +0200)] 
cmake: omit clang-tidy on internal libs curlu and curltool

Skip clang-tidy while compiling curlu and curltool internal libraries.
To save about 1 minute per run. These libraries compile the lib and src
sources a second time, with the `UNITTESTS` macro enabled, which makes
tiny difference, for internal use. I figure it's not worth the extra CI
(and local) time because finding extra issues in these passes is
unlikely, and if found, not critical.

autotools also doesn't check curlu and curltool with clang-tidy.

Ref: https://github.com/curl/curl/pull/17680#issuecomment-2991730158
Ref: https://stackoverflow.com/questions/61867616/ignore-certain-files-when-using-clang-tidy
Ref: https://cmake.org/cmake/help/latest/prop_tgt/LANG_CLANG_TIDY.html

Follow-up to fabfa8e4024473035b3e5c3c30c330be726d9bb4 #15825

Closes #17693

5 weeks agovtls: change send/recv signatures of tls backends
Stefan Eissing [Wed, 11 Jun 2025 12:50:15 +0000 (14:50 +0200)] 
vtls: change send/recv signatures of tls backends

Similar to connection filter changes, return a CURLcode and the
read/written amount as size_t *.

Closes #17593

5 weeks agodocs: fix broken link in CODE_REVIEW.md
Fabrício Canedo [Tue, 17 Jun 2025 18:51:57 +0000 (15:51 -0300)] 
docs: fix broken link in CODE_REVIEW.md

In CODE_REVIEW.md file, the link that points to CONTRIBUTE was broken,
so I fixed this issue changing the link from only "CONTRIBUTE.md" to
"https://curl.se/dev/contribute.html".

Closes #17656

5 weeks agodocs: fix broken link in INSTALL.md
Fabrício Canedo [Tue, 17 Jun 2025 17:46:23 +0000 (14:46 -0300)] 
docs: fix broken link in INSTALL.md

In INSTALL.md file, the link that points to CURL-DISABLE was broken,
so I fixed this issue changing the link from only "CURL-DISABLE.md" to
"https://github.com/curl/curl/blob/master/docs/CURL-DISABLE.md".

Fixes https://github.com/curl/curl-www/issues/427
Closes #17654

5 weeks agodocs: fix docs for CURLOPT_PREQUOTE after #17616
Ethan Alker [Fri, 20 Jun 2025 21:50:49 +0000 (17:50 -0400)] 
docs: fix docs for CURLOPT_PREQUOTE after #17616

Closes #17690

6 weeks agotests: make `Makefile.inc` files 80 columns
Daniel Stenberg [Sun, 15 Jun 2025 10:53:43 +0000 (12:53 +0200)] 
tests: make `Makefile.inc` files 80 columns

Since all code fits within that, it is more convenient.

Co-authored-by: Viktor Szakats
Follow-up to 2c27a67daa1b76859c18d63e4e1f528db05b5e13 #17590

Closes #17623

6 weeks agoGHA: update rojopolis/spellcheck-github-actions digest to 35a02ba
renovate[bot] [Fri, 20 Jun 2025 19:55:50 +0000 (19:55 +0000)] 
GHA: update rojopolis/spellcheck-github-actions digest to 35a02ba

Closes #17686

6 weeks agoftplistparser: split parse_unix into sub functions
Daniel Stenberg [Thu, 12 Jun 2025 11:42:28 +0000 (13:42 +0200)] 
ftplistparser: split parse_unix into sub functions

Closes #17608

6 weeks agodocs: fix documentation of connect_only 2
Stefan Eissing [Mon, 16 Jun 2025 07:54:20 +0000 (09:54 +0200)] 
docs: fix documentation of connect_only 2

Setting CURLOPT_CONNECT_ONLY with value 2 is only defined
for WebSocket and the effect on other protocols is undetermined.
That includes the HTTP urls.

Fixes #17621
Reported-by: Kirill Obukhov
Closes #17635

6 weeks agoftp: fix prequotes for a directory in URL
Bartosz Ruszczak [Fri, 14 Mar 2025 20:53:42 +0000 (21:53 +0100)] 
ftp: fix prequotes for a directory in URL

Allow prequotes to be sent after curl has changed the working directory,
just before the listing command if the URL is a directory.

FTP state machine is updated with the new FTP_LIST_PREQUOTE state and
FTP_RETR_LIST_TYPE type.

Test 754 verifies

Fixes #8602
Closes #17616

6 weeks agotest1599: verify a bad FTP password with no user
Daniel Stenberg [Fri, 20 Jun 2025 20:13:42 +0000 (22:13 +0200)] 
test1599: verify a bad FTP password with no user

Verifies the fix from #17659

Closes #17687

6 weeks agourl: fix NULL deref with bad password when no user is provided
z2_ [Wed, 18 Jun 2025 02:27:05 +0000 (04:27 +0200)] 
url: fix NULL deref with bad password when no user is provided

Closes #17659

6 weeks agotests: drop useless "nodist_SOURCES" assignments
Daniel Stenberg [Fri, 20 Jun 2025 20:51:41 +0000 (22:51 +0200)] 
tests: drop useless "nodist_SOURCES" assignments

They cause automake warnings and have no effect.

Closes #17688

6 weeks agoxfer: manage pause bits
Stefan Eissing [Tue, 17 Jun 2025 11:13:26 +0000 (13:13 +0200)] 
xfer: manage pause bits

Concentrate the handling of KEEP_RECV_PAUSE and KEEP_SEND_PAUSE into
common transfer functions. Setting or clearing these bits requires
subsequent actions involving connection events and client reader/writer
notifications. Have it in one place.

Closes #17650

6 weeks agohttp: explicitly ignore parsing errors for Retry-After
Daniel Stenberg [Fri, 20 Jun 2025 11:38:22 +0000 (13:38 +0200)] 
http: explicitly ignore parsing errors for Retry-After

Add (void) and explain in comment.

Closes #17682

6 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 20 Jun 2025 11:08:55 +0000 (13:08 +0200)] 
RELEASE-NOTES: synced

6 weeks agoconnection: eliminate member `remote_addr`
Stefan Eissing [Mon, 19 May 2025 12:38:22 +0000 (14:38 +0200)] 
connection: eliminate member `remote_addr`

Used to be a pointer set (and cleared) by the socket connection filters
to a struct in their contexts. Instead, add a filter query method to
obtain the pointer when needed.

Closes #17385

6 weeks agoautotools: drop `$top_builddir/src` from src header path
Viktor Szakats [Fri, 20 Jun 2025 07:40:21 +0000 (09:40 +0200)] 
autotools: drop `$top_builddir/src` from src header path

There is no generated header or source in `$top_builddir/src`, that src
would #include. Also syncing with cmake.

Closes #17679

6 weeks agocmake: simplify handling generated `lib1521.c` in libtests
Viktor Szakats [Thu, 19 Jun 2025 18:58:31 +0000 (20:58 +0200)] 
cmake: simplify handling generated `lib1521.c` in libtests

Also unfold line and sync with other tests.

Closes #17676

6 weeks agobuild: sync curlx build variables and script
Viktor Szakats [Thu, 19 Jun 2025 15:14:47 +0000 (17:14 +0200)] 
build: sync curlx build variables and script

Between src and tests, both in autotools and cmake.

Closes #17675

6 weeks agolib530, 582: smoothen out minor differences
Viktor Szakats [Tue, 17 Jun 2025 08:50:43 +0000 (10:50 +0200)] 
lib530, 582: smoothen out minor differences

Fix indentation, casts, a few other minor difference between these tests
that share a common codebase.

Closes #17649

6 weeks agocmake: build `stubgss` library for libtests to match autotools
Viktor Szakats [Tue, 17 Jun 2025 18:10:28 +0000 (20:10 +0200)] 
cmake: build `stubgss` library for libtests to match autotools

Used by test 2056 and 2057, in a way that's Linux- & autotools-specific.
This patch builds it for all Unix, syncing cmake with autotools.

Adapt the two tests to find the library in CMake builds as well.

Tested OK on Linux. (CI does not test this. The corresponding jobs build
in debug mode, while the `LD_PRELOAD` feature is locked to non-debug.)

On macOS it didn't load without building everything for aarch64e arch:
"../bld/tests/libtest/libstubgss.dylib' (mach-o file, but is
an incompatible architecture (have 'arm64', need 'arm64e'))"
With that fixed it still did not load correctly and/or the tests did not
pass. So, for macOS these tests remain disabled.

Also:
- GHA/macos: build for aarch64e. (recognized by Apple clang as of this
  patch. llvm and gcc fall back to aarch64.)

Follow-up to 56d949d31ad182a22bd3bad25b1a902b635d549d #1687

Closes #17653

6 weeks agotest1596: let test pass after year 2036
Bernhard M. Wiedemann [Thu, 19 Jun 2025 07:10:50 +0000 (09:10 +0200)] 
test1596: let test pass after year 2036

Background:
As part of my work on reproducible builds for openSUSE, I check that
software still gives identical build results in the future. The usual
offset is +16 years, because that is how long I expect some software
will be used in some places. This showed up failing tests in our package
build. See https://reproducible-builds.org/ for why this matters.

I tested that it passes on x86_64 in year 2041 and i586 in year 2037.

(but on i586, I got `TESTFAIL: These test cases failed: 31 46 61 1415`)

Closes #17665

6 weeks agoeasy: fix comment-documentation
bch [Wed, 18 Jun 2025 23:54:03 +0000 (16:54 -0700)] 
easy: fix comment-documentation

-> easy_perform() is the INTERNAL interface that performs a blocking[...]

Closes #17664

6 weeks agowarnless: drop parts of the `read`/`write` preprocessor hack (Windows)
Viktor Szakats [Thu, 19 Jun 2025 12:41:34 +0000 (14:41 +0200)] 
warnless: drop parts of the `read`/`write` preprocessor hack (Windows)

The `#undef` hack is no longer necessary after changing the redifitions
to not map back to the original symbols.

This makes it unnecessary to repeat the redefinitions after compiling
`warnless.c` itself (in unity mode).

Which in turns makes it unnecessary to include `warnless.h` again, to
trigger such redefinition.

This also means that `read`/`write` are now redefined on Windows from
the first inclusion of `warnless.h`.

Also:
- tests/server: drop a repeat `warnless.h` include, that is unnecessary
  after this patch.
- tests/unit: drop repeat `warnless.h` include.
- tests/libtest: drop repeat `warnless.h` includes.
- tests/libtest: formatting.

Follow-up to 2f312a14da94068d58b6a39f79f82acd0bf82149 #17619
Follow-up to 84338c4de2d7c798e3c270c9610d51a4ad18a90b #12331
Follow-up to 6239146e931fd3127f6994975a56d1b4884a708a

Closes #17673

6 weeks agotftpd: use `CURLMIN()` macro
Viktor Szakats [Thu, 19 Jun 2025 13:24:16 +0000 (15:24 +0200)] 
tftpd: use `CURLMIN()` macro

Closes #17674

6 weeks agolib: make `CURLX_SET_BINMODE()` and use it
Viktor Szakats [Thu, 19 Jun 2025 12:05:25 +0000 (14:05 +0200)] 
lib: make `CURLX_SET_BINMODE()` and use it

Use it from libtests' `first.c` and thus also from units, and tunits.

Also:
- cmake: drop stray `curltool` lib dependency for units.
- units: stop depending on `src` headers.
- tests/server: drop depending on `src` headers.
  (the remaining one listed in the comments, `tool_xattr.h`, was not
  actually used from servers.)
- tests/server: drop duplicate curlx headers.
  (Except `warnless.h`, which is tricky on Windows.)

Closes #17672

6 weeks agolib: make `curlx_wait_ms()` and use it
Viktor Szakats [Mon, 16 Jun 2025 13:20:17 +0000 (15:20 +0200)] 
lib: make `curlx_wait_ms()` and use it

Move function to curlx/, change all callers.

Also:
- src: replace local implementation.
- tests/client: replace local ad-hoc sleep code.
- tests/libtest: replace local `wait_ms()` implementation.
- lib1531: replace local ad-hoc sleep code.
- tests/server: replace local, simplified copy.
- tests/server: formatting, drop some unused headers.

Closes #17641

6 weeks agotests/server: make all global vars/funcs static
Viktor Szakats [Thu, 19 Jun 2025 10:28:49 +0000 (12:28 +0200)] 
tests/server: make all global vars/funcs static

Also merge `util.h` into `util.c`.

Closes #17671

6 weeks agobuild: tidy up header paths, use srcdir where possible
Viktor Szakats [Sat, 14 Jun 2025 15:06:58 +0000 (17:06 +0200)] 
build: tidy up header paths, use srcdir where possible

To improve readability.

Also add more comments on why each is necessary.

Closes #17630

6 weeks agocmake: use `target_link_options()` when available
Viktor Szakats [Thu, 19 Jun 2025 09:54:47 +0000 (11:54 +0200)] 
cmake: use `target_link_options()` when available

To pass `-municode` to the linker. Before this patch we passed this via
`target_link_libraries()` which is designed to pass libraries. Keep
using it for old CMake versions, where no better alternative existed.

https://cmake.org/cmake/help/latest/command/target_link_options.html

Also:
- also pass `-municode` as `PRIVATE` for old cmake versions.
  (it should not make a difference because no target depends on the curl
  tool, but this seem to be the modern, non-ambiguous syntax.)
- unfold a bunch of split lines for greppability of `add_library()` and
  `add_executable()` commands.
- quote a string.

Closes #17670

6 weeks agocmake: sync `target_link_libraries()` order in tests more
Viktor Szakats [Thu, 19 Jun 2025 09:52:50 +0000 (11:52 +0200)] 
cmake: sync `target_link_libraries()` order in tests more

Closes #17669

6 weeks agotests/client: drop autotools logic no longer necessary
Viktor Szakats [Thu, 19 Jun 2025 09:28:39 +0000 (11:28 +0200)] 
tests/client: drop autotools logic no longer necessary

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

Follow-up to 539d11297d36cff0bca7dda1f217186f060d577d #17642

Closes #17668

6 weeks agocmake: sync tests scripts by using the variable `BUNDLE`
Viktor Szakats [Thu, 19 Jun 2025 08:22:27 +0000 (10:22 +0200)] 
cmake: sync tests scripts by using the variable `BUNDLE`

To reduce the diff between tests CMakeFiles.txt, and syncing with
autotools, which already used the `BUNDLE` variable like this.

Also:
- fold lines that went over 132 chars after this change.
- autotools: sync order of macros with cmake.

Closes #17667

6 weeks agoautotools: simplify configuration in tests, examples
Viktor Szakats [Wed, 18 Jun 2025 08:33:15 +0000 (10:33 +0200)] 
autotools: simplify configuration in tests, examples

- GHA/windows: make a mingw autotools build static only.
- GHA/windows: fix a CI script issue with the build above.
- src: fix to pass `LIBCURL_PC_LIBS_PRIVATE` instead of `LINKFLAGS`.
  This makes the libs propagate to tunits, making the local hack there
  unnecessary. `LINKFLAGS` had this single use in the repo, and it was
  empty in local tests.
- tests: drop passing redundant `LIBCURL_PC_LDFLAGS_PRIVATE`.
- tests: drop redundant target name from config variables.
- examples, tests/client: drop `LIBDIR` temp variables with single uses.
- examples, tests: formatting to sync `Makefile.am` scripts with each
  other.

Closes #17661

6 weeks agotests/client: use `curl_mfprintf()`
Viktor Szakats [Tue, 17 Jun 2025 17:57:28 +0000 (19:57 +0200)] 
tests/client: use `curl_mfprintf()`

Replacing `fprintf()`. `curl_mfprintf()` is a public libcurl API.

Following the same change made for libtests.

Follow-up to 255aac56f9773d7c138816bfe0390293f7da33a5 #17253

Closes #17651

6 weeks agobuild: sync build scripts between client/libtest
Viktor Szakats [Wed, 18 Jun 2025 08:26:42 +0000 (10:26 +0200)] 
build: sync build scripts between client/libtest

Closes #17660

6 weeks agocmake: move `OUTPUT` argument in the `add_custom_command()` line
Viktor Szakats [Tue, 17 Jun 2025 19:08:02 +0000 (21:08 +0200)] 
cmake: move `OUTPUT` argument in the `add_custom_command()` line

For greppability.

Closes #17658

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