]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
2 years 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
2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years agoconfigure: make --disable-docs imply --disable-manual
Daniel Stenberg [Tue, 26 Mar 2024 16:14:56 +0000 (17:14 +0100)] 
configure: make --disable-docs imply --disable-manual

Because when the docs is not built, the necesary curl.txt file is not
present so then the manual cannot get built.

Reported-by: Harry Sintonen
Closes #13191

2 years agocmdline-docs: fix make install with configure --disable-docs
Chris Webb [Wed, 27 Mar 2024 10:09:54 +0000 (10:09 +0000)] 
cmdline-docs: fix make install with configure --disable-docs

make -C docs/cmdline-opts install depends on all-am, which in turn
depends on $(MANS), unconditionally defined to be $(man_MANS).

As with CLEANFILES, only add curl.1 to man_MANS when BUILD_DOCS is true
so we don't try to build curl.1 unnecessarily.

Closes #13198

2 years agoRELEASE-PROCEDURE: remove old release dates, add new pending ones curl-8_7_1
Daniel Stenberg [Wed, 27 Mar 2024 07:11:20 +0000 (08:11 +0100)] 
RELEASE-PROCEDURE: remove old release dates, add new pending ones

2 years agoRELEASE-NOTES: synced curl-8_7_0
Daniel Stenberg [Wed, 27 Mar 2024 06:46:15 +0000 (07:46 +0100)] 
RELEASE-NOTES: synced

curl 8.7.0 release

2 years agoTHANKS: new contributors from the 8.7.0 release
Daniel Stenberg [Wed, 27 Mar 2024 06:46:15 +0000 (07:46 +0100)] 
THANKS: new contributors from the 8.7.0 release

2 years agoCURLOPT_POSTFIELDS.md: used for MQTT as well
Daniel Stenberg [Tue, 26 Mar 2024 09:56:08 +0000 (10:56 +0100)] 
CURLOPT_POSTFIELDS.md: used for MQTT as well

Closes #13189

2 years agohttp: remove stale comment about rewindbeforesend
Daniel Stenberg [Mon, 25 Mar 2024 23:32:56 +0000 (00:32 +0100)] 
http: remove stale comment about rewindbeforesend

... because that struct field exists no more.

Follow-up to 14bcea074a782272.

Closes #13187

2 years agoDISTROS: add document with distro pointers
Daniel Stenberg [Sat, 23 Mar 2024 13:43:35 +0000 (14:43 +0100)] 
DISTROS: add document with distro pointers

Lots of organizations distribute curl packages to end users. This is a
collection of pointers to where to learn more about curl on and with
each distro.

Assisted-by: Alan Coopersmith
Assisted-by: Andrew Kaster
Assisted-by: Andy Fiddaman
Assisted-by: Arjan van de Ven
Assisted-by: Brian Clemens
Assisted-by: chrysos349 on github
Assisted-by: Dan Fandrich
Assisted-by: Dan McDonald
Assisted-by: Gaelan Steele
Assisted-by: graywolf on github
Assisted-by: Jan Macku
Assisted-by: John Marshall
Assisted-by: Jonathan Perkin
Assisted-by: Kevin Daudt
Assisted-by: Marcus Müller
Assisted-by: Michał Górny
Assisted-by: Outvi V
Assisted-by: Ross Burton
Assisted-by: Sean Molenaar
Assisted-by: Till Wegmüller
Assisted-by: Viktor Szakats
Assisted-by: Winni Neessen
Closes #13178

2 years agowolfSSL: do not call the stub function wolfSSL_BIO_set_init()
Fabian Keil [Sun, 17 Mar 2024 13:30:33 +0000 (14:30 +0100)] 
wolfSSL: do not call the stub function wolfSSL_BIO_set_init()

Calling the function isn't necessary and causes the build
to fail when wolfSSL has been compiled with NO_WOLFSSL_STUB:

     Making all in opts
       CCLD     curl
     ld: error: undefined symbol: wolfSSL_BIO_set_init
     >>> referenced by wolfssl.c:235 (vtls/wolfssl.c:235)
     >>>               libcurl_la-wolfssl.o:(wolfssl_bio_cf_create) in archive ../lib/.libs/libcurl.a
     cc: error: linker command failed with exit code 1 (use -v to see invocation)
     *** Error code 1

