]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
19 months agorustls: fix partial send handling
Stefan Eissing [Thu, 16 May 2024 12:59:25 +0000 (14:59 +0200)] 
rustls: fix partial send handling

When TLS bytes could not completely sent off, the amount of plain bytes
already added to rustls were forgotten. This lead to send those byte
duplicate, corrupting the request send to the server.

Closes #13676

19 months agopytest: add DELETE tests, check server version
Stefan Eissing [Thu, 16 May 2024 15:53:19 +0000 (17:53 +0200)] 
pytest: add DELETE tests, check server version

- add tests for DELETE working
- check apache version in keepalive test
- fix some comments

Closes #13679

19 months agovquic-tls: use correct cert name check API for wolfSSL
Juliusz Sosinowicz [Thu, 16 May 2024 18:16:37 +0000 (20:16 +0200)] 
vquic-tls: use correct cert name check API for wolfSSL

wolfSSL_X509_check_host checks the peer name against the alt names and
the common name.

Fixes #13487
Closes #13680

19 months agocmake: initialize `BUILD_TESTING` before first use
Viktor Szakats [Thu, 16 May 2024 00:56:37 +0000 (02:56 +0200)] 
cmake: initialize `BUILD_TESTING` before first use

Before this patch `BUILD_TESTING` was used once, then initialized, then
used again. This caused the `curlu` library not being built when relying
on an implicit `BUILD_TESTING=ON` setting, and ending up with a link
error when building the `testdeps` target.

It did not cause issues when `BUILD_TESTING` was explicitly set.

Move the initialization before the first use to fix it.

Regression from aace27b0965c10394544d1dacc9c2cb2fe0de3d3 #12287
Closes #13668

19 months agolibtest: 2308 verifies CURLE_WRITE_ERROR after write callback error
Daniel Stenberg [Thu, 16 May 2024 07:07:31 +0000 (09:07 +0200)] 
libtest: 2308 verifies CURLE_WRITE_ERROR after write callback error

Verifies that the issue in #13669 actually is fixed. This return code is
what the CURLOPT_WRITEFUNCTION manpage documents should be returned.

This code is mostly from the
Source-written-by: Trumeet on github
Closes #13671

19 months agosocketpair: fix compilation when USE_UNIX_SOCKETS is not defined
Antoine Bollengier [Wed, 15 May 2024 20:46:05 +0000 (22:46 +0200)] 
socketpair: fix compilation when USE_UNIX_SOCKETS is not defined

Closes #13666

19 months agorustsls: fix error code on receive
Stefan Eissing [Thu, 16 May 2024 06:55:14 +0000 (08:55 +0200)] 
rustsls: fix error code on receive

- use CURLE_RECV_ERROR instead of CURLE_READ_ERROR when receiving
  data fails.

Closes #13670

19 months agoci: disable Renovate dashboard
Max Dymond [Thu, 16 May 2024 08:02:36 +0000 (09:02 +0100)] 
ci: disable Renovate dashboard

The Renovate dashboard insists on an open issue,
which is a problem. Disable the dashboard. Status
can still be seen at https://developer.mend.io/github/curl/curl.

Fixes #13630
Closes #13673

19 months agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 16 May 2024 06:44:21 +0000 (08:44 +0200)] 
RELEASE-NOTES: synced

19 months agoGHA: update awslabs/aws-lc to v1.27.0
renovate[bot] [Wed, 15 May 2024 21:23:24 +0000 (21:23 +0000)] 
GHA: update awslabs/aws-lc to v1.27.0

Closes #13667

19 months agocurl_easy_pause.md: use correct defines in example
Daniel Stenberg [Wed, 15 May 2024 14:11:42 +0000 (16:11 +0200)] 
curl_easy_pause.md: use correct defines in example

Spotted-by: Harry Sintonen
Closes #13664

19 months agoappveyor: more tidy-ups
Viktor Szakats [Sun, 12 May 2024 22:34:54 +0000 (00:34 +0200)] 
appveyor: more tidy-ups

- use `--disable` when calling `curl --version`. Just in case.

- use single-quotes for a constant.

Closes #13662

19 months agoreuse: migrate standalone license file to dep5
Viktor Szakats [Wed, 15 May 2024 09:50:07 +0000 (11:50 +0200)] 
reuse: migrate standalone license file to dep5

Follow-up to 73a36021207284ad2b4340ffde34a51b0ba4d47a
Closes #13660

19 months agoappveyor: guard against crash-build with VS2008
Viktor Szakats [Wed, 15 May 2024 06:19:54 +0000 (08:19 +0200)] 
appveyor: guard against crash-build with VS2008

The combination of `-DDEBUGBUILD`, a shared `curl.exe`, and the VS2008
compiler creates a `curl.exe` segfaulting on startup:

```
+ _bld/src/curl.exe --version
./appveyor.sh: line 122:   793 Segmentation fault      "${curl}" --version
Command exited with code 139
```
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/49817266/job/651iy6qn1e238pqj#L191

