]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
20 months agoKNOWN_BUGS: IMAPS connection fails with rustls error 13005/head
Daniel Stenberg [Tue, 27 Feb 2024 16:50:25 +0000 (17:50 +0100)] 
KNOWN_BUGS: IMAPS connection fails with rustls error

Closes #10457

20 months agoKNOWN_BUGS: FTPS upload, FileZilla, GnuTLS and close_notify
Daniel Stenberg [Tue, 27 Feb 2024 16:48:18 +0000 (17:48 +0100)] 
KNOWN_BUGS: FTPS upload, FileZilla, GnuTLS and close_notify

Closes #11383

20 months agoKNOWN_BUGS: Implicit FTPS upload timeout
Daniel Stenberg [Tue, 27 Feb 2024 16:46:19 +0000 (17:46 +0100)] 
KNOWN_BUGS: Implicit FTPS upload timeout

Closes #11720

20 months agoKNOWN_BUGS: HTTP/2 prior knowledge over proxy
Daniel Stenberg [Tue, 27 Feb 2024 16:44:55 +0000 (17:44 +0100)] 
KNOWN_BUGS: HTTP/2 prior knowledge over proxy

Closes #12641

20 months agoTODO: build HTTP/3 with OpenSSL and nghttp3 using cmake
Daniel Stenberg [Tue, 27 Feb 2024 16:43:22 +0000 (17:43 +0100)] 
TODO: build HTTP/3 with OpenSSL and nghttp3 using cmake

Closes #12988

20 months agoTODO: Select signature algorithms
Daniel Stenberg [Tue, 27 Feb 2024 16:41:40 +0000 (17:41 +0100)] 
TODO: Select signature algorithms

Closes #12982

20 months agoexamples: use present tense in comments
Daniel Stenberg [Tue, 27 Feb 2024 11:29:27 +0000 (12:29 +0100)] 
examples: use present tense in comments

remove "will" and some other word fixes

Closes #13003

20 months agodocs: more language cleanups
Daniel Stenberg [Tue, 27 Feb 2024 09:35:28 +0000 (10:35 +0100)] 
docs: more language cleanups

- present tense
- avoid bad words

Closes #13003

20 months agosetopt: Fix disabling all protocols
Daniel Gustafsson [Tue, 27 Feb 2024 14:43:56 +0000 (15:43 +0100)] 
setopt: Fix disabling all protocols

When disabling all protocols without enabling any, the resulting
set of allowed protocols remained the default set.  Clearing the
allowed set before inspecting the passed value from --proto make
the set empty even in the errorpath of no protocols enabled.

Co-authored-by: Dan Fandrich <dan@telarity.com>
Reported-by: Dan Fandrich <dan@telarity.com>
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
Closes: #13004
20 months agofopen: fix narrowing conversion warning on 32-bit Android
Andreas Kiefer [Mon, 26 Feb 2024 20:08:10 +0000 (21:08 +0100)] 
fopen: fix narrowing conversion warning on 32-bit Android

This was fixed in commit 06dc599405f, but came back in commit
03cb1ff4d62.

When building for 32-bit ARM or x86 Android, `st_mode` is defined as
`unsigned int` instead of `mode_t`, resulting in a
`-Wimplicit-int-conversion` clang warning because `mode_t` is
`unsigned short`. Add a cast to silence the warning, but only for
32-bit Android builds, because other architectures and platforms are
not affected.

Ref: https://android.googlesource.com/platform/bionic/+/refs/tags/ndk-r25c/libc/include/sys/stat.h#86
Closes https://github.com/curl/curl/pull/12998

20 months agolib: Curl_read/Curl_write clarifications
Stefan Eissing [Thu, 15 Feb 2024 15:22:53 +0000 (16:22 +0100)] 
lib: Curl_read/Curl_write clarifications

- replace `Curl_read()`, `Curl_write()` and `Curl_nwrite()` to
  clarify when and at what level they operate
- send/recv of transfer related data is now done via
  `Curl_xfer_send()/Curl_xfer_recv()` which no longer has
  socket/socketindex as parameter. It decides on the transfer
  setup of `conn->sockfd` and `conn->writesockfd` on which
  connection filter chain to operate.
- send/recv on a specific connection filter chain is done via
  `Curl_conn_send()/Curl_conn_recv()` which get the socket index
  as parameter.
- rename `Curl_setup_transfer()` to `Curl_xfer_setup()` for
  naming consistency
- clarify that the special CURLE_AGAIN hangling to return
  `CURLE_OK` with length 0 only applies to `Curl_xfer_send()`
  and CURLE_AGAIN is returned by all other send() variants.
- fix a bug in websocket `curl_ws_recv()` that mixed up data
  when it arrived in more than a single chunk

The method for sending not just raw bytes, but bytes that are either
"headers" or "body". The send abstraction stack, to to bottom, now is:

* `Curl_req_send()`: has parameter to indicate amount of header bytes,
  buffers all data.
* `Curl_xfer_send()`: knows on which socket index to send, returns
  amount of bytes sent.
* `Curl_conn_send()`: called with socket index, returns amount of bytes
  sent.

In addition there is `Curl_req_flush()` for writing out all buffered
bytes.