Closes #13164

2 years agocmdline-opts: shorter help texts
Daniel Stenberg [Mon, 25 Mar 2024 09:02:30 +0000 (10:02 +0100)] 
cmdline-opts: shorter help texts

In an effort to increase the readability of the "--help all" output on
narrow (80 column) terminals.

Co-authored-by: Jay Satiro
Closes #13169

2 years agocurl-rustls.m4: add pkg-config support to rustls detection
Matt Jolly [Sun, 24 Mar 2024 09:00:09 +0000 (19:00 +1000)] 
curl-rustls.m4: add pkg-config support to rustls detection

Based on the existing openssl pkg-config detection, this commit tries to
use pkg-config to find `rustls` then falls back to the current approach
if that fails.

We use the following logic:

- if no path is provided, just use pkg-config, if it's not there we have
  a problem!
- if a path is provided, try pkg-config
  + if pkg-config fails, try and find rustls directly

Closes #13179

2 years agoTODO: update 13.11 with more information
Mohammadreza Hendiani [Fri, 22 Mar 2024 14:30:29 +0000 (18:00 +0330)] 
TODO: update 13.11 with more information

Closes #13173

2 years agodocs/libcurl: generate PROTOCOLS from meta-data
Daniel Stenberg [Fri, 22 Mar 2024 22:48:54 +0000 (23:48 +0100)] 
docs/libcurl: generate PROTOCOLS from meta-data

Remove the PROTOCOLS section from the source files completely and
instead generate them based on the header data in the curldown files.

It also generates TLS backend information for options marked for TLS as
protocol.

Closes #13175

2 years agoCURLMOPT_MAX*: mention what happens if changed mid-transfer
Daniel Stenberg [Fri, 22 Mar 2024 23:36:50 +0000 (00:36 +0100)] 
CURLMOPT_MAX*: mention what happens if changed mid-transfer

For CURLMOPT_MAXCONNECTS and CURLMOPT_MAX_HOST_CONNECTIONS

Ref: #13158
Closes #13176

2 years agodocs/libcurl: add TLS backend info for all TLS options
Daniel Stenberg [Thu, 21 Mar 2024 14:46:32 +0000 (15:46 +0100)] 
docs/libcurl: add TLS backend info for all TLS options

All man pages that are listed to be for TLS now must also specify
exactly what TLS backends the option works for, or use All if they all
work.

cd2nroff makes sure this is done and that the listed backends exist.

Closes #13168

2 years agodocs/libcurl: cleanups
Daniel Stenberg [Thu, 21 Mar 2024 14:32:26 +0000 (15:32 +0100)] 
docs/libcurl: cleanups

- CURLINFO_TLS_SESSION.md: remove mention of NSS
- CURLINFO_TLS_SSL_PTR.md: remove NSS leftover
- CURLOPT_CAINFO.md: drop mention of backends not supporting this
- CURLOPT_CAPATH.md: wolfSSL also supports this

Closes #13166

2 years agodocs: make each libcurl man specify protocol(s)
Daniel Stenberg [Thu, 21 Mar 2024 10:50:20 +0000 (11:50 +0100)] 
docs: make each libcurl man specify protocol(s)

The mandatory header now has a mandatory list of protocols for which the
manpage is relevant.

Most man pages already has a "PROTOCOLS" section, but this introduces a
stricter way to specify the relevant protocols.

cd2nroff verifies that at least one protocol is mentioned (which can be
`*`).

This information is not used just yet, but A) the PROTOCOLS section can
now instead get generated and get a unified wording across all manpages
and B) this allows us to more reliably filter/search for protocol
specific manpages/options.

Closes #13166

2 years agohttp2, http3: only return CURLE_PARTIAL_FILE when bytes were received
Stefan Eissing [Tue, 19 Mar 2024 15:06:40 +0000 (16:06 +0100)] 
http2, http3: only return CURLE_PARTIAL_FILE when bytes were received

- should resolve spurious pytest failures when stream were reset
  right after response header were received

Clsoes #13151

2 years agohttp: separate response parsing from response action
Stefan Eissing [Mon, 11 Mar 2024 16:23:15 +0000 (17:23 +0100)] 
http: separate response parsing from response action

