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
Richard Levitte [Wed, 24 Jan 2024 12:07:00 +0000 (13:07 +0100)]
cmake: freshen up docs/INSTALL.cmake
- Turn docs/INSTALL.cmake into a proper markdown file,
docs/INSTALL-CMAKE.md
- Move things around to divide the description into configuration,
building and installing sections
- Mention the more modern cmake options to configure, build and install,
but also retain the older variants as fallbacks
Viktor Szakats [Sat, 27 Jan 2024 17:40:38 +0000 (17:40 +0000)]
build: delete/replace clang warning pragmas
- delete redundant warning suppressions for `-Wformat-nonliteral`.
This now relies on `CURL_PRINTF()` and it's theoratically possible
that this macro isn't active but the warning is. We're ignoring this
as a corner-case here.
- replace two pragmas with code changes to avoid the warnings.
Patrick Monnerat [Thu, 25 Jan 2024 12:58:19 +0000 (13:58 +0100)]
sasl: make login option string override http auth
- Use http authentication mechanisms as a default, not a preset.
Consider http authentication options which are mapped to SASL options as
a default (overriding the hardcoded default mask for the protocol) that
is ignored if a login option string is given.
Prior to this change, if some HTTP auth options were given, sasl mapped
http authentication options to sasl ones but merged them with the login
options.
That caused problems with the cli tool that sets the http login option
CURLAUTH_BEARER as a side-effect of --oauth2-bearer, because this flag
maps to more than one sasl mechanisms and the latter cannot be cleared
individually by the login options string.
Daniel Stenberg [Sun, 21 Jan 2024 23:04:47 +0000 (00:04 +0100)]
pingpong: stop using the download buffer
The pingpong logic now uses its own dynbuf for receiving command
response data.
When the "final" response header for a commanad has been received, that
final line is left first in the recvbuf for the protocols to parse at
will. If there is additional data behind the final response line, the
'overflow' counter is indicate how many bytes.
Viktor Szakats [Wed, 24 Jan 2024 12:25:15 +0000 (12:25 +0000)]
cmake: rework options to enable curl and libcurl docs
Rework CMake options for building/using curl tool and libcurl manuals.
- rename `ENABLE_MANUAL` to `ENABLE_CURL_MANUAL`, meaning:
to build man page and built-in manual for curl tool.
- rename `BUILD_DOCS` to `BUILD_LIBCURL_DOCS`, meaning:
to build man pages for libcurl.
- `BUILD_LIBCURL_DOCS` now works without having to enable
`ENABLE_CURL_MANUAL` too.
- drop support for existing CMake-level `USE_MANUAL` option to avoid
confusion. (It used to work with the effect of current
`ENABLE_CURL_MANUAL`, but only by accident.)
Assisted-by: Richard Levitte
Ref: #12771
Closes #12773
Daniel Stenberg [Tue, 23 Jan 2024 14:12:09 +0000 (15:12 +0100)]
GHA: add a job scanning for "bad words" in markdown
This means words, phrases or things we have decided not to use - words that
are spelled right according to the dictionary but we want to avoid. In the
name of consistency and better documentation.