7210 Commits

Author SHA1 Message Date
Daniel Stenberg
6d6899c2f0 tool: support fractions for --limit-rate and --max-filesize
Allow 2.5k or 3.7M etc. Add mention in documentation.

Verify in test case 1623.

Closes #20266
2026-01-17 23:25:26 +01:00
Daniel Stenberg
6aaac9dd38 vquic: drop support for OpenSSL-QUIC
- It is slower and uses more memory than the alternatives and is only
  experimental in curl.
- We disable a few tests for OpenSSL-QUIC because of flakiness
- It gets little attention from OpenSSL and we have no expectation of the
  major flaws getting corrected anytime soon.
- No one has spoken up for keeping it
- curl users building with vanilla OpenSSL can still use QUIC through the
  means of ngtcp2

Closes #20226
2026-01-17 22:49:34 +01:00
Daniel Stenberg
6c31df453b mqtt: initial support for MQTTS
Closes #19418
2026-01-17 22:43:36 +01:00
Viktor Szakats
57ff2d6c91 dns: flatten the include tree
Closes #20106
2026-01-17 11:45:18 +01:00
Stefan Eissing
1a57302d1a ratelimit: download finetune
When a download size is known and rate limiting is in effect, adjust the
duration of each measurement step and its rate for maximum precision.

Since it is unpredictable how long the last bytes of a download will
take, download speed can be thrown off if the "last bytes" are a
significant amount of the total download. Make the "last bytes" small in
comparision to the rest and "stretch" the rate limit intervals to
accommodate the difference.

Fix ngtcp2 receive data acknowldgements to be based on a local window
size tracking. This allows window updates controlled by rate limits.

Fix ratelimit wait time calculation to accomodate negative tokens.

h3 rate limit, update timeers

Make download rate limits work correctly in ngtcp2. Fix multi handling
of rate limits to set a timer for when limits will update again.

Without running the transfer on limit updates, protocols like h2/h3 may
stall if the server does not send due to stream windows being too small.

scorecard: measure download speedlimits

When running scorecard with --limit-rate=n, show the reported download
speed averages plus percentage deviation from the limit.

Closes #20228
2026-01-16 16:42:31 +01:00
calm329
de69e67793 imap: skip literals inside quoted strings
Fixes #20320
Closes #20322
2026-01-15 22:38:15 +01:00
Viktor Szakats
ac6264366f tidy-up: miscellaneous
- tool_bname: scope an include.
- `endif` comments.
- Markdown fixes.
- comment tidy-ups.
- whitespace, newlines, indent.

Closes #20309
2026-01-15 13:06:13 +01:00
Viktor Szakats
62ba3604dc checksrc: do not apply BANNEDFUNC to struct member functions
Omit this warning, when `close()` is banned:
```
./lib/vtls/vtls.c:947:13: warning: use of close is banned (BANNEDFUNC)
   Curl_ssl->close(cf, data);
             ^
```
Ref: https://github.com/curl/curl/actions/runs/21012427938/job/60410334312?pr=20212#step:3:6

Ref: #20212

Closes #20323
2026-01-15 02:06:06 +01:00
Viktor Szakats
2623e333fd build: drop stray ifndef guards for local/internal macros
For:
- lib/vtls: `MAX_PINNED_PUBKEY_SIZE`.
- src: `UNPRINTABLE_CHAR`.
- tests/server/tftpd: `PKTSIZE`.

Closes #20314
2026-01-14 12:53:14 +01:00
Daniel Stenberg
134fb66121 digest: handle quotes in the path
- The 'uri' component needs to be escaped as well
- Rewrote the quote function to use dynbuf
- Build the digest at least partly with dynbuf
- Use goto as a general error mechanism
- Make test 64 use a double quote in the URL

Closes #20295
2026-01-14 09:57:00 +01:00
Viktor Szakats
2949faa93c badwords: fix typos found
Not caught in CI.

Closes #20308
2026-01-14 03:11:33 +01:00
Viktor Szakats
4651d4c76b badwords: catch and fix more variants of NN-bit
Closes #20304
2026-01-14 02:35:00 +01:00
Viktor Szakats
7d9004ee47 build: drop duplicate C includes
- `stdlib.h` and `string.h` is included via `curl_setup_once.h`,
  allowing to drop from `tests/server` sources and `tool_doswin.c`.

- `stdlib.h` is also included via `setup-vms.h` (earlier than above),
  allowing to drop it from `curl_addrinfo.h` on VMS.