- move code that triggers on end-of-response into separate function from
  parsing
- simplify some headp/headerlen usage
- add `httpversion` to SingleRequest to indicate the version of the
  current response

Closes #13134

2 years agohttp2: remove the third (unused) argument from http2_data_done()
Daniel Stenberg [Wed, 20 Mar 2024 11:06:13 +0000 (12:06 +0100)] 
http2: remove the third (unused) argument from http2_data_done()

Closes #13154

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 21 Mar 2024 07:28:56 +0000 (08:28 +0100)] 
RELEASE-NOTES: synced

2 years agoRELEASE-NOTES: corrected
Karlson2k [Wed, 20 Mar 2024 22:03:24 +0000 (23:03 +0100)] 
RELEASE-NOTES: corrected

Corrected link for item 118

Closes #13157

2 years agoCURLOPT_INTERFACE.md: remove spurious amp, add see-also
Daniel Stenberg [Tue, 19 Mar 2024 10:27:42 +0000 (11:27 +0100)] 
CURLOPT_INTERFACE.md: remove spurious amp, add see-also

Closes #13149

2 years agohttp: improve response header handling, save cpu cycles
Stefan Eissing [Mon, 18 Mar 2024 11:46:43 +0000 (12:46 +0100)] 
http: improve response header handling, save cpu cycles

Saving some cpu cycles in http response header processing:
- pass the length of the header line along
- use string constant sizeof() instead of strlen()
- check line length if prefix is possible
- switch on first header char to limit checks

Closes #13143

2 years agotool_getparam: accept a blank -w ""
Daniel Stenberg [Mon, 18 Mar 2024 22:01:22 +0000 (23:01 +0100)] 
tool_getparam: accept a blank -w ""

Added test 468 to verify.

Regression from 07bcae89d5d00 (shipped in 8.6.0)
Reported-by: Thomas Pyle
Fixes #13144
Closes #13145

2 years agocurl_sha512_256: work around a NetBSD bug
Evgeny Grin [Fri, 15 Mar 2024 12:11:53 +0000 (13:11 +0100)] 
curl_sha512_256: work around a NetBSD bug

Based on Michael Kaufmann analysis and suggestion

Closes #13133

2 years agohttp: expect 100 rework
Stefan Eissing [Mon, 11 Mar 2024 16:23:15 +0000 (17:23 +0100)] 
http: expect 100 rework

Move all handling of HTTP's `Expect: 100-continue` feature into a client
reader. Add sending flag `KEEP_SEND_TIMED` that triggers transfer
sending on general events like a timer.

HTTP installs a `CURL_CR_PROTOCOL` reader when announcing `Expect:
100-continue`. That reader works as follows:

- on first invocation, records time, starts the `EXPIRE_100_TIMEOUT`
  timer, disables `KEEP_SEND`, enables `KEEP_SEND_TIMER` and returns 0,
  eos=FALSE like a paused upload.

- on subsequent invocation it checks if the timer has expired. If so, it
  enables `KEEP_SEND` and switches to passing through reads to the
  underlying readers.

Transfer handling's `readwrite()` will be invoked when a timer expires
(like `EXPIRE_100_TIMEOUT`) or when data from the server arrives. Seeing
`KEEP_SEND_TIMER`, it will try to upload more data, which triggers
reading from the client readers again. Which then may lead to a new
pausing or cause the upload to start.

Flags and timestamps connected to this have been moved from
`SingleRequest` into the reader's context.

Closes #13110

2 years agombedtls: fix pytest for newer versions
Stefan Eissing [Fri, 15 Mar 2024 09:10:13 +0000 (10:10 +0100)] 
mbedtls: fix pytest for newer versions

Fix the expectations in pytest for newer versions of mbedtls

Closes #13132

2 years agoipv6.md: mention IPv4 mapped addresses
Daniel Stenberg [Fri, 15 Mar 2024 08:38:21 +0000 (09:38 +0100)] 
ipv6.md: mention IPv4 mapped addresses

Reported-by: Josh Soref
Assisted-by: Jay Satiro
Fixes #13112
Closes #13131