Add job that triggers the issue and add the necessary logic to skip
running the affected `curl.exe`.

Ref: #13592
Closes #13654

19 months agoGHA: pin dependencies
renovate[bot] [Wed, 15 May 2024 09:39:30 +0000 (09:39 +0000)] 
GHA: pin dependencies

Closes #13628

19 months agosocket: remove redundant call to getsockname
Orgad Shaneh [Wed, 15 May 2024 07:02:36 +0000 (10:02 +0300)] 
socket: remove redundant call to getsockname

The result "add" is unused.

Closes #13655

19 months agoCI: renovate updates
renovate[bot] [Tue, 14 May 2024 15:27:19 +0000 (15:27 +0000)] 
CI: renovate updates

- GHA: update actions/checkout action to v4
- GHA: update wolfSSL/wolfssh to v1.4.17
- GHA: update wolfSSL/wolfssl to v5.7.0
- Update the regex config in renovate.json

Closes #13632
Closes #13641
Closes #13658
Closes #13659

19 months agoci: fix renovate config for WolfSSL/WolfSSH tagging scheme
Max Dymond [Tue, 14 May 2024 16:16:14 +0000 (17:16 +0100)] 
ci: fix renovate config for WolfSSL/WolfSSH tagging scheme

WolfSSL/WolfSSH use a different versioning scheme;
stable builds end with `-stable`. Renovate requires
some extra configuration to extract the version
from these types of tags.

Closes #13644

19 months agoci: set semantic type as CI and include digests as CI operations
Max Dymond [Tue, 14 May 2024 15:44:37 +0000 (16:44 +0100)] 
ci: set semantic type as CI and include digests as CI operations

Replace "chore" with "ci" for renovate's semantic
type, and include digests with "pin" and
"pinDigest" as ci operations.

Closes #13644

19 months agoDEPRECATE.md: TLS libraries without 1.3 support
Daniel Stenberg [Mon, 6 May 2024 21:27:41 +0000 (23:27 +0200)] 
DEPRECATE.md: TLS libraries without 1.3 support

curl drops support for TLS libraries without TLS 1.3 capability after
May 2025.

It requires that a curl build using the library should be able to
negotiate and use TLS 1.3, or else it is not good enough. We support a
vast amount of other TLS libraries that are likely to satisfy users
better.

Closes #13544

19 months agoRevert "ci: update nghttp2/nghttp2 to v1.62.0"
Daniel Stenberg [Wed, 15 May 2024 07:13:21 +0000 (09:13 +0200)] 
Revert "ci: update nghttp2/nghttp2 to v1.62.0"

This reverts commit 14f2c767555b7598d7783ccd9093670b84d28488.

We need to also upgrade the C++ compiler for that bump to work.

Closes #13656

19 months agoDockerfile: update debian digest to 911821c
renovate[bot] [Tue, 14 May 2024 15:27:02 +0000 (15:27 +0000)] 
Dockerfile: update debian digest to 911821c

Closes #13629

19 months agoci: update gnutls/gnutls to v3.8.5
renovate[bot] [Tue, 14 May 2024 15:27:07 +0000 (15:27 +0000)] 
ci: update gnutls/gnutls to v3.8.5

Closes #13640

19 months agoci: update awslabs/aws-lc to v1.26.0
renovate[bot] [Tue, 14 May 2024 21:29:06 +0000 (21:29 +0000)] 
ci: update awslabs/aws-lc to v1.26.0

Closes #13647

19 months agoci: update cloudflare/quiche to v0.21.0
renovate[bot] [Tue, 14 May 2024 22:25:42 +0000 (22:25 +0000)] 
ci: update cloudflare/quiche to v0.21.0

Closes #13648

19 months agoci: update libressl-portable/portable to v3.9.2
renovate[bot] [Tue, 14 May 2024 22:25:47 +0000 (22:25 +0000)] 
ci: update libressl-portable/portable to v3.9.2

Closes #13649

19 months agoci: update nghttp2/nghttp2 to v1.62.0
renovate[bot] [Tue, 14 May 2024 22:25:54 +0000 (22:25 +0000)] 
ci: update nghttp2/nghttp2 to v1.62.0

Closes #13650

19 months agoci: update ngtcp2/nghttp3 to v1.3.0
renovate[bot] [Tue, 14 May 2024 22:26:02 +0000 (22:26 +0000)] 
ci: update ngtcp2/nghttp3 to v1.3.0

Closes #13651

19 months agoci: update ngtcp2/ngtcp2 to v1.5.0
renovate[bot] [Tue, 14 May 2024 22:26:08 +0000 (22:26 +0000)] 
ci: update ngtcp2/ngtcp2 to v1.5.0

Closes #13652

19 months agoci: handle git submodules for mbedTLS
Max Dymond [Tue, 14 May 2024 09:02:30 +0000 (10:02 +0100)] 
ci: handle git submodules for mbedTLS

19 months agoci: reconfigure renovate
Max Dymond [Tue, 14 May 2024 08:57:03 +0000 (09:57 +0100)] 
ci: reconfigure renovate

