]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
15 months agombedTLS: implement CURLOPT_SSL_CIPHER_LIST option
Jan Venekamp [Tue, 23 Apr 2024 15:42:45 +0000 (17:42 +0200)] 
mbedTLS: implement CURLOPT_SSL_CIPHER_LIST option

Use a lookup list to set the cipher suites, allowing the
ciphers to be set by either openssl or IANA names.

To keep the binary size of the lookup list down we compress
each entry in the cipher list down to 2 + 6 bytes using the
C preprocessor.

Closes #13442

15 months agoCI: show more failed `config.log` on Circle CI
Viktor Szakats [Wed, 24 Apr 2024 09:15:58 +0000 (11:15 +0200)] 
CI: show more failed `config.log` on Circle CI

Show last 1000 lines of `config.log` if `./configure` fails. This was
already done for one job, this patch extends it to all.

Ref: #13438
Closes #13462

15 months agotelnet: check return code from fileno()
Daniel Stenberg [Wed, 24 Apr 2024 06:07:34 +0000 (08:07 +0200)] 
telnet: check return code from fileno()

and return error if necessary

Spotted by CodeSonar

Closes #13457

15 months agotls: fix SecureTransport + BearSSL cmake unity builds
Viktor Szakats [Tue, 23 Apr 2024 14:34:39 +0000 (16:34 +0200)] 
tls: fix SecureTransport + BearSSL cmake unity builds

Avoid clashing static function names by namespacing them.

Pointed-out-by: Jan Venekamp
Ref: https://github.com/curl/curl/pull/13442#discussion_r1576350700
Closes #13450

15 months agodllmain: Call OpenSSL thread cleanup for Windows and Cygwin
Jay Satiro [Tue, 28 Nov 2023 08:39:09 +0000 (03:39 -0500)] 
dllmain: Call OpenSSL thread cleanup for Windows and Cygwin

- Call OPENSSL_thread_stop on thread termination (DLL_THREAD_DETACH)
  to prevent a memory leak in case OpenSSL is linked statically.

- Warn in libcurl-thread.3 that if OpenSSL is linked statically then it
  may require thread cleanup.

OpenSSL may need per-thread cleanup to stop a memory leak. For Windows
and Cygwin if libcurl was built as a DLL then we can do that for the
user by calling OPENSSL_thread_stop on thread termination. However, if
libcurl was built statically then we do not have notification of thread
termination and cannot do that for the user.

Also, there are several other unusual cases where it may be necessary
for the user to call OPENSSL_thread_stop, so in the libcurl-thread
warning I added a link to the OpenSSL documentation.

Co-authored-by: Viktor Szakats
Reported-by: southernedge@users.noreply.github.com
Reported-by: zmcx16@users.noreply.github.com
Ref: https://www.openssl.org/docs/man3.0/man3/OPENSSL_thread_stop.html#NOTES

Fixes https://github.com/curl/curl/issues/12327
Closes https://github.com/curl/curl/pull/12408

15 months agorustls: remove incorrect SSLSUPP_TLS13_CIPHERSUITES flag
Jan Venekamp [Tue, 23 Apr 2024 15:59:46 +0000 (17:59 +0200)] 
rustls: remove incorrect SSLSUPP_TLS13_CIPHERSUITES flag

The rustls backend advertises SSLSUPP_TLS13_CIPHERSUITES, but
the code does not actually seem to support it (yet?). Removed
the flag and corrected documentation.

Closes #13452

15 months agoquiche: expire all active transfers on connection close
Stefan Eissing [Tue, 23 Apr 2024 10:51:30 +0000 (12:51 +0200)] 
quiche: expire all active transfers on connection close

- when a connection close is detected, all ongoing transfers
  need to expire bc no more POLL events are likely to happen
  for them.

Fixes #13439
Reported-by: Jay Satiro
Closes #13447

15 months agotests: fix feature case in test1481
Dan Fandrich [Tue, 23 Apr 2024 00:15:58 +0000 (17:15 -0700)] 
tests: fix feature case in test1481

This test was being skipped everywhere because the feature never
matched.

Closes #13445

15 months agotool_operate: don't truncate the etag save file by default
Gusted [Sat, 20 Apr 2024 16:44:42 +0000 (18:44 +0200)] 
tool_operate: don't truncate the etag save file by default

