]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
22 months agoCI: add a 32-bit i686 Linux build 11799/head
Dan Fandrich [Tue, 5 Sep 2023 00:08:19 +0000 (17:08 -0700)] 
CI: add a 32-bit i686 Linux build

This is done by cross-compiling under regular x86_64 Linux.  Since the
kernel offers backwards compatibility, the binaries can be tested as
normal.

Closes #11799

22 months agotests: fix a type warning on 32-bit x86
Dan Fandrich [Tue, 5 Sep 2023 00:07:51 +0000 (17:07 -0700)] 
tests: fix a type warning on 32-bit x86

22 months agotests: delete stray `.orig` file
Viktor Szakats [Mon, 4 Sep 2023 18:53:51 +0000 (18:53 +0000)] 
tests: delete stray `.orig` file

Follow-up to 331b89a319d0067fa1e6441719307cfef9c7960f
Closes #11797

22 months agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 4 Sep 2023 20:29:06 +0000 (22:29 +0200)] 
RELEASE-NOTES: synced

22 months agolib: silence compiler warning in inet_ntop6
Viktor Szakats [Mon, 4 Sep 2023 00:29:48 +0000 (00:29 +0000)] 
lib: silence compiler warning in inet_ntop6

```
./curl/lib/inet_ntop.c:121:21: warning: possible misuse of comma operator here [-Wcomma]
        cur.base = i, cur.len = 1;
                    ^
./curl/lib/inet_ntop.c:121:9: note: cast expression to void to silence warning
        cur.base = i, cur.len = 1;
        ^~~~~~~~~~~~
        (void)(     )
```

Closes #11790

22 months agotransfer: also stop the sending on closed connection
Daniel Stenberg [Mon, 4 Sep 2023 12:14:32 +0000 (14:14 +0200)] 
transfer: also stop the sending on closed connection

Previously this cleared the receiving bit only but in some cases it is
also still sending (like a request-body) when disconnected and neither
direction can continue then.

Fixes #11769
Reported-by: Oleg Jukovec
Closes #11795

22 months agodocs: change `sub-domain` to `subdomain`
John Bampton [Mon, 4 Sep 2023 12:14:57 +0000 (22:14 +1000)] 
docs: change `sub-domain` to `subdomain`

https://en.wikipedia.org/wiki/Subdomain

Closes #11793

22 months agomulti: more efficient pollfd count for poll
Stefan Eissing [Mon, 4 Sep 2023 07:55:27 +0000 (09:55 +0200)] 
multi: more efficient pollfd count for poll

- do not use separate pollfds for sockets that have POLLIN+POLLOUT

Closes #11792

22 months agohttp2: polish things around POST
Stefan Eissing [Tue, 29 Aug 2023 11:08:35 +0000 (13:08 +0200)] 
http2: polish things around POST

- added test cases for various code paths
- fixed handling of blocked write when stream had
  been closed inbetween attempts
- re-enabled DEBUGASSERT on send with smaller data size

- in debug builds, environment variables can be set to simulate a slow
  network when sending data. cf-socket.c and vquic.c support
  * CURL_DBG_SOCK_WBLOCK: percentage of send() calls that should be
    answered with a EAGAIN. TCP/UNIX sockets.
    This is chosen randomly.
  * CURL_DBG_SOCK_WPARTIAL: percentage of data that shall be written
    to the network. TCP/UNIX sockets.
    Example: 80 means a send with 1000 bytes would only send 800
    This is applied to every send.
  * CURL_DBG_QUIC_WBLOCK: percentage of send() calls that should be
    answered with EAGAIN. QUIC only.
    This is chosen randomly.

Closes #11756

22 months agodocs: add curl_global_trace to some SEE ALSO sections
Daniel Stenberg [Mon, 4 Sep 2023 06:52:12 +0000 (08:52 +0200)] 
docs: add curl_global_trace to some SEE ALSO sections

Closes #11791

22 months agoos400: fix checksrc nits
Daniel Stenberg [Sun, 3 Sep 2023 16:07:45 +0000 (18:07 +0200)] 
os400: fix checksrc nits

Closes #11789

22 months agohyper: remove `hyptransfer->endtask`
Nicholas Nethercote [Fri, 1 Sep 2023 01:41:22 +0000 (11:41 +1000)] 
hyper: remove `hyptransfer->endtask`

`Curl_hyper_stream` needs to distinguish between two kinds of
`HYPER_TASK_EMPTY` tasks: (a) the `foreach` tasks it creates itself, and
(b) background tasks that hyper produces. It does this by recording the
address of any `foreach` task in `hyptransfer->endtask` before pushing
it into the executor, and then comparing that against the address of
tasks later polled out of the executor.

This works right now, but there is no guarantee from hyper that the
addresses are stable. `hyper_executor_push` says "The executor takes
ownership of the task, which should not be accessed again unless
returned back to the user with `hyper_executor_poll`". That wording is a
bit ambiguous but with my Rust programmer's hat on I read it as meaning
the task returned with `hyper_executor_poll` may be conceptually the
same as a task that was pushed, but that there are no other guarantees
and comparing addresses is a bad idea.

