Commit Graph

35235 Commits

Author SHA1 Message Date
Daniel Stenberg
72f9133311
tests/globalconfig.pm: remove the qw
Fixes the warning.

Fixes #16976
Closes #16977
2025-04-05 18:25:34 +02:00
Daniel Stenberg
b8bd019c6a
content_encoding: Transfer-Encoding parser improvements
- allow and ignore "identity" as an encoding

- fail if any other encoder than chunked follows after chunked

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

Add test 1493 to 1496 to verify.

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

Reported-by: Jonathan Rosa
Fixes #16956
Closes #16959
2025-04-05 18:23:07 +02:00
Daniel Stenberg
3454844f36
libtest/first: stop defining MEMDEBUG_NODEFINES
It causes problems in unity builds, in particular when this file is used
for unit tests.

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

Closes #16978
2025-04-05 18:20:22 +02:00
Daniel Stenberg
f3527ed443
randdisable: build randomizer
This script makes a "random" build using configure and verifies that it
builds curl correctly. It randomly adds a number of the available
--disable-* flags to configure. When it detects a problem the script
stops, otherwise it continues trying more combinations.

Closes #16962
2025-04-05 14:59:17 +02:00
Stefan Eissing
5fbd78eb2d
http2: fix stream window size after unpausing
When pausing a HTTP/2 transfer, the stream's local window size
is reduced to 0 to prevent the server from sending further data
which curl cannot write out to the application.

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

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

Fixes #16955
Closes #16960
2025-04-05 14:54:40 +02:00
Dan Fandrich
dac78ae638 tests: remove some unused test case sections 2025-04-04 13:23:31 -07:00
Dan Fandrich
cbb80f215e tests: unify test case keywords
Unify the case, punctuation and name of test case keywords so they can
be more easily selected or skipped when desired. Add a few keywords that
were missing. Fix a couple of typos in test names.
2025-04-04 13:23:15 -07:00
Yedaya Katsman
80f9f6e59b
rand: update comment on Curl_rand_bytes weak random
From what I understand both rustls and mbedTLS expose a strong random
function, so as long as you have a TLS library random will be strong.

Followup 8972845123 "vtls/rustls: support strong CSRNG data"
Followup a90a5bccd4 "mbedtls: implement CTR-DRBG and HAVEGE random generators"

Closes #16965
2025-04-04 21:32:07 +02:00
Stefan Eissing
4f3c22d77d
https-connect, fix httpsrr target check
The HTTPSRR check on the record's target was not working as it used the
wrong index on the NUL byte if the target was not NULL.