`Curl_req_send()` is active for requests without body,
`Curl_buffer_send()` still being used for others. This is because the
special quirks need to be addressed in future parts:

* `expect-100` handling
* `Curl_fillreadbuffer()` needs to add directly to the new
  `data->req.sendbuf`
* special body handlings, like `chunked` encodings and line end
  conversions will be moved into something like a Client Reader.

In functions of the pattern `CURLcode xxx_send(..., ssize_t *written)`,
replace the `ssize_t` with a `size_t`. It makes no sense to allow for negative
values as the returned `CURLcode` already specifies error conditions. This
allows easier handling of lengths without casting.

Closes #12964

20 months agomulti: make add_handle free any multi_easy
Daniel Stenberg [Mon, 26 Feb 2024 08:50:49 +0000 (09:50 +0100)] 
multi: make add_handle free any multi_easy

If the easy handle that is being added to a multi handle has previously
been used for curl_easy_perform(), there is a private multi handle here
that we can kill off. While it flushes some caches etc for the easy
handle would it be used for an easy interface transfer again after being
used in the multi stack, this cleanup simplifies behavior and uses less
memory.

Closes #12992

20 months agodocs: use present tense
Daniel Stenberg [Tue, 27 Feb 2024 06:48:10 +0000 (07:48 +0100)] 
docs: use present tense

avoid "will", detect "will" as a bad word in the CI

Also line wrapped a bunch of paragraphs

Closes #13001

20 months agoCURLOPT_SSL_CTX_FUNCTION.md: no promises of lifetime after return
Daniel Stenberg [Mon, 26 Feb 2024 21:27:07 +0000 (22:27 +0100)] 
CURLOPT_SSL_CTX_FUNCTION.md: no promises of lifetime after return

... and cleanup other language.

Closes #12999

20 months agolib: send rework
Stefan Eissing [Wed, 14 Feb 2024 11:09:32 +0000 (12:09 +0100)] 
lib: send rework

Curl_read/Curl_write clarifications

- replace `Curl_read()`, `Curl_write()` and `Curl_nwrite()` to 1clarify
  when and at what level they operate

- send/recv of transfer related data is now done via
  `Curl_xfer_send()/Curl_xfer_recv()` which no longer has
  socket/socketindex as parameter. It decides on the transfer setup of
  `conn->sockfd` and `conn->writesockfd` on which connection filter
  chain to operate.

- send/recv on a specific connection filter chain is done via
  `Curl_conn_send()/Curl_conn_recv()` which get the socket index as
  parameter.

- rename `Curl_setup_transfer()` to `Curl_xfer_setup()` for naming
  consistency

- clarify that the special CURLE_AGAIN handling to return `CURLE_OK`
  with length 0 only applies to `Curl_xfer_send()` and CURLE_AGAIN is
  returned by all other send() variants.

SingleRequest reshuffling

- move functions into request.[ch]
- differentiate between reset and free
- add Curl_req_done() to perform last actions
- add a send `bufq` to SingleRequest for future use in keeping upload data

Closes #12963

20 months agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 26 Feb 2024 22:05:51 +0000 (23:05 +0100)] 
RELEASE-NOTES: synced

20 months agohttp_chunks: remove unused 'endptr' variable
Daniel Stenberg [Mon, 26 Feb 2024 11:27:07 +0000 (12:27 +0100)] 
http_chunks: remove unused 'endptr' variable

Closes #12996

20 months agolib: initialize output pointers to NULL before calling strto[ff,l,ul]
Louis Solofrizzo [Mon, 26 Feb 2024 11:07:22 +0000 (12:07 +0100)] 
lib: initialize output pointers to NULL before calling strto[ff,l,ul]

In order to make MSAN happy:

    ==2200945==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x596f3b3ed246 in curlx_strtoofft [...]/libcurl/src/lib/strtoofft.c:239:11
    #1 0x596f3b402156 in Curl_httpchunk_read [...]/libcurl/src/lib/http_chunks.c:149:12
    #2 0x596f3b348550 in readwrite_data [...]/libcurl/src/lib/transfer.c:607:11
    [...]

    ==2202041==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x5a3fab66a72a in Curl_parse_port [...]/libcurl/src/lib/urlapi.c:547:8
    #1 0x5a3fab650645 in parse_authority [...]/libcurl/src/lib/urlapi.c:796:12
    #2 0x5a3fab6740f6 in parseurl [...]/libcurl/src/lib/urlapi.c:1176:16
    #3 0x5a3fab664fc5 in parseurl_and_replace [...]/libcurl/src/lib/urlapi.c:1342:12
    [...]

    ==2202320==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x569076a0d6b0 in ipv4_normalize [...]/libcurl/src/lib/urlapi.c:683:12
    #1 0x5690769f2820 in parse_authority [...]/libcurl/src/lib/urlapi.c:803:10
    #2 0x569076a160f6 in parseurl [...]/libcurl/src/lib/urlapi.c:1176:16
    #3 0x569076a06fc5 in parseurl_and_replace [...]/libcurl/src/lib/urlapi.c:1342:12
    [...]

Signed-off-by: Louis Solofrizzo <lsolofrizzo@scaleway.com>
Closes #12995