This commit instead uses `hyper_task_set_userdata` to mark the `foreach`
task with a `USERDATA_RESP_BODY` value which can then be checked for,
removing the need for `hyptransfer->endtask`. This makes the code look
more like that hyper C API examples, which use userdata for every task
and never look at task addresses.

Closes #11779

23 months agows: fix spelling mistakes in examples and tests
Dave Cottlehuber [Fri, 1 Sep 2023 14:47:41 +0000 (14:47 +0000)] 
ws: fix spelling mistakes in examples and tests

Closes #11784

23 months agotool_filetime: make -z work with file dates before 1970
Daniel Stenberg [Fri, 1 Sep 2023 21:46:22 +0000 (23:46 +0200)] 
tool_filetime: make -z work with file dates before 1970

Fixes #11785
Reported-by: Harry Sintonen
Closes #11786

23 months agobuild: fix portability of mancheck and checksrc targets
Dan Fandrich [Fri, 1 Sep 2023 21:51:32 +0000 (14:51 -0700)] 
build: fix portability of mancheck and checksrc targets

At least FreeBSD preserves cwd across makefile lines, so rules
consisting of more than one "cd X; do_something" must be explicitly run
in a subshell to avoid this. This problem caused the Cirrus FreeBSD
build to fail when parallel make jobs were enabled.

23 months agoCI: adjust labeler match patterns for new & obsolete files
Dan Fandrich [Fri, 1 Sep 2023 21:04:54 +0000 (14:04 -0700)] 
CI: adjust labeler match patterns for new & obsolete files

23 months agoconfigure: trust pkg-config when it's used for zlib
Dan Fandrich [Thu, 31 Aug 2023 23:06:02 +0000 (16:06 -0700)] 
configure: trust pkg-config when it's used for zlib

The library flags retrieved from pkg-config were later thrown out and
harded-coded, which negates the whole reason to use pkg-config.
Also, previously, the assumption was made that --libs-only-l and
--libs-only-L are the full decomposition of --libs, which is untrue and
would not allow linking against a static zlib. The new approach is
better in that it uses --libs, although only if --libs-only-l returns
nothing.

Bug: https://curl.se/mail/lib-2023-08/0081.html
Reported-by: Randall
Closes #11778

23 months agoCI/ngtcp2: clear wolfssl for when cache is ignored
Stefan Eissing [Fri, 1 Sep 2023 12:49:39 +0000 (14:49 +0200)] 
CI/ngtcp2: clear wolfssl for when cache is ignored

Closes #11783

23 months agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 1 Sep 2023 12:59:50 +0000 (14:59 +0200)] 
RELEASE-NOTES: synced

23 months agohyper: fix a progress upload counter bug
Nicholas Nethercote [Fri, 1 Sep 2023 04:55:47 +0000 (14:55 +1000)] 
hyper: fix a progress upload counter bug

`Curl_pgrsSetUploadCounter` should be a passed a total count, not an
increment.

This changes the failing diff for test 579 with hyper from this:
```
 Progress callback called with UL 0 out of 0[LF]
-Progress callback called with UL 8 out of 0[LF]
-Progress callback called with UL 16 out of 0[LF]
-Progress callback called with UL 26 out of 0[LF]
-Progress callback called with UL 61 out of 0[LF]
-Progress callback called with UL 66 out of 0[LF]
+Progress callback called with UL 29 out of 0[LF]
```
to this:
```
 Progress callback called with UL 0 out of 0[LF]
-Progress callback called with UL 8 out of 0[LF]
-Progress callback called with UL 16 out of 0[LF]
-Progress callback called with UL 26 out of 0[LF]
-Progress callback called with UL 61 out of 0[LF]
-Progress callback called with UL 66 out of 0[LF]
+Progress callback called with UL 40 out of 0[LF]
```
Presumably a step in the right direction.

Closes #11780

23 months agoawssiv4: avoid freeing the date pointer on error
Daniel Stenberg [Fri, 1 Sep 2023 08:35:40 +0000 (10:35 +0200)] 
awssiv4: avoid freeing the date pointer on error

Since it was not allocated, don't free it even if it was wrong syntax

Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=61908

Follow-up to b137634ba3adb

Closes #11782

23 months agoCI: ngtcp2-linux: use separate caches for tls libraries
Stefan Eissing [Fri, 1 Sep 2023 10:36:13 +0000 (12:36 +0200)] 
CI: ngtcp2-linux: use separate caches for tls libraries

allow ever changing master for wolfssl

Closes #11766

23 months agoreplace `master` as wolfssl-version with recent commit
Stefan Eissing [Fri, 1 Sep 2023 09:42:32 +0000 (11:42 +0200)] 
replace `master` as wolfssl-version with recent commit

23 months agowolfssl, use master again in CI
Stefan Eissing [Wed, 30 Aug 2023 09:51:17 +0000 (11:51 +0200)] 
wolfssl, use master again in CI

- with the shared session update fix landed in master, it
  is time to use that in our CI again