- set prefix for github actions updates to be gha:
- set prefix for other renovate actions to be ci:
- disable debian updates in linux-old.yml

19 months agotidy-up: whitespace [ci skip]
Viktor Szakats [Tue, 14 May 2024 14:49:47 +0000 (16:49 +0200)] 
tidy-up: whitespace [ci skip]

19 months agowarnless: delete orphan declarations
Viktor Szakats [Tue, 14 May 2024 12:39:11 +0000 (14:39 +0200)] 
warnless: delete orphan declarations

Follow-up to 358f7e757781857c4b498a68634726609fa3884a #11932
Closes #13639

19 months agoBUG-BOUNTY.md: clarify the third party situation
Daniel Stenberg [Wed, 8 May 2024 09:45:37 +0000 (11:45 +0200)] 
BUG-BOUNTY.md: clarify the third party situation

We do not pay bounties for problems in other libraries.

Closes #13560

19 months agohttp tests: in CI skip test_02_23* for quiche
Stefan Eissing [Tue, 14 May 2024 10:32:09 +0000 (12:32 +0200)] 
http tests: in CI skip test_02_23* for quiche

For unknown reasons, these tests fail in CI often, but run fine locally.
Skip them in CI to avoid unrelated PRs to have failures.

Closes #13638

19 months agohsts: explicitly skip blank lines
Daniel Gustafsson [Tue, 14 May 2024 08:19:41 +0000 (10:19 +0200)] 
hsts: explicitly skip blank lines

Keep blank lines or lines containing only whitespace to make it all
the way to the more expensive sscanf call in hsts_add.

Closes: #13603
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
19 months agoautotools: Only probe for SGI MIPS compilers on IRIX
Daniel Gustafsson [Tue, 14 May 2024 08:04:27 +0000 (10:04 +0200)] 
autotools: Only probe for SGI MIPS compilers on IRIX

MIPSPro and the predecessor compiler which was part of the IDO (IRIS
Development Option) were only ever shipped on the SGI IRIX operating
system (with MIPSPro on 6.0+ which was released in 1994).  Limit the
autoconf check to IRIX when probing for these compilers to save some
cycles on other platforms.

Closes: #13611
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
19 months agotests: fix test 1167 to skip digit-only symbols
Viktor Szakats [Mon, 13 May 2024 20:45:56 +0000 (22:45 +0200)] 
tests: fix test 1167 to skip digit-only symbols

This avoids mistaking symbols with their numeric value when using
certain C preprocessors which output these numeric values at the
beginning of the line as part of an expression.

Seen on OpenBSD 7.5 + clang.

Example `test1167.pl -v` output, before this patch:
```
Source: cpp /home/runner/work/curl/curl/tests/../include/curl/curl.h
Symbol: 20000
Line #3835:   20000 +  142,
[...]
Bad symbols in public header files:
   20000
   [...]
```
Ref: https://github.com/curl/curl/actions/runs/9069136530/job/24918015357#step:3:7513

Ref: #13583
Closes #13634

19 months agolib: call Curl_strntolower instead of doing crafted loops
Daniel Stenberg [Mon, 13 May 2024 21:11:46 +0000 (23:11 +0200)] 
lib: call Curl_strntolower instead of doing crafted loops

Closes #13627

19 months agosetopt: acknowledge errors proper for CURLOPT_COOKIEJAR
Daniel Stenberg [Mon, 13 May 2024 15:31:44 +0000 (17:31 +0200)] 
setopt: acknowledge errors proper for CURLOPT_COOKIEJAR

Error out on error, do not continue.

Closes #13624

19 months agovtls: remove duplicate assign
Daniel Stenberg [Mon, 13 May 2024 18:00:23 +0000 (20:00 +0200)] 
vtls: remove duplicate assign

Curl_ssl_peer_cleanup() already clears the ->sni field, no point in
assigning it again.

Spotted by CodeSonar

Closes #13626

19 months agoGroup all non-major updates together to reduce PR spam
Max Dymond [Mon, 13 May 2024 15:20:34 +0000 (16:20 +0100)] 
Group all non-major updates together to reduce PR spam

19 months agoAdd the remainder of the workflows
Max Dymond [Mon, 13 May 2024 15:15:18 +0000 (16:15 +0100)] 
Add the remainder of the workflows

19 months agoAdd some basic versioning for some workflows to check whether this is detected properly
Max Dymond [Mon, 13 May 2024 14:45:30 +0000 (15:45 +0100)] 
Add some basic versioning for some workflows to check whether this is detected properly

19 months agoAdd renovate.json
renovate[bot] [Mon, 13 May 2024 13:54:50 +0000 (13:54 +0000)] 
Add renovate.json

19 months agovauth: make two functions void that always just returned OK
Daniel Stenberg [Mon, 13 May 2024 15:21:54 +0000 (17:21 +0200)] 
vauth: make two functions void that always just returned OK

Removes the need to check return values when they can never fail.

Pointed out by CodeSonar

Closes #13621