This fixes a regression of 75d79a4486b279100209ddf8c7fdb12955fb66e9. The
code in tool-operate truncated the etag save file, under the assumption
that the file would be written with a new etag value. However since
75d79a4486b279100209ddf8c7fdb12955fb66e9 that might not be the case
anymore and could result in the file being truncated when --etag-compare
and --etag-save was used and that the etag value matched with what the
server responded. Instead the truncation should not be done when a new
etag value should be written.

Test 3204 was added to verify that the file with the etag value doesn't
change the contents when used by --etag-compare and --etage-save and
that value matches with what the server returns on a non 2xx response.

Closes #13432

15 months agotests: enable test 1117 for hyper
Abdullah Alyan [Sun, 21 Apr 2024 13:24:57 +0000 (16:24 +0300)] 
tests: enable test 1117 for hyper

Closes #13436

15 months agosendf: useless assignment in cr_lc_read()
Daniel Stenberg [Sun, 21 Apr 2024 15:29:18 +0000 (17:29 +0200)] 
sendf: useless assignment in cr_lc_read()

Spotted by CodeSonar

Closes #13437

15 months agotool_paramhlp: remove duplicate assign
Daniel Stenberg [Sat, 20 Apr 2024 21:06:24 +0000 (23:06 +0200)] 
tool_paramhlp: remove duplicate assign

Spotted by CodeSonar

Closes #13433

15 months agotransfer: remove useless assignment
Daniel Stenberg [Sat, 20 Apr 2024 21:21:02 +0000 (23:21 +0200)] 
transfer: remove useless assignment

in Curl_xfer_recv_resp

Spotted by CodeSonar

Closes #13435

15 months agohttp: acknowledge a returned error code
Daniel Stenberg [Sat, 20 Apr 2024 21:15:00 +0000 (23:15 +0200)] 
http: acknowledge a returned error code

... and do not overwrite it with a new value that could then hide the
problem.

Spotted by CodeSonar

Closes #13434

15 months agotool_operate: init vars unconditionally in post_per_transfer
Daniel Stenberg [Sat, 20 Apr 2024 12:15:39 +0000 (14:15 +0200)] 
tool_operate: init vars unconditionally in post_per_transfer

In case of (the unlikely) early return, they could otherwise remain
uninitialized

Spotted by CodeSonar

Closes #13430

15 months agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 19 Apr 2024 21:59:43 +0000 (23:59 +0200)] 
RELEASE-NOTES: synced

15 months agourlapi: allow setting port number zero
Daniel Stenberg [Fri, 19 Apr 2024 12:42:39 +0000 (14:42 +0200)] 
urlapi: allow setting port number zero

Also set and check errno when strtoul() parsing numbers for better error
checking.

Updated test 1560

Closes #13427

15 months agohttp_aws_sigv4: remove useless assignment
Daniel Stenberg [Fri, 19 Apr 2024 12:12:36 +0000 (14:12 +0200)] 
http_aws_sigv4: remove useless assignment

This code assigned the variable the same value it already had

Spotted by CodeSonar

Closes #13426

15 months agofile: remove useless assignment
Daniel Stenberg [Fri, 19 Apr 2024 12:09:54 +0000 (14:09 +0200)] 
file: remove useless assignment

This code assigned the variable the same value it already had.

Spotted by CodeSonar

Closes #13425

15 months agotest2406: verify -f with HTTP/2
Daniel Stenberg [Fri, 19 Apr 2024 06:55:10 +0000 (08:55 +0200)] 
test2406: verify -f with HTTP/2

15 months agohttp2 + ngtcp2: pass CURLcode errors from callbacks
Stefan Eissing [Thu, 18 Apr 2024 21:24:34 +0000 (23:24 +0200)] 
http2 + ngtcp2: pass CURLcode errors from callbacks

- errors returned by Curl_xfer_write_resp() and the header variant are
  not errors in the protocol. The result needs to be returned on the
  next recv() from the protocol filter.

- make xfer write errors for response data cause the stream to be
  cancelled

- added pytest test_02_14 and test_02_15 to verify that also for
  parallel processing

Reported-by: Laramie Leavitt
Fixes #13411
Closes #13424