Closes #20303
2026-01-14 00:55:05 +01:00
Viktor Szakats
0431cbe71a build: globally suppress DJGPP warnings in FD_SET()
Replacing the many local `#pragma` used before this patch,
reducing the number of `__DJGPP__` guards from 58 to 13.

Closes #20299
2026-01-13 23:17:10 +01:00
dependabot[bot]
ad8374aedc GHA: bump pip-dependencies
- update `ruff` from 0.14.10 to 0.14.11
- update `filelock` from 3.20.1 to 3.20.3 (CVE-2026-22701) (used in pytests)
- update `psutil` from 7.2.0 to 7.2.1

Closes #20300
2026-01-13 23:17:10 +01:00
Viktor Szakats
60f9d3dd7b build: omit forward declarations
- drop redundant forward declarations.
- reorder local functions to not need forward declarations.
- tftpd: merge two `ifdef` blocks.

Closes #20297
2026-01-13 21:15:36 +01:00
Viktor Szakats
b6298a2336 mod_curltest: silence unused argument compiler warning
Closes #20292
2026-01-13 17:43:35 +01:00
Viktor Szakats
80739fa89d tests/server: use CURL_PRINTF(), drop -Wformat-nonliteral workaround
Closes #20286
2026-01-13 14:27:27 +01:00
Daniel Stenberg
f057ed05be checksrc: warn for leading spaces before the preprocessor hash
Fix the 40+ fallouts

Closes #20282
2026-01-13 09:52:26 +01:00
Viktor Szakats
3ee1d3b573 tidy-up: merge root packages directory into projects
To simplify the directory layout.

- OS400 and vms support move from `packages` to `projects`.

- Windows README and `generate.bat` files move from `projects`
  to `projects/Windows`.

Closes #20271
2026-01-12 23:49:35 +01:00
Jay Satiro
3652127e81 tool_cb_hdr: suppress header output when --out-null
This change brings --out-null more in line with the documentation which
says --out-null is expected to behave like a portable -o /dev/null.

Prior to this change curl did not suppress the header output from --head
when --out-null was used to suppress output.

Assisted-by: Daniel Stenberg
Reported-by: Andrew Kvalheim

Ref: https://curl.se/docs/manpage.html#--out-null

Fixes https://github.com/curl/curl/discussions/20235
Closes https://github.com/curl/curl/pull/20256
2026-01-12 15:36:44 -05:00
Daniel Stenberg
44312b4b11 mimepost: allocate main struct on-demand
This makes the easy handle 432 bytes smaller (totally 5352 bytes on my
rather maximized Linux 64 bit build). The 440 byte mimepost struct is
now allocated only when needed.

Closes #20260
2026-01-12 16:21:02 +01:00
Daniel Stenberg
31fbbb322e altsvc: only accept 17 byte dates from files
Since the date format is fixed there is no need to accept more data.

Update test355 to verify reject of too long date in alt-svc file

This test case was originally supposed to verify alt-svc loading from a
file but never did because it was done incorrectly.

Now it verifies that a too long date in the input file makes curl
disregard the entry.

Closes #20259
2026-01-12 13:49:57 +01:00
Daniel Stenberg
0159100f4f lib: use (u)int64_t instead of long long
Remove config-plan9.h because it does not support 64 bit, meaning it has
not been working for years.

Closes #20233
2026-01-10 12:40:54 +01:00
Stefan Eissing
3b261e2ad7 pytest: bump quiche version check update
Since the Lazy Lucas did not manage to get the fix merged in 0.24.7,
increase the pytest version check number in the hope that it will happen
in the next release.

Closes #20229
2026-01-09 15:47:27 +01:00
Daniel Stenberg
13c1a93414 lib: remove uses of PRIu32 by adding "hack" for DJGPP
Avoid using PRIu32 and PRId32 in product source code. We don't need it.
It reduces readability. It is also inconsistent since unsigned int has
the same size and does not require the define.

DJGPP warns about using %u for uint32_t by default because it seems to
typedef it to unsigned long instead of unsigned int. Which even that is
annoying since long and int are both 32 bit on this platform.

We use our own *printf() implementation and we know this is safe.

This work-around defines uint32_t for DJGPP into unsigned int to avoid
the warnings and thus the need to use PRIu32 and PRId32.

Closes #20215
2026-01-08 14:15:47 +01:00
Viktor Szakats
8881a52ab0 tests: fix to use uint32_t where necessary
Fixes MS-DOS DJGPP buidls, possibly others.

Follow-up to e70436a88a #20200
Follow-up to 4701a6d2ae #19695