2 years agohttp: revisit http_perhapsrewind()
Stefan Eissing [Wed, 13 Mar 2024 10:42:17 +0000 (11:42 +0100)] 
http: revisit http_perhapsrewind()

- use facilities provided by client readers better
- work also for non-uploading requests like GET/HEAD
- update documentation

Closes #13117

2 years agotest 1541: verify getinfo values on first header callback
Stefan Eissing [Thu, 14 Mar 2024 11:28:46 +0000 (12:28 +0100)] 
test 1541: verify getinfo values on first header callback

Reported-by: chensong1211 on github
Ref: #13125
Closes #13128

2 years agoTLS: start shutdown only when peer did not already close
Stefan Eissing [Fri, 8 Mar 2024 08:37:27 +0000 (09:37 +0100)] 
TLS: start shutdown only when peer did not already close

- When curl sees a TCP close from the peer, do not start a TLS shutdown.
  TLS shutdown is a handshake and if the peer already closed the
  connection, it is not interested in participating.

Reported-by: dfdity on github
Assisted-by: Jiří Bok
Assisted-by: Pēteris Caune
Fixes #10290
Closes #13087

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 14 Mar 2024 22:11:53 +0000 (23:11 +0100)] 
RELEASE-NOTES: synced

2 years agocurl: make --libcurl output better CURLOPT_*SSLVERSION
Daniel Stenberg [Thu, 14 Mar 2024 12:58:45 +0000 (13:58 +0100)] 
curl: make --libcurl output better CURLOPT_*SSLVERSION

The option is really two enums ORed together, so it needs special
attention to make the code output nice.

Added test 1481 to verify. Both the server and the proxy versions.

Reported-by: Boris Verkhovskiy
Fixes #13127
Closes #13129

2 years agoGHA/linux: add sysctl trick to work-around GitHub runner issue
Daniel Stenberg [Thu, 14 Mar 2024 11:56:39 +0000 (12:56 +0100)] 
GHA/linux: add sysctl trick to work-around GitHub runner issue

The GitHub image runner update from 20240304.1.0 to 20240310.1
introduces a problem for clang-14. The issue is caused by
incompatibility between llvm 14 provided in ubuntu-22.04 image and the
much newer kernel configured with high-entropy ASLR.

As a work-around, we issue a sysctl command to lower the entropy and get
clang-14 to work again.

URL: https://github.com/actions/runner-images/issues/9491

Closes #13124

2 years agoSPONSORS: describe the basics
Daniel Stenberg [Wed, 13 Mar 2024 12:26:07 +0000 (13:26 +0100)] 
SPONSORS: describe the basics

Closes #13119

2 years agoGOVERNANCE: document the core team
Daniel Stenberg [Wed, 13 Mar 2024 12:23:38 +0000 (13:23 +0100)] 
GOVERNANCE: document the core team

Closes #13118

2 years agovquic-tls: fix the error code returned for bad CA file
Jay Satiro [Wed, 13 Mar 2024 06:03:18 +0000 (02:03 -0400)] 
vquic-tls: fix the error code returned for bad CA file

- Return CURLE_SSL_CACERT_BADFILE if wolfSSL encounters a problem
  reading the cert file or path.

This is a follow-up to the parent commit aedbbdf1.

Reported-by: Karthikdasari0423@users.noreply.github.com
Fixes https://github.com/curl/curl/issues/13115

2 years agovquic-tls: return appropirate errors on wolfSSL errors
Daniel Stenberg [Mon, 11 Mar 2024 09:53:08 +0000 (10:53 +0100)] 
vquic-tls: return appropirate errors on wolfSSL errors

Reported-by: Dexter Gerig
Closes #13107

2 years agotidy-up: one comment and EOF newlines
Viktor Szakats [Tue, 12 Mar 2024 12:04:27 +0000 (12:04 +0000)] 
tidy-up: one comment and EOF newlines

Reviewed-by: Daniel Stenberg
Closes #13108

2 years agocmdline-opts: language cleanups
Daniel Stenberg [Tue, 12 Mar 2024 09:34:58 +0000 (10:34 +0100)] 
cmdline-opts: language cleanups

Use imperative mood consistently for the first sentence describing an
option.

"Set this" instead "tell curl to set" or "this sets..."