15 months agorequest: make Curl_req_init return void
Daniel Stenberg [Fri, 19 Apr 2024 08:46:42 +0000 (10:46 +0200)] 
request: make Curl_req_init return void

Since it could not return error and therefore this change removes dead
code for the caller.

Spotted by CodeSonar.

Closes #13423

15 months agomulti: remove the unused Curl_preconnect function
Daniel Stenberg [Fri, 19 Apr 2024 08:37:37 +0000 (10:37 +0200)] 
multi: remove the unused Curl_preconnect function

The implementation has been removed, no point in keeping it around.

Follow-up to 476adfeac019ed

Closes #13422

15 months agoCurl_creader_read: init two variables to avoid using them uninited
Daniel Stenberg [Fri, 19 Apr 2024 07:42:25 +0000 (09:42 +0200)] 
Curl_creader_read: init two variables to avoid using them uninited

Spotted by CodeSonar

Closes #13419

15 months agohttp: reject HTTP major version switch mid connection
Daniel Stenberg [Fri, 19 Apr 2024 08:27:04 +0000 (10:27 +0200)] 
http: reject HTTP major version switch mid connection

A connection that has seen an HTTP major version now refuses any other
major HTTP version in future responses. Previously, a HTTP/1.x
connection would just silently accept HTTP/2 or HTTP/3 in the status
lines as long as it had support for those built-in. It would then just
lead to confusion and badness.

Indirectly Spotted by CodeSonar which identified a duplicate assignment
in this function.

Add test 471 to verify

Closes #13421

15 months agomqtt: when Curl_xfer_recv returns error, don't use nread
Daniel Stenberg [Fri, 19 Apr 2024 07:32:23 +0000 (09:32 +0200)] 
mqtt: when Curl_xfer_recv returns error, don't use nread

A returned error code makes other return value unreliable, and in this
case potentially uninitialized. On error, do not read other return
values like the nread counter.

Spotted by CodeSonar

Closes #13418

15 months agoftp: fix socket leak on rare error
Daniel Stenberg [Fri, 19 Apr 2024 07:13:42 +0000 (09:13 +0200)] 
ftp: fix socket leak on rare error

In the function AcceptServerConnect() the newly created socket would
leak if Curl_conn_tcp_accepted_set() returns error. Which basically
should never happen.

Spotted by CodeSonar.

Closes #13417

15 months agourlapi: remove unused flags argument from Curl_url_set_authority
Daniel Stenberg [Thu, 18 Apr 2024 14:49:10 +0000 (16:49 +0200)] 
urlapi: remove unused flags argument from Curl_url_set_authority

The function is only called from a single place (for HTTP/2 server push)
so might as well just assume this fixed option every time.

Closes #13409

15 months agogithub/ISSUE_TEMPLATE: tweak the commericual support text
Daniel Stenberg [Thu, 18 Apr 2024 15:00:57 +0000 (17:00 +0200)] 
github/ISSUE_TEMPLATE: tweak the commericual support text

15 months agogithub/ISSUE_TEMPLATE: link the GitHub discussions too
Daniel Stenberg [Thu, 18 Apr 2024 14:59:21 +0000 (16:59 +0200)] 
github/ISSUE_TEMPLATE: link the GitHub discussions too

... and move the feature request line to the bottom.

15 months agocurl_url_get.md: clarify queries and fragments and CURLU_GET_EMPTY
Daniel Stenberg [Thu, 18 Apr 2024 12:39:21 +0000 (14:39 +0200)] 
curl_url_get.md: clarify queries and fragments and CURLU_GET_EMPTY

Follow-up to 3eac21d86bc5

Closes #13407

15 months agotests: check caddy server version to match test expectations
Stefan Eissing [Thu, 18 Apr 2024 10:18:14 +0000 (12:18 +0200)] 
tests: check caddy server version to match test expectations

- new caddy servers no longer return 200 on POSTs, but 405
  as they should

Closes #13405

15 months agocurl_url_set.md: extended
Daniel Stenberg [Thu, 18 Apr 2024 08:42:18 +0000 (10:42 +0200)] 
curl_url_set.md: extended

Closes #13404