20 months agolib: move client writer into own source
Stefan Eissing [Wed, 7 Feb 2024 11:05:05 +0000 (12:05 +0100)] 
lib: move client writer into own source

Refactoring of the client writer that passes the data to the
client/application's callback functions.

- split out into own source cw-out.[ch] from sendf.c

- move tempwrite and tempcount from data->state into the context of the
  client writer

- redesign the 3 tempwrite dynbufs as a linked list of dynbufs. On
  paused transfers, this allows to "record" interleaved HEADER/BODY
  chunks to be "played back" in the same order on unpausing.

- keep the overall size limit of all buffered data to DYN_PAUSE_BUFFER.
  On exceeding that, return CURLE_TOO_LARGE instead of
  CURLE_OUT_OF_MEMORY as before.

- add method to be called when a transfer is DONE to allow writing of
  any data still buffered

- when paused, record HEADER writes exactly as they come for later
  playback. HEADERs are documented to be written one-by-one.

Closes #12898

20 months agourldata: move authneg bit from conn to Curl_easy
Stefan Eissing [Fri, 16 Feb 2024 11:15:10 +0000 (12:15 +0100)] 
urldata: move authneg bit from conn to Curl_easy

- from `conn->bits.authneg` to `data->req.authneg`
- this is a property of the request about to be made
  and not a property of the connection
- in multiuse connections, transfer could step on each others
  toes here potentially.

Closes #12949

20 months agoc-hyper: add header collection writer in hyper builds
Stefan Eissing [Tue, 6 Feb 2024 13:56:05 +0000 (14:56 +0100)] 
c-hyper: add header collection writer in hyper builds

Closes #12880

20 months agohttp: move headers collecting to writer
Stefan Eissing [Tue, 6 Feb 2024 12:55:07 +0000 (13:55 +0100)] 
http: move headers collecting to writer

- add a client writer that does "push" response
  headers written to the client if the headers api
  is enabled
- remove special handling in sendf.c
- needs to be installed very early on connection
  setup to catch CONNECT response headers

Closes #12880

20 months agosendf: Curl_client_write(), make passed in buf const
Stefan Eissing [Tue, 6 Feb 2024 11:10:19 +0000 (12:10 +0100)] 
sendf: Curl_client_write(), make passed in buf const

20 months agolib: remove curl_mimepart object when CURL_DISABLE_MIME
MAntoniak [Fri, 9 Feb 2024 17:20:47 +0000 (18:20 +0100)] 
lib: remove curl_mimepart object when CURL_DISABLE_MIME

Remove curl_mimepart object from UserDefined structure when
CURL_DISABLE_MIME flag is active. Reduce size of UserDefined structure.

Also remove unreachable code: when CURL_DISABLE_MIME is set, httpreq can
never have HTTPREQ_POST_MIME value and the same goes for the
CURL_DISABLE_FORM_API flag and the HTTPREQ_POST_FORM value

Closes #12948

20 months agorustls: make curl compile with 0.12.0
kpcyrd [Sun, 25 Feb 2024 20:50:18 +0000 (21:50 +0100)] 
rustls: make curl compile with 0.12.0

Closes #12989

20 months agostrtoofft: fix the overflow check
Daniel Stenberg [Sun, 25 Feb 2024 21:52:40 +0000 (22:52 +0100)] 
strtoofft: fix the overflow check

... to not rely on wrapping, since it is an undefined behavior that is
not what always might happen. This is in our private strtoff() parser
function, used only on platforms without a native version.

Reported-by: vulnerabilityspotter on hackerone
Closes #12990

20 months agolibssh/libssh2: return error on too big range
Daniel Stenberg [Sat, 24 Feb 2024 21:38:22 +0000 (22:38 +0100)] 
libssh/libssh2: return error on too big range

If trying to get the range 0 - 2^63 and the remote file is 2^63 bytes or
larger.

Fixes #12983
Closes #12984

20 months agosetopt: fix check for CURLOPT_PROXY_TLSAUTH_TYPE value
Scott Talbert [Sat, 24 Feb 2024 03:02:09 +0000 (22:02 -0500)] 
setopt: fix check for CURLOPT_PROXY_TLSAUTH_TYPE value

Prior to this change CURLOPT_PROXY_TLSAUTH_TYPE would return
CURLE_BAD_FUNCTION_ARGUMENT on any type other than NULL. Since there is
only one type of TLS auth and it is also the default (SRP) the TLS auth
would work anyway.

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

20 months agomprintf: fix format prefix I32/I64 for windows compilers
Jay Satiro [Fri, 16 Feb 2024 21:02:19 +0000 (16:02 -0500)] 
mprintf: fix format prefix I32/I64 for windows compilers

- Support I32 & I64 (eg: %I64d) for all Win32 builds.

Prior to this change mprintf support for the I format prefix, which is a
Microsoft extension, was dependent on the compiler used.

When Borland compiler support was removed in fd7ef00f the prefix was
then no longer supported for that compiler; however since it's still
possible to build with Borland I'm restoring support for the prefix in
this way.

Reported-by: Paweł Witas
Fixes https://github.com/curl/curl/issues/12944
Closes https://github.com/curl/curl/pull/12950