Plus some extra cleanups and rephrasing.

Closes #13106

2 years agomanagen: remove space before protocols
Daniel Stenberg [Tue, 12 Mar 2024 07:45:22 +0000 (08:45 +0100)] 
managen: remove space before protocols

For options that are listed for specific protocols, the protocols (shown
first within parentheses) are now output without the leading space in the
manpage output.

Closes #13105

2 years agombedtls: properly cleanup the thread-shared entropy
Jay Satiro [Thu, 7 Mar 2024 00:18:46 +0000 (19:18 -0500)] 
mbedtls: properly cleanup the thread-shared entropy

- Store the state of the thread-shared entropy for global init/cleanup.

- Use curl's thread support of mbedtls for all Windows builds instead of
  just when the threaded resolver is used via USE_THREADS_WIN32.

Prior to this change on global cleanup curl builds that have curl thread
support for mbedtls freed the entropy (8b1d2298) but failed to mark that
it had been freed, which caused problems on subsequent init + transfer.

Bug: https://github.com/curl/curl/discussions/11919#discussioncomment-8687105
Reported-by: awesomekosm@users.noreply.github.com
Closes https://github.com/curl/curl/pull/13071

2 years agotool_getparam: handle non-existing (out of range) short-options
Daniel Stenberg [Mon, 11 Mar 2024 21:39:22 +0000 (22:39 +0100)] 
tool_getparam: handle non-existing (out of range) short-options

... correctly, even when they follow an existing one without a space in
between.

Verify with test 467

Follow-up to 07dd60c05b
Reported-by: Geeknik Labs
Fixes #13101
Closes #13102

2 years agolib: move 'done' parameter to SingleRequests
Stefan Eissing [Mon, 11 Mar 2024 11:35:07 +0000 (12:35 +0100)] 
lib: move 'done' parameter to SingleRequests

A transfer may do several `SingleRequest`s for its success. This happens
regularly for authentication, follows and retries on failed connections.
The "readwrite()" calls and functions connected to those carried a `bool
*done` parameter to indicate that the current `SingleRequest` is over.
This may happen before `upload_done` or `download_done` bits of
`SingleRequest` are set.

The problem with that is now `write_resp()` protocol handlers are
invoked in places where the `bool *done` cannot be passed up to the
caller. Instead of being a bool in the call chain, it needs to become a
member of `SingleRequest`, reflecting its state.

This removes the `bool *done` parameter and adds the `done` bit to
`SingleRequest` instead. It adds `Curl_req_soft_reset()` for using a
`SingleRequest` in a follow up, clearing `done` and other
flags/counters.

Closes #13096

2 years agorequest: clarify message when request has been sent off
Stefan Eissing [Mon, 11 Mar 2024 08:50:55 +0000 (09:50 +0100)] 
request: clarify message when request has been sent off

Change the "uploaded and fine" message for requests without a body

Reported-by: Karthikdasari0423 on github
Fixes #13093
Closes #13095

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 11 Mar 2024 06:30:01 +0000 (07:30 +0100)] 
RELEASE-NOTES: synced

2 years agolib: keep conn IP information together
Stefan Eissing [Fri, 8 Mar 2024 09:45:14 +0000 (10:45 +0100)] 
lib: keep conn IP information together

new struct ip_quadruple for holding local/remote addr+port

- used in data->info and conn and cf-socket.c
- copy back and forth complete struct
- add 'secondary' to conn
- use secondary in reporting success for ftp 2nd connection

Reported-by: DasKutti on github
Fixes #13084
Closes #13090

2 years agoscripts/managen: the new name and home for the manpage generator
Daniel Stenberg [Fri, 8 Mar 2024 10:22:12 +0000 (11:22 +0100)] 
scripts/managen: the new name and home for the manpage generator

It was previously docs/cmdline-opts/gen.pl

Closes #13089

2 years agoVULN-DISCLOSURE-POLICY.md: update detail about CVE requests
Daniel Stenberg [Fri, 8 Mar 2024 10:09:48 +0000 (11:09 +0100)] 
VULN-DISCLOSURE-POLICY.md: update detail about CVE requests

curl is a CNA now

Closes #13088