Fixes #16966
Reported-by: Pavel Kropachev
Closes #16968
2025-04-04 21:31:02 +02:00
Dan Fandrich
0e9f2c41b6 tests: fix some test tag mismatches 2025-04-04 09:17:08 -07:00
Dan Fandrich
b117d2cacf tests: move a boolean variable out of the path section 2025-04-04 08:42:43 -07:00
Daniel Stenberg
db3e7a24b5
hostip: show the correct name on proxy resolve error
Regression, probably from 8ded8e5f3f (#16451)

Fixes #16958
Reported-by: Jean-Christophe Amiel
Closes #16961
2025-04-04 14:23:01 +02:00
Jay Satiro
997e55d5a7 tests: use a more portable null device path
- Use File::Spec->devnull() to get the null device path.

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

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

Closes https://github.com/curl/curl/pull/16930
2025-04-04 03:40:47 -04:00
Nigel Brittain
c871dcb612
http_aws_sigv4: add additional verbose log statements
To use curl as a tool for troubleshooting SigV4 signing, it is useful to
have the 'Canonical Request', 'String To Sign' and 'Signature'
calculations output.

Closes #16952
2025-04-04 08:54:09 +02:00
Viktor Szakats
b809629f8c
cmake: use absolute paths for completion targets
Fixing potential:
```
CMake Error at scripts/CMakeLists.txt:72 (install):
  install FILES given directory "/usr/ports/ftp/curl/work/.build/scripts/" to
  install.
```

Reported-by: Daniel Engberg
Fixes #16946
Follow-up to c8b0f0c9ad #16833
Closes #16954
2025-04-04 02:34:52 +02:00
Dan Fandrich
eb0c622a5b scripts: fix --opts-dir help in completion.pl
The help text gave the wrong option name.

Reported-by: Daniel Engberg
Ref: #16946
2025-04-03 16:14:34 -07:00
Yedaya Katsman
fe1ba25c87
rustls: make max size of cert and key reasonable
SIZE_MAX is an very overkill size for certificates or keys, lower it to
100KiB for both certificate and keys. The default max size of openssl is
100KiB for the entire chain [1], and it seems firefox fails at ~60kb
[2].

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

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

Closes #16951
2025-04-03 23:30:36 +02:00
Viktor Szakats
bdc42ba23e
GHA/curl-for-win: switch to podman (from docker)
Closes #16727
2025-04-03 23:23:37 +02:00
Viktor Szakats
c6bd2e6a9a
tests: prefer --insecure over -k
To make it uniform in all tests, and greppability.

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

Closes #16878
2025-04-03 23:18:55 +02:00
Dan Fandrich
9ba597bed7 lib: make Curl_easyopts const
Also, make the optiontable rule work in an out-of-tree build.

Closes #16950
2025-04-03 13:43:26 -07:00
Dan Fandrich
9f4f61ddcb lib: add const to clientwriter tables
Unlike the connection filter tables that hold a writable log level, the
client writer tables can be const.
2025-04-03 12:45:54 -07:00
Dan Fandrich
34cdd4e118 INSTALL.md: update the minimal libcurl size example
It's only gone up by 7 KiB over the dozen releases in the last year.
2025-04-03 12:16:51 -07:00
Daniel Stenberg
982d0a14b6
RELEASE-NOTES: synced 2025-04-03 20:37:17 +02:00
Daniel Stenberg
7e0eea7d7b
tests: mark ipfs tests to require ipfs
Fixes #16947
Reported-by: Daniel Engberg
Closes #16948
2025-04-03 19:55:01 +02:00
renovate[bot]
69d58309af
GHA: update cloudflare/quiche to v0.23.5
Closes #16913
2025-04-03 17:44:34 +02:00
Daniel Stenberg
681df5ec51
tests/README.md: document --test-duphandle
Follow-up to cbafcec50b

Closes #16944
2025-04-03 17:23:58 +02:00
Daniel Stenberg
8f65bd6977
asyn-thread: fix build without socketpair
Follow-up to 9b6148e9d9

Closes #16945
2025-04-03 17:19:59 +02:00
Stefan Eissing
9b6148e9d9
async-threaded resolver: use ref counter
Allocate the data shared between a transfer and an aync resolver thread
separately and use a reference counter to determine its release.

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

Retake of the revert in fb15a986c0

Closes #16916
2025-04-03 16:43:37 +02:00
Stefan Eissing
01e76702ac
dnscache: slight refactoring
Slight refactoring around dnscache, e.g. hostcache

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

Closes #16941
2025-04-03 16:40:56 +02:00
Daniel Stenberg
6140a574de
tests/README.md: list the openssl tool among the prerequisites
Used for test cert generation since 8.13.0

Closes #16942
2025-04-03 16:25:29 +02:00
Daniel Stenberg
d6a626d5d8
parsedate: provide Curl_wkday also for GnuTLS builds
Otherwise --disable-dateparse + --with-gnutls builds might fail.

Found with randdisable

Closes #16943
2025-04-03 16:00:17 +02:00
Viktor Szakats
3d4e4a1874
genserv.pl: fail with a message if openssl is missing or failing
Reported-by: Tomas Volf
Fixes #16926
Follow-up to 44341e736a #16824
Ref: #16928
Co-authored-by: Daniel Stenberg
Closes #16929
2025-04-03 14:17:37 +02:00
Daniel Stenberg
78710ee955
conncache: make Curl_cpool_init return void
Since it cannot fail, removing the return code simplifies the code paths
calling this function.

Closes #16936
2025-04-03 13:37:17 +02:00
Daniel Stenberg
49701094fc
http: fix a build error when all auths are disabled
error: ‘result’ undeclared (first use in this function)

Found with randdisable

Closes #16939
2025-04-03 12:38:36 +02:00
Daniel Stenberg
8f496d05b6
hostip: fix build without threaded-resolver and without DoH
Closes #16938
2025-04-03 11:52:37 +02:00
Stefan Eissing
b56b0c078e
vtls: fix build with ssl but without http
Fixes #16935
Closes #16937
2025-04-03 11:37:45 +02:00
Daniel Stenberg
4cf9e87fca
if2ip: build the function also if FTP is present
Previously it was not compiled if CURL_DISABLE_BINDLOCAL is set, but the
FTP code is also using this function.

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

Closes #16933
2025-04-03 11:25:25 +02:00
Daniel Stenberg
6e00db58fb
configure: fix --disable-rt
This option now better only prevents the actual -lrt to be used, and
thus has no effect if the system does not need -lt for the monotonic
clock etc.

Fixes #16932
Closes #16934
2025-04-03 11:10:47 +02:00
Daniel Stenberg
5caba3bd97
curl_krb5: only use functions if FTP is still enabled
Reported-by: x1sc0 on github
Fixes #16925
Closes #16931
2025-04-03 10:52:47 +02:00
Daniel Stenberg
daa8693619
VERSIONS: list all past releases
This document now lists all previous releases.

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

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

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

Closes #16907
2025-04-03 08:26:33 +02:00
Andrew
fe5f435b42
http_negotiate: fix non-SSL build with GSSAPI
Fixes #16919
Closes #16921
2025-04-03 08:25:09 +02:00
Viktor Szakats
87168807b2
eventfd: fix feature guards
Enable eventfd code consistently when both `HAVE_EVENTFD` and
`HAVE_SYS_EVENTFD_H` macros are defined.

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

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

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

Reported-by: Abhinav Singhal
Bug: https://curl.se/mail/lib-2025-04/0000.html
Closes #16909
2025-04-03 01:12:19 +02:00
Viktor Szakats
22352e627d
configure: restore link checks
The omitted link checks were not what I though they were. Omitting one
caused a mis-detection on Solaris, where the compile check alone
mis-detects `CloseSocket` as present.

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

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

Partial revert of, regression from bd9f9b085a #16377
Reported-by: Dagobert Michelsen
Bug: https://curl.se/mail/lib-2025-04/0004.html
Fixes #16915
Closes #16917
2025-04-03 00:19:06 +02:00
Jay Satiro
e0b4ea889f INSTALL-CMAKE.md: fix typo 2025-04-02 17:45:57 -04:00
Daniel Stenberg
673c56a034
RELEASE-NOTES: synced
and bump to 8.13.1 for now
2025-04-02 22:51:06 +02:00
Yedaya Katsman
878d1fc340
tests/serverhelp: remove last remnants of http-pipe server
Followup on https://github.com/curl/curl/pull/5921

Closes #16924
2025-04-02 22:46:53 +02:00
Daniel Stenberg
8a45c2851a
lib1960: revert the use of libcurl's inet_pton
Since it now uses hex conversion code from strparse as well.

Closes #16888
2025-04-02 14:17:56 +02:00
Daniel Stenberg
0c6e63a1be
lib: unify conversions to/from hex
Curl_hexbyte - output a byte as a two-digit ASCII hex number

Curl_hexval - convert an ASCII hex digit to its binary value

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

Closes #16888
2025-04-02 14:17:56 +02:00
Daniel Stenberg
1d84d683bb
test: make unittest 1308 into a libtest
Test 1308 was wrongly marked a unit test when in reality it is a
libtest.

Closes #16891
2025-04-02 14:01:27 +02:00
Viktor Szakats
202a333e4d
processhelp.pm: avoid potential endless loop, log more (Windows)
`pidwait()` is a function to wait for a PID to disappear from the list
of processes. On Windows change this function to:

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

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

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

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

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

Ref: #16840
Ref: #14854

Closes #16908
2025-04-02 12:54:46 +02:00