Commit graph

39513 commits

Author SHA1 Message Date
Daniel Stenberg
2a5d6a5502
curl_url_set.md: expand the CURLU_NO_AUTHORITY description
Closes #22515
2026-08-07 13:06:57 +02:00
Daniel Stenberg
ff4bab0a68
ldap_do: refactor error handling and simplify show_vals function
- (much) less code repetition

- simplifies ldap_do somewhat

Closes #22510
2026-08-07 11:45:19 +02:00
Stefan Eissing
7f6a75664f
dnsd: add support for DoH
dnsd now opens UDP+TCP sockets and accepts http: DoH requests to obtain
the same, configured answers (records, delays, error codes) as over UDP.

DoH: use `async->queries_ongoing` like all other resolvers instead of
the internal `pending` counter. Fixes waiting for results.

Tests: in pytest, parameterize dnsd tests to use both DNS and DoH.

Closes #22506
2026-08-07 09:20:12 +02:00
Dan Fandrich
24ff74fa8d CI: fix labeler matches for vdns file move 2026-08-06 08:24:02 -07:00
Daniel Stenberg
c04189523c
cookie: refuse to load cookies set against a PSL domain
Verified by test 409

Reported-by: 1rhino2 on hackerone

Closes #22500
2026-08-06 17:03:02 +02:00
Viktor Szakats
7db9947fcf
servers: drop CRT and curlx calls from main_window_loop() (Windows)
To simplify and to avoid the chance of potential interference or
thread-safety issues. If one these 3 Win32 API calls fail, there is
likely a serious problem, out of the code's control. Knowing
`GetLastError()` is unlikely to help.

Refs:
https://learn.microsoft.com/windows/win32/api/winuser/nc-winuser-wndproc
https://learn.microsoft.com/previous-versions/windows/desktop/legacy/ms686736(v=vs.85)
https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-getmessage
https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-createwindowexa
https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-registerclassa

Ref: 9ea48811fe #22487
Ref: 1c49f2f26d #18451
Follow-up to ac1e206278

Closes #22045
2026-08-06 16:06:28 +02:00
Daniel Stenberg
de9919f38a
TODO: ECH for QUIC
And drop:

- Consider OCSP stapling by default

It is a practice that is going out-of-style, so doing this by default now
seems wrong.

- Provide callback for cert verification

We have lots of options already. Let's not do this.

Closes #22504
2026-08-06 14:55:34 +02:00
Daniel Stenberg
26b9f3aa9b
rtsp: refactor method handling and improve error checks
- convert the method switch() to a simple table

- avoid converting the methods from external to internal numbers, they were
  the same anyway so keep the external ones, just use the old defines.

- fix range check. It wrongly used the method numbers as bitmask, which made
  the check not work previously. Also error on OOM.

- Dropped the session-id check. It too wrongly did a bitmask check which was
  wrong and never worked. When fixed, it broke test cases so I dropped the
  entire check.

- split out rtsp_setup_request() from rtsp_do()

- replace the httpversion variable with a define

Closes #22505
2026-08-06 14:51:32 +02:00
Daniel Stenberg
a478393759
psl: update a comment to understandable English
Closes #22502
2026-08-06 14:48:27 +02:00
Daniel Stenberg
b5716286e9
tests: keep test names shorter than 70 columns
- makes test names less complicated

- makes them less likely to wrap lines when using narrow terminals

- runtests now returns error for the test if the name is longer

- replace the "..." with a singe space

Closes #22492
2026-08-06 14:31:15 +02:00
Daniel Stenberg
abcb5349e3
cf-socket: disable TCP SYN retransmissions for localhost on Windows
Suggested-by: Marcel Jamin
URL: https://curl.se/mail/lib-2026-08/0002.html
URL: https://daniel.haxx.se/blog/2024/08/14/slow-tcp-connect-on-windows/