15 months agourlapi: add CURLU_GET_EMPTY for empty queries and fragments
Daniel Stenberg [Wed, 17 Apr 2024 09:39:25 +0000 (11:39 +0200)] 
urlapi: add CURLU_GET_EMPTY for empty queries and fragments

By default the API inhibits empty queries and fragments extracted.
Unless this new flag is set.

This also makes the behavior more consistent: without it set, zero
length queries and fragments are considered not present in the URL. With
the flag set, they are returned as a zero length strings if they were in
fact present in the URL.

This applies when extracting the individual query and fragment
components and for the full URL.

Closes #13396

15 months agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 17 Apr 2024 20:53:40 +0000 (22:53 +0200)] 
RELEASE-NOTES: synced

15 months agolib1560: test with leading zeroes and more IPv4 versions
Daniel Stenberg [Wed, 17 Apr 2024 13:00:00 +0000 (15:00 +0200)] 
lib1560: test with leading zeroes and more IPv4 versions

Inspired by WHATWG URL Spec test inputs

Closes #13400

15 months agosmtp: result of Curl_bufq_cread was not used
MonkeybreadSoftware [Wed, 17 Apr 2024 11:12:09 +0000 (13:12 +0200)] 
smtp: result of Curl_bufq_cread was not used

return the result back to the caller.

Closes #13398

15 months agourlapi: fix relative redirects to fragment-only
Daniel Stenberg [Wed, 17 Apr 2024 08:42:28 +0000 (10:42 +0200)] 
urlapi: fix relative redirects to fragment-only

Using the URL API for a redirect URL when the redirected-to string
starts with a hash, ie is only a fragment, the API would produce the
wrong final URL.

Adjusted test 1560 to test for several new redirect cases.

Closes #13394

15 months agourl: fix use of an uninitialized variable
Jiwoo Park [Wed, 17 Apr 2024 12:41:07 +0000 (21:41 +0900)] 
url: fix use of an uninitialized variable

Closes #13399

15 months agoos400: sync with latest changes
Patrick Monnerat [Wed, 17 Apr 2024 15:39:23 +0000 (17:39 +0200)] 
os400: sync with latest changes

- Conversion support for new version info character field rtmp_version.
- New ILE/RPG declarations.

Closes #13402

15 months agongtcp2: fix macro use
Daniel Stenberg [Wed, 17 Apr 2024 13:12:32 +0000 (15:12 +0200)] 
ngtcp2: fix macro use

macro "H3_STREAM_CTX" requires 2 arguments, but only 1 given

Follow-up to c6655f7029ec5c128561e3ecf1f93db3ed0432a4

Closes #13401

15 months agosendf: fix two typos in comments
MonkeybreadSoftware [Wed, 17 Apr 2024 08:36:08 +0000 (10:36 +0200)] 
sendf: fix two typos in comments

The parameters are named data, not date.

Closes #13393

15 months agolib: silence warnings on comma misuse
MonkeybreadSoftware [Wed, 17 Apr 2024 08:27:42 +0000 (10:27 +0200)] 
lib: silence warnings on comma misuse

Building curl with -Wcomma, I see warnings about "possible misuse of
comma operator here" and moving fields assignment out of the for() fixes
it.

Closes #13392

15 months agohttp/2, http/3: decouple stream state from easy handle
Stefan Eissing [Wed, 27 Mar 2024 14:01:06 +0000 (15:01 +0100)] 
http/2, http/3: decouple stream state from easy handle

- add `Curl_hash_offt` as hashmap between a `curl_off_t` and
  an object. Use this in h2+h3 connection filters to associate
  `data->id` with the internal stream state.
- changed implementations of all affected connection filters
- removed `h2_ctx*` and `h3_ctx*` from `struct HTTP` and thus
  the easy handle
- solves the problem of attaching "foreign protocol" easy handles
  during connection shutdown

Test 1616 verifies the new hash functions.

Closes #13204

15 months agoROADMAP: remove completed entries, mention websocket
Daniel Stenberg [Wed, 17 Apr 2024 08:35:12 +0000 (10:35 +0200)] 
ROADMAP: remove completed entries, mention websocket

15 months agoTHANKS-filter: name fixes
Daniel Stenberg [Wed, 17 Apr 2024 07:48:45 +0000 (09:48 +0200)] 
THANKS-filter: name fixes

