]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
15 months agoci: add curl-for-win builds: Linux MUSL, macOS, Windows 13333/head
Viktor Szakats [Wed, 10 Apr 2024 09:29:04 +0000 (09:29 +0000)] 
ci: add curl-for-win builds: Linux MUSL, macOS, Windows

Linux MUSL (llvm/clang), macOS Apple clang, Windows (llvm/clang).

Configured with HTTP/2 and HTTP/3 and other dependencies (the default
curl-for-win) for a comprehensive build test.

```
curl 8.8.0-DEV (x86_64-unknown-linux-musl) libcurl/8.8.0-DEV LibreSSL/3.9.1 zlib/1.3.1 brotli/1.1.0 zstd/1.5.6 libpsl/0.21.5 libssh2/1.11.0 nghttp2/1.61.0 ngtcp2/1.4.0 nghttp3/1.2.0
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS brotli HSTS HTTP2 HTTP3 HTTPS-proxy IPv6 Largefile libz NTLM PSL SSL threadsafe UnixSockets zstd

curl 8.8.0-DEV (x86_64-apple-darwin) libcurl/8.8.0-DEV LibreSSL/3.9.1 zlib/1.3.1 brotli/1.1.0 zstd/1.5.6 libpsl/0.21.5 libssh2/1.11.0 nghttp2/1.61.0 ngtcp2/1.4.0 nghttp3/1.2.0
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS brotli HSTS HTTP2 HTTP3 HTTPS-proxy IPv6 Largefile libz NTLM PSL SSL threadsafe UnixSockets zstd

curl 8.8.0-DEV (x86_64-w64-mingw32) libcurl/8.8.0-DEV LibreSSL/3.9.1 zlib/1.3.1 brotli/1.1.0 zstd/1.5.6 WinIDN libpsl/0.21.5 libssh2/1.11.0 nghttp2/1.61.0 ngtcp2/1.4.0 nghttp3/1.2.0
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS brotli HSTS HTTP2 HTTP3 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM PSL SPNEGO SSL SSPI threadsafe UnixSockets zstd
```

Limited to x64, because for build testing the additional CPUs don't add
much value compared to the extra build time. They can be enabled easily
if deemed useful.

To the extent of curl-for-win configuration options, it's trivial to add
further build combinations.

Closes #13335

15 months agoOS400: fix shellcheck warnings in scripts
Viktor Szakats [Sun, 7 Apr 2024 12:39:59 +0000 (12:39 +0000)] 
OS400: fix shellcheck warnings in scripts