Closes #22494
2026-08-06 14:22:59 +02:00
Viktor Szakats
9ea48811fe
servers: drop duplicate (and interacting) ctrl handlers on Windows, add exit message
On Windows, the init code calls `SetConsoleCtrlHandler()`, and before
this patch also set handlers for all Unixy signals. Of these, `SIGBREAK`
(used on Windows-only), `SIGINT`, `SIGABRT` and `SIGTERM` were also
setting up a `SetConsoleCtrlHandler()`, in addition to the call made
directly. (The rest, `SIGHUP`, `SIGPIPE`, `SIGALRM` are either missing
the macros, or ignored by `signal()` on Windows.)

As per WINE sources, `SetConsolCtrlHandler(<h>, TRUE)` calls are
additive, which means the test server set up two console ctrl handlers.

Then the ctrl handler set directly (`ctrl_event_handler()`), was
triggering the other signal handler via `raise()`, for the 'initiate
exit' logic, which in turn triggered exiting a wait within `select_ws()`
and other loops. The Windows window handler also made use of the
`SIGTERM` event to initiate exit via `raise()` and the second signal
handler.

To simplify, de-duplicate the ctrl handlers by dropping `signal()` calls
and keeping the direct Win32 call with `ctrl_event_handler()` doing all
the signal handling on Windows. Break out the 'initiate exit' logic into
a function and call it from both Unix and Windows signal/ctrl/window
handlers. Also drop calling `raise()` on exit, because it's a no-op
without a `signal()` pair.

Also:
- drop logging the actual ctrl type number, replace with just logging
  whether we handled the event, in `ctrl_event_handler()`. To avoid
  using non-signal-safe functions (e.g. `fprintf()`) from the handler.
- also replace `logmsg()` with `WriteFile()` to prevent regressions.
  Ref: #22045
- replace `logmsg()` with `WriteFile()` in `main_window_proc()`.
- fix to forward ctrl handling to the OS in the rare case of failed
  `exit_event` initialization on startup. To swap a possible hang
  (within `WaitForMultipleObjectsEx()`) with an ungraceful shutdown.
- add support for an 'exit message' string, set by signal/ctrl handlers,
  and log it on app exit. To avoid the need to deal with logging within
  the handlers, yet have a static trace message about the event.
  Complementing the already logged signal number.
- drop stderr trace message from `exit_signal_handler()` in favor of an
  exit message. runtests triggers it frequantly, which added much noise
  to stderr. As a bonus, this also allows dropping the compiler warning
  suppression.
  Reported-by: Stefan Eissing
  Bug: https://github.com/curl/curl/pull/22487#issuecomment-5204092974
  Follow-up to 3aae64e4fb #22507

Refs:
https://learn.microsoft.com/windows/console/setconsolectrlhandler
https://learn.microsoft.com/windows/console/registering-a-control-handler-function
https://learn.microsoft.com/cpp/c-runtime-library/reference/raise
https://learn.microsoft.com/cpp/c-runtime-library/reference/signal
https://gitlab.winehq.org/wine/wine/-/blob/wine-11.14/dlls/kernelbase/console.c#L1517-1526
d6e817a4cc/misc/signal.cpp (L286-L348)

Follow-up to fe28fcf04c 7dc8a981fa 0e058776c0 #5260

Closes #22487
2026-08-06 14:03:51 +02:00
Viktor Szakats
3aae64e4fb
servers: drop complex and redundant signal handler output
In year 2020 the Unixy signal handler received a `logmsg()` call to log
the signal number, but at the same time it already saved it to a global
variable and logged it on exit, meaning this extra `logmsg()` was
redundant. Because `logmsg()` is not signal-safe, this call was replaced
in 2025 with signal-safe logging, but without the signal number, while
also adding complexity, spent on trying to open the log file and handle
errors. All for nothing, because the signal number was logged all along.

This patch removes all this, and simplifies it to a single, signal-safe
`write()` to STDERR to say that the signal handler triggered. This is
also non-critical, but may help debugging.

Also: point the POSIX documentation to the 2004 revision, which has a
shorter list of safe functions. (was: 2018)

Follow-up to e95f509c66 #16852
Follow-up to 9869f6dc5a #5218

Closes #22507
2026-08-06 12:48:45 +02:00
Viktor Szakats
3822fa8658
servers: de-duplicate shutdown signal/logging code
To share more common code between servers, and to log the same set of
information for all of them.