15 months agowinbuild: add ENABLE_WEBSOCKETS option
MonkeybreadSoftware [Sat, 30 Mar 2024 10:46:48 +0000 (11:46 +0100)] 
winbuild: add ENABLE_WEBSOCKETS option

Closes #13232

15 months agodmaketgz: compacter
Daniel Stenberg [Tue, 16 Apr 2024 21:54:08 +0000 (23:54 +0200)] 
dmaketgz: compacter

Removes the need for disabling shellcheck warnings.

Follow-up to d28f74913c2
Proposed-by: Viktor Szakats
Closes #13391

15 months agotests: Fix uninitialized value warning
Dan Fandrich [Wed, 17 Apr 2024 02:50:13 +0000 (19:50 -0700)] 
tests: Fix uninitialized value warning

The check for an option must be predicated on options existing at all.

Follow-up to f7cc9e91

15 months agoidn: add native AppleIDN (icucore) support for macOS/iOS
MonkeybreadSoftware [Sun, 31 Mar 2024 09:55:27 +0000 (11:55 +0200)] 
idn: add native AppleIDN (icucore) support for macOS/iOS

I implemented the IDN functions for macOS and iOS using Unicode
libraries coming with macOS and iOS.

Builds and runs here on macOS 14.2.1. Also verified to load and
run on older macOS version 10.13.

Build requires macOS SDK 13 or equivalent.

Set `-DUSE_APPLE_IDN=ON` CMake option to enable it.
With autotools and other build tools, set these manual options:
```
CPPFLAGS=-DUSE_APPLE_IDN
LIBS=-licucore
```

Completes TODO 1.6.

TODO: add autotools option and feature-detection.

Refs: #5330 #5371
Co-authored-by: Viktor Szakats
Closes #13246

15 months agohttp3: extend download abort tests, fixes in ngtcp2
Stefan Eissing [Mon, 15 Apr 2024 12:34:32 +0000 (14:34 +0200)] 
http3: extend download abort tests, fixes in ngtcp2

- fix flow handling in ngtcp2 to ACK data on streams
  we abort ourself.
- extend test_02_23* cases to also run for h3
- skip test_02_23* for OpenSSL QUIC as it gets stalled
  on progressing the connection

Closes #13374

15 months agotests: add -q as first option when invoking curl for tests
Daniel Stenberg [Tue, 16 Apr 2024 12:18:55 +0000 (14:18 +0200)] 
tests: add -q as first option when invoking curl for tests

To reduce the risk that the user running the tests has a .curlrc present
that messes things up.

Support 'option="no-q"' for the <command> tag to switch it off on demand.
Use this new feature in test 433 and 436.

Ref: #13284
Closes #13387

15 months agodmaketgz: release tarball generation using docker
Daniel Stenberg [Tue, 16 Apr 2024 14:56:03 +0000 (16:56 +0200)] 
dmaketgz: release tarball generation using docker

For easier reproducibility.

Mention using this script in RELEASE-PROCEDURE

Closes #13388

15 months agocmake: update ECH code and minor fixups
Viktor Szakats [Tue, 16 Apr 2024 08:10:11 +0000 (10:10 +0200)] 
cmake: update ECH code and minor fixups

- `openssl_check_symbol_exists()` expects a 4th argument now.
  Follow-up to edc2702a1fe3a4a5386ffd9aa4f240f0c0197fa2 #13373

- minor comment/script touch-ups.
  Follow-up to a362962b7289ec02b412890c9515657cf0ed50ac #11922

- fix indentation.

Closes #13383

15 months agotests: fix shellcheck issues in `ech_tests.sh`
Viktor Szakats [Tue, 16 Apr 2024 08:02:40 +0000 (10:02 +0200)] 
tests: fix shellcheck issues in `ech_tests.sh`

Add double-quotes where missing.

Follow-up to a362962b7289ec02b412890c9515657cf0ed50ac #11922
Closes #13382

15 months agodist: add ECH files to tarball
Viktor Szakats [Tue, 16 Apr 2024 07:51:57 +0000 (09:51 +0200)] 
dist: add ECH files to tarball

Also sort `EXTRA_DIST` list in `tests/Makefile.am` and make it diffable.

Follow-up to a362962b7289ec02b412890c9515657cf0ed50ac #11922
Closes #13381