19 months agosetopt: remove check for 'option' that is always true
Daniel Stenberg [Mon, 13 May 2024 14:25:12 +0000 (16:25 +0200)] 
setopt: remove check for 'option' that is always true

- make sure that passing in option set to NULL clears the fields
  correctly

- remove the weird second take if Curl_parse_login_details() returns
  error

Follow-up to 7333faf00bf25db7cd1e0012d6b140

Spotted by CodeSonar

Closes #13619

19 months agotests: tidy up types in server code
Viktor Szakats [Sun, 12 May 2024 19:14:06 +0000 (21:14 +0200)] 
tests: tidy up types in server code

Cherry-picked from #13489
Closes #13610

19 months agosetopt: make the setstropt_userpwd args compulsory
Daniel Stenberg [Sun, 12 May 2024 14:52:51 +0000 (16:52 +0200)] 
setopt: make the setstropt_userpwd args compulsory

They were always used so no point in allowing them to be optional.

follow-up to 0e37b42dc956bd8a

Closes #13608
Reviewed-by: Daniel Gustafsson
19 months agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 13 May 2024 07:48:25 +0000 (09:48 +0200)] 
RELEASE-NOTES: synced

19 months agowebsocket: Avoid memory leak in error path
Daniel Gustafsson [Mon, 13 May 2024 07:11:23 +0000 (09:11 +0200)] 
websocket: Avoid memory leak in error path

In the errorpath for randstr being too long to copy into the buffer
we leak the randstr when returning CURLE_FAILED_INIT.  Fix by using
an explicit free on randstr in the errorpath.

Closes: #13602
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
19 months agohsts: Remove single-use single-line function
Daniel Gustafsson [Mon, 13 May 2024 07:07:30 +0000 (09:07 +0200)] 
hsts: Remove single-use single-line function

The hsts_entry() function contains of a single line and is only
used in a single place in the code, so move the allocation into
hsts_create instead to improve code readability. C code usually
don't use the factory abstraction for object creation, and this
small example wasn't following our usual code style.

Closes: #13604
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
19 months agolib: bump hash sizes to `size_t`
Viktor Szakats [Sun, 5 May 2024 15:45:11 +0000 (17:45 +0200)] 
lib: bump hash sizes to `size_t`

Follow-up to cc907e80a2498c0599253271a6f657f614b52a4e #13502
Cherry-picked from #13489
Closes #13601

19 months agotests: make the unit test result type `CURLcode`
Viktor Szakats [Sat, 11 May 2024 19:36:05 +0000 (21:36 +0200)] 
tests: make the unit test result type `CURLcode`

Before this patch, the result code was a mixture of `int` and
`CURLcode`.

Also adjust casts and fix a couple of minor issues found along the way.

Cherry-picked from #13489
Closes #13600

19 months agoappveyor: tidy-ups
Viktor Szakats [Sat, 11 May 2024 13:34:12 +0000 (15:34 +0200)] 
appveyor: tidy-ups