2 years agolib: client reader polish
Stefan Eissing [Thu, 7 Mar 2024 10:05:53 +0000 (11:05 +0100)] 
lib: client reader polish

- seek_func/seek_client, use transfer values only
    - remove copies held in `struct connectdata`, use only
      ever `data->set.seek_func`
    - resolves possible issues in multiuse connections
    - new mime post reader eliminates need to ever overwriting this

- websockets, remove empty Curl_ws_done() function

Closes #13079

2 years agolib1598: fix `CURLOPT_POSTFIELDSIZE` usage
Marcel Raad [Fri, 8 Mar 2024 07:45:10 +0000 (08:45 +0100)] 
lib1598: fix `CURLOPT_POSTFIELDSIZE` usage

It requires a `long` argument.

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

2 years agodocs/cmdline-opts: drop the curl.1 from the dist tarball
Daniel Stenberg [Thu, 7 Mar 2024 22:25:07 +0000 (23:25 +0100)] 
docs/cmdline-opts: drop the curl.1 from the dist tarball

Since it is no longer needed for building tool_hugehelp.c and all the
docs is available in readable markdown format in the tarball, the peeps
that don't want to build the manpage still do good.

Removing it also fixes the complexity of out-of-tree builds when the
curl.1 exists in the source tree.

2 years agotest1140/1173: extend wildcards to find curl.1
Daniel Stenberg [Thu, 7 Mar 2024 21:30:50 +0000 (22:30 +0100)] 
test1140/1173: extend wildcards to find curl.1

... in its new build path.

Also update the test scripts to be more precise in error messages to
help us understand CI errors better.

Follow-up to f03c85635f35269f1
Ref: #13029
Closes #13083

2 years agohttp2: minor tweaks to optimize two struct sizes
Daniel Stenberg [Thu, 7 Mar 2024 15:41:06 +0000 (16:41 +0100)] 
http2: minor tweaks to optimize two struct sizes

- use BIT() instead of bool
- place the struct fields in (roughly) size order

Closes #13082

2 years agobuildconf.bat: remove outdated groff/nroff use
Daniel Stenberg [Thu, 7 Mar 2024 09:33:49 +0000 (10:33 +0100)] 
buildconf.bat: remove outdated groff/nroff use

- don't try to generate the real hugehelp file, because it requires
  curl.txt which needs a build
- don't attempt to do anything in a c-ares subdirectory

Follow-up to f03c85635f35269
Closes #13078

2 years agohttp2: memory errors in the push callbacks are fatal
Daniel Stenberg [Thu, 7 Mar 2024 15:02:13 +0000 (16:02 +0100)] 
http2: memory errors in the push callbacks are fatal

Use the correct nghttp2 error code accordingly.

Closes #13081

2 years agomkhelp: rename variable to fix compiler warnings
Viktor Szakats [Thu, 7 Mar 2024 09:25:39 +0000 (09:25 +0000)] 
mkhelp: rename variable to fix compiler warnings

```
src\tool_operate.c(541,33): warning C4459: declaration of 'm' hides global declaration [_bld\src\curl.vcxproj]
  _bld\src\tool_hugehelp.c(8,27):
  see declaration of 'm'
src\tool_paramhlp.c(307,14): warning C4459: declaration of 'm' hides global declaration [_bld\src\curl.vcxproj]
src\tool_progress.c(118,16): warning C4459: declaration of 'm' hides global declaration [_bld\src\curl.vcxproj]
src\tool_writeout.c(288,31): warning C4459: declaration of 'm' hides global declaration [_bld\src\curl.vcxproj]
```
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/49348159/job/51ee75cd2n0wj6lc#L614

Reviewed-by: Daniel Stenberg
Closes #13077

2 years agoKNOWN_BUGS: POP3 issue when reading small chunks
Daniel Stenberg [Thu, 7 Mar 2024 16:40:29 +0000 (17:40 +0100)] 
KNOWN_BUGS: POP3 issue when reading small chunks

Closes #12063

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 7 Mar 2024 15:50:59 +0000 (16:50 +0100)] 
RELEASE-NOTES: synced

2 years agoasyn-ares: fix data race warning
Robert Moreton [Mon, 26 Feb 2024 23:16:21 +0000 (18:16 -0500)] 
asyn-ares: fix data race warning