15 months agoopenvms: look for `USE_IPV6` in `config.h` (was: `ENABLE_IPV6`)
Viktor Szakats [Sat, 13 Apr 2024 09:51:36 +0000 (09:51 +0000)] 
openvms: look for `USE_IPV6` in `config.h` (was: `ENABLE_IPV6`)

The OpenVMS script `config_h.com` is parsing the config header
generated by autotools. Let's make it look for the macro name we now
use universally across the codebase.

Follow-up to e411c98f702f0fb38dceec95e7507ef15a00d12c #13349
Closes #13360

15 months agoDockerfile: for release automation and reproducibility
daniel-j-h [Sun, 31 Mar 2024 15:25:36 +0000 (17:25 +0200)] 
Dockerfile: for release automation and reproducibility

Closes #13250

15 months agocw-out: improved error handling
Stefan Eissing [Wed, 10 Apr 2024 12:52:34 +0000 (14:52 +0200)] 
cw-out: improved error handling

- remember error encountered in invoking write callback and always fail
  afterwards without further invokes

- check behaviour in test_02_17 with h2-pausing client

Reported-by: Pavel Kropachev
Fixes #13337
Closes #13340

15 months agoversion: add "ECH" as a feature
Daniel Stenberg [Mon, 15 Apr 2024 15:08:16 +0000 (17:08 +0200)] 
version: add "ECH" as a feature

If available

Follow-up to a362962b7
Closes #13378

15 months agoCURLOPT_ECH: polish
Daniel Stenberg [Tue, 16 Apr 2024 06:37:43 +0000 (08:37 +0200)] 
CURLOPT_ECH: polish

- remove the pointer to build instructions, it won't work in manpages
- add see-also
- minor white space edits

Closes #13379

15 months agotidy-up: whitespace [ci skip]
Viktor Szakats [Tue, 16 Apr 2024 07:52:23 +0000 (09:52 +0200)] 
tidy-up: whitespace [ci skip]

15 months agombedtls: fix building with v3 in CMake Unity mode
Viktor Szakats [Mon, 15 Apr 2024 18:39:15 +0000 (18:39 +0000)] 
mbedtls: fix building with v3 in CMake Unity mode

Before this patch the internal feature detection macro
`HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS` was defined in three files,
with an incomplete logic in one of them. In Unity mode that spilled
into another source file and broke the build.

Closes #13377

15 months agocmake: add librtmp/rtmpdump option and detection
Viktor Szakats [Mon, 15 Apr 2024 10:35:07 +0000 (10:35 +0000)] 
cmake: add librtmp/rtmpdump option and detection

Add CMake option `USE_LIBRTMP`. Disabled by default.

This library requires OpenSSL TLS-backend when linked statically.

Follow-up to 6eb9e65781fa1fd8a0bcfe0715187a3a35f09ae4 #13364
Closes #13373

15 months agoTLS: add support for ECH (Encrypted Client Hello)
Stephen Farrell [Thu, 4 Apr 2024 13:23:35 +0000 (14:23 +0100)] 
TLS: add support for ECH (Encrypted Client Hello)

An EXPERIMENTAL feature used with CURLOPT_ECH and --ech.

Closes #11922

15 months agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 15 Apr 2024 21:47:08 +0000 (23:47 +0200)] 
RELEASE-NOTES: synced

15 months agomulti: introduce SETUP state for better timeouts
Daniel Stenberg [Fri, 5 Apr 2024 11:07:16 +0000 (13:07 +0200)] 
multi: introduce SETUP state for better timeouts

Since we can go to the CONNECT state from PENDING, potentially multiple
times for a single transfer, this change introdues a SETUP state that
happens before CONNECT when doing a new transfer.

Now, doing a redirect on a handle goes back to SETUP (not CONNECT like
before) and we initilize the connect timeout etc in SETUP. Previously,
we would do it in CONNECT but that would make it unreliable in cases
where a transfer goes in and out between CONNECT and PENDING multiple
times.

SETUP is transient, so the handle never actually stays in that state.

Additionally: take care of timeouts of PENDING transfers in
curl_multi_perform()

Ref: #13227
Closes #13371