20 months agocd2nroff: gen: make `\>` in input to render as plain '>' in output
Daniel Stenberg [Fri, 23 Feb 2024 11:52:59 +0000 (12:52 +0100)] 
cd2nroff: gen: make `\>` in input to render as plain '>' in output

The same (copy and pasted) fix/mistake as in gen.pl

20 months agogen: make `\>` in input to render as plain '>' in output
Daniel Stenberg [Fri, 23 Feb 2024 11:52:09 +0000 (12:52 +0100)] 
gen: make `\>` in input to render as plain '>' in output

Reported-by: Gisle Vanem
Fixes #12977
Closes #12978

20 months agoconfigure.ac: find libpsl with pkg-config
Fabrice Fontaine [Thu, 15 Feb 2024 19:59:25 +0000 (20:59 +0100)] 
configure.ac: find libpsl with pkg-config

Find libpsl with pkg-config to avoid static build failures.

Ref: http://autobuild.buildroot.org/results/1fb15e1a99472c403d0d3b1a688902f32e78d002

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Closes #12947

20 months agoBUG-BOUNTY.md: clarify that the curl security team decides
Daniel Stenberg [Thu, 22 Feb 2024 15:34:35 +0000 (16:34 +0100)] 
BUG-BOUNTY.md: clarify that the curl security team decides

Closes #12975

20 months agoTHANKS: add bug reporter from #740
Daniel Stenberg [Fri, 23 Feb 2024 09:11:11 +0000 (10:11 +0100)] 
THANKS: add bug reporter from #740

Ref: https://github.com/curl/curl/issues/740

20 months agomulti: fix multi_sock handling of select_bits 12976/head
Stefan Eissing [Thu, 22 Feb 2024 08:01:06 +0000 (09:01 +0100)] 
multi: fix multi_sock handling of select_bits

- OR the event bitmask to data->state.select_bits instead of overwriting
  them. They are cleared again on use.

Reported-by: 5533asdg on github
Fixes #12971
Closes #12972

20 months agocurlver: bump to 8.7.0 for next release
Daniel Stenberg [Thu, 22 Feb 2024 08:34:41 +0000 (09:34 +0100)] 
curlver: bump to 8.7.0 for next release

20 months agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 22 Feb 2024 07:46:04 +0000 (08:46 +0100)] 
RELEASE-NOTES: synced

20 months agowrite-out: add '%{proxy_used}'
Daniel Stenberg [Thu, 22 Feb 2024 07:38:53 +0000 (08:38 +0100)] 
write-out: add '%{proxy_used}'

Returns 1 if the previous transfer used a proxy, otherwise 0. Useful to
for example determine if a `NOPROXY` pattern matched the hostname or
not.

Extended test 970 and 972

20 months agoCURLINFO_USED_PROXY: return bool whether the proxy was used
Daniel Stenberg [Thu, 22 Feb 2024 07:38:53 +0000 (08:38 +0100)] 
CURLINFO_USED_PROXY: return bool whether the proxy was used

Adds test536 to verify

Closes #12719

20 months agosha512_256: remove the cast macro, minor language/format edits
Daniel Stenberg [Tue, 20 Feb 2024 10:48:27 +0000 (11:48 +0100)] 
sha512_256: remove the cast macro, minor language/format edits

Follow-up to cbe41d151d6a100c

Closes #12966

20 months agoDoH: add trace configuration
Stefan Eissing [Mon, 27 Nov 2023 10:30:25 +0000 (11:30 +0100)] 
DoH: add trace configuration

- refs #12397 where it is dicussed how to en-/disable verbose output
  of DoH operations
- introducing `struct curl_trc_feat` to track a curl feature for
  tracing
- adding `data->state.feat` optionally pointing to the feature a
  transfer belongs to
- adding trace functions and verbosity checks on features
- using trace feature in DoH code
- documenting `doh` as feature for `--trace-config`

Closes #12411

20 months agowebsocket: fix curl_ws_recv()
Stefan Eissing [Thu, 15 Feb 2024 15:39:40 +0000 (16:39 +0100)] 
websocket: fix curl_ws_recv()

- when data arrived in several chunks, the collection into
  the passed buffer always started at offset 0, overwriting
  the data already there.

adding test_20_07 to verify fix

- debug environment var CURL_WS_CHUNK_SIZE can be used to
  influence the buffer chunk size used for en-/decoding.

Closes #12945

20 months agodigest: support SHA-512/256
Evgeny Grin [Thu, 8 Feb 2024 09:31:12 +0000 (10:31 +0100)] 
digest: support SHA-512/256

Also fix the tests. New implementation tested with GNU libmicrohttpd.
The new numbers in tests are real SHA-512/256 numbers (not just some
random ;) numbers ).

20 months agotests: add SHA-512/256 unit test
Evgeny Grin [Wed, 7 Feb 2024 22:07:07 +0000 (23:07 +0100)] 
tests: add SHA-512/256 unit test

20 months agoSHA-512/256: implement hash algorithm
Evgeny Grin [Wed, 7 Feb 2024 22:06:28 +0000 (23:06 +0100)] 
SHA-512/256: implement hash algorithm

Closes #12897

20 months agocurl_setup.h: add curl_uint64_t internal type
Evgeny Grin [Sat, 10 Feb 2024 18:28:27 +0000 (19:28 +0100)] 
curl_setup.h: add curl_uint64_t internal type