- Store the c-ares version during global init.

Prior to this change several threads could write the same data to a
static int variable at the same time. Though in practice it's not a
problem ThreadSanitizer may warn.

Reported-by: Nikita Taranov
Assisted-by: Jay Satiro
Fixes #13065
Closes #13000

2 years agohyper: implement unpausing via client reader
Stefan Eissing [Thu, 7 Mar 2024 09:08:35 +0000 (10:08 +0100)] 
hyper: implement unpausing via client reader

Just a tidy up to contain 'ifdef' pollution of common
code parts with implementation specifics.

- remove the ifdef hyper unpausing in easy.c
- add hyper client reader for CURL_CR_PROTOCOL phase
  that implements the unpause method for calling
  the hyper waker if it is set

Closes #13075

2 years agongtcp2: no recvbuf for stream
Stefan Eissing [Thu, 7 Mar 2024 08:23:11 +0000 (09:23 +0100)] 
ngtcp2: no recvbuf for stream

- write response data directly to the transfer via
 `Curl_xfer_write_resp()` like we do in HTTP/2.

Closes #13073

2 years agodocs/cmdline-opts/.gitignore: ignore curl.txt
Stefan Eissing [Thu, 7 Mar 2024 09:18:33 +0000 (10:18 +0100)] 
docs/cmdline-opts/.gitignore: ignore curl.txt

Closes #13076

2 years agosha512_256: add support for GnuTLS and OpenSSL
Evgeny Grin (Karlson2k) [Wed, 6 Mar 2024 23:42:04 +0000 (00:42 +0100)] 
sha512_256: add support for GnuTLS and OpenSSL

This is a follow-up for PR #12897.

Add support for SHA-512/256 digest calculation by TLS backends.
Currently only OpenSSL and GnuTLS (actually, nettle) support
SHA-512/256.

Closes #13070

2 years agodigest: add check for hashing error
Evgeny Grin [Thu, 7 Mar 2024 00:35:31 +0000 (01:35 +0100)] 
digest: add check for hashing error

Closes #13072

2 years agocmake: enable `ENABLE_CURL_MANUAL` by default
Viktor Szakats [Wed, 6 Mar 2024 22:24:56 +0000 (22:24 +0000)] 
cmake: enable `ENABLE_CURL_MANUAL` by default

Meaning `curl.1` and `src/tool_hugehelp.c` are built by default,
and `--manual` in curl tool is also enabled by default.

This syncs behaviour with autotools.

For a reproducible `curl.1`, `SOURCE_DATE_EPOCH` needs to be set
to a consistent date, e.g. the timestamp of `CHANGES`.

A pre-built manual (e.g. the one distributed in the official source
tarball) will be ignored and rebuilt after this patch, unless
explicitly disabling this option.

Fixes #13028
Closes #13069

2 years agohttp2: push headers better cleanup
Stefan Eissing [Wed, 6 Mar 2024 08:36:08 +0000 (09:36 +0100)] 
http2: push headers better cleanup

- provide common cleanup method for push headers

Closes #13054

2 years agoGIT-INFO: convert to markdown
Daniel Stenberg [Thu, 7 Mar 2024 08:28:06 +0000 (09:28 +0100)] 
GIT-INFO: convert to markdown

Closes #13074

2 years agocmake: fix libcurl.pc and curl-config library specifications
Richard Levitte [Tue, 13 Feb 2024 05:45:57 +0000 (06:45 +0100)] 
cmake: fix libcurl.pc and curl-config library specifications

Letting CMake figure out where libraries are located gives you full
paths. When generating libcurl.pc and curl-config, getting libraries as
full paths is unusual when one expects to get a list of -l<libname>.

To meet expectations, an effort is made to convert the full paths into
-l<libname>, possibly with -L<libdir> before it.

Fixes #6169
Fixes #12748
Closes #12930

2 years agotest463: HTTP with -d @file with file containing CR, LF and null byte
Daniel Stenberg [Wed, 6 Mar 2024 21:44:41 +0000 (22:44 +0100)] 
test463: HTTP with -d @file with file containing CR, LF and null byte