15 months agocmake: forward `USE_LIBRTMP` option to C
Tal Regev [Sun, 14 Apr 2024 02:37:18 +0000 (05:37 +0300)] 
cmake: forward `USE_LIBRTMP` option to C

Define in C `USE_LIBRTMP` if user requested it from cmake.

Closes #13364

15 months agocurl_version_info: provide librtmp version
Daniel Stenberg [Mon, 15 Apr 2024 06:31:59 +0000 (08:31 +0200)] 
curl_version_info: provide librtmp version

Ref: https://github.com/curl/curl/pull/13364#issuecomment-2054151942
Reported-by: talregev on github
Closes #13368

15 months agodocs: clarify CURLOPT_MAXFILESIZE and CURLOPT_MAXFILESIZE_LARGE
blankie [Mon, 15 Apr 2024 09:35:14 +0000 (19:35 +1000)] 
docs: clarify CURLOPT_MAXFILESIZE and CURLOPT_MAXFILESIZE_LARGE

The bounds of the size parameter were not specified, and nor was it
specified how to disable the maximum file size check.

The documentation also incorrectly stated that CURLOPT_MAXFILESIZE
always returns CURLE_OK and that CURLOPT_MAXFILESIZE_LARGE only returns
CURLE_OK or CURLE_UNKNOWN_OPTION.

It also did not mention what the default value is, which is zero. This
commit updates the documentation to make note of all these things.

Closes #13372

15 months agoOS400: post-shellcheck changes adjustments
Patrick Monnerat [Sun, 14 Apr 2024 23:10:10 +0000 (01:10 +0200)] 
OS400: post-shellcheck changes adjustments

Build scripts must be executed by the os/400 shell (sh), not bash which
is a PASE program.

Shell function get_make_vars() escaping reworked to match $() subcommand
construct.

Follow-up to 8a622baf9e9233241bbe93d6599c99cb46478614
Closes #13366

15 months agoOS400: tidy-up
Viktor Szakats [Sat, 13 Apr 2024 19:57:04 +0000 (19:57 +0000)] 
OS400: tidy-up

Drop/fixup mods trying to make some syntax highlighters happier.

Follow-up to 8a622baf9e9233241bbe93d6599c99cb46478614 #13309
Closes #13362

15 months agomulti: timeout handles even without connection
Daniel Stenberg [Thu, 4 Apr 2024 09:14:44 +0000 (11:14 +0200)] 
multi: timeout handles even without connection

When there is a "change" in a multi handle and pending handles are moved
back to the main list to be retested if they can proceed further (for
example a previous transfer completed or a connection has a confirmed
multiplexed state), the timeout check in multi_runsingle() would not
trigger because it required an established connection.

This could make a pending tranfer go back to pending state even though
it had been "in progress" for a longer time than permitted. By removing
the requirement for an associated connection, the timeout check will be
done proper even for transfers that has not yet been assigned one.

Ref #13227
Reported-by: Rahul Krishna M
Closes #13276

15 months agomprintf: check fputc error rather than matching returned character
Patrick Monnerat [Sun, 14 Apr 2024 12:20:28 +0000 (14:20 +0200)] 
mprintf: check fputc error rather than matching returned character

OS/400 ascii fputc wrapper deviates from the posix standard by the
fact that it returns the ebcdic encoding of the original ascii
character. Testing for a matching value for success will then always
fail.

This commit replaces the chariacter comparison by an explicit error
return check.

Follow-up to ef2cf58
Closes #13367

15 months agoci: add CMake build variation, fixup libssh detection in `linux-old`
Viktor Szakats [Sat, 13 Apr 2024 10:42:34 +0000 (10:42 +0000)] 
ci: add CMake build variation, fixup libssh detection in `linux-old`

To test without c-ares and hit `easy_lock.h` on an old system. Use this
new build step to introduce small variations, and also test libssh2.