Closes #20210
2026-01-07 17:01:06 +01:00
Daniel Stenberg
5f612acaa1 urlapi: split parts of parseurl() into sub functions
- parse_file
- parse_scheme
- guess_scheme
- handle_fragment
- handle_query
- handle_path

Closes #20205
2026-01-07 14:31:08 +01:00
pojomi
dc739fee16 config2setopts: add space in cookie header with multiple -b
Closes #20184
2026-01-05 23:32:00 +01:00
Daniel Stenberg
20ac5531cd mk-lib1521: make the test set each string option again
In an attempt to make sure that setting it again does not leak memory.

The second string is set to `""`, which is done so that this now finds
the problem reported in #20179.

Ref: #20179
Closes #20181
2026-01-04 14:48:13 +01:00
Daniel Stenberg
193397bf4e progress: narrower time display, multiple fixes
- Each time field is now 7 characters wide, so that the total width
  never exceeds 79 columns so that it works correctly also in Windows
  terminals. The title lines are adjusted accordingly.

  This is accomplished by using h:mm:ss style up to 10 hours, and for
  longer periods switch to "nnX nnY" style output. For hours, days,
  months and years.

  For less than one hour, the hour field is now dropped.

  When no time info is provided, the field is now space-only. No more
  `-:--:--`.

  Also fixed the output for really long times which previously was
  completely broken. The largest time now shows as ">99999y". (Becase
  I can't figure out a better way).

- For sizes, the widths are now properly fixed to 6 characters. When
  displaying a unit with less than 3 digits, it shows two decimal
  precision like "16777215 => 15.99M" and one decmal otherwise: "262143
  => 255.9k"

  Also fixes the decimal math. 131071 is 127.9k, which it previously did
  not show.

- The time and size field outputs are now properly verified in test
  1636.

Fixes #20122
Closes #20173

fixup use only space when no time exists

Drop the hour from the display when zero
2026-01-04 14:42:08 +01:00
Daniel Stenberg
eb7f5b71e5 tool_doswin: remove the max length check
A too long name is likely to cause a problem later anyway and get
reported there. We don't enforce file name lengths for any other
systems.

Assisted-by: Jay Satiro
Assisted-by: Viktor Szakats

Closes #20143
2026-01-04 11:22:43 +01:00
Daniel Stenberg
b32e66a8ee tool_progress: fix large time outputs and decimal size display
Time output:

- was broken for really large times

- now uses spaces instead of --:--:--

- >99999y is now the largest shown time

- show HH:MM:SS as long as hours are fewer than 100

Size:

- made the decimal output always only use a single decimal

Test:

- Add test 1622 to verify these functions

Closes #20177
2026-01-04 00:16:59 +01:00
Viktor Szakats
b374a8f07f servers.pm: say the protocol when http server failed to start
To serve as possibly more signal to see when/why the http server fails
to start in some random cases (on Windows).

Seen it happen in the 'mingw, CM clang-x86_64 gnutls libss' CI job:
https://github.com/curl/curl/pull/20163#issuecomment-3705572750
https://github.com/curl/curl/pull/20163#issuecomment-3707231458

Closes #20176
2026-01-03 20:39:27 +01:00
Stefan Eissing
68b94daeb8 pytest: test 16_01 stabilize
When checking the reported times of a transfer, do not exptect
the 'queue' time to be in any relation to others. 'queue' uses its own
start timestamp and the reported duration is thereofore independant.

Ref: #20112
Closes #20163
2026-01-03 13:04:21 +01:00
Stefan Eissing
a348f19bd1 pytest: test 07_22 stabilize
Do not generate a 400 response code, but use a 200 one. The upload needs
to fail on sending, not on seeing a 400 response. Seeing a 400 before
the sending fails (when CI timings shift) will expose the wrong error
code.

Ref: #20112
Closes #20164
2026-01-03 00:48:54 +01:00
Stefan Eissing
2c32ab12a0 pytest: test 07_70 stabilize (curl_ngtcp2)
We recently allowed a larger send buffer in ngtcp2 streams. This allowed
curl to send more early data then previously when the server was slow in
performing the handshake. This led to flaky test failures when the
amount of early data was larger than expected.

Change test expectations to allow for varying amount of early data.

Ref: #20112
Closes #20161
2026-01-03 00:48:54 +01:00
Daniel Stenberg
03c9215e62 altsvc: accept ma/persist per alternative entry
The 'ma' and 'persist' keywords should be considered per list entry, not
once per header.

Expand test 1654 to verify such headers

Reported-by: Hunt Darlener
Closes #20160
2026-01-02 23:50:21 +01:00
Viktor Szakats
8292820b73 pytest: replace allowlist with feature check to enable OCSP test 17_08
Add a `cert-status` feature flag to `curlinfo`, based on the conditions
used in `lib/vtls` sources.

To:
- fix disabling this test when using OpenSSL (or fork) built with
  the `no-ocsp` option.
- enable this test for AWS-LC in CI.

Note:
- BoringSSL (and quiche) has OSCP disabled by default.
- MultiSSL dynamic selection continues to confuse this test.
  (To fix it, support would need to be detected by querying libcurl
  via curl. Probably overkill given that OCSP is on its way out.)

Follow-up to f2c765028f #20149

Closes #20133
2026-01-02 01:23:27 +01:00
Viktor Szakats
f2c765028f pytest: enable OCSP test 17_08 for LibreSSL
Before: 735 passed, 115 skipped
After: 738 passed, 112 skipped

Closes #20149
2026-01-01 23:46:05 +01:00
dependabot[bot]
ef97f47635 GHA: bump pip-dependencies
- update `ruff` from 0.14.9 to 0.14.10
- update `psutil` from 7.1.3 to 7.2.0

Closes #20141
2026-01-01 20:49:00 +01:00
Viktor Szakats
1ca678472f tests: drop redundant parenthesis from two macro expressions
Closes #20136
2025-12-31 18:49:53 +01:00
Daniel Stenberg
bfa5857c44 test1664: extend with more tests for curlx_str_quotedword
Closes #20123
2025-12-31 17:06:09 +01:00
Viktor Szakats
258521e170 hostip.h: drop redundant setjmp.h include
Already included directly via `hostip.c`, and other header users do not
use it.

Also add comment about why `setjmp.h` is used.

Cherry-picked from #20106

Closes #20132
2025-12-31 17:00:57 +01:00
Viktor Szakats
352f3f140c tests: include headers only when used
Cherry-picked from #20106

Closes #20131
2025-12-31 17:00:56 +01:00
trxvorr
f81e7197c1 digest: fix OWS and escaped quote handling
The migration to the strparse API introduced regressions in Digest
authentication parsing where Optional Whitespace (OWS) after commas was
not skipped, and escaped quotes in values were not correctly parsed.

This change ensures whitespace is skipped before key lookups and escaped
characters are properly handled and unescaped in quoted values.

Reported-by: herdiyanitdev on hackerone
Closes #20102
2025-12-30 23:22:26 +01:00
Jay Satiro
1068d048ec tool_doswin: increase allowable length of path sanitizer
- Use 32767-1 instead of PATH_MAX-1 (260-1) as the maximum allowable
  length of a path in Windows.

Prior to this change the path sanitizer in Windows used 32767-1 as the
maximum length only for paths that had the "\\" prefix like
"\\?\longpath". Since then we added some workarounds to open longer
paths without "\\?\" prefix by normalizing the path and adding that
prefix, and the sanitizer is called before the prefix is added.

Bug: https://github.com/curl/curl/issues/20044
Reported-by: Viktor Szakats

Closes https://github.com/curl/curl/pull/20046
2025-12-30 04:00:50 -05:00
Viktor Szakats
7032982896 tidy-up: miscellaneous
- asyn-thrdd.c: scope an include.
- apply more clang-format suggestions.
- tidy-up PP guard comments.
- delete empty line from the top of headers.
- add empty line after `curl_setup.h` include where missing.
- fix indent.
- CODE_STYLE.md: add `strcpy`.
  Follow-up to 8636ad55df #20088
- lib1901.c: drop unnecessary line.
  Follow-up to 436e67f65b #20076

Closes #20070
2025-12-26 22:06:09 +01:00
Daniel Stenberg
a585cc35e5 memdebug: stop tracking send and recv
- they rarely catch any problems
- we have other ways to test different send/recv problems
- the number of such calls vary much more per invoke than others, making
  memdebugging harder
- reducing the total number of fallible functions per test is good
- they were not used as intended anyway

Closes #20097
2025-12-26 10:27:27 +01:00
Daniel Stenberg
18af4e4e10 cookie: flush better
The cookie flushing (saving to a cookie jar) should only be done if a
transfer has been started. This is now done by checking the
cookies->running field, which is not reset in curl_easy_reset() so the
saving works correctly even after a call to that.

Follow-up to fd6eb8d6e7

Verified by test 1920

Reported-by: Alexander Batischev
Fixes #20090
Closes #20094
2025-12-25 12:05:23 +01:00