The unsigned version of curl_off_t basically

20 months agodocs: dist curl*.1 and install without perl
Daniel Stenberg [Mon, 19 Feb 2024 08:32:07 +0000 (09:32 +0100)] 
docs: dist curl*.1 and install without perl

Drop docs/mk-ca-bundle.1 from the tarball. It can be generated at will.

Closes #12959
Fixes #12921
Reported-by: Michael Forney
20 months agoOpenSSL QUIC: adapt to v3.3.x
Stefan Eissing [Tue, 13 Feb 2024 12:59:03 +0000 (13:59 +0100)] 
OpenSSL QUIC: adapt to v3.3.x

- set our idle timeout as transport parameter
- query negotiated idle timeout for connection alive checks
- query number of available bidi streams on a connection
- use write_ex2 with SSL_WRITE_FLAG_CONCLUDE to signal
  EOF on last chunk write, so stream close does not
  require an additional QUIC packet

Closes #12933

20 months agoMANUAL.md: fix typo
Ramiro Garcia [Mon, 19 Feb 2024 18:29:50 +0000 (15:29 -0300)] 
MANUAL.md: fix typo

Closes #12965

20 months agoBINDINGS: add mcurl, the python binding
Daniel Stenberg [Mon, 19 Feb 2024 15:50:30 +0000 (16:50 +0100)] 
BINDINGS: add mcurl, the python binding

Ref: #12956
Closes #12962

20 months agomk-ca-bundle.md: cleanups and polish 12958/head
Daniel Stenberg [Mon, 19 Feb 2024 08:31:08 +0000 (09:31 +0100)] 
mk-ca-bundle.md: cleanups and polish

Closes #12958

20 months agospellcheck.yml: remove .1/.3 handling, clean all man page .md files
Daniel Stenberg [Mon, 19 Feb 2024 08:54:21 +0000 (09:54 +0100)] 
spellcheck.yml: remove .1/.3 handling, clean all man page .md files

Since we generate all .1 and .3 files from markdown now, we can limit
the spellcheck to the markdown versions only.

Closes #12960

20 months agolibcurl-docs: cleanups
Daniel Stenberg [Mon, 19 Feb 2024 09:56:14 +0000 (10:56 +0100)] 
libcurl-docs: cleanups

 CURLMOPT_SOCKETDATA.md: fix typo
 CURLMOPT_TIMERDATA.md: fix typo
 CURLOPT_COOKIELIST.m: quote strings
 CURLOPT_PREREQFUNCTION.md: quote variable names
 CURLOPT_TCP_NODELAY.md: rephrased to please spell checker
 CURLOPT_WILDCARDMATCH.md: rephrased
 libcurl-tutorial.md: use correct option name
 curl_global_init_mem.md: quote headers
 curl_easy_getinfo.md: use correct symbol names in headers
 curl_global_trace.md: quote some headers
 curl_ws_meta.md: quote struct field names
 libcurl-env.md: quote headers

20 months agocd2nroff: remove backticks from titles
Daniel Stenberg [Mon, 19 Feb 2024 09:56:38 +0000 (10:56 +0100)] 
cd2nroff: remove backticks from titles

20 months agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 19 Feb 2024 07:34:37 +0000 (08:34 +0100)] 
RELEASE-NOTES: synced

20 months agohttp_chunks: fix the accounting of consumed bytes
Stefan Eissing [Wed, 14 Feb 2024 15:27:23 +0000 (16:27 +0100)] 
http_chunks: fix the accounting of consumed bytes

Prior to this change chunks were handled correctly although in verbose
mode libcurl could incorrectly warn of "Leftovers after chunking" even
if there were none.

Reported-by: Michael Kaufmann
Fixes https://github.com/curl/curl/issues/12937
Closes https://github.com/curl/curl/pull/12939

20 months agofile: use xfer buf for file:// transfers
Stefan Eissing [Tue, 13 Feb 2024 10:39:06 +0000 (11:39 +0100)] 
file: use xfer buf for file:// transfers

- For file:// transfers use the multi handle's transfer buffer for
  up- and downloads.

Prior to this change a6c9a33 (precedes 8.6.0) changed the file://
transfers to use a smaller stack based buffer, and that caused a
significant performance decrease in Windows.

Bug: https://github.com/curl/curl/issues/12750#issuecomment-1920103086
Reported-by: edmcln@users.noreply.github.com
Closes https://github.com/curl/curl/pull/12932

20 months agoHTTP3.md: always run nghttp3 submodule init
Karthikdasari0423 [Mon, 12 Feb 2024 09:52:39 +0000 (15:22 +0530)] 
HTTP3.md: always run nghttp3 submodule init

- For consistency change all 'build nghttp3' commands to run submodule
  init after cloning, even if the branch does not have submodules.

Follow-up to 5a4b2f93 and 4f794558.

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

20 months agoCURLOPT_POSTQUOTE.md: fix typo
LeeRiva [Sun, 11 Feb 2024 21:52:12 +0000 (22:52 +0100)] 
CURLOPT_POSTQUOTE.md: fix typo

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