Also add workaround to existing job to enable libssh. (CMake's generic
auto-detection doesn't seem to work here.):
```
CMake Warning at CMakeLists.txt:908 (find_package):
  Could not find a package configuration file provided by "libssh" with any
  of the following names:

    libsshConfig.cmake
    libssh-config.cmake
```
Ref: https://github.com/curl/curl/actions/runs/8661316091/job/23750974358#step:5:69

Closes #13361

15 months agolib: merge `ENABLE_QUIC` C macro into `USE_HTTP3`
Viktor Szakats [Thu, 11 Apr 2024 16:35:08 +0000 (16:35 +0000)] 
lib: merge `ENABLE_QUIC` C macro into `USE_HTTP3`

Before this patch `lib/curl_setup.h` defined these two macros right
next to each other, then the source code used them interchangeably.

After this patch, `USE_HTTP3` guards all HTTP/3 / QUIC features.
(Like `USE_HTTP2` does for HTTP/2.) `ENABLE_QUIC` is no longer used.

This patch doesn't change the way HTTP/3 is enabled via autotools
or CMake. Builders who enabled HTTP/3 manually by defining both of
these macros via `CPPFLAGS` can now delete `-DENABLE_QUIC`.

Closes #13352

15 months agobuild: prefer `USE_IPV6` macro internally (was: `ENABLE_IPV6`)
Viktor Szakats [Thu, 11 Apr 2024 12:01:58 +0000 (12:01 +0000)] 
build: prefer `USE_IPV6` macro internally (was: `ENABLE_IPV6`)

Before this patch, two macros were used to guard IPv6 features in curl
sources: `ENABLE_IPV6` and `USE_IPV6`. This patch makes the source use
the latter for consistency with other similar switches.

`-DENABLE_IPV6` remains accepted for compatibility as a synonym for
`-DUSE_IPV6`, when passed to the compiler.

`ENABLE_IPV6` also remains the name of the CMake and `Makefile.vc`
options to control this feature.

Closes #13349

15 months agoDISTROS: mark rolling release distros
Dan Fandrich [Wed, 10 Apr 2024 20:15:23 +0000 (13:15 -0700)] 
DISTROS: mark rolling release distros

These are ones that are unlikely to have back-ported curl patches.

Closes #13353

15 months agombedtls: cut off trailing newlines from debug logs
Daniel Stenberg [Fri, 12 Apr 2024 08:57:02 +0000 (10:57 +0200)] 
mbedtls: cut off trailing newlines from debug logs

To avoid double newlines in the output.

Reported-by: Gisle Vanem
Fixes #13321
Closes #13356

15 months agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 12 Apr 2024 11:25:44 +0000 (13:25 +0200)] 
RELEASE-NOTES: synced

15 months agoCURLINFO_REQUEST_SIZE: fixed, add tests for transfer infos reported
Stefan Eissing [Thu, 4 Apr 2024 09:06:06 +0000 (11:06 +0200)] 
CURLINFO_REQUEST_SIZE: fixed, add tests for transfer infos reported

- tests for 'size_request' and other stats reported, for
  presence and consistency

Reported-by: Jonatan Vela
Fixes #13269
Closes #13275

15 months agodist: add files missing from release tarball
Viktor Szakats [Thu, 11 Apr 2024 11:16:18 +0000 (11:16 +0000)] 
dist: add files missing from release tarball

Closes #13346

15 months agoci: parallelize more, tidy up cmake commands (distcheck, macos)
Viktor Szakats [Mon, 8 Apr 2024 13:18:35 +0000 (13:18 +0000)] 
ci: parallelize more, tidy up cmake commands (distcheck, macos)

Also enable `-DCURL_WERROR=ON` in the Linux cmake build test.

Closes #13343

15 months agodocs: add CURLOPT_NOPROGRESS to CURLOPT_XFERINFOFUNCTION example
Toon Claes [Thu, 11 Apr 2024 11:45:25 +0000 (13:45 +0200)] 
docs: add CURLOPT_NOPROGRESS to CURLOPT_XFERINFOFUNCTION example

It's important to set `CURLOPT_NOPROGRESS` to `0` if you want your
transfer callback function, set by `CURLOPT_XFERINFOFUNCTION`, getting
called. To emphasize this to the users, add this to the code example.

Closes #13348

15 months agomisc: fix typos
RainRat [Wed, 10 Apr 2024 07:36:10 +0000 (00:36 -0700)] 
misc: fix typos

Closes #13344

15 months agofile: add support for getting basic directory listings
Colin Leroy-Mira [Sat, 16 Mar 2024 11:39:01 +0000 (12:39 +0100)] 
file: add support for getting basic directory listings

Not supported on Windows (yet)

Closes #13137

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