23 months agotests: fix formatting errors in `FILEFORMAT.md`.
Nicholas Nethercote [Thu, 31 Aug 2023 23:25:26 +0000 (09:25 +1000)] 
tests: fix formatting errors in `FILEFORMAT.md`.

Without the surrounding backticks, these tags get swallowed when the
markdown is rendered.

Closes #11777

23 months agocmake: add support for `CURL_DEFAULT_SSL_BACKEND`
Viktor Szakats [Thu, 31 Aug 2023 15:27:35 +0000 (15:27 +0000)] 
cmake: add support for `CURL_DEFAULT_SSL_BACKEND`

Allow overriding the default TLS backend via a CMake setting.

E.g.:
`cmake [...] -DCURL_DEFAULT_SSL_BACKEND=mbedtls`

Accepted values: bearssl, gnutls, mbedtls, openssl, rustls,
schannel, secure-transport, wolfssl

The passed string is baked into the curl/libcurl binaries.
The value is case-insensitive.

We added a similar option to autotools in 2017 via
c7170e20d0a18ec8a514b4daa53bcdbb4dcb3a05.

TODO: Convert to lowercase to improve reproducibility.

Closes #11774

23 months agosectransp: fix compiler warnings
Viktor Szakats [Thu, 31 Aug 2023 13:42:49 +0000 (13:42 +0000)] 
sectransp: fix compiler warnings

https://github.com/curl/curl-for-win/actions/runs/6037489221/job/16381860220#step:3:11046
```
/Users/runner/work/curl-for-win/curl-for-win/curl/lib/vtls/sectransp.c:2435:14: warning: unused variable 'success' [-Wunused-variable]
    OSStatus success;
             ^
/Users/runner/work/curl-for-win/curl-for-win/curl/lib/vtls/sectransp.c:3300:44: warning: unused parameter 'sha256len' [-Wunused-parameter]
                                    size_t sha256len)
                                           ^
```

Closes #11773

23 months agotidy-up: mostly whitespace nits
Viktor Szakats [Thu, 31 Aug 2023 13:28:49 +0000 (13:28 +0000)] 
tidy-up: mostly whitespace nits

- delete completed TODO from `./CMakeLists.txt`.
- convert a C++ comment to C89 in `./CMake/CurlTests.c`.
- delete duplicate EOLs from EOF.
- add missing EOL at EOF.
- delete whitespace at EOL (except from expected test results).
- convert tabs to spaces.
- convert CRLF EOLs to LF in GHA yaml.
- text casing fixes in `./CMakeLists.txt`.
- fix a codespell typo in `packages/OS400/initscript.sh`.

Closes #11772

23 months agoCI: remove Windows builds from Cirrus, without replacement
Dan Fandrich [Thu, 31 Aug 2023 06:47:30 +0000 (23:47 -0700)] 
CI: remove Windows builds from Cirrus, without replacement

If we don't do this, all coverage on Cirrus will cease in a few days. By
removing the Windows builds, the FreeBSD one should still continue
as before. The Windows builds will need be moved to another service to
maintain test coverage.

Closes #11771

23 months agoCI: switch macOS ARM build from Cirrus to Circle CI
Dan Fandrich [Thu, 31 Aug 2023 00:58:27 +0000 (17:58 -0700)] 
CI: switch macOS ARM build from Cirrus to Circle CI

Cirrus is drastically reducing their free tier on Sept. 1, so they will
no longer perform all these builds for us. All but one build has been
moved, with the LibreSSL one being dropped because of linking problems
on Circle.

One important note about this change is that Circle CI is currently
directing all these builds to x86_64 hardware, despite them requesting
ARM. This is because ARM nodes are scheduled to be available on the
free tier only in December. This reduces our architectural diversity
until then but it should automatically come back once those machines are
enabled.

23 months agoCI: use the right variable for BSD make
Dan Fandrich [Thu, 31 Aug 2023 22:07:31 +0000 (15:07 -0700)] 
CI: use the right variable for BSD make

BSD uses MAKEFLAGS instead of MAKE_FLAGS so it wasn't doing parallel
builds before.

23 months agoCI: drop the FreeBSD 12.X build
Dan Fandrich [Wed, 30 Aug 2023 20:47:11 +0000 (13:47 -0700)] 
CI: drop the FreeBSD 12.X build

Cirrus' new free tier won't let us have many builds, so drop the
nonessential ones. The FreeBSD 13.X build will still give us the most
relevant FreeBSD coverage.

23 months agoCI: move the Alpine build from Cirrus to GHA
Dan Fandrich [Wed, 30 Aug 2023 20:45:40 +0000 (13:45 -0700)] 
CI: move the Alpine build from Cirrus to GHA

Cirrus is reducing their free tier to next to nothing, so we must move
builds elsewhere.

23 months agotest_07_upload.py: fix test_07_34 curl args
Stefan Eissing [Wed, 30 Aug 2023 09:18:17 +0000 (11:18 +0200)] 
test_07_upload.py: fix test_07_34 curl args

- Pass correct filename to --data-binary.

Prior to this change --data-binary was passed an incorrect filename due
to a missing separator in the arguments list. Since aacbeae7 curl will
error on incorrect filenames for POST.

Fixes https://github.com/curl/curl/issues/11761
Closes https://github.com/curl/curl/pull/11763

23 months agotests: document which tests fail due to hyper's lack of trailer support.
Nicholas Nethercote [Wed, 30 Aug 2023 08:50:41 +0000 (18:50 +1000)] 
tests: document which tests fail due to hyper's lack of trailer support.

Closes #11762

23 months agodocs: removing "pausing transfers" from HYPER.md.
Nicholas Nethercote [Wed, 30 Aug 2023 09:24:01 +0000 (19:24 +1000)] 
docs: removing "pausing transfers" from HYPER.md.

It's a reference to #8600, which was fixed by #9070.

Closes #11764

23 months agoos400: handle CURL_TEMP_PRINTF() while building bind source
Patrick Monnerat [Fri, 18 Aug 2023 23:45:00 +0000 (01:45 +0200)] 
os400: handle CURL_TEMP_PRINTF() while building bind source

Closes #11547

23 months agoos400: build test servers
Patrick Monnerat [Sat, 19 Aug 2023 06:28:39 +0000 (08:28 +0200)] 
os400: build test servers

Also fix a non-compliant main prototype in disabled.c.

Closes #11547

23 months agotests: fix compilation error for os400
Patrick Monnerat [Sun, 30 Jul 2023 17:10:31 +0000 (19:10 +0200)] 
tests: fix compilation error for os400

OS400 uses BSD 4.3 setsockopt() prototype by default: this does not
define parameter as const, resulting in an error if actual parameter is
const. Remove the const keyword from the actual parameter cast: this
works in all conditions, even if the formal parameter uses it.

Closes #11547

23 months agoos400: make programs and command name configurable
Patrick Monnerat [Sun, 30 Jul 2023 18:04:25 +0000 (20:04 +0200)] 
os400: make programs and command name configurable

Closes #11547

23 months agoos400: move build configuration parameters to a separate script
Patrick Monnerat [Sun, 30 Jul 2023 16:04:09 +0000 (18:04 +0200)] 
os400: move build configuration parameters to a separate script

They can then easily be overriden in a script named "config400.override"
that is not part of the distribution.

Closes #11547

23 months agoos400: implement CLI tool
Patrick Monnerat [Tue, 29 Aug 2023 11:32:39 +0000 (13:32 +0200)] 
os400: implement CLI tool

This is provided as a QADRT (ascii) program, a link to it in the IFS and
a minimal CL command.

Closes #11547

23 months agolib: fix aws-sigv4 having date header twice in some cases
Matthias Gatto [Mon, 28 Aug 2023 11:38:20 +0000 (13:38 +0200)] 
lib: fix aws-sigv4 having date header twice in some cases

When the user was providing the header X-XXX-Date, the header was
re-added during signature computation, and we had it twice in the
request.

Reported-by: apparentorder@users.noreply.github.com
Signed-off-by: Matthias Gatto <matthias.gatto@outscale.com>
Fixes: https://github.com/curl/curl/issues/11738
Closes: https://github.com/curl/curl/pull/11754
23 months agomulti: remove 'processing: <url>' debug message
Jay Satiro [Wed, 30 Aug 2023 06:01:09 +0000 (02:01 -0400)] 
multi: remove 'processing: <url>' debug message

- Remove debug message added by e024d566.

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

23 months agoftp: fix temp write of ipv6 address
Jay Satiro [Mon, 28 Aug 2023 07:09:18 +0000 (03:09 -0400)] 
ftp: fix temp write of ipv6 address

- During the check to differentiate between a port and IPv6 address
  without brackets, write the binary IPv6 address to an in6_addr.

Prior to this change the binary IPv6 address was erroneously written to
a sockaddr_in6 'sa6' when it should have been written to its in6_addr
member 'sin6_addr'. There's no fallout because no members of 'sa6' are
accessed before it is later overwritten.

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

23 months agotool: change some fopen failures from warnings to errors
Jay Satiro [Sun, 20 Aug 2023 07:08:15 +0000 (03:08 -0400)] 
tool: change some fopen failures from warnings to errors

- Error on missing input file for --data, --data-binary,
  --data-urlencode, --header, --variable, --write-out.

Prior to this change if a user of the curl tool specified an input file
for one of the above options and that file could not be opened then it
would be treated as zero length data instead of an error. For example, a
POST using `--data @filenametypo` would cause a zero length POST which
is probably not what the user intended.

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

23 months agohostip: fix typo
Jay Satiro [Tue, 29 Aug 2023 21:08:23 +0000 (17:08 -0400)] 
hostip: fix typo

23 months agotool: avoid including leading spaces in the Location hyperlink
Davide Masserut [Fri, 25 Aug 2023 16:41:10 +0000 (18:41 +0200)] 
tool: avoid including leading spaces in the Location hyperlink

Co-authored-by: Dan Fandrich <dan@coneharvesters.com>
Closes #11735

23 months agoSECURITY-PROCESS.md: not a sec issue: Tricking user to run a cmdline
Daniel Stenberg [Tue, 29 Aug 2023 11:24:06 +0000 (13:24 +0200)] 
SECURITY-PROCESS.md: not a sec issue: Tricking user to run a cmdline

Closes #11757

23 months agoconnect: stop halving the remaining timeout when less than 600 ms left
Daniel Stenberg [Fri, 18 Aug 2023 11:41:16 +0000 (13:41 +0200)] 
connect: stop halving the remaining timeout when less than 600 ms left

When curl wants to connect to a host, it always has a TIMEOUT. The
maximum time it is allowed to spend until a connect is confirmed.

curl will try to connect to each of the IP adresses returned for the
host. Two loops, one for each IP family.

During the connect loop, while curl has more than one IP address left to
try within a single address family, curl has traditionally allowed (time
left/2) for *this* connect attempt. This, to not get stuck on the
initial addresses in case the timeout but still allow later addresses to
get attempted.

This has the downside that when users set a very short timeout and the
host has a large number of IP addresses, the effective result might be
that every attempt gets a little too short time.

This change stop doing the divided-by-two if the total time left is
below a threshold. This threshold is 600 milliseconds.

Closes #11693

23 months agoasyn-ares: reduce timeout to 2000ms
Daniel Stenberg [Mon, 28 Aug 2023 14:07:34 +0000 (16:07 +0200)] 
asyn-ares: reduce timeout to 2000ms

When UDP packets get lost this makes for slightly faster retries. This
lower timeout is used by @c-ares itself by default starting next
release.

Closes #11753

23 months agomisc: remove duplicate words
John Bampton [Sat, 26 Aug 2023 12:08:10 +0000 (22:08 +1000)] 
misc: remove duplicate words

Closes #11740

23 months agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 29 Aug 2023 08:27:05 +0000 (10:27 +0200)] 
RELEASE-NOTES: synced

23 months agowolfSSL: avoid the OpenSSL compat API when not needed
Daniel Stenberg [Mon, 28 Aug 2023 13:47:29 +0000 (15:47 +0200)] 
wolfSSL: avoid the OpenSSL compat API when not needed

... and instead call wolfSSL functions directly.

Closes #11752

23 months agolib: fix null ptr derefs and uninitialized vars (h2/h3)
Viktor Szakats [Fri, 25 Aug 2023 22:28:35 +0000 (22:28 +0000)] 
lib: fix null ptr derefs and uninitialized vars (h2/h3)

Fixing compiler warnings with gcc 13.2.0 in unity builds.

Assisted-by: Jay Satiro
Assisted-by: Stefan Eissing
Closes #11739

23 months agosecureserver.pl: fix stunnel version parsing
Jay Satiro [Wed, 23 Aug 2023 06:49:47 +0000 (02:49 -0400)] 
secureserver.pl: fix stunnel version parsing

- Allow the stunnel minor-version version part to be zero.

Prior to this change with the stunnel version scheme of <major>.<minor>
if either part was 0 then version parsing would fail, causing
secureserver.pl to fail with error "No stunnel", causing tests that use
the SSL protocol to be skipped. As a practical matter this bug can only
be caused by a minor-version part of 0, since the major-version part is
always greater than 0.

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

23 months agosecureserver.pl: fix stunnel path quoting
Jay Satiro [Wed, 23 Aug 2023 07:37:43 +0000 (03:37 -0400)] 
secureserver.pl: fix stunnel path quoting

- Store the stunnel path in the private variable $stunnel unquoted and
  instead quote it in the command strings.

Prior to this change the quoted stunnel path was passed to perl's file
operators which cannot handle quoted paths. For example:

$stunnel = "\"/C/Program Files (x86)/stunnel/bin/tstunnel\"";
if(-x $stunnel or -x "$stunnel")
# false even if path exists and is executable

Our other test scripts written in perl, unlike this one, use servers.pm
which has a global $stunnel variable with the path stored unquoted and
therefore those scripts don't have this problem.

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

23 months agoaltsvc: accept and parse IPv6 addresses in response headers
Daniel Stenberg [Sat, 26 Aug 2023 22:06:02 +0000 (00:06 +0200)] 
altsvc: accept and parse IPv6 addresses in response headers

Store numerical IPv6 addresses in the alt-svc file with the brackets
present.

Verify with test 437 and 438

Fixes #11737
Reported-by: oliverpool on github
Closes #11743

23 months agolibtest: use curl_free() to free libcurl allocated data
Daniel Stenberg [Mon, 28 Aug 2023 06:29:15 +0000 (08:29 +0200)] 
libtest: use curl_free() to free libcurl allocated data

In several test programs. These mistakes are not detected or a problem
as long as memdebug.h is included, as that provides the debug wrappers
for all memory functions in the same style libcurl internals do it,
which makes curl_free and free effectively the same call.

Reported-by: Nicholas Nethercote
Closes #11746

23 months agodisable.d: explain --disable not implemented prior to 7.50.0
Jay Satiro [Tue, 22 Aug 2023 18:48:45 +0000 (14:48 -0400)] 
disable.d: explain --disable not implemented prior to 7.50.0

Option -q/--disable was added in 5.0 but only -q was actually
implemented. Later --disable was implemented in e200034 (precedes
7.49.0), but incorrectly, and fixed in 6dbc23c (precedes 7.50.0).

Reported-by: pszlazak@users.noreply.github.com
Fixes https://github.com/curl/curl/issues/11710
Closes #11712

23 months agohyper: fix ownership problems
Nicholas Nethercote [Mon, 28 Aug 2023 04:35:08 +0000 (14:35 +1000)] 
hyper: fix ownership problems

Some of these changes come from comparing `Curl_http` and
`start_CONNECT`, which are similar, and adding things to them that are
present in one and missing in another.

The most important changes:
- In `start_CONNECT`, add a missing `hyper_clientconn_free` call on the
  happy path.
- In `start_CONNECT`, add a missing `hyper_request_free` on the error
  path.
- In `bodysend`, add a missing `hyper_body_free` on an early-exit path.
- In `bodysend`, remove an unnecessary `hyper_body_free` on a different
  error path that would cause a double-free.
  https://docs.rs/hyper/latest/hyper/ffi/fn.hyper_request_set_body.html
  says of `hyper_request_set_body`: "This takes ownership of the
  hyper_body *, you must not use it or free it after setting it on the
  request." This is true even if `hyper_request_set_body` returns an
  error; I confirmed this by looking at the hyper source code.

Other changes are minor but make things slightly nicer.

Closes #11745

23 months agomulti.h: the 'revents' field of curl_waitfd is supported
Daniel Stenberg [Mon, 28 Aug 2023 08:48:37 +0000 (10:48 +0200)] 
multi.h: the 'revents' field of curl_waitfd is supported

Since 6d30f8ebed34e7276

Reported-by: Nicolás Ojeda Bär
Ref: #11748
Closes #11749

23 months agotool_paramhlp: improve str2num(): avoid unnecessary call to strlen()
Gerome Fournier [Sun, 27 Aug 2023 11:25:47 +0000 (13:25 +0200)] 
tool_paramhlp: improve str2num(): avoid unnecessary call to strlen()

Closes #11742

23 months agodocs: mention critical files in same directories as curl saves
Daniel Stenberg [Mon, 21 Aug 2023 07:37:08 +0000 (09:37 +0200)] 
docs: mention critical files in same directories as curl saves

... cannot be fully protected. Don't do it.

Co-authored-by: Jay Satiro
Reported-by: Harry Sintonen
Fixes #11530
Closes #11701

23 months agoOpenSSL: clear error queue after SSL_shutdown
John Hawthorn [Fri, 25 Aug 2023 18:06:28 +0000 (11:06 -0700)] 
OpenSSL: clear error queue after SSL_shutdown

We've seen errors left in the OpenSSL error queue (specifically,
"shutdown while in init") by adding some logging it revealed that the
source was this file.

Since we call SSL_read and SSL_shutdown here, but don't check the return
code for an error, we should clear the OpenSSL error queue in case one
was raised.

This didn't affect curl because we call ERR_clear_error before every
write operation (a0dd9df9ab35528eb9eb669e741a5df4b1fb833c), but when
libcurl is used in a process with other OpenSSL users, they may detect
an OpenSSL error pushed by libcurl's SSL_shutdown as if it was their
own.

Co-authored-by: Satana de Sant'Ana <satana@skylittlesystem.org>
Closes #11736

23 months agotests: update cookie expiry dates to far in the future
Alexander Kanavin [Fri, 4 Aug 2023 11:48:12 +0000 (13:48 +0200)] 
tests: update cookie expiry dates to far in the future

This allows testing Y2038 with system time set to after that, so that
actual Y2038 issues can be exposed, and not masked by expiry errors.

Fixes #11576
Closes #11610

23 months agomisc: fix spelling
John Bampton [Fri, 25 Aug 2023 11:57:53 +0000 (21:57 +1000)] 
misc: fix spelling

Closes #11733

23 months agocmdline-opts/page-header: clarify stronger that !opt == URL
Daniel Stenberg [Fri, 25 Aug 2023 14:44:20 +0000 (16:44 +0200)] 
cmdline-opts/page-header: clarify stronger that !opt == URL

Everything provided on the command line that is not an option (or an
argument to an option) is treated as a URL.

Closes #11734

23 months agotests/runner: fix %else handling
Daniel Stenberg [Fri, 25 Aug 2023 10:37:32 +0000 (12:37 +0200)] 
tests/runner: fix %else handling

Getting the show state proper for %else and %endif did not properly work
in nested cases.

Follow-up to 3d089c41ea9

Closes #11731

23 months agodocs: Remove mention of #10803 from `KNOWN_BUGS`.
Nicholas Nethercote [Fri, 25 Aug 2023 08:42:43 +0000 (18:42 +1000)] 
docs: Remove mention of #10803 from `KNOWN_BUGS`.

Because the leaks have been fixed.

23 months agoc-hyper: fix another memory leak in `Curl_http`.
Nicholas Nethercote [Fri, 25 Aug 2023 08:40:31 +0000 (18:40 +1000)] 
c-hyper: fix another memory leak in `Curl_http`.

There is a `hyper_clientconn_free` call on the happy path, but not one
on the error path. This commit adds one.

Fixes the second memory leak reported by Valgrind in #10803.

Fixes #10803
Closes #11729

23 months agoc-hyper: fix a memory leak in `Curl_http`.
Nicholas Nethercote [Fri, 25 Aug 2023 05:01:53 +0000 (15:01 +1000)] 
c-hyper: fix a memory leak in `Curl_http`.

A request created with `hyper_request_new` must be consumed by either
`hyper_clientconn_send` or `hyper_request_free`.

This is not terrifically clear from the hyper docs --
`hyper_request_free` is documented only with "Free an HTTP request if
not going to send it on a client" -- but a perusal of the hyper code
confirms it.

This commit adds a `hyper_request_free` to the `error:` path in
`Curl_http` so that the request is consumed when an error occurs after
the request is created but before it is sent.

Fixes the first memory leak reported by Valgrind in #10803.

Closes #11729

23 months agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 25 Aug 2023 11:56:46 +0000 (13:56 +0200)] 
RELEASE-NOTES: synced

23 months agomisc: spellfixes
John Bampton [Fri, 25 Aug 2023 09:42:38 +0000 (19:42 +1000)] 
misc: spellfixes

Closes #11730

23 months agotests: add support for nested %if conditions
Daniel Stenberg [Thu, 24 Aug 2023 21:51:24 +0000 (23:51 +0200)] 
tests: add support for nested %if conditions

Provides more flexiblity to test cases.

Also warn and bail out if there is an '%else' or %endif' without a
preceeding '%if'.

Ref: #11610
Closes #11728

23 months agotime-cond.d: mention what happens on a missing file
Daniel Stenberg [Thu, 24 Aug 2023 15:36:37 +0000 (17:36 +0200)] 
time-cond.d: mention what happens on a missing file

Closes #11727

23 months agodocs/cmdline-opts: match the current output
Christian Hesse [Thu, 24 Aug 2023 08:02:53 +0000 (10:02 +0200)] 
docs/cmdline-opts: match the current output

The release date has been added in output, reflect that in documentation.

Closes #11723

23 months agolib: minor comment corrections
Daniel Stenberg [Thu, 24 Aug 2023 08:02:23 +0000 (10:02 +0200)] 
lib: minor comment corrections

23 months agodocs: rewrite to present tense
Daniel Stenberg [Tue, 22 Aug 2023 15:40:39 +0000 (17:40 +0200)] 
docs: rewrite to present tense

... instead of using future tense.

+ numerous cleanups and improvements
+ stick to "reuse" not "re-use"
+ fewer contractions

Closes #11713

23 months agourlapi: setting a blank URL ("") is not an ok URL
Daniel Stenberg [Wed, 23 Aug 2023 12:30:17 +0000 (14:30 +0200)] 
urlapi: setting a blank URL ("") is not an ok URL

Test it in 1560
Fixes #11714
Reported-by: ad0p on github
Closes #11715

23 months agospelling: use 'reuse' not 're-use' in code and elsewhere
Daniel Stenberg [Wed, 23 Aug 2023 12:47:45 +0000 (14:47 +0200)] 
spelling: use 'reuse' not 're-use' in code and elsewhere

Unify the spelling as both versions were previously used intermittently

Closes #11717

23 months agosystem.h: add CURL_OFF_T definitions on HP-UX with HP aCC
Michael Osipov [Wed, 23 Aug 2023 12:55:31 +0000 (14:55 +0200)] 
system.h: add CURL_OFF_T definitions on HP-UX with HP aCC

HP-UX on IA64 provides two modes: 32 and 64 bit while 32 bit being the
default one. Use "long long" in 32 bit mode and just "long" in 64 bit
mode.

Closes #11718

23 months agotests: don't call HTTP errors OK in test cases
Dan Fandrich [Wed, 16 Aug 2023 16:03:53 +0000 (09:03 -0700)] 
tests: don't call HTTP errors OK in test cases

Some HTTP errors codes were accompanied by the text OK, which causes
some cognitive dissonance when reading them.

23 months agohttp: close the connection after a late 417 is received
Dan Fandrich [Tue, 15 Aug 2023 20:43:07 +0000 (13:43 -0700)] 
http: close the connection after a late 417 is received

In this situation, only part of the data has been sent before aborting
so the connection is no longer usable.

Assisted-by: Jay Satiro
Fixes #11678
Closes #11679

23 months agoruntests: slightly increase the longest log file displayed
Dan Fandrich [Thu, 17 Aug 2023 01:20:11 +0000 (18:20 -0700)] 
runtests: slightly increase the longest log file displayed

The new limit provides enough space for a 64 KiB data block to be logged
in a trace file, plus a few lines at the start and end for context. This
happens to be the amount of data sent at a time in a PUT request.

23 months agotests: add delay command to the HTTP server
Dan Fandrich [Mon, 21 Aug 2023 21:10:25 +0000 (14:10 -0700)] 
tests: add delay command to the HTTP server

This adds a delay after client connect.

23 months agocirrus: install everthing with pkg, avoid pip
Daniel Stenberg [Tue, 22 Aug 2023 15:47:56 +0000 (17:47 +0200)] 
cirrus: install everthing with pkg, avoid pip

Assisted-by: Sevan Janiyan
Closes #11711

23 months agocurl_url*.3: update function descriptions
Daniel Stenberg [Tue, 22 Aug 2023 09:26:05 +0000 (11:26 +0200)] 
curl_url*.3: update function descriptions

- expand and clarify several descriptions
- avoid using future tense all over

Closes #11708

23 months agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 22 Aug 2023 06:26:12 +0000 (08:26 +0200)] 
RELEASE-NOTES: synced

23 months agoCI/cirrus: disable python install on FreeBSD
Stefan Eissing [Mon, 21 Aug 2023 12:05:38 +0000 (14:05 +0200)] 
CI/cirrus: disable python install on FreeBSD

- python cryptography package does not build build FreeBSD
- install just mentions "error"
- this gets the build and the main test suite going again

Closes #11705

23 months agotest2600: fix flakiness on low cpu
Stefan Eissing [Fri, 18 Aug 2023 09:08:52 +0000 (11:08 +0200)] 
test2600: fix flakiness on low cpu

- refs #11355 where failures to to low cpu resources in CI
  are reported
- vastly extend CURLOPT_CONNECTTIMEOUT_MS and max durations
  to test cases
- trigger Curl_expire() in test filter to allow re-checks before
  the usual 1second interval

Closes #11690

23 months agotool_urlglob: use the correct format specifier for curl_off_t in msnprintf
Maksim Sciepanienka [Sat, 19 Aug 2023 23:59:31 +0000 (01:59 +0200)] 
tool_urlglob: use the correct format specifier for curl_off_t in msnprintf

Closes #11698

23 months agotest687/688: two more basic --xattr tests
Daniel Stenberg [Sat, 19 Aug 2023 21:33:25 +0000 (23:33 +0200)] 
test687/688: two more basic --xattr tests

Closes #11697

23 months agocmdline-opts/docs: mentioned the negative option part
Daniel Stenberg [Sat, 19 Aug 2023 18:06:14 +0000 (20:06 +0200)] 
cmdline-opts/docs: mentioned the negative option part

... for --no-alpn and --no-buffer in the same style done for other --no-
options:

"Note that this is the negated option name documented."

Closes #11695

23 months agotool/var: also error when expansion result starts with NUL
Emanuele Torre [Sat, 19 Aug 2023 16:51:16 +0000 (18:51 +0200)] 
tool/var: also error when expansion result starts with NUL

Expansions whose output starts with NUL were being expanded to the empty
string, and not being recognised as values that contain a NUL byte, and
should error.

Closes #11694

23 months agotests: add 'large-time' as a testable feature
Daniel Stenberg [Sat, 19 Aug 2023 19:20:03 +0000 (21:20 +0200)] 
tests: add 'large-time' as a testable feature

This allows test cases to require this feature to run and to be used in
%if conditions.

Large here means larger than 32 bits. Ie does not suffer from y2038.

Closes #11696

23 months agotests/Makefile: add check-translatable-options.pl to tarball
Daniel Stenberg [Fri, 18 Aug 2023 06:48:34 +0000 (08:48 +0200)] 
tests/Makefile: add check-translatable-options.pl to tarball

Used in test 1544

Follow-up to ae806395abc8c

23 months agogen.pl: fix a long version generation mistake
Daniel Stenberg [Thu, 17 Aug 2023 21:21:02 +0000 (23:21 +0200)] 
gen.pl: fix a long version generation mistake

Too excessive escaping made the parsing not find the correct long names
later and instead add "wrong" links.

Follow-up to 439ff2052e219

Reported-by: Lukas Tribus
Fixes #11688
Closes #11689

23 months agolib: move mimepost data from ->req.p.http to ->state
Daniel Stenberg [Wed, 16 Aug 2023 08:43:02 +0000 (10:43 +0200)] 
lib: move mimepost data from ->req.p.http to ->state

When the legacy CURLOPT_HTTPPOST option is used, it gets converted into
the modem mimpost struct at first use. This data is (now) kept for the
entire transfer and not only per single HTTP request. This re-enables
rewind in the beginning of the second request instead of in end of the
first, as brought by 1b39731.

The request struct is per-request data only.

Extend test 650 to verify.

Fixes #11680
Reported-by: yushicheng7788 on github
Closes #11682

23 months agoos400: do not check translatable options at build time
Patrick Monnerat [Thu, 10 Aug 2023 23:03:37 +0000 (01:03 +0200)] 
os400: do not check translatable options at build time

Now that there is a test for this, the build time check is not needed
anymore.

Closes #11650