20 months agochecksrc.pl: fix handling .checksrc with CRLF
Evgeny Grin [Sun, 18 Feb 2024 06:36:27 +0000 (11:36 +0500)] 
checksrc.pl: fix handling .checksrc with CRLF

- When parsing .checksrc chomp the (CR)LF line ending.

Prior to this change on Windows checksrc.pl would not process the
symbols in .checksrc properly, since many git repos in Windows use auto
crlf to check out files with CRLF line endings.

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

20 months agocmake: fix install for older CMake versions
Richard Levitte [Sat, 10 Feb 2024 16:34:43 +0000 (17:34 +0100)] 
cmake: fix install for older CMake versions

- Generate the docs install list by using a foreach loop instead of
  LIST:TRANSFORM since older CMake can't handle the latter.

Reported-by: Dan Fandrich
Fixes https://github.com/curl/curl/issues/12920
Closes https://github.com/curl/curl/pull/12922

20 months agovtls: fix tls proxy peer verification
Stefan Eissing [Tue, 13 Feb 2024 10:05:21 +0000 (11:05 +0100)] 
vtls: fix tls proxy peer verification

- When verifying a proxy certificate for an ip address, use the correct
  ip family.

Prior to this change the "connection" ip family was used, which was not
necessarily the same.

Reported-by: HsiehYuho@users.noreply.github.com
Fixes https://github.com/curl/curl/issues/12831
Closes https://github.com/curl/curl/pull/12931

20 months agoCI: Bump the Circle CI base Ubuntu image to the latest 20.04
Dan Fandrich [Fri, 16 Feb 2024 00:04:40 +0000 (16:04 -0800)] 
CI: Bump the Circle CI base Ubuntu image to the latest 20.04

The previous ones are going to be removed soon, plus the new ones
include all the fixes since then.

20 months agotransfer: improve Windows SO_SNDBUF update limit
Jay Satiro [Fri, 9 Feb 2024 09:08:35 +0000 (04:08 -0500)] 
transfer: improve Windows SO_SNDBUF update limit

- Change the 1 second SO_SNDBUF update limit from per transfer to per
  connection.

Prior to this change many transfers over the same connection could cause
many SO_SNDBUF updates made to that connection per second, which was
unnecessary.

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

20 months agoschannel: fix hang on unexpected server close
Jay Satiro [Fri, 9 Feb 2024 08:41:30 +0000 (03:41 -0500)] 
schannel: fix hang on unexpected server close

- Treat TLS connection close (either due to a close_notify from the
  server or just closed due to receiving 0) as pending data.

This is because in some cases schannel_recv knows the connection is
closed but has to return actual pending data so it can't return 0 or an
error to indicate no more data. In this case schannel_recv must be
called again, which only happens if readwrite_data sees that there is
still pending data.

Prior to this change if the total size of the body that libcurl expected
to receive from the server was unknown then it was possible under some
network conditions that libcurl would hang waiting to receive more data,
when in fact a close_notify alert indicating no more data would be sent
was already processed.

Fixes https://github.com/curl/curl/issues/12894
Closes https://github.com/curl/curl/pull/12910

20 months agoKNOWN_BUGS: FTP upload fails if remebered dir is deleted
Daniel Stenberg [Sat, 10 Feb 2024 17:31:31 +0000 (18:31 +0100)] 
KNOWN_BUGS: FTP upload fails if remebered dir is deleted

Closes #12181
Closes #12923

20 months agombedtls: use mbedtls_ssl_conf_{min|max}_tls_version
MAntoniak [Thu, 8 Feb 2024 19:16:23 +0000 (20:16 +0100)] 
mbedtls: use mbedtls_ssl_conf_{min|max}_tls_version

... instead of the deprecated mbedtls_ssl_conf_{min|max}_version

Closes #12905

21 months agoCI: bump to actions/cache@v4 to avoid warning
Dan Fandrich [Sat, 10 Feb 2024 01:23:55 +0000 (17:23 -0800)] 
CI: bump to actions/cache@v4 to avoid warning

21 months agotest1165: improve pattern matching
Evgeny Grin [Thu, 8 Feb 2024 17:41:55 +0000 (18:41 +0100)] 
test1165: improve pattern matching

* Fix excluded digits at the end of the symbols ('CURL_DISABLE_POP3'
  was checked as 'CURL_DISABLE_POP')

Closes #12903

21 months agoscripts: Fix cijobs.pl for Azure and GHA
Dan Fandrich [Fri, 9 Feb 2024 22:38:58 +0000 (14:38 -0800)] 
scripts: Fix cijobs.pl for Azure and GHA

The spacing in the yaml files changed.

21 months agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 9 Feb 2024 22:47:10 +0000 (23:47 +0100)] 
RELEASE-NOTES: synced

21 months agoTODO: use pkg-config to find libpsl
Daniel Stenberg [Fri, 9 Feb 2024 15:37:43 +0000 (16:37 +0100)] 
TODO: use pkg-config to find libpsl

Closes #12919

21 months agoTODO: avoid nroff
Daniel Stenberg [Fri, 9 Feb 2024 15:30:28 +0000 (16:30 +0100)] 
TODO: avoid nroff

Instead of adjusting roffit, skip the nroff step.

Closes #12919