2 years agoparamhlp: fix CRLF-stripping files with "-d @file"
Daniel Stenberg [Wed, 6 Mar 2024 14:39:09 +0000 (15:39 +0100)] 
paramhlp: fix CRLF-stripping files with "-d @file"

All CR and LF bytes should be stripped, as documented, and all other
bytes are inluded in the data. Starting now, it also excludes null bytes
as they would otherwise also cut the data short.

Reported-by: Simon K
Fixes #13063
Closes #13064

2 years agocmake: fix `CURL_WINDOWS_SSPI=ON` with Schannel disabled
Viktor Szakats [Wed, 6 Mar 2024 11:43:40 +0000 (11:43 +0000)] 
cmake: fix `CURL_WINDOWS_SSPI=ON` with Schannel disabled

Prior to this change `CURL_WINDOWS_SSPI` was accidentally forced `OFF`
when building without the Schannel TLS backend.

This in turn may have caused Kerberos, SPNEGO and SSPI features
disappearing even with `CURL_WINDOWS_SSPI=ON` set.

This patch fixes it by using the `CURL_USE_SCHANNEL` setting as a
default for `CURL_WINDOWS_SSPI`, but allowing a manual override.

Also update the option text to better tell its purpose.

Thanks-to: Andreas Loew
Reviewed-by: Daniel Stenberg
Ref: #13056
Closes #13061

2 years agoKNOWN_BUGS: FTPS server compatibility on Windows with Schannel
Jay Satiro [Sun, 3 Mar 2024 07:15:24 +0000 (02:15 -0500)] 
KNOWN_BUGS: FTPS server compatibility on Windows with Schannel

- Remove "2.12 FTPS with Schannel times out file list operation"

- Remove "7.12 FTPS directory listing hangs on Windows with Schannel"

- Add "7.12 FTPS server compatibility on Windows with Schannel"

This change adds a more generic bug description that explains FTPS with
the latest curl and Schannel is not widely used and may have more bugs
than other TLS backends.

The two removed FTPS Schannel bugs can't be reproduced any longer and
were likely fixed by 24d6c288.

Ref: https://github.com/curl/curl/issues/5284
Ref: https://github.com/curl/curl/issues/9161
Ref: https://github.com/curl/curl/issues/12894

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

2 years agotrace-config.md: remove the mutexed options list
Jay Satiro [Sat, 2 Mar 2024 22:44:33 +0000 (17:44 -0500)] 
trace-config.md: remove the mutexed options list

- Remove the rendered manpage message that says:
  "[--trace-config] is mutually exclusive to --trace and -v, --verbose".

Actually it can be used with either of those options, which are mutually
exclusive to each other but not to --trace-config.

Ref: https://curl.se/docs/manpage.html#--trace-config

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

2 years agomkhelp: simplify the generated hugehelp program
Daniel Stenberg [Tue, 5 Mar 2024 16:32:00 +0000 (17:32 +0100)] 
mkhelp: simplify the generated hugehelp program

Use a plain array and puts() every line, also allows us to provide the
strings without ending newlines.

- merge blank lines into the next one as a prefixed newline.
- turn eight consecutive spaces into a tab (since they can only be on the
  left side of text)
- the newly generated tool_hugehelp is 3K lines shorter and 50K smaller
- modifies the top logo layout a little by reducing the indent

Closes #13047

2 years agodocs: ascii version of manpage without nroff
Daniel Stenberg [Mon, 4 Mar 2024 16:22:17 +0000 (17:22 +0100)] 
docs: ascii version of manpage without nroff

Create ASCII version of manpage without nroff

 - build src/tool_hugegelp.c from the ascii manpage
 - move the the manpage and the ascii version build to docs/cmdline-opts
 - remove all use of nroff from the build process
 - should make the build entirely reproducible (by avoiding nroff)

 - partly reverts 2620aa9 to build libcurl option man pages one by one
   in cmake because the appveyor builds got all crazy until I did

The ASCII version of the manpage

 - is built with gen.pl, just like the manpage is
 - has a right-justified column making the appearance similar to the previous
   version
 - uses a 4-space indent per level (instead of the old version's 7)
 - does not do hyphenation of words (which nroff does)

History

  We first made the curl build use nroff for building the hugehelp file in
  December 1998, for curl 5.2.

Closes #13047