Also:
- move server unix socket to global variable.

Follow-up to d1eca3861c #22501
Follow-up to 1637bbc9ce #22498

Closes #22503
2026-08-06 11:16:09 +02:00
Daniel Stenberg
6e96c468d4
DEPRECATE.md: HTTP/2 Server Push gets removed in March 2027
URL: https://curl.se/mail/lib-2026-08/0003.html
Closes #22490
2026-08-06 11:14:31 +02:00
Viktor Szakats
d1eca3861c
servers: sync server port global variable across servers, make port variables uint16_t
Follow-up to 1637bbc9ce #22498

Closes #22501
2026-08-06 10:02:19 +02:00
Viktor Szakats
fd24c4bcf4
tests/server/dnsd: fix to install signal handlers on startup
To sync with the rest of code which already handled `got_exit_signal`
and did the restoration on exit. Also syncing with rest of servers.

Also: turn off `keep_sigalrm` to sync with most servers.

Closes #22499
2026-08-06 09:10:57 +02:00
Viktor Szakats
1637bbc9ce
servers: sync socket type global variables
Replace `ipv_inuse` and `use_ipv6` with `socket_type` and
`socket_domain` (where missing) to avoid dupliicate globals with
overlapping purposes. The replacement variables also support Unix
sockets.

Also:
- simplify/reduce IPv6 guards.
- socksd: fix to reset `socket_domain` for `--ipv4` option.

Closes #22498
2026-08-06 08:44:30 +02:00
Viktor Szakats
133785b159
servers: drop re-registering the signal handler on modern systems
Before this patch modern systems used `sigaction()` and `SA_RESTART` to
install signal handlers, but the signal handler function itself still
made a call to the legacy `signal()` function to re-register itself
before returning.

Re-registering the handler is not necessary with `sigaction()`. It's
also undesired to use the legacy API when the modern one is available.

Fix by guarding off this call in builds that support the modern API.

Follow-up to 3fb6e5a010 #6529
Follow-up to 18cbb4d7d6

Closes #22497
2026-08-05 19:34:52 +02:00
Viktor Szakats
b11e0026f7
GHA/windows: re-enable taskkill in torture jobs
Torture jobs are arguably the most flaky nowadays. Make a blind try to
see if re-enabling taskkill makes an observable improvement for torture.

Follow-up to 208b87744e #21039
Follow-up to f450f3801b #19897
Follow-up to 2701ac6a4d #19421

Closes #22495
2026-08-05 18:29:59 +02:00
Viktor Szakats
947ae0e0cc
servers: drop redundant guards on Windows
These `SIG*` macro are provided by all supported Windows toolchains.

Cherry-picked from #22487

Closes #22493
2026-08-05 15:09:12 +02:00
Viktor Szakats
b260e9f841
servers: fix to avoid a non-signal-safe call in signal handler
`strlen()` is only guaranteed to be signal-safe since POSIX.1-2008.

Ref: https://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html#tag_02_04_03

Reported by Copilot
Bug: https://github.com/curl/curl/pull/22487#pullrequestreview-4863961494
Follow-up to e95f509c66 #16852

Closes #22491
2026-08-05 15:09:12 +02:00
Daniel Stenberg
518a4dadff
RELEASE-NOTES: synced 2026-08-05 13:19:30 +02:00
Viktor Szakats
7babac8690
servers: fix HANDLE leak in UWP builds
Also: shorten code.

Reported by Copilot
Bug: https://github.com/curl/curl/pull/22487#pullrequestreview-4863399903

Closes #22489
2026-08-05 13:07:49 +02:00
Daniel Stenberg
90325ff044
http2: make server push transfers inherit share from parent
Reported-by: Stephan Zeisberg
Closes #22488
2026-08-05 11:52:08 +02:00
Stefan Eissing
69a224d6b4
vdns: directory for all DNS related sources
Move all DNS related source files from lib to lib/vdns. Fix
include paths, no furher changes.