21 months agoRevert "CI: run Circle macOS builds on x86 for now"
Dan Fandrich [Thu, 4 Jan 2024 18:32:04 +0000 (10:32 -0800)] 
Revert "CI: run Circle macOS builds on x86 for now"

This reverts commit 2683de3078eadc86d9b182e7417f4ee75a247e2c.
ARM resources are now available in Circle CI, so run these builds on ARM
again. This platform needs explicit paths set to libpsl and its
dependency icu4c.

Follow-up to 2683de30

Closes #12635

21 months agocmake: add warning for using TLS libraries without 1.3 support
Viktor Szakats [Thu, 8 Feb 2024 21:45:55 +0000 (22:45 +0100)] 
cmake: add warning for using TLS libraries without 1.3 support

Closes #12900

21 months agoconfigure: add warning for using TLS libraries without 1.3 support
Daniel Stenberg [Thu, 8 Feb 2024 14:11:55 +0000 (15:11 +0100)] 
configure: add warning for using TLS libraries without 1.3 support

Closes #12900

21 months agombedtls: fix building when MBEDTLS_X509_REMOVE_INFO flag is defined
MAntoniak [Thu, 8 Feb 2024 18:54:45 +0000 (19:54 +0100)] 
mbedtls: fix building when MBEDTLS_X509_REMOVE_INFO flag is defined

Closes #12904

21 months agoftp: fix socket wait activity in ftp_domore_getsock
Stefan Eissing [Fri, 9 Feb 2024 12:10:08 +0000 (13:10 +0100)] 
ftp: fix socket wait activity in ftp_domore_getsock

- when waiting on the data connection, always add the control socket to
  the pollset on state STOP or let the pingpong add the socket according
  to its needs.

Reported-by: Fabian Vogt
Fixes #12901
Closes #12913

21 months agodist: make sure the http tests are in the tarball
Daniel Stenberg [Fri, 9 Feb 2024 13:15:25 +0000 (14:15 +0100)] 
dist: make sure the http tests are in the tarball

Fixes #12914
Reported-by: Fabian Vogt
Closes #12917

21 months agomulti: add xfer_buf to multi handle
Stefan Eissing [Fri, 26 Jan 2024 11:05:08 +0000 (12:05 +0100)] 
multi: add xfer_buf to multi handle

- can be borrowed by transfer during recv-write operation
- needs to be released before borrowing again
- adjustis size to `data->set.buffer_size`
- used in transfer.c readwrite_data()

Closes #12805

21 months agowrite-out.md: clarify error handling details
Daniel Stenberg [Thu, 8 Feb 2024 22:41:50 +0000 (23:41 +0100)] 
write-out.md: clarify error handling details

- it gets used even if the transfer fails

- it does not cause error to be returned even if it fails

Closes #12909

21 months agoftp: do lineend conversions in client writer
Stefan Eissing [Tue, 6 Feb 2024 10:56:35 +0000 (11:56 +0100)] 
ftp: do lineend conversions in client writer

- remove the ftp special handling from sendf.c
- let ftp_do() add a client writer that does
  the linened conversions
- change the lineend conversion to no longer
  modify the passed buffer, but write smaller
  chunks to the next cwriter instead. The
  inefficiency of this will be mitigated once
  we add output buffering for all client writes.

Closes #12878

21 months agoftp: tracing improvements
Stefan Eissing [Thu, 8 Feb 2024 16:52:29 +0000 (17:52 +0100)] 
ftp: tracing improvements

- trace socketindex for connection filters when not the first
- trace socket fd in tcp
- trace pollset adjusts in vtls

Closes #12902

21 months agoHTTP3.md: adjust the OpenSSL QUIC install instructions
Karthikdasari0423 [Thu, 8 Feb 2024 11:38:16 +0000 (17:08 +0530)] 
HTTP3.md: adjust the OpenSSL QUIC install instructions