- use `$()` instead of backticks, and re-arrange double-quotes inside.
- add missing `|| exit 1` to `cd` calls. (could be dropped by using `set -eu`.)
- add `-n` to a few `if`s.
- shorten redirections by using `{} >` (as shellcheck recommended).
- silence warnings where variables were detected as unused (SC2034).
- a couple misc updates to silence warnings.
- switch to bash shebang for `-ot` feature.
- split two lines to unbreak syntax highlighting in my editor. (`$(expr \`, `$(dirname \`)

Also enable CI checks for OS/400 shell scripts.

Ref: #13307
Closes #13309

15 months agolib: add Curl_xfer_write_resp_hd
Stefan Eissing [Thu, 21 Mar 2024 11:15:59 +0000 (12:15 +0100)] 
lib: add Curl_xfer_write_resp_hd

Add method in protocol handlers to allow writing of a single,
0-terminated header line. Avoids parsing and copying these lines.

Closes #13165

15 months agollist: add Curl_llist_append()
Stefan Eissing [Wed, 10 Apr 2024 09:51:08 +0000 (11:51 +0200)] 
llist: add Curl_llist_append()

- use for better readability in all places where the "insert_next"
  actually performs an append to the list
- add some tests in unit1300

Closes #13336

15 months agognutls: lazy init the trust settings
Stefan Eissing [Wed, 10 Apr 2024 11:30:16 +0000 (13:30 +0200)] 
gnutls: lazy init the trust settings

- delay loading of trust anchors and CRLs after the ClientHello
  has been sent off
- add tracing to IO operations
- on IO errors, return the CURLcode of the underlying filter

Closes #13339

15 months agohttp_negotiate: fix `CURL_DISABLE_PROXY` build
Marcel Raad [Wed, 10 Apr 2024 08:49:12 +0000 (10:49 +0200)] 
http_negotiate: fix `CURL_DISABLE_PROXY` build

`proxyuserpwd` was removed from `dynamically_allocated_data` in commit
f46385d36df.

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

15 months agoquic: fixup duplicate static function name (for cmake unity)
Viktor Szakats [Wed, 10 Apr 2024 01:11:14 +0000 (01:11 +0000)] 
quic: fixup duplicate static function name (for cmake unity)

Visible in daily curl-for-win builds:
https://github.com/curl/curl-for-win/actions/runs/8621925870

```
lib/vquic/curl_ngtcp2.c:1916:12: error: redefinition of 'ossl_new_session_cb'
static int ossl_new_session_cb(SSL *ssl, SSL_SESSION *ssl_sessionid)
           ^
lib/vtls/openssl.c:2978:12: note: previous definition is here
static int ossl_new_session_cb(SSL *ssl, SSL_SESSION *ssl_sessionid)
           ^
```
https://github.com/curl/curl-for-win/actions/runs/8621925870/job/23631885439#step:3:6965

Follow-up to 3210101088dfa3d6a125d213226b092f2f866722 #13172
Closes #13332

15 months agoappveyor: make VS2010 job build-only, enable Schannel, fix compiler warnings
Viktor Szakats [Tue, 9 Apr 2024 19:08:18 +0000 (19:08 +0000)] 
appveyor: make VS2010 job build-only, enable Schannel, fix compiler warnings

Tests were consistently flaky for a while.

Also fix compiler warnings in `CertOpenStore()` calls for old MSVC compilers:
```
C:/projects/curl/lib/vtls/schannel.c(688):
  warning C4306: 'type cast' : conversion from 'int' to 'LPCSTR' of greater size
C:/projects/curl/lib/vtls/schannel_verify.c(642):
  warning C4306: 'type cast' : conversion from 'int' to 'LPCSTR' of greater size
```
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/49580310/job/ywu2y44kymgc0nif#L106

Closes #13330

15 months agoprojects: drop MSVC project files for recent versions
Daniel Stenberg [Mon, 8 Apr 2024 07:13:17 +0000 (09:13 +0200)] 
projects: drop MSVC project files for recent versions

We encourage users to generate visual studio project files using CMake.

We keep project files in git for ancient visual studio versions that
cmake cannot generate files for, but we no longer ship the project files
in the tarballs.

appveyor: switch VisualStudioSolution job to VC12 (Visual Studio 2013)

Co-Authored-by: Viktor Szakats
Co-Authored-by: Jay Satiro
Closes #13311

15 months agocmake: use namespaced custom target names
Viktor Szakats [Tue, 9 Apr 2024 10:17:22 +0000 (10:17 +0000)] 
cmake: use namespaced custom target names

Rename custom target to namespaced (unique) names to avoid colliding
with 3rd-party projects (e.g. libzip) built together with curl.

Reported-by: hammlee96 on github
Fixes #13324
Closes #13326

15 months agoappveyor: re-enable OpenSSL 3, bump to 3.2.1
Viktor Szakats [Tue, 9 Apr 2024 16:21:55 +0000 (16:21 +0000)] 
appveyor: re-enable OpenSSL 3, bump to 3.2.1

Ref: b62454a875d70f93ab5347c050903596feb45a23 #13266
Closes #13329

15 months agoCI: upgrade openssl version to 3.3.0 for openssl-quic
Stefan Eissing [Tue, 9 Apr 2024 13:36:28 +0000 (15:36 +0200)] 
CI: upgrade openssl version to 3.3.0 for openssl-quic

Closes #13328

15 months agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 9 Apr 2024 15:17:56 +0000 (17:17 +0200)] 
RELEASE-NOTES: synced

Bump to 8.8.0-DEV

15 months agocurl_multi_waitfds.md: add protocol mention
Daniel Stenberg [Tue, 9 Apr 2024 14:59:28 +0000 (16:59 +0200)] 
curl_multi_waitfds.md: add protocol mention

Follow-up to 02beac6bb6b

15 months agolib: add curl_multi_waitfds
Dmitry Karpov [Fri, 15 Mar 2024 04:41:44 +0000 (21:41 -0700)] 
lib: add curl_multi_waitfds

New function call, similar to curl_multi_fdset()

Closes #13135

15 months agodist: verify tarball reproducibility in CI
Viktor Szakats [Tue, 9 Apr 2024 12:18:23 +0000 (12:18 +0000)] 
dist: verify tarball reproducibility in CI

Closes #13327

15 months agotests: stabilitze test_02_23*
Stefan Eissing [Tue, 9 Apr 2024 07:41:19 +0000 (09:41 +0200)] 
tests: stabilitze test_02_23*

- h2-download now always opens the output file on first write callback
  invocation, if it will pause the transfer or not.
- Checks on output files then does not depend on the amount of data curl
  has collected for the first write.

Closes #13323

15 months agotls: fix compile issues on old-linux CI
Stefan Eissing [Tue, 9 Apr 2024 07:53:26 +0000 (09:53 +0200)] 
tls: fix compile issues on old-linux CI

Follow-up to 3210101088dfa
Closes #13325

15 months agodist: add reproducible dir entries to tarballs
Viktor Szakats [Tue, 9 Apr 2024 06:46:35 +0000 (06:46 +0000)] 
dist: add reproducible dir entries to tarballs

In the initial implementation of reproducible tarballs, they were
missing directory entries, while .zip archives had them. It meant
that on extracting the tarball, on-disk directory entries got the
current timestamp.

This patch fixes this by including directory entries in the tarball,
with reproducible timestamps. It also moves sorting inside tar,
to ensure reproducible directory entry timestamps on extract
(without the need of `--delay-directory-restore` option, when
extracting with GNU tar. BSD tar got that right by default.)

GNU tar 1.28 (2014-07-28) introduced `--sort=`.

Ref: https://github.com/curl/curl/pull/13299#discussion_r1555957350
Follow-up to 860cd5fc2dc8e165fadd2c19a9b7c73b3ae5069d #13299
Closes #13322

15 months agotls: use shared init code for TCP+QUIC
Stefan Eissing [Fri, 22 Mar 2024 12:07:25 +0000 (13:07 +0100)] 
tls: use shared init code for TCP+QUIC

Closes #13172

15 months ago.mailmap: update Gisle's preferred email
Daniel Stenberg [Tue, 9 Apr 2024 06:50:07 +0000 (08:50 +0200)] 
.mailmap: update Gisle's preferred email

15 months agodoc: pytest `--repeat` -> `--count`
Jan Macku [Thu, 28 Mar 2024 09:14:04 +0000 (10:14 +0100)] 
doc: pytest `--repeat` -> `--count`

Pytest doesn't have a `--repeat` option, but it does have a `--count`
option.

```
--count=COUNT         Number of times to repeat each test
```

Closes #13218

15 months agosrc/Makefile.am: access curl.txt using a relative path, not abs
Daniel Stenberg [Mon, 8 Apr 2024 21:22:36 +0000 (23:22 +0200)] 
src/Makefile.am: access curl.txt using a relative path, not abs

... to make it work when mounted using different mount points. Like when
generated/used inside and outside of a docker image.

Closes #13320

15 months agobuild: remove MacOSX-Framework script
Daniel Stenberg [Mon, 8 Apr 2024 12:54:35 +0000 (14:54 +0200)] 
build: remove MacOSX-Framework script

I don't think this is much used these days.

Also remove the libcurl.plist file used (only) by this script

Closes #13313

15 months agorelease-tools.sh: store the timestamp and release tag too
Daniel Stenberg [Mon, 8 Apr 2024 15:14:35 +0000 (17:14 +0200)] 
release-tools.sh: store the timestamp and release tag too

When maketgz invokes this script to generate the docs/RELEASE-TOOLS.md
file that gets bundled in the release, it now also passes on the exact
timestamp and version number so that those details also get mentioned in
the document. They will help users reproduce an identical tarball.

Closes #13319

15 months agoGHA: disable permissions where missing
Viktor Szakats [Sun, 7 Apr 2024 10:01:25 +0000 (10:01 +0000)] 
GHA: disable permissions where missing

Reviewed-by: Daniel Stenberg
Closes #13306

15 months agoCI: update component versions
Stefan Eissing [Mon, 8 Apr 2024 12:01:28 +0000 (14:01 +0200)] 
CI: update component versions

- ngtcp2: v1.4.0
- nghttp3: v1.2.0
- nghttp2: v1.61.0
- mod_h2: v2.0.27

Closes #13316

15 months agoCMake: check fseeko after detecting HAVE_FILE_OFFSET_BITS
Jérôme Leclercq [Tue, 2 Apr 2024 17:42:08 +0000 (19:42 +0200)] 
CMake: check fseeko after detecting HAVE_FILE_OFFSET_BITS

Closes #13264

15 months agohttp2: emit RST when client write fails
Stefan Eissing [Fri, 5 Apr 2024 13:38:11 +0000 (15:38 +0200)] 
http2: emit RST when client write fails

- When the writing of response data fails, reset the stream
  and do not return a callback error to nghttp2. That would
  be a fatal error for the connection and harm other requests.
- add test cases for various abort scenarios

Reported-by: Konstantin Kuzov
Fixes #13292
Closes #13298

15 months agombedtls: call mbedtls_ssl_setup() after RNG callback is set
Kailun Qin [Mon, 8 Apr 2024 09:13:56 +0000 (05:13 -0400)] 
mbedtls: call mbedtls_ssl_setup() after RNG callback is set

Since mbedTLS v3.6.0, the RNG check added in ssl_conf_check() will fail
if no RNG is provided when calling mbedtls_ssl_setup().

Therefore, mbedtls_ssl_conf_rng() needs to be called before the SSL
context is passed to mbedtls_ssl_setup().

Ref: https://github.com/Mbed-TLS/mbedtls/commit/b422cab052b51ec84758638d6783d6ba4fc60613

Signed-off-by: Kailun Qin <kailun.qin@intel.com>
Closes #13314

15 months agoNTLM_WB: drop support
Daniel Stenberg [Sun, 31 Mar 2024 14:54:28 +0000 (16:54 +0200)] 
NTLM_WB: drop support

The feature has not worked for months and has been marked as DEPRECATED
for six+ months.

Closes #13249

15 months agocurl_trc: fix build error when lacking verbose messages
Daniel Stenberg [Mon, 8 Apr 2024 07:49:11 +0000 (09:49 +0200)] 
curl_trc: fix build error when lacking verbose messages

Follow-up from 0b28ece657b2273
Closes #13312

15 months agocontrithanks: honor `CURLWWW` variable
Viktor Szakats [Mon, 8 Apr 2024 09:47:20 +0000 (09:47 +0000)] 
contrithanks: honor `CURLWWW` variable

Reviewed-by: Daniel Stenberg
Closes #13315

15 months agoGHA: add shellcheck job and fix warnings, shell tidy-ups
Viktor Szakats [Sun, 7 Apr 2024 10:02:49 +0000 (10:02 +0000)] 
GHA: add shellcheck job and fix warnings, shell tidy-ups

Reviewed-by: Daniel Stenberg
Closes #13307

15 months agodist: do not require Perl in `maketgz`
Viktor Szakats [Sun, 7 Apr 2024 23:35:09 +0000 (23:35 +0000)] 
dist: do not require Perl in `maketgz`

Perl remains required for the tarball build process.

Follow-up to 860cd5fc2dc8e165fadd2c19a9b7c73b3ae5069d #13299

Reviewed-by: Daniel Stenberg
Closes #13310

15 months agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 8 Apr 2024 08:33:36 +0000 (10:33 +0200)] 
RELEASE-NOTES: synced

15 months agodocs/cmdline-opts: invoke managen using a relative path
Daniel Stenberg [Thu, 4 Apr 2024 16:00:33 +0000 (18:00 +0200)] 
docs/cmdline-opts: invoke managen using a relative path

... no need to use an absolute path, that makes the build unncessarily
fail if invoked using a different mount point. managen now takes options
to find the input files.

Update test1478 to provide the dir arguments to managen

Closes #13281

15 months agoGHA: add valgrind to a wolfSSL build
Daniel Stenberg [Thu, 4 Apr 2024 06:50:34 +0000 (08:50 +0200)] 
GHA: add valgrind to a wolfSSL build

Closes #13274

15 months agodist: `set -eu`, fix shellcheck, make reproducible and smaller tarballs
Viktor Szakats [Fri, 5 Apr 2024 13:27:05 +0000 (13:27 +0000)] 
dist: `set -eu`, fix shellcheck, make reproducible and smaller tarballs

- set bash `-eu` and fix fallouts.
- fix shellcheck warnings.
- set and use `SOURCE_DATE_EPOCH` for reproducibility.
Authored-by: Daniel J. H.
  Ref: #13280
- set `TZ=UTC` and `LC_ALL=C` for reproducibility.
- make file timestamps in tarball/zip reproducible.
- make directory timestamps in zip reproducible.
- make timestamps of tarballs/zip reproducible.
- make file order in tarball/zip reproducible.
- omit extra file metadata from zip for reproducibility.
- use maximum zip compression.
- use POSIX `ustar` tarball format to avoid supply chain vulnerability:
  https://seclists.org/oss-sec/2021/q4/0
- make uid/gid in tarball reproducible.
- omit owner user/group names from tarball for reproducibility and privacy.
- omit current timestamp from .gz header for reproducibility.
- display SHA-256 hashes of produced tarballs/zip.
- fix whitespace.

`.tar.gz` also became smaller in the process: 4,462,311 -> 4,148,249 bytes (8.7.1)

Requires GNU tar, GNU date, `sha256sum`.

Reviewed-by: Daniel Stenberg
Ref: #13250
Closes #13299

15 months agotests/http: fix compiler warning
Gisle Vanem [Sat, 6 Apr 2024 22:11:03 +0000 (18:11 -0400)] 
tests/http: fix compiler warning

- Init result code variable to fix clang warning that it may be used
  uninitialized.

Fixes https://github.com/curl/curl/issues/13301
Closes https://github.com/curl/curl/pull/13304

15 months agovquic: use new curl_int64_t type
Stefan Eissing [Fri, 5 Apr 2024 10:11:48 +0000 (12:11 +0200)] 
vquic: use new curl_int64_t type

- add curl_int64_t signed 64-bit type for lib use

- define CURL_PRId64, CURL_PRIu64 format ids

- use curl_int64_t in vquic

curl_int64_t signed complements the existing curl_uint64_t unsigned.

Note that `curl_int64_t` and `int64_t` are assignable from each other
but not identical. Some platforms with 64 long type defint int64_t as
"long long" (staring at macOS) which messes up things like pointers and
format identifiers.

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

15 months agolib: use multi instead of multi_easy for the active multi
Jay Satiro [Tue, 9 Jan 2024 08:24:57 +0000 (03:24 -0500)] 
lib: use multi instead of multi_easy for the active multi

- Use data->multi and not data->multi_easy to refer to the active multi.

The easy handle's active multi is always data->multi.

This is a follow up to 757dfdf which changed curl so that an easy handle
used with the easy interface and then multi interface cannot have two
different multi handles associated with it at the same time
(data->multi_easy from the easy interface and data->multi from the multi
interface).

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

15 months agotidy-up: whitespace [ci skip]
Viktor Szakats [Fri, 5 Apr 2024 15:50:07 +0000 (15:50 +0000)] 
tidy-up: whitespace [ci skip]

15 months agomakefile: remove the sorting from the vc-ide action
Daniel Stenberg [Fri, 5 Apr 2024 11:01:58 +0000 (13:01 +0200)] 
makefile: remove the sorting from the vc-ide action

This target generates the MSVC project files. This change removes the
extra sorting and instead makes the script use the order of the files as
listed in the variables - which are mostly sorted anyway.

This is an attempt to make the project file generation more easily
reproducible.

Ref: #13250
Closes #13294

15 months agobearssl: fix compiler warnings
Gisle Vanem [Fri, 5 Apr 2024 12:14:29 +0000 (14:14 +0200)] 
bearssl: fix compiler warnings

"variables may be uninitialized when used"

Fixes #13290
Closes #13297

15 months agoDISTROS: Cygwin updates
Daniel Stenberg [Thu, 4 Apr 2024 15:23:19 +0000 (17:23 +0200)] 
DISTROS: Cygwin updates

Brought-by: Brian Inglis
Fixes #13258
Co-authored-by: Viktor Szakats
Closes #13279

15 months agolib: add trace support for client reads and writes
Stefan Eissing [Thu, 28 Mar 2024 13:12:54 +0000 (14:12 +0100)] 
lib: add trace support for client reads and writes

- add `CURL_TRC_READ()` and `CURL_TRC_WRITE()`
- use in generic client writers and readers, as well
  as http headers, chunking and websockets

Closes #13223

15 months agourldata: remove fields not used depending on used features
MAntoniak [Mon, 25 Mar 2024 23:19:23 +0000 (00:19 +0100)] 
urldata: remove fields not used depending on used features

Reduced size of dynamically_allocated_data structure.

Reduced number of stored values in enum dupstring and enum dupblob. This
affects the reduced array placed in the UserDefined structure.

Closes #13188

15 months agocmake: enable `-pedantic-errors` for clang when `CURL_WERROR=ON`
Viktor Szakats [Thu, 4 Apr 2024 21:22:37 +0000 (21:22 +0000)] 
cmake: enable `-pedantic-errors` for clang when `CURL_WERROR=ON`

clang doesn't have the issues of GCC and old CMake versions.

Note: This introduces asymmetry with autotools, which only enables
this for GCC.

Reviewed-by: Daniel Stenberg
Closes #13286

15 months agocmake: fix `CURL_WERROR=ON` for old CMake and use it in GHA/linux-old
Viktor Szakats [Thu, 4 Apr 2024 10:45:01 +0000 (10:45 +0000)] 
cmake: fix `CURL_WERROR=ON` for old CMake and use it in GHA/linux-old

- cmake: fix `-pedantic-errors` for old CMake with `CURL_WERROR=ON` set.

  `-pedantic-errors` option throws a warning with GCC (all versions) and
  makes `check_symbol_exists()` fail in CMake versions older than
  v3.23.0 (2022-03-29), when CMake introduced a workaround:

  https://gitlab.kitware.com/cmake/cmake/-/issues/13208
  https://gitlab.kitware.com/cmake/cmake/-/commit/eeb45401163d831b8c841ef6eba81466b4067b68
  https://gitlab.kitware.com/cmake/cmake/-/commit/1ab7c3cd28b27ca162c4559e1026e5cad1898ade

  Follow-up to 3829759bd042c03225ae862062560f568ba1a231 #12489

- set `CURL_WERROR=ON` for the `linux-old` job in CI.

Closes #13282

15 months agolib: use `#error` instead of invalid syntax in `curl_setup_once.h`
Viktor Szakats [Thu, 4 Apr 2024 20:01:05 +0000 (20:01 +0000)] 
lib: use `#error` instead of invalid syntax in `curl_setup_once.h`

Reviewed-by: Daniel Stenberg
Closes #13287

15 months agoGHA: on macOS remove $HOME/.curlrc
Daniel Stenberg [Thu, 4 Apr 2024 21:38:36 +0000 (23:38 +0200)] 
GHA: on macOS remove $HOME/.curlrc

A recent image upgrade added a $HOME/.curlrc by default using --ipv4.

Ref: https://github.com/actions/runner-images/pull/9586
Fixes #13284
Closes #13285

15 months agocmake: fixup `DEPENDS` filename
Viktor Szakats [Thu, 4 Apr 2024 19:33:49 +0000 (19:33 +0000)] 
cmake: fixup `DEPENDS` filename

Fixing:
```
make[2]: Circular docs/curl-config.1 <- docs/curl-config.1 dependency dropped.
make[2]: Circular docs/mk-ca-bundle.1 <- docs/mk-ca-bundle.1 dependency dropped.
```
Ref: https://github.com/curl/curl/actions/runs/8559617487/job/23456740844?pr=13282#step:6:18

Follow-up to 5023ffad2c27d4b916ddb91800f99ecc5d3aad07 #13197
Closes #13283

15 months agoGHA: enable unity mode for cmake jobs + tidy-ups
Viktor Szakats [Thu, 4 Apr 2024 10:45:01 +0000 (10:45 +0000)] 
GHA: enable unity mode for cmake jobs + tidy-ups

Unity mode is not supported by CMake v3.7.2 used in linux-old, but
enable it anyway for consistency and to kick in automatically once
migrating to a newer old Linux in the future.

Also:
- replace `CMAKE_COMPILE_WARNING_AS_ERROR` with `CURL_WERROR`.
- delete default build option `PICKY_COMPILER=ON`.

Closes #13277

15 months agoCI: Add CI build on Debian stretch to test old support 13029/head
Dan Fandrich [Fri, 1 Mar 2024 23:01:48 +0000 (15:01 -0800)] 
CI: Add CI build on Debian stretch to test old support

This version still has ELTS support and contains some old versions of
key components like cmake to help prevent us from breaking that support.

Closes #13029

15 months agorequest: paused upload on completed download, assess connection
Stefan Eissing [Wed, 3 Apr 2024 11:18:01 +0000 (13:18 +0200)] 
request: paused upload on completed download, assess connection

A transfer with a completed download that is still uploading needs to
check the connection state when it is PAUSEd, since connection
close/errors would otherwise go unnoticed.

Reported-by: Sergey Bronnikov
Fixes #13260
Closes #13271

15 months agourl: do not URL decode proxy crendentials
Daniel Stenberg [Wed, 3 Apr 2024 09:32:55 +0000 (11:32 +0200)] 
url: do not URL decode proxy crendentials

The two options CURLOPT_PROXYUSERNAME and CURLOPT_PROXYPASSWORD set the
actual names as-is, not URL encoded.

Modified test 503 to use percent-encoded strings in the credential
strings that should be passed on as-is.

Reported-by: Sergey Ogryzkov
Fixes #13265
Closes #13270

15 months agoappveyor: enable cmake unity mode by default
Viktor Szakats [Thu, 28 Mar 2024 09:07:35 +0000 (09:07 +0000)] 
appveyor: enable cmake unity mode by default

Leave one non-unity cmake job. This makes the jobs finish slightly
quicker, while giving more coverage for unity issues.

Before:
https://ci.appveyor.com/project/curlorg/curl/builds/49496977
https://ci.appveyor.com/project/curlorg/curl/builds/49500372
After:
https://ci.appveyor.com/project/curlorg/curl/builds/49500338

Also fixup unrelated whitespace.

Reviewed-by: Daniel Stenberg
Closes #13217

15 months agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 4 Apr 2024 09:29:34 +0000 (11:29 +0200)] 
RELEASE-NOTES: synced

15 months agocmake: speed up libcurl doc building again
Viktor Szakats [Wed, 27 Mar 2024 15:54:08 +0000 (15:54 +0000)] 
cmake: speed up libcurl doc building again

This time limit the number of files per command to avoid exceeding
limitations of certain OS/shell envs.

Such known env is Windows with the `cmd.exe` shell, which features an
8K command-line length limit to this day.

Allowlisting `UNIX` to have no limit and using a limit of 200 for other
envs to be safe. If there is a way to detect `cmd.exe` and/or we know
which precise envs are sensitive to this, we can tweak these conditions
further.

Even with the low limit, this patch reduces external commands by 200x,
making builds much faster.

Ref: #12762 2620aa930bc73af1e4c70b10e3125b957b96ecfb (initial)
Ref: #13047 f03c85635f35269f1f45b983bf216624f541760a (revert)

Reviewed-by: Daniel Stenberg
Closes #13207

15 months agocmake: tidy-up to use `WORKING_DIRECTORY`
Viktor Szakats [Wed, 27 Mar 2024 14:25:47 +0000 (14:25 +0000)] 
cmake: tidy-up to use `WORKING_DIRECTORY`

Reviewed-by: Daniel Stenberg
Closes #13206

15 months agocmake: generate misc manpages and install `mk-ca-bundle.pl`
Viktor Szakats [Wed, 27 Mar 2024 09:56:24 +0000 (09:56 +0000)] 
cmake: generate misc manpages and install `mk-ca-bundle.pl`

- install `mk-ca-bundle.pl` like autotools does.

- generate and install `mk-ca-bundle.1` and `curl-config.1` like
  autotools. This fixes tests 1140 and 1173.

Reported-by: Dan Fandrich
  Fixes #13194

- add option `BUILD_MISC_DOCS` to control building the above two
  manpages. Enabled by default.

- appveyor: stop disabling tests 1140 and 1173.

Reviewed-by: Daniel Stenberg
Closes #13197

15 months agowolfssl: plug memory leak in wolfssl_connect_step2()
Fabian Keil [Sun, 17 Mar 2024 14:49:58 +0000 (15:49 +0100)] 
wolfssl: plug memory leak in wolfssl_connect_step2()

Fixes:

     test 2034...[simple HTTPS GET with DER public key pinning]
     ==61829== 22,610 (3,744 direct, 18,866 indirect) bytes in 1 blocks are definitely lost in loss record 51 of 54
     ==61829==    at 0x484BB74: malloc (vg_replace_malloc.c:446)
     ==61829==    by 0x4B53A80: wolfSSL_Malloc (memory.c:344)
     ==61829==    by 0x4C1C8E1: wolfSSL_X509_new (x509.c:5326)
     ==61829==    by 0x4C3977D: d2i_X509orX509REQ (x509.c:3628)
     ==61829==    by 0x4C1D1F4: wolfSSL_X509_d2i (x509.c:3664)
     ==61829==    by 0x4C1C37B: wolfSSL_X509_dup (x509.c:13425)
     ==61829==    by 0x4C197DB: wolfSSL_get_peer_certificate (ssl.c:18765)
     ==61829==    by 0x33297C: wolfssl_connect_step2 (wolfssl.c:875)
     ==61829==    by 0x331669: wolfssl_connect_common (wolfssl.c:1287)
     ==61829==    by 0x3303E9: wolfssl_connect_nonblocking (wolfssl.c:1319)
     ==61829==    by 0x32FE89: ssl_connect_nonblocking (vtls.c:510)
     ==61829==    by 0x32DBE5: ssl_cf_connect (vtls.c:1679)
     ==61829==    by 0x27ABD7: Curl_conn_cf_connect (cfilters.c:307)
     ==61829==    by 0x27D9CF: cf_setup_connect (connect.c:1199)
     ==61829==    by 0x27ABD7: Curl_conn_cf_connect (cfilters.c:307)
     ==61829==    by 0x283CEA: cf_hc_baller_connect (cf-https-connect.c:135)

Closes #13272

16 months agoappveyor: OpenSSL 3 no longer found by CMake, revert to 1.1.1
Viktor Szakats [Wed, 3 Apr 2024 03:06:16 +0000 (03:06 +0000)] 
appveyor: OpenSSL 3 no longer found by CMake, revert to 1.1.1

OpenSSL moved directories, and bumped versions in AppVeyor CI.

Downgrading is not an ideal solution, but however trivial the solution
may be, I failed to come with anything that made CMake recognize either
OpenSSL 3.1 or 3.2.

Possibly caused by:
https://github.com/appveyor/build-images/commit/702e8cdca01f28f6a40687783f493c786cebbe2c
https://github.com/appveyor/build-images/pull/149

Closes #13266

16 months agowinbuild: use $(RC) correctly
hongfei.li [Wed, 3 Apr 2024 06:24:42 +0000 (14:24 +0800)] 
winbuild: use $(RC) correctly

Cloes #13267

16 months agodist: remove the curl-config.1 from the tarball
Daniel Stenberg [Wed, 3 Apr 2024 08:00:03 +0000 (10:00 +0200)] 
dist: remove the curl-config.1 from the tarball

The markdown file is already there and the .1 file gets generated in the
build.

Ref: #13250
Closes #13268

16 months agocurl_global_trace.md: shorten the description
Daniel Stenberg [Tue, 2 Apr 2024 13:34:12 +0000 (15:34 +0200)] 
curl_global_trace.md: shorten the description

Closes #13263

16 months agotest1901: verify chunked POST from callback with CURLOPT_POSTFIELDSIZE set
Daniel Stenberg [Tue, 2 Apr 2024 13:27:54 +0000 (15:27 +0200)] 
test1901: verify chunked POST from callback with CURLOPT_POSTFIELDSIZE set

Follow-up to 721941aadf4ad

Ref: #13257
Closes #13262

16 months agohttp: with chunked POST forced, disable length check on read callback
Stefan Eissing [Mon, 1 Apr 2024 13:41:18 +0000 (15:41 +0200)] 
http: with chunked POST forced, disable length check on read callback

- when an application forces HTTP/1.1 chunked transfer encoding
  by setting the corresponding header and instructs curl to use
  the CURLOPT_READFUNCTION, disregard any POST length information.
- this establishes backward compatibility with previous curl versions

Applications are encouraged to not force "chunked", but rather
set length information for a POST. By setting -1, curl will
auto-select chunked on HTTP/1.1 and work properly on other HTTP
versions.

Reported-by: Jeff King
Fixes #13229
Closes #13257

16 months agoINSTALL-CMAKE.md: explain `cmake -G <generator-name>`
Jay Satiro [Sun, 31 Mar 2024 06:55:50 +0000 (02:55 -0400)] 
INSTALL-CMAKE.md: explain `cmake -G <generator-name>`

- Explain that CMake's -G option can be used to specify which build
  system to generate files for.

Example: cmake ../curl -G "MinGW Makefiles"

Ref: https://github.com/curl/curl/pull/12224#issuecomment-2026813645

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

16 months agolibcurl-opts: mention pipelining less
Daniel Stenberg [Mon, 1 Apr 2024 07:52:23 +0000 (09:52 +0200)] 
libcurl-opts: mention pipelining less

libcurl has not supported HTTP pipelining since many years. Remove a few
(more) mentions of the feature.

Closes #13254

16 months agom4: reposition USE_RUSTLS="yes" for pkg-config
Daniel McCarney [Sun, 31 Mar 2024 20:19:10 +0000 (16:19 -0400)] 
m4: reposition USE_RUSTLS="yes" for pkg-config

It's necessary to set this var to "yes" _after_ AC_DEFINE and AC_SUBST
in order for a later `test` to pass so that `check_for_ca_bundle=1` ends
up being set. This is in turn required for the default CA certificate
bundle to be set when building w/ rustls & pkg-config.

Reported-by: Matt Jolly
Fixes #13248
Closes #13251

16 months agomaketgz: put docs/RELEASE-TOOL.md into the tarball
Daniel Stenberg [Sat, 30 Mar 2024 20:46:14 +0000 (21:46 +0100)] 
maketgz: put docs/RELEASE-TOOL.md into the tarball

Generated with scripts/release-tools.sh

The script lists the exact Debian package names and version numbers for
the tools that are used to generate the tarball.

Closes #13239

16 months agocd2nroff/manage: use UTC when SOURCE_DATE_EPOCH is set
Daniel Stenberg [Sat, 30 Mar 2024 23:59:55 +0000 (00:59 +0100)] 
cd2nroff/manage: use UTC when SOURCE_DATE_EPOCH is set

Make them independent of the TZ setting. Also set a date string like
YYYY-MM-DD to avoid a local month name in the date.

Reported-by: Carlos Henrique Lima Melara
Fixes #13242
Closes #13243

16 months agoRELEASE-NOTES: synced
Daniel Stenberg [Sun, 31 Mar 2024 14:35:08 +0000 (16:35 +0200)] 
RELEASE-NOTES: synced

16 months agodocs/MAIL-ETIQUETTE: convert to markdown
Daniel Stenberg [Sun, 31 Mar 2024 10:20:04 +0000 (12:20 +0200)] 
docs/MAIL-ETIQUETTE: convert to markdown

To render nicer. To get spellchecked.

Closes #13247

16 months agoreuse: add copyright + license info to individual docs/*.md files
Daniel Stenberg [Sun, 31 Mar 2024 09:52:28 +0000 (11:52 +0200)] 
reuse: add copyright + license info to individual docs/*.md files

Instead of use 'docs/*.md' in dep5. For clarity and avoiding a wide-
matching wildcard.

+ Remove mention of old files from .reuse/dep5
+ add info to .github/dependabot.yml
+ make scripts/copyright.pl warn on non-matching patterns

Closes #13245

16 months agotest470: warn about unicode quote character read from config file
Daniel Stenberg [Sat, 30 Mar 2024 21:49:01 +0000 (22:49 +0100)] 
test470: warn about unicode quote character read from config file

Idea-by: Emanuele Torre
16 months agotest469: verify warning when argument has unicode quote
Daniel Stenberg [Sat, 30 Mar 2024 21:49:01 +0000 (22:49 +0100)] 
test469: verify warning when argument has unicode quote

16 months agotool_getparam: output warning for leading unicode quote character
Daniel Stenberg [Sat, 30 Mar 2024 21:49:01 +0000 (22:49 +0100)] 
tool_getparam: output warning for leading unicode quote character

... in the option argument.

Typically this is a mistake done when copying example command lines from
online documentation using the wrong quote character.

Presumably there are also other potential quote characters that might be
used, and this check is done without even knowing that unicode is used!

Reported-by: Sanjay Pujare
Fixes #13214
Closes #13215

16 months agotool: follow-up getenv fix
Daniel Stenberg [Sat, 30 Mar 2024 22:42:48 +0000 (23:42 +0100)] 
tool: follow-up getenv fix

Remove a double free. Change the IPFS env use to a plain getenv() simply
because coverity gets confused.

Follow-up to 9126b141c9398fe
Closes #13241

16 months agoidn: make Curl_idnconvert_hostname() use Curl_idn_decode()
Daniel Stenberg [Sat, 30 Mar 2024 21:56:48 +0000 (22:56 +0100)] 
idn: make Curl_idnconvert_hostname() use Curl_idn_decode()

In the name of less code duplication

Closes #13236

16 months agocurl-confopts.m4: define CARES_NO_DEPRECATED when c-ares is used
Daniel Stenberg [Sat, 30 Mar 2024 21:37:08 +0000 (22:37 +0100)] 
curl-confopts.m4: define CARES_NO_DEPRECATED when c-ares is used

Starting in 1.28.0 c-ares added deprecation warnings for some API calls
libcurl uses.

Closes #13240

16 months agovquic: use CURL_FORMAT_CURL_OFF_T for 64 bit printf output
Daniel Stenberg [Sat, 30 Mar 2024 10:15:29 +0000 (11:15 +0100)] 
vquic: use CURL_FORMAT_CURL_OFF_T for 64 bit printf output

Reported-by: Keitagit-kun on github
Fixes #13224
Closes #13231

16 months agoopenldap: create ldap URLs correctly for IPv6 addresses
Daniel Stenberg [Sat, 30 Mar 2024 10:14:54 +0000 (11:14 +0100)] 
openldap: create ldap URLs correctly for IPv6 addresses

Reported-by: Sergio Durigan Junior
Fixes #13228
Closes #13235

16 months agocurl: use curl_getenv instead of the curlx_ version
Daniel Stenberg [Sat, 30 Mar 2024 09:41:21 +0000 (10:41 +0100)] 
curl: use curl_getenv instead of the curlx_ version

The curlx one was once introduced when we still considered dropping the
libcurl function at some point. To reduce confusion and to make it
easier to understand when curl_free() should be used, use the actual
libcurl function call directly instead.

Closes #13230

16 months agocurl_sha512_256: do not use workaround for NetBSD when not needed
Evgeny Grin [Thu, 28 Mar 2024 21:42:55 +0000 (22:42 +0100)] 
curl_sha512_256: do not use workaround for NetBSD when not needed

Assisted-by: riastradh on github
Assisted-by: Michael Kaufmann
Closes #13225

16 months agom4: fix rustls pkg-config codepath
Matt Jolly [Wed, 27 Mar 2024 12:52:26 +0000 (22:52 +1000)] 
m4: fix rustls pkg-config codepath

The previous pkg-config code would successfully detect rustls but did
not set all appropriate variables and call the right macros to properly
configure cURL.

Reported-by: kpcyrd on github
Fixes #13200
Closes #13202

16 months agodeps: update librustls 0.12.0 -> 0.13.0
Daniel McCarney [Sat, 30 Mar 2024 18:18:45 +0000 (14:18 -0400)] 
deps: update librustls 0.12.0 -> 0.13.0

This commit updates the optional rustls-ffi librustls dependency from
0.12.0 to 0.13.0. This version is based on the latest available rustls
release (0.23.4).

The breaking API changes from 0.12.0 to 0.13.0 are in API surface unused
by curl, so this is an in-place update without any code changes.

The `RUSTLS.md` documentation is updated to reflect the new version in
use, and to clarify that `cbindgen` isn't required to build `librustls`
- it's only used by developers to update the vendored `rustls.h` header
file maintained upstream.

Closes #13238

16 months agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 28 Mar 2024 15:30:18 +0000 (16:30 +0100)] 
RELEASE-NOTES: synced

16 months agotool_xattr: "guess" URL scheme if none is provided
Daniel Stenberg [Thu, 28 Mar 2024 12:16:04 +0000 (13:16 +0100)] 
tool_xattr: "guess" URL scheme if none is provided

... when figuring out the source URL to store.

Reported-by: Dagfinn Ilmari Mannsåker
Fixes #13205
Closes #13221

16 months agotool_xattr: in debug builds, act normally if CURL_FAKE_XATTR is not set
Daniel Stenberg [Thu, 28 Mar 2024 12:11:11 +0000 (13:11 +0100)] 
tool_xattr: in debug builds, act normally if CURL_FAKE_XATTR is not set

Closes #13220

16 months agocontent_encoding: brotli and others, pass through 0-length writes
Stefan Eissing [Thu, 28 Mar 2024 10:08:15 +0000 (11:08 +0100)] 
content_encoding: brotli and others, pass through 0-length writes

- curl's transfer handling may write 0-length chunks at the end of the
  download with an EOS flag. (HTTP/2 does this commonly)

- content encoders need to pass-through such a write and not count this
  as error in case they are finished decoding

Fixes #13209
Fixes #13212
Closes #13219

16 months agolibssh2: set length to 0 if strdup failed
Tobias Stoeckmann [Wed, 27 Mar 2024 23:38:09 +0000 (00:38 +0100)] 
libssh2: set length to 0 if strdup failed

Internally, libssh2 dereferences the NULL pointer if length is non-zero.
The callback function cannot return the error condition, so at least
prevent subsequent crash.

Closes #13213

16 months agoRELEASE-PROCEDURE: mention an initial working build
Daniel Stenberg [Thu, 28 Mar 2024 09:05:09 +0000 (10:05 +0100)] 
RELEASE-PROCEDURE: mention an initial working build

This is the step that was not done and caused the 8.7.0 mishap (it
lacked the correctly generated hugehelp file).

Remove the mention of the copyright script as this is verified by a CI
job these days: the REUSE one.

Closes #13216

16 months agocurl_sha512_255: fix detection of OpenSSL 1.1.1 or later
Paul Howarth [Wed, 27 Mar 2024 18:17:54 +0000 (18:17 +0000)] 
curl_sha512_255: fix detection of OpenSSL 1.1.1 or later

Use the same OPENSSL_VERSION_NUMBER comparison as in lib/vtls/openssl.c.

Closes #13208

16 months agocf-socket: remove references to l_ip, l_port
Robert Moreton [Wed, 27 Mar 2024 19:21:19 +0000 (15:21 -0400)] 
cf-socket: remove references to l_ip, l_port

Fixes #13210
Closes #13211

16 months agoopenssl: do not set SSL_MODE_RELEASE_BUFFERS
Daniel Stenberg [Wed, 27 Mar 2024 13:15:11 +0000 (14:15 +0100)] 
openssl: do not set SSL_MODE_RELEASE_BUFFERS

While it might save some memory, it causes OpenSSL to instead do a huge
amount of allocations.

Ref: #13136
Closes #13203

16 months agocurl: make --help adapt to the terminal width
Daniel Stenberg [Mon, 25 Mar 2024 12:07:48 +0000 (13:07 +0100)] 
curl: make --help adapt to the terminal width

Instead of assuming and working with 80 colums, try figuring out what
width is actually used.

Ref: #13141

Closes #13171

16 months agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 27 Mar 2024 11:47:56 +0000 (12:47 +0100)] 
RELEASE-NOTES: synced

and bump to 8.7.2 for now