Closes #22482
2026-08-05 08:09:07 +02:00
renovate[bot]
e5b5846c10
Dockerfile: Update debian:bookworm-slim Docker digest to abd67ff
Closes #22486
2026-08-05 08:01:28 +02:00
Viktor Szakats
69e8278149
servers: fix to reverse SA_RESTART option for sigaction() on modern codepath
Historically servers used the deprecated `siginterrupt()` function to
configure restart behavior on specific signals. It accepts a flag, where
1 means to remove the `SA_RESTART` option, and 0 means to enable it.

In year 2021 3fb6e5a010 introduced the
modern alternative to the codebase, replacing `siginterrupt()` with
`sigaction()`. After this patch, supporting, modern, systems reacted on
the same flag, but, by accident, set the `SA_RESTART` bit when flag is
1, and did not set it when 0. This reversed the previous behavior, and
the one still used on the `siginterrupt()` legacy codepath.

Fix it by revesring the `SA_RESTART` logic for the `sigaction()`
codepath, syncing it with the pre-existing behavior.

I find it odd this did not cause any perceivable issue for 5 years, even
though it's the active one in most Unix envs.

Spotted by GitHub Code Quality, though suggesting to fix
`siginterrupt()` calls. But looking into the history, those were correct
all along.

Refs:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/siginterrupt.html
https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigaction.html
https://www.man7.org/linux/man-pages/man3/siginterrupt.3.html
https://www.man7.org/linux/man-pages/man2/sigaction.2.html

Follow-up to 3fb6e5a010 #6529

Closes #22037
2026-08-04 17:36:14 +02:00
Daniel Stenberg
2112f185c0
TODO: do not consider APPDATA for netrc
See #22462
Closes #22480
2026-08-04 11:48:01 +02:00
Stefan Eissing
73a05428d4
dnscache: use Curl_peer in resolve and dnscache operations
Removes unused/duplicate members in async/ares/doh structs.

Closes #22446
2026-08-04 10:49:11 +02:00
Daniel Stenberg
7acf124614
url: rename Curl_init_do => Curl_init_transfer
And correct some comments

Closes #22474
2026-08-04 09:08:53 +02:00
Viktor Szakats
a368fbe968
curl_ed25519: add GnuTLS support (via nettle, hogweed)
The necessary cryptography API is provided by nettle 3.1+, via its
'hogweed' library. The minimum GnuTLS version required by curl is 3.6.5,
which requires nettle 3.4.1+, so the API is always available.

Also:
- autotools: detect and use nettle's hogweed library.
- cmake/FindNettle: add support for the hogweed library.
- GHA/http3-linux: enable in the autotools/cmake GnuTLS jobs.

Ref: 4353ea025a

Closes #22456
2026-08-03 16:48:08 +02:00
Daniel Stenberg
56457f838c
test557: test curl_mv*printf() functions
These functions were previously untested in the test suite. This is just
a set of basic invokes to make sure they work. The core of these
functions is identical and is tested already.

  - curl_mvfprintf
  - curl_mvprintf
  - curl_mvsnprintf
  - curl_mvsprintf
  - curl_mvaprintf

Closes #22472
2026-08-03 16:24:06 +02:00
Daniel Stenberg
1f860394e6
lib1560: add CURLU_NO_GUESS_SCHEME tests
Closes #22469
2026-08-03 14:00:11 +02:00
Daniel Stenberg
a2b178d378
tests: convert unit test 1396 and 1398 into libtests
They were previously unit tests but used only public library functions.

Closes #22471
2026-08-03 13:55:53 +02:00
Stefan Eissing
b3cd319655
curl_trc: remove unused expire timers
The expire timers
-  DNS_PER_NAME
-  DNS_PER_NAME2
-  HAPPY_EYEBALLS_DNS

are unused since we changed our happy eyeballing and handling of partial
resolve results.

Closes #22468
2026-08-03 13:10:16 +02:00
Daniel Stenberg
08679d89f5
multi: remove #if 0'ed code that uses old struct
Closes #22467
2026-08-03 10:55:44 +02:00
renovate[bot]
a946d40822
GHA: Update pizlonator/fil-c to v0.682
Closes #22464
2026-08-03 09:38:18 +02:00
Daniel Stenberg
54371bca75
lib: update mentions of the legacy "sessionhandle"
It is now "Curl_easy"

