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`
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 ).
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
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
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.
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.
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.
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.
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.
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.
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()
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.
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.
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
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
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.
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.
Stefan Eissing [Thu, 1 Feb 2024 09:51:45 +0000 (10:51 +0100)]
https-proxy: use IP address and cert with ip in alt names
- improve info logging when peer verification fails to indicate
if DNS name or ip address has been tried to match
- add test case for contacting https proxy with ip address
- add pytest env check on loaded credentials and re-issue
when they are no longer valid
- disable proxy ip address test for bearssl, since not supported there
Peter Krefting [Fri, 2 Feb 2024 22:22:32 +0000 (23:22 +0100)]
version: allow building with ancient libpsl
The psl_check_version_number() API was added in libpsl 0.11.0. CentOS 7
ships with version 0.7.0 which lacks this API. Revert to using the older
versioning API if we detect an old libpsl version.
Daniel Stenberg [Mon, 5 Feb 2024 22:23:56 +0000 (23:23 +0100)]
docs: make curldown do angle brackets like markdown
Make sure we use \< and \> in markdown all over so that it renders
correctly, on GitHub and elsewhere. cd2nroff now outputs a warning if it
finds an unescaled angle bracket.
Joel Depooter [Sat, 3 Feb 2024 01:58:04 +0000 (17:58 -0800)]
docs: add missing slashes to SChannel client certificate documentation
When setting the CURLOPT_SSLCERT option to a certificate thumprint, it
is required to have a backslash between the "store location", "store
name" and "thumbprint" tokens. These slashes were present in the
previous documentation, but were missed in the transition to markdown
documentation.
Stefan Eissing [Wed, 31 Jan 2024 15:30:54 +0000 (16:30 +0100)]
HTTP/2: write response directly
- use the new `Curl_xfer_write_resp()` to write incoming responses
directly to the client
- eliminates `stream->recvbuf`
- memory consumption on parallel transfers minimized
Chris Webb [Sat, 3 Feb 2024 21:05:59 +0000 (21:05 +0000)]
configure: add --disable-docs flag
Building man pages from curldown sources now requires perl. Add a
--disable-docs flag to configure to enable building and installing
without documentation where perl is not available or man pages are not
required. This is selected automatically (with a warning) when perl is
not found by configure.
Daniel Stenberg [Thu, 1 Feb 2024 12:23:12 +0000 (13:23 +0100)]
sendf: ignore response body to HEAD
and mark the stream for close, but return OK since the response this far
was ok - if headers were received. Partly because this is what curl has
done traditionally.
Daniel Stenberg [Thu, 1 Feb 2024 10:28:22 +0000 (11:28 +0100)]
ftp: treat a 226 arriving before data as a signal to read data
For active mode transfers.
Due to some interesting timing, curl can sometimes get the 226 (transfer
complete) over the control channel first, before the data connection
signals readability. If this happens, use that as a signal to check the
data connection.
Additionally, set the socket filter in listen mode *before* the
PORT/EPRT command is issued, to reduce the risk that the little time gap
could interfere.
This issue never reproduced for me on Debian and takes several hundred
rounds for me to trigger on my mac.
Reported-by: Stefan Eissing
Fixes #12823
Closes #12841