tried installing with old steps but failed
tried with newly added setps and able to build
```
root@ubuntu:~/curl# ./src/curl -V
/root/curl/src/.libs/curl: /lib/x86_64-linux-gnu/libssl.so.3: version `OPENSSL_3.2.0' not found (required by /root/curl/lib/.libs/libcurl.so.4)
root@ubuntu:~/curl#
```
```
root@ubuntu:~/curl# ./src/curl -V
curl 8.6.1-DEV (x86_64-pc-linux-gnu) libcurl/8.6.1-DEV OpenSSL/3.2.0 zlib/1.2.11 brotli/1.0.9 libpsl/0.21.0 nghttp3/1.1.0 OpenLDAP/2.5.16
Release-Date: [unreleased]
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli HSTS HTTP3 HTTPS-proxy IPv6 Largefile libz NTLM PSL SSL threadsafe TLS-SRP UnixSockets
root@ubuntu:~/curl#
```

Closes #12896

21 months agoTODO: align the TOC with the header
Daniel Stenberg [Thu, 8 Feb 2024 14:00:00 +0000 (15:00 +0100)] 
TODO: align the TOC with the header

21 months agodocs: make sure curl.1 is included in dist tarballs
Daniel Stenberg [Thu, 8 Feb 2024 06:58:09 +0000 (07:58 +0100)] 
docs: make sure curl.1 is included in dist tarballs

Ref: https://github.com/curl/curl/issues/12832#issuecomment-1933271873

Closes #12892

21 months agoHTTP3.md: remove quiche word in Openssl 3.2
Karthikdasari0423 [Thu, 8 Feb 2024 08:02:05 +0000 (13:32 +0530)] 
HTTP3.md: remove quiche word in Openssl 3.2

Closes #12893

21 months agocurl: when allocating variables, add the name into the struct
Daniel Stenberg [Wed, 7 Feb 2024 13:28:38 +0000 (14:28 +0100)] 
curl: when allocating variables, add the name into the struct

This saves the name from being an extra separate allocation.

Closes #12891

21 months agolib582: remove code causing warning that is never run
Daniel Stenberg [Wed, 7 Feb 2024 13:06:56 +0000 (14:06 +0100)] 
lib582: remove code causing warning that is never run

The previous realloc code in this code could trigger a compiler warning,
but since that code path cannot happen in normal circumstances it now
instead exits with an error message there.

Ref: #12887
Closes #12890

21 months agovtls: revert "receive max buffer" + add test case
Stefan Eissing [Thu, 1 Feb 2024 17:15:50 +0000 (18:15 +0100)] 
vtls: revert "receive max buffer" + add test case

- add test_05_04 for requests using http/1.0, http/1.1 and h2 against an
  Apache resource that does an unclean TLS shutdown.
- revert special workarund in openssl.c for suppressing shutdown errors
  on multiplexed connections
- vlts.c restore to its state before 9a90c9dd64d2f03601833a70786d485851bd1b53

Fixes #12885
Fixes #12844

Closes #12848

21 months agotests: support setting/using blank content env variables
Daniel Stenberg [Mon, 5 Feb 2024 16:04:28 +0000 (17:04 +0100)] 
tests: support setting/using blank content env variables

- test450: remove --config from the keywords
- test2080: change return code
- test428: add --config as a keyword
- test428: disable on Windows due to CI problems

21 months agocurl: exit on config file parser errors
Daniel Stenberg [Mon, 5 Feb 2024 14:04:31 +0000 (15:04 +0100)] 
curl: exit on config file parser errors

Like when trying to import an environment variable that does not exist.

Also fix a bug for reading env variables when there is a default value
set.

Bug: https://curl.se/mail/archive-2024-02/0008.html
Reported-by: Brett Buddin
Add test 462 to verify.

Closes #12862

21 months agoCURLOPT_WRITEFUNCTION.md: typo fix
Daniel Szmulewicz [Wed, 7 Feb 2024 12:13:14 +0000 (20:13 +0800)] 
CURLOPT_WRITEFUNCTION.md: typo fix

The maximum amount of body data that is <be> passed to the write
callback is defined in the curl.h header file

Closes #12889

21 months agolib: convert Curl_get_line to use dynbuf
Daniel Stenberg [Tue, 6 Feb 2024 09:15:52 +0000 (10:15 +0100)] 
lib: convert Curl_get_line to use dynbuf

Create the line in a dynbuf. Aborts the reading of the file on
errors. Avoids having to always allocate maximum amount from the
start. Avoids direct malloc.

Closes #12846

21 months agoKNOWN_BUGS: unicode on Windows
Daniel Stenberg [Tue, 6 Feb 2024 16:39:04 +0000 (17:39 +0100)] 
KNOWN_BUGS: unicode on Windows

Closes #11461
Closes #12231
Closes #12883

21 months agotool_operate: change precedence of server Retry-After time
Daniel Stenberg [Mon, 5 Feb 2024 23:09:11 +0000 (18:09 -0500)] 
tool_operate: change precedence of server Retry-After time

- When calculating the retry time, no longer allow a server's requested
  Retry-After time to take precedence over a longer retry time (either
  default algorithmic or user-specified).

Prior to this change the server's Retry-After time took precedence over
curl's retry time in all cases, but that's not always practical for
short Retry-After times depending on how busy the server is.

Bug: https://curl.se/mail/archive-2024-01/0022.html
Reported-by: Dirk Hünniger
Closes https://github.com/curl/curl/pull/12871

21 months agocmdline-docs: quote and angle bracket cleanup
Daniel Stenberg [Tue, 6 Feb 2024 17:07:07 +0000 (18:07 +0100)] 
cmdline-docs: quote and angle bracket cleanup

- make sure angle brackets are escaped
- remove a lot of superfluous double quotes
- replace several double quotes with backticks

To make nicer-looking markdown.

Closes #12884

21 months agobadwords: use hostname, not host name
Daniel Stenberg [Tue, 6 Feb 2024 22:43:41 +0000 (23:43 +0100)] 
badwords: use hostname, not host name

and username, filename - consistently. Fixed the patterns in
badwords.txt to catch these.

Closes #12888

21 months agocmake: fix function description in comment [ci skip]
Viktor Szakats [Tue, 6 Feb 2024 13:04:24 +0000 (13:04 +0000)] 
cmake: fix function description in comment [ci skip]

Closes #12879

21 months agoheader.md: remove backslash, make nicer markdown
Daniel Stenberg [Tue, 6 Feb 2024 10:20:30 +0000 (11:20 +0100)] 
header.md: remove backslash, make nicer markdown

- remove a leftover backslash before a dash
- use backticks for "code" strings

Closes #12877