Follow-up to 434f8d0389 (June 2016)

Closes #22463
2026-08-03 08:57:36 +02:00
Viktor Szakats
c59b06c99c
sshserver.pl: bump an sshd config to use its modern name
Ref: ee9c0da803

Closes #22460
2026-08-02 11:47:46 +02:00
Viktor Szakats
0043b3fb8c
DEPENDENCIES.md: document minimum nettle version: 3.4.1 (2018-12-04)
It comes as a transitive requirement by the minimum GnuTLS version.
Because libcurl uses nettle directly (in GnuTLS builds), I figure it is
useful to document explicitly.

Refs:
4353ea025a
https://github.com/curl/curl/pull/22456#discussion_r3695417678
https://github.com/gnutls/nettle/releases/tag/nettle_3.4.1_release_20181204

Closes #22457
2026-08-02 10:30:59 +02:00
dependabot[bot]
d2ea63b17c
GHA: bump GitHub Actions and pips
- update `actions/checkout` from 7.0.0 to 7.0.1
- update `actions/labeler` from 6.1.0 to 7.0.0
- update `github/codeql-action/analyze` from 4.36.2 to 4.37.3
- update `github/codeql-action/init` from 4.36.2 to 4.37.3

- update `cryptography` from 48.0.1 to 49.0.0
- update `filelock` from 3.29.0 to 3.32.0
- update `impacket` from 0.13.0 to 0.13.1
- update `pytest` from 9.0.3 to 9.1.1
- update `websockets` from 16.0 to 16.1.1

Closes #22458
Closes #22459
2026-08-02 00:02:10 +02:00
Viktor Szakats
527573490e
GHA/http3-linux: enable HTTPSIG in jobs running tests
To test HTTPSIG with all supported OpenSSL forks.

Follow-up to a55731050e #22386 #21239

Closes #22453
2026-07-31 13:02:10 +02:00
Viktor Szakats
e9f6619694
curl_ed25519: drop unused wolfSSL random generator
Follow-up to a55731050e #22386 #21239

Closes #22451
2026-07-31 12:38:52 +02:00
Viktor Szakats
ca48bd076d
curl_ed25519: tidy-up backend fallback
Sync fallback logic with other crypto algos to:

- allow falling back to the next backend candidate when wolfSSL does not
  have ed25519 built in.

- de-duplicate fallback code.

Follow-up to a55731050e #22386 #21239

Closes #22450
2026-07-31 12:38:52 +02:00
Viktor Szakats
cb21a37a68
build: assume POSIX select() is available
This change effectively replaces an explicit compile-time #error with
a missing prototype error in environments not offering `select()`, and
saves curl-compatible systems from performing an explicit feature check.

Refs:
https://pubs.opengroup.org/onlinepubs/009695399/functions/pselect.html
https://linux.die.net/man/2/select

Closes #22448
2026-07-31 12:38:52 +02:00
Ramesh Adhikari
decc609085
h3-proxy: fix NULL deref when non-:status header arrives before :status
Closes #22449
2026-07-31 09:30:21 +02:00
Stefan Eissing
6e130eb484
apple-fast-udp: fix sendmsg_x partial results
When sending with sendmsg_x(), fix handling of last gso chunk being
smaller. Handle partial results correctly. Ignore SOCKEMSGSIZE by
reporting success which drops PMTUD probes into the void.

Closes #22429
2026-07-30 22:55:04 +02:00
Daniel Stenberg
5eb2f0757e
curl: help category cleanups
- add 'mqtt' as a category
- add more protocol categories to several options
- make --data worded better to also cover MQTT

Closes #22447
2026-07-30 16:17:55 +02:00
Viktor Szakats
1d7b8e6c29
gitignore: maintenance updates
- docs/cmdline-opts/.gitignore: also ignore `manpage.tmp.*`.
  Follow-up to a55731050e #22386 #21239

- ./.gitignore: drop obsolete entries.
  Follow-up to 4f38db1d28 #1923

Closes #22445
2026-07-30 12:00:22 +02:00