- delete a duplicate line.
- simplify a `make` call.
- merge two `if` branches.
- reorder autotools options for clarity.
- add `--enable-warnings` where missing (it's also the default.)
- add empty lines to YAML for readability.
- use lowercase install prefix/directory.

Closes #13598

19 months agodocs/cmdline-opts: mention STARTTLS for --ssl and --ssl-reqd
Daniel Stenberg [Fri, 10 May 2024 21:30:06 +0000 (23:30 +0200)] 
docs/cmdline-opts: mention STARTTLS for --ssl and --ssl-reqd

... since users might look for those terms in the manpage.

Closes #13590

19 months agosetopt: warn on Curl_set*opt() uses not using the return value
Daniel Stenberg [Fri, 10 May 2024 21:50:58 +0000 (23:50 +0200)] 
setopt: warn on Curl_set*opt() uses not using the return value

And switch the invokes that would "set" NULL to instead just plainly
free the pointer, as those were otherwise the invokes that would ignore
the return code. And possibly confuse static code analyzers.

Closes #13591

19 months agoautotools: delete unused functions
Orgad Shaneh [Sun, 12 May 2024 05:45:11 +0000 (08:45 +0300)] 
autotools: delete unused functions

Closes #13605

19 months agoexamples: fix/silence `-Wsign-conversion`
Viktor Szakats [Sat, 27 Apr 2024 19:09:01 +0000 (21:09 +0200)] 
examples: fix/silence `-Wsign-conversion`

- extend `FD_SET()` hack to all platforms (was only Cygwin).
  Warnings may also happen in other envs, e.g. OmniOS.
  Ref: https://github.com/libssh2/libssh2/actions/runs/8854199687/job/24316762831#step:3:2021

- tidy-up `CURLcode` vs `int` use.

- cast an unsigned to `long` before passing to `curl_easy_setopt()`.

Cherry-picked from #13489
Follow-up to 3829759bd042c03225ae862062560f568ba1a231 #12489
Closes #13501

19 months agocmake: fix `HAVE_IOCTLSOCKET_FIONBIO` test with gcc 14
Orgad Shaneh [Fri, 10 May 2024 10:13:32 +0000 (13:13 +0300)] 
cmake: fix `HAVE_IOCTLSOCKET_FIONBIO` test with gcc 14

The function signature has had u_long flags since ever. This is how it
is defined in the documentation, and implemented in MinGW.

The code that uses ioctlsocket in nonblock.c also has unsigned long.

Error:
CurlTests.c:275:41: error: passing argument 3 of 'ioctlsocket' from incompatible pointer type [-Wincompatible-pointer-types]
  275 |         if(0 != ioctlsocket(0, FIONBIO, &flags))
      |                                         ^~~~~~
      |                                         |
      |                                         int *
In file included from CurlTests.c:266:
/opt/mxe/usr/i686-w64-mingw32.static/include/winsock2.h:1007:76: note: expected 'u_long *' {aka 'long unsigned int *'} but argument is of type 'int *'
 1007 |   WINSOCK_API_LINKAGE int WSAAPI ioctlsocket(SOCKET s,__LONG32 cmd,u_long *argp);
      |                                                                    ~~~~~~~~^~~~

Closes #13578

19 months agoftp: fix build for CURL_DISABLE_VERBOSE_STRINGS
Jay Satiro [Fri, 10 May 2024 23:14:29 +0000 (19:14 -0400)] 
ftp: fix build for CURL_DISABLE_VERBOSE_STRINGS

This is a follow-up to b7c7dffe which changed the FTP state change
verbose debug text (aka infof) to tracing debug text (aka trc).

Prior to this change if libcurl was without DEBUGBUILD and built with
CURL_DISABLE_VERBOSE_STRINGS (ie --disable-verbose) the build would
error.

Caught by Circle CI job openssl-no-verbose.

19 months agolib: clear the easy handle's saved errno before transfer
Jay Satiro [Fri, 10 May 2024 07:19:16 +0000 (03:19 -0400)] 
lib: clear the easy handle's saved errno before transfer

- Clear data->state.os_errno before transfer.

- Explain the change in behavior in the CURLINFO_OS_ERRNO doc.

- Add to the CURLINFO_OS_ERRNO doc the list of libcurl network-related
  errors that may cause the errno to be saved.

data->state.os_errno is saved before libcurl returns a network-related
failure such as connection failure. It is accessible to the user via
CURLINFO_OS_ERRNO so they can get more information about the failure.

Prior to this change it wasn't cleared before transfer, so if a user
retrieved the saved errno it could be from a previous transfer. That is
because an errno is not always saved for network-related errors.

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

19 months agoftp: add tracing support
Stefan Eissing [Fri, 10 May 2024 10:59:12 +0000 (12:59 +0200)] 
ftp: add tracing support

- add `Curl_trc_feat_ftp` for tracing via trace config
- add macro CURL_TRC_FTP(data, fmt, ...)
- replace DEBUGF(infof()) statements in ftp.c by CURL_TRC_FTP()
- always trace FTP connection state

Closes #13580

19 months agohttp: remove redundant check
Daniel Stenberg [Fri, 10 May 2024 12:33:34 +0000 (14:33 +0200)] 
http: remove redundant check

Spotted by CodeSonar

Closes #13582

19 months agoldap: fix unused variables (seen on OmniOS)
Viktor Szakats [Fri, 10 May 2024 15:03:26 +0000 (17:03 +0200)] 
ldap: fix unused variables (seen on OmniOS)

```
../../lib/ldap.c: In function 'ldap_do':
  ../../lib/ldap.c:380:11: error: unused variable 'ldap_ca' [-Werror=unused-variable]
    380 |     char *ldap_ca = conn->ssl_config.CAfile;
        |           ^~~~~~~
  ../../lib/ldap.c:379:9: error: unused variable 'ldap_option' [-Werror=unused-variable]
    379 |     int ldap_option;
        |         ^~~~~~~~~~~
```
Ref: https://github.com/curl/curl/actions/runs/9033564377/job/24824192730#step:3:6059

Ref: #13583
Closes #13588

19 months agourl: make parse_login_details use memdup0
Daniel Stenberg [Fri, 10 May 2024 13:32:57 +0000 (15:32 +0200)] 
url: make parse_login_details use memdup0

Also make the user and password arguments mandatory, since all code
paths in libcurl used them anyway.

Adapted unit test case 1620 to the new rules.

Closes #13584

19 months agodigest: replace strcpy for empty string with simple assignment
Orgad Shaneh [Fri, 10 May 2024 15:08:25 +0000 (18:08 +0300)] 
digest: replace strcpy for empty string with simple assignment

Closes #13586

19 months agoautotools: fix `HAVE_IOCTLSOCKET_FIONBIO` test for gcc 14
Viktor Szakats [Fri, 10 May 2024 16:01:22 +0000 (18:01 +0200)] 
autotools: fix `HAVE_IOCTLSOCKET_FIONBIO` test for gcc 14

```
conftest.c:152:41: error: passing argument 3 of 'ioctlsocket' from incompatible pointer type [-Wincompatible-pointer-types]
  152 |         if(0 != ioctlsocket(0, FIONBIO, &flags))
      |                                         ^~~~~~
      |                                         |
      |                                         int *
```

Reported-by: LigH
Fixes #13579
Closes #13587

19 months agoCI: ignore test 286 on Appveyor gcc 7 build
Viktor Szakats [Fri, 10 May 2024 07:49:57 +0000 (09:49 +0200)] 
CI: ignore test 286 on Appveyor gcc 7 build

Disabled earlier for gcc 9 builds. gcc 7 uses the same runner and
prone to similar intermittent failures.

Follow-up to f1e05a6e6e7225fa09952abb2c935ae1abe44f45 #12106 #12040
Closes #13575

19 months agocf-socket: don't try getting local IP without socket
Daniel Stenberg [Fri, 10 May 2024 08:52:58 +0000 (10:52 +0200)] 
cf-socket: don't try getting local IP without socket

In cf_tcp_connect(), it might fail and not get a socket assigned to
ctx->sock but set_local_ip() is still called which would make
getsockname() get invoked with a negative file desriptor and fail.

By adding this check, set_local_ip() will now instead blank out the
fields correctly.

Spotted by CodeSonar

Closes #13577

19 months agotool_getparam: remove two redundant conditions
Daniel Stenberg [Fri, 10 May 2024 08:24:15 +0000 (10:24 +0200)] 
tool_getparam: remove two redundant conditions

When getstr() does not return error, it returns a valid pointer.

Spotted by CodeSonar

Closes #13576

19 months agoquiche: trust its timeout handling
Stefan Eissing [Fri, 10 May 2024 12:01:20 +0000 (14:01 +0200)] 
quiche: trust its timeout handling

- set the idle timeout transport parameter
  in milliseconds as documented by quiche
- do not calculate the idle timeout, rely on
  quiche handling it

Closes #13581

19 months agodmaketgz: accept a SOURCE_DATE_EPOCH as an second argument
Daniel Stenberg [Fri, 10 May 2024 06:50:47 +0000 (08:50 +0200)] 
dmaketgz: accept a SOURCE_DATE_EPOCH as an second argument

to make it easier to reproduce a tarball

Closes #13573

19 months agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 10 May 2024 07:33:26 +0000 (09:33 +0200)] 
RELEASE-NOTES: synced

19 months agoh3/ngtcp2: improve error handling
Stefan Eissing [Wed, 8 May 2024 11:44:35 +0000 (13:44 +0200)] 
h3/ngtcp2: improve error handling

- identify ngtcp2 and nghttp3 error codes that are fatal
- close quic connection on fatal errors
- refuse further filter operations once connection is closed
- confusion about the nghttp3 API. We should close the QUIC stream on
  cancel and not use the nghttp3 calls intended to be invoked when the
  QUIC stream was closed by the peer.

Closes #13562

19 months agodocs: fix some CURLINFO examples
Jay Satiro [Wed, 8 May 2024 07:37:12 +0000 (03:37 -0400)] 
docs: fix some CURLINFO examples

- improve getinfo result check for example sections:
  CURLINFO_ACTIVESOCKET, CURLINFO_LASTSOCKET, CURLINFO_SSL_VERIFYRESULT,
  CURLINFO_PROXY_SSL_VERIFYRESULT

- fix getinfo result check for example sections:
  CURLINFO_NUM_CONNECTS, CURLINFO_OS_ERRNO

- fix verify result check for example sections:
  CURLINFO_PROXY_SSL_VERIFYRESULT

Bug: https://github.com/curl/curl/discussions/13557#discussion-6625507
Reported-by: farazrbx@users.noreply.github.com
Closes https://github.com/curl/curl/pull/13559

19 months agoKNOWN_BUGS: gssapi library name + version is missing in curl_version_info()
Daniel Stenberg [Thu, 9 May 2024 09:24:07 +0000 (11:24 +0200)] 
KNOWN_BUGS: gssapi library name + version is missing in curl_version_info()

Closes #13492
Closes #13570

19 months agokrb5: use dynbuf
Daniel Stenberg [Wed, 8 May 2024 13:20:23 +0000 (15:20 +0200)] 
krb5: use dynbuf

Closes #13568

19 months agomanagen: fix the option sort order
Daniel Stenberg [Wed, 8 May 2024 21:50:55 +0000 (23:50 +0200)] 
managen: fix the option sort order

... it used to strip off the .d file extension to sort correctly but
ever since the extension changed to .md the operation failed and the
sort got wrong.

Follow-up to 2494b8dd5175cee7f2e

Closes #13567

19 months agoGHA: repair the linux-old job
Stefan Eissing [Wed, 8 May 2024 13:39:06 +0000 (15:39 +0200)] 
GHA: repair the linux-old job

package libc6_2.28-10+deb10u2_amd64.deb changed to
libc6_2.28-10+deb10u3_amd64.deb

Closes #13564

19 months agoappveyor: make gcc 6 mingw64 job build-only
Viktor Szakats [Wed, 8 May 2024 17:43:07 +0000 (19:43 +0200)] 
appveyor: make gcc 6 mingw64 job build-only

This job has proven to be the flakiest of all, and it's also the oldest
Windows runner we had tests running on: 'Visual Studio 2015', that is
running on Windows Server 2012 R2:
  https://www.appveyor.com/docs/windows-images-software/

Turn off tests on this job to help stabilizing CI runs.

This was also one of the slowest running job amongst the AppVeyor CI ones.

Flakiness data:
  https://testclutch.curl.se/static/reports/summary.html
Entries:
  Appveyor / CMake, mingw-w64, gcc 6, Debug, x86, Schannel, Static, no-unity (curl) [current]
  Appveyor / CMake, mingw-w64, gcc 6, Debug, x86, Schannel, Static (curl) [former]

Closes #13566

19 months agounit2604: use alloc instead of overlong string const
Stefan Eissing [Wed, 8 May 2024 13:32:28 +0000 (15:32 +0200)] 
unit2604: use alloc instead of overlong string const

Closes #13563

19 months agobufq: remove duplicate word in comment
Daniel Gustafsson [Wed, 8 May 2024 17:12:03 +0000 (19:12 +0200)] 
bufq: remove duplicate word in comment

Inspired by 13552.

Closes: #13554
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
19 months agolib/cf-h1-proxy: silence compiler warnings (gcc 14)
Viktor Szakats [Tue, 7 May 2024 15:50:42 +0000 (17:50 +0200)] 
lib/cf-h1-proxy: silence compiler warnings (gcc 14)

They came up ealier with gcc 12 (Windows), but apparently gcc 14 is
still reporting them, also under Linux.

```
/home/runner/work/curl-for-win/curl-for-win/curl/lib/cf-h1-proxy.c: In function 'cf_h1_proxy_close':
/home/runner/work/curl-for-win/curl-for-win/curl/lib/cf-h1-proxy.c:1060:17: warning: null pointer dereference [-Wnull-dereference]
 1060 |   cf->connected = FALSE;
/home/runner/work/curl-for-win/curl-for-win/curl/lib/cf-h1-proxy.c:1061:8: warning: null pointer dereference [-Wnull-dereference]
 1061 |   if(cf->ctx) {
      |      ~~^~~~~
In function 'tunnel_free',
    inlined from 'cf_h1_proxy_destroy' at /home/runner/work/curl-for-win/curl-for-win/curl/lib/cf-h1-proxy.c:1053:3:
/home/runner/work/curl-for-win/curl-for-win/curl/lib/cf-h1-proxy.c:198:27: warning: null pointer dereference [-Wnull-dereference]
  198 |   struct h1_tunnel_state *ts = cf->ctx;
      |                           ^~
```
Ref: https://github.com/curl/curl-for-win/actions/runs/8985369476/job/24679219528#step:3:6320

Fixes #13237
Closes #13555

19 months agombedtls: support TLS 1.3
MAntoniak [Thu, 8 Feb 2024 20:12:49 +0000 (21:12 +0100)] 
mbedtls: support TLS 1.3

Closes #13539

19 months agoversion: use msnprintf instead of strncpy
Daniel Stenberg [Wed, 8 May 2024 06:41:28 +0000 (08:41 +0200)] 
version: use msnprintf instead of strncpy

- to ensure a terminating null byte
- to avoid zero-padding the target

debug code only

Closes #13549

19 months agocurl_path: make Curl_get_pathname use dynbuf
Daniel Stenberg [Tue, 7 May 2024 12:28:29 +0000 (14:28 +0200)] 
curl_path: make Curl_get_pathname use dynbuf

... instead of malloc and memcpy

- unit test 2604 verifies Curl_get_pathname()

Closes #13550

19 months agolib: make protocol handlers store scheme name lowercase
Daniel Stenberg [Tue, 7 May 2024 14:55:23 +0000 (16:55 +0200)] 
lib: make protocol handlers store scheme name lowercase

- saves a lowercase operation when the "[scheme]_proxy" name is
  generated
- appears less "shouting"
- update test 970, 972, 1438 and 1536

Closes #13553

19 months agolib: remove two instances of "only only" messages
Daniel Stenberg [Tue, 7 May 2024 14:25:37 +0000 (16:25 +0200)] 
lib: remove two instances of "only only" messages

Fixes #13551
Reported-by: Lucas Nussbaum
Closes #13552

19 months agoasyn-thread: fix curl_global_cleanup crash in Windows
Pavel P [Thu, 2 May 2024 04:15:44 +0000 (06:15 +0200)] 
asyn-thread: fix curl_global_cleanup crash in Windows

- Make sure that asynchronous resolves handled by Winsock are stopped
  before WSACleanup is called.

This is implemented by ensuring that when Curl_resolver_kill is called
(eg via multi_done) it will cancel the Winsock asynchronous resolve and
wait for the cancellation to complete. Winsock runs the asynchronous
completion routine immediately when a resolve is canceled.

Prior to this change it was possible that during curl_global_cleanup
"a DNS resolver thread created by GetAddrInfoExW did not terminate yet,
however curl is already shutting down, deinitializing Winsock with
WSACleanup() leading to an access violation."

Background:

If libcurl is built with the asynchronous threaded resolver option for
Windows then it resolves in one of two ways. For Windows 8.1 and later,
libcurl resolves by using the Winsock asynchronous resolver which does
its own thread management. For older versions of Windows, libcurl
resolves by creating a separate thread that calls getaddrinfo. This
change only affects the former and it's already handled for the latter.

Reported-by: Ch40zz@users.noreply.github.com
Fixes https://github.com/curl/curl/issues/13509
Closes https://github.com/curl/curl/pull/13518

19 months agoasyn-thread: fix Curl_thread_create result check
Jay Satiro [Mon, 6 May 2024 18:49:43 +0000 (14:49 -0400)] 
asyn-thread: fix Curl_thread_create result check

- Compare to curl_thread_t_null instead of 0 for error.

Currently for both supported thread libraries (pthreads and Windows)
curl_thread_t_null is defined as 0. However, the pattern throughout the
code is to check against curl_thread_t_null and not 0 since for
posterity some thread library may not use 0 for error.

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

19 months agocurl_multibyte: remove access() function wrapper for Windows
Jay Satiro [Fri, 3 May 2024 23:31:00 +0000 (19:31 -0400)] 
curl_multibyte: remove access() function wrapper for Windows

- Remove curlx_win32_access() which was a wrapper to use access() in
  Windows.

This is a follow-up to 602fc213, one of two commits which removed
access() calls from the codebase and banned use of the function.

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

19 months agotls: Remove EXAMPLEs from deprecated options
Daniel Gustafsson [Mon, 6 May 2024 18:55:27 +0000 (20:55 +0200)] 
tls: Remove EXAMPLEs from deprecated options

CURLOPT_EGDSOCKET and CURLOPT_RANDOM_FILE are both completely dead
so remove their example sections since the code there is useless.
There is still a way to inject a random file for OpenSSL older than
1.1.0 but it's not what the example showed (and it's not even done
with this option) so we refrain from documenting it here.

Closes: #13540
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
19 months agotests: Only require EXAMPLE for non-deprecated options
Daniel Gustafsson [Mon, 6 May 2024 18:55:00 +0000 (20:55 +0200)] 
tests: Only require EXAMPLE for non-deprecated options

Manpages which document deprecated CURLOPT_ or CURLINFO_ are not
required to have an EXAMPLE section since they might effectively
be dead no-ops which we don't want to trick users into believing
they can use by copying example code.

Closes: #13540
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
19 months agoEXPERIMENTAL: add graduation requirements for each feature
Daniel Stenberg [Mon, 6 May 2024 12:02:31 +0000 (14:02 +0200)] 
EXPERIMENTAL: add graduation requirements for each feature

Starting now, experimental features should have a set of documentated
requirements of what is needed for the feature to graduate.

This adds requirements to all existing experiments.

Closes #13541

19 months agomisc: fix typos, quoting and spelling
Ivan [Mon, 6 May 2024 08:35:53 +0000 (10:35 +0200)] 
misc: fix typos, quoting and spelling

Fix wording of comments, and misquotings where `' is markdown parsed
where it shouldn't be, and remove a misspelled preprocessor comment
which really isn't needed (and removing it makes it match surrounding
code better).

Closes: #13538
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
19 months agotests: Mark tftpd timer function as noreturn
Daniel Gustafsson [Mon, 6 May 2024 07:51:16 +0000 (09:51 +0200)] 
tests: Mark tftpd timer function as noreturn

This avoids the below compiler warning:

tftpd.c:280:1: warning: function 'timer' could be declared with
    attribute 'noreturn' [-Wmissing-noreturn]

Closes: #13534
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
19 months agodoh: Remove unused function prototype
Daniel Gustafsson [Mon, 6 May 2024 07:50:37 +0000 (09:50 +0200)] 
doh: Remove unused function prototype

Closes: #13536
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
19 months agodoh: cleanups in ECH related functions
Daniel Stenberg [Fri, 3 May 2024 13:06:54 +0000 (15:06 +0200)] 
doh: cleanups in ECH related functions

- make local_decode_rdata_name use dynbuf instead of calloc + memcpy
- avoid extra memdup in local_decode_rdata_alpn
- no need to if() before free()
- use memdup instead of calloc + memcpy in Curl_doh_decode_httpsrr

Reviewed-by: Stephen Farrell
Closes #13526

19 months agolibssh2: delete redundant feature guard
Viktor Szakats [Sun, 5 May 2024 09:49:11 +0000 (11:49 +0200)] 
libssh2: delete redundant feature guard

Delete `HAVE_LIBSSH2_VERSION` (equivalent to
`LIBSSH2_VERSION_NUM` > 0x010100) guard surrounding
a `LIBSSH2_VERSION_NUM` > 0x010B00 one.

Reviewed-by: Daniel Gustafsson
Closes #13537