]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
2 years agoos400: correct Curl_os400_sendto()
jonrumsey [Thu, 16 Feb 2023 20:46:49 +0000 (20:46 +0000)] 
os400: correct Curl_os400_sendto()

Add const qualifier to 5th argument of Curl_os400_sendto()

Make OS400 wrapper for sendto match the normal prototype of sendto()
with a const qualifier.

Fixes #10539
Closes #10548

2 years agotests-httpd: add proxy tests
Stefan Eissing [Wed, 15 Feb 2023 11:39:46 +0000 (12:39 +0100)] 
tests-httpd: add proxy tests

for direct and tunneling checks on http: and https:

Closes #10519

2 years agocurl: make --silent work stand-alone
Daniel Stenberg [Thu, 16 Feb 2023 15:34:36 +0000 (16:34 +0100)] 
curl: make --silent work stand-alone

- renamed the struct field to 'silent' to match the cmdline option
- make --show-error toggle independently of --silent
- make --silent independent of ->noprogress as well

By doing this, the three options --silent, --no-progress-meter and
--show-error should work independently of each other and also work with
and without '--no-' prefix as documented.

Reported-by: u20221022 on github
Fixes #10535
Closes #10536

2 years agosocks: allow using DoH to resolve host names
Daniel Stenberg [Thu, 16 Feb 2023 22:52:22 +0000 (23:52 +0100)] 
socks: allow using DoH to resolve host names

For SOCKS modes where a local host resolve is done.

It was previously disabled in 12d655d4561, but a few local tests seem to
indicate that it works fine. Works now because of the SOCKS refactor of
4a4b63daaa01ef59 that made it non-blocking.

Reported-by: roughtex on github
Fixes #10537
Closes #10540

2 years agotest: add test for HTTP/2 corruption as reported in #10525
Stefan Eissing [Thu, 16 Feb 2023 13:09:16 +0000 (14:09 +0100)] 
test: add test for HTTP/2 corruption as reported in #10525

- adding test_02_20 for reproducing the situation
- using recently released mod_h2 Apache module
- skipping test if an older version is installed
- adding installation of current mod_h2 to github pytest workflow

This reproduces the error reliable (for me) on the lib/http2.c version
of curl 7.88.0. And passes with the recent curl master.

Closes #10534

2 years agotool_operate: allow debug builds to set buffersize
Daniel Stenberg [Thu, 16 Feb 2023 08:26:55 +0000 (09:26 +0100)] 
tool_operate: allow debug builds to set buffersize

Using the CURL_BUFFERSIZE environment variable.

Closes #10532

2 years agoconnnect: fix timeout handling to use full duration
Stefan Eissing [Wed, 15 Feb 2023 09:31:52 +0000 (10:31 +0100)] 
connnect: fix timeout handling to use full duration

- connect timeout was used at half the configured value, if the
  destination had 1 ip version 4 and other version 6 addresses
  (or the other way around)
- extended test2600 to reproduce these cases

Reported-by: Michael Kaufmann
Fixes #10514
Closes #10517

2 years agotool_getparam: make --get a true boolean
Daniel Stenberg [Thu, 16 Feb 2023 07:19:06 +0000 (08:19 +0100)] 
tool_getparam: make --get a true boolean

To match how it is documented in the man page.

Fixes #10527
Reported-by: u20221022 on github
Closes #10531

2 years agohttp:: include stdint.h more readily
Harry Sintonen [Thu, 16 Feb 2023 00:29:37 +0000 (02:29 +0200)] 
http:: include stdint.h more readily

Closes #10516

2 years agotests: make the telnet server shut down a socket gracefully
Stefan Eissing [Tue, 14 Feb 2023 13:29:13 +0000 (14:29 +0100)] 
tests: make the telnet server shut down a socket gracefully

- test 1452 failed occasionally with ECONNRESET errnos in curl when the
  server closed the connection in an unclean state.

Closes #10509

2 years agohttp2: set drain on stream end
Harry Sintonen [Thu, 16 Feb 2023 04:26:26 +0000 (06:26 +0200)] 
http2: set drain on stream end

Ensure that on_frame_recv() stream end will trigger a read if there is
pending data. Without this it could happen that the pending data is
never consumed.

This combined with https://github.com/curl/curl/pull/10529 should fix
https://github.com/curl/curl/issues/10525

Ref: https://github.com/curl/curl/issues/10525
Closes #10530

2 years agohttp2: buffer/pausedata and output flush fix.
Stefan Eissing [Wed, 15 Feb 2023 21:11:13 +0000 (22:11 +0100)] 
http2: buffer/pausedata and output flush fix.

 * do not process pending input data when copying pausedata to the
   caller
 * return CURLE_AGAIN if the output buffer could not be completely
   written out.

Ref: #10525
Closes #10529

2 years agokrb5: silence cast-align warning
Marcel Raad [Wed, 15 Feb 2023 20:48:24 +0000 (21:48 +0100)] 
krb5: silence cast-align warning

Add an intermediate cast to `void *`, as done everywhere else when
casting from `sockaddr *` to `sockaddr_in *`.

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

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 15 Feb 2023 22:46:46 +0000 (23:46 +0100)] 
RELEASE-NOTES: synced

bumped to 7.88.1

2 years agotests: make sure gnuserv-tls has SRP support before using it
Daniel Stenberg [Wed, 15 Feb 2023 14:04:07 +0000 (15:04 +0100)] 
tests: make sure gnuserv-tls has SRP support before using it

Reported-by: fundawang on github
Fixes #10522
Closes #10524

2 years agoruntests: fix "uninitialized value $port"
Daniel Stenberg [Wed, 15 Feb 2023 12:03:21 +0000 (13:03 +0100)] 
runtests: fix "uninitialized value $port"

by using a more appropriate variable

Reported-by: fundawang on github
Fixes #10518
Closes #10520

2 years agoRELEASE-NOTES: synced curl-7_88_0
Daniel Stenberg [Wed, 15 Feb 2023 07:10:01 +0000 (08:10 +0100)] 
RELEASE-NOTES: synced

7.88.0 release

2 years agoTHANKS: added contributors from 7.88.0
Daniel Stenberg [Wed, 15 Feb 2023 07:10:01 +0000 (08:10 +0100)] 
THANKS: added contributors from 7.88.0

2 years agoopenssl: rename 'errcode_t' to 'sslerr_t'
Daniel Stenberg [Mon, 13 Feb 2023 20:05:05 +0000 (21:05 +0100)] 
openssl: rename 'errcode_t' to 'sslerr_t'

Turns out "/usr/include/et/com_err.h" typedefs this type (without proper
variable scoping).

comerr is the "common error description library" that apparently might be used
by krb5 code, which then makes this header get used in a curl build.

Reported-by: Bruno Henrique Batista Cruz da Silva
Fixed #10502
Closes #10500

2 years agoCONTRIBUTE: More formally specify the commit description
Dan Fandrich [Sat, 11 Feb 2023 19:05:42 +0000 (11:05 -0800)] 
CONTRIBUTE: More formally specify the commit description

This codifies what people have actually used in git commits over the
past 6 years. I've left off some lesser-used headers that appear to
duplicate others and tried to describe a consistent use for several
others that were used more arbitrarily.

This makes it easier for new committers to find out the kinds of things
we want to acknowledge, makes it easier to perform statistical analysis
on commits, and opens the possibility of performing lint checks on
descriptions before submission.

Reviewed-by: Daniel Stenberg
Reviewed-by: Jay Satiro
Closes #10478

2 years agoopenssl: test and fix for forward proxy handling (non-tunneling).
Stefan Eissing [Mon, 13 Feb 2023 15:15:20 +0000 (16:15 +0100)] 
openssl: test and fix for forward proxy handling (non-tunneling).

- adding pytest test_10 cases for proxy httpd setup tests
- fixing openssl bug in https: proxy hostname verification that
  used the hostname of the request and not the proxy name.

Closes #10498

2 years agocmdline-opts/Makefile: on error, do not leave a partial
Daniel Stenberg [Mon, 13 Feb 2023 14:34:54 +0000 (15:34 +0100)] 
cmdline-opts/Makefile: on error, do not leave a partial

And support 'make V=1' to show the full command line

Closes #10497

2 years agocurl.1: make help, version and manual sections "custom"
Daniel Stenberg [Mon, 13 Feb 2023 14:33:13 +0000 (15:33 +0100)] 
curl.1: make help, version and manual sections "custom"

Instead of using "multi: boolean", as these are slightly special as in
they do are not enable/disable ones.

Fixes #10490
Reported-by: u20221022 on github
Closes #10497

2 years agotests: add tests for HTTP/2 and HTTP/3 to verify the header API
Stefan Eissing [Mon, 13 Feb 2023 13:22:37 +0000 (14:22 +0100)] 
tests: add tests for HTTP/2 and HTTP/3 to verify the header API

Test 2403 and 2503 check "header_json" output and therefore use of
header-api

Closes #10495

2 years agoCI: update wolfssl / wolfssh to 5.5.4 / 1.4.12
Philip H [Mon, 13 Feb 2023 08:04:51 +0000 (09:04 +0100)] 
CI: update wolfssl / wolfssh to 5.5.4 / 1.4.12

Closes #10493

2 years agoKNOW_BUGS: cleanups with some changed to TODOs
Daniel Stenberg [Sun, 12 Feb 2023 17:07:08 +0000 (18:07 +0100)] 
KNOW_BUGS: cleanups with some changed to TODOs

- remove "Excessive HTTP/2 packets with TCP_NODELAY"

  This is not a bug. Rather room for improvement.

I believe these have been fixed:

- 17.4 Connection failures with parallel HTTP/2
- 17.5 HTTP/2 connections through HTTPS proxy frequently stall

- remove "FTPS needs session reuse"

That is still true, but curl should also do session reuse now.

- remove "ASCII FTP"

It is documented behavior, and not single user has asked for extended
functionality here the last decade or so.

- remove "Passive transfer tries only one IP address"

add as a TODO

- remove "DoH leaks memory after followlocation"

With a recipe on how to reproduce, this is pointless to keep around

- remove "DoH does not inherit all transfer options"

add it as a TODO

Closes #10487

2 years agoGHA: bump ngtcp2 workflow dependencies
Tatsuhiro Tsujikawa [Mon, 13 Feb 2023 12:40:30 +0000 (21:40 +0900)] 
GHA: bump ngtcp2 workflow dependencies

Closes #10494

2 years agocontent_encoding: do not reset stage counter for each header
Patrick Monnerat [Mon, 13 Feb 2023 07:33:09 +0000 (08:33 +0100)] 
content_encoding: do not reset stage counter for each header

Test 418 verifies

Closes #10492

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 13 Feb 2023 10:31:28 +0000 (11:31 +0100)] 
RELEASE-NOTES: synced

2 years agomulti: stop sending empty HTTP/3 UDP datagrams on Windows
Jay Satiro [Tue, 7 Feb 2023 08:14:34 +0000 (03:14 -0500)] 
multi: stop sending empty HTTP/3 UDP datagrams on Windows

- Limit the 0-sized send procedure that is used to reset a SOCKET's
  FD_WRITE to TCP sockets only.

Prior to this change the reset was used on UDP sockets as well, but
unlike TCP sockets a 0-sized send actually sends out a datagram.

Assisted-by: Marc Hörsken
Ref: https://github.com/curl/curl/pull/9203

Fixes https://github.com/curl/curl/issues/9086
Closes https://github.com/curl/curl/pull/10430

2 years agoh3: silence compiler warnings
Viktor Szakats [Sun, 12 Feb 2023 17:11:46 +0000 (17:11 +0000)] 
h3: silence compiler warnings

Reviewed-by: Daniel Stenberg
Fixes #10485
Closes #10486

2 years agosmb: return error on upload without size
Daniel Stenberg [Sun, 12 Feb 2023 12:24:08 +0000 (13:24 +0100)] 
smb: return error on upload without size

The protocol needs to know the size ahead of time, this is now a known
restriction and not a bug.

Also output a clearer error if the URL path does not contain proper
share.

Ref: #7896
Closes #10484

2 years agowindows: always use curl's basename() implementation
Viktor Szakats [Sun, 12 Feb 2023 12:52:59 +0000 (12:52 +0000)] 
windows: always use curl's basename() implementation

The `basename()` [1][2] implementation provided by mingw-w64 [3] makes
assumptions about input encoding and may break with non-ASCII strings.

`basename()` was auto-detected with CMake, autotools and since
68fa9bf3f5d7b4fcbb57619f70cb4aabb79a51f6 (2022-10-13), also in
`Makefile.mk` after syncing its behaviour with the mainline build
methods. A similar patch for curl-for-win broke official Windows
builds earlier, in release 7.83.1_4 (2022-06-15).

This patch forces all Windows builds to use curl's internal
`basename()` implementation to avoid such problems.

[1]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/basename.html
[2]: https://www.man7.org/linux/man-pages/man3/basename.3.html
[3]: https://sourceforge.net/p/mingw-w64/mingw-w64/ci/master/tree/mingw-w64-crt/misc/basename.c

Reported-by: UnicornZhang on Github
Assisted-by: Cherish98 on Github
Reviewed-by: Daniel Stenberg
Fixes #10261
Closes #10475

2 years agoLinux CI: Bump rustls-ffi to v0.9.1
Philip H [Sat, 11 Feb 2023 16:30:26 +0000 (17:30 +0100)] 
Linux CI: Bump rustls-ffi to v0.9.1

Closes #10476

2 years agolibtest: build lib2305 with multibyte as well
Daniel Stenberg [Sat, 11 Feb 2023 22:16:46 +0000 (23:16 +0100)] 
libtest: build lib2305 with multibyte as well

Fixes a build regression.

Follow-up to 5a9a04d5567
Reported-by: Viktor Szakats
Ref: https://github.com/curl/curl/pull/10475#issuecomment-1426831800

Closes #10477

2 years agocmake: fix dev warning due to mismatched arg
Dmitry Atamanov [Fri, 10 Feb 2023 17:44:36 +0000 (22:44 +0500)] 
cmake: fix dev warning due to mismatched arg

The package name passed to find_package_handle_standard_args (BROTLI)
does not match the name of the calling package (Brotli). This can lead
to problems in calling code that expects find_package result variables
(e.g., _FOUND) to follow a certain pattern.

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

2 years agosetopt: Address undefined behaviour by checking for null
James Keast [Fri, 10 Feb 2023 19:24:15 +0000 (15:24 -0400)] 
setopt: Address undefined behaviour by checking for null

This addresses undefined behaviour found using clang's UBsan:

curl/lib/setopt.c:177:14: runtime error: applying non-zero offset 1 to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior curl/lib/setopt.c:177:14 in

Closes #10472

2 years agorustls: improve error messages
Jacob Hoffman-Andrews [Fri, 10 Feb 2023 01:12:07 +0000 (17:12 -0800)] 
rustls: improve error messages

Changes numeric error codes into verbose error codes in two places.
Adds a prefix indicating that the error came from rustls, and in some
places which function it came from.

Adds special handling for RUSTLS_RESULT_UNEXPECTED_EOF, since the
default message of "Unexpected EOF" is insufficiently explanatory.

Closes #10463

2 years agoopenssl: remove dead code
Daniel Stenberg [Fri, 10 Feb 2023 22:27:15 +0000 (23:27 +0100)] 
openssl: remove dead code

Follow-up to e8b00fcd6a

Due to the new 'if(!nonblocking)' check on the block a level above,
there is no need to check for it again within the same conditional.

Detected by Coverity

Closes #10473

2 years agongtcp2: replace removed define and stop using removed function
Daniel Stenberg [Fri, 10 Feb 2023 23:06:13 +0000 (00:06 +0100)] 
ngtcp2: replace removed define and stop using removed function

They were removed upstream.

Reported-by: Karthikdasari0423 on github
Fixes #10469
Closes #10474

2 years agoscripts/delta: show percent of number of files changed since last tag
Daniel Stenberg [Fri, 10 Feb 2023 17:52:16 +0000 (18:52 +0100)] 
scripts/delta: show percent of number of files changed since last tag

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 10 Feb 2023 17:49:34 +0000 (18:49 +0100)] 
RELEASE-NOTES: synced

2 years agopytest: add a test case for PUSH related things.
Stefan Eissing [Thu, 9 Feb 2023 12:08:26 +0000 (13:08 +0100)] 
pytest: add a test case for PUSH related things.

- checking that "103 Early Hints" are visible in curl's header dump file

Closes #10452

2 years agoWEBSOCKET.md: typo
Gregory Panakkal [Fri, 10 Feb 2023 08:32:57 +0000 (14:02 +0530)] 
WEBSOCKET.md: typo

Fixing missing slash for ws protocol scheme

Closes #10464

2 years agovquic: stabilization and improvements
Stefan Eissing [Thu, 9 Feb 2023 09:49:04 +0000 (10:49 +0100)] 
vquic: stabilization and improvements

vquic stabilization
- udp send code shared between ngtcp2 and quiche
- quiche handling of data and events improved

ngtcp2 and pytest improvements
- fixes handling of "drain" situations, discovered in scorecard
  tests with the Caddy server.
- improvements in handling transfers that have already  data or
  are already closed to make an early return on recv

pytest
- adding caddy tests when available

scorecard improvemnts.
- using correct caddy port
- allowing tests for only httpd or caddy

Closes #10451

2 years agoLinux CI: update some dependecies to latest tag
Philip H [Thu, 9 Feb 2023 08:22:39 +0000 (09:22 +0100)] 
Linux CI: update some dependecies to latest tag

Closes #10458

2 years agotest2305: send 3 frames, 4097 bytes each, as one message
Daniel Stenberg [Wed, 8 Feb 2023 12:17:41 +0000 (13:17 +0100)] 
test2305: send 3 frames, 4097 bytes each, as one message

Receive them using a 256 bytes buffer in a loop.

2 years agows: fix recv of larger frames
Daniel Stenberg [Wed, 8 Feb 2023 13:24:49 +0000 (14:24 +0100)] 
ws: fix recv of larger frames

 + remove 'oleft' from the struct
 + deal with "overflow data" in a separate dynbuf

Reported-by: Mike Duglas
Fixes #10438
Closes #10447

2 years agocurl/websockets.h: extend the websocket frame struct
Daniel Stenberg [Wed, 8 Feb 2023 22:02:50 +0000 (23:02 +0100)] 
curl/websockets.h: extend the websocket frame struct

2 years agosws: fix typo, indentation add more ws logging
Daniel Stenberg [Wed, 8 Feb 2023 13:34:42 +0000 (14:34 +0100)] 
sws: fix typo, indentation add more ws logging

2 years agotest2304: remove stdout verification
Daniel Stenberg [Thu, 9 Feb 2023 18:38:56 +0000 (19:38 +0100)] 
test2304: remove stdout verification

This cripples the test somewhat but the check was bad since depending on
timing it could exit before the output was done, making the test flaky.

2 years agoCI: Add more labeler match patterns
Dan Fandrich [Mon, 30 Jan 2023 23:10:11 +0000 (15:10 -0800)] 
CI: Add more labeler match patterns

2 years agoCI: Retry failed downloads to reduce spurious failures
Dan Fandrich [Thu, 9 Feb 2023 20:06:12 +0000 (12:06 -0800)] 
CI: Retry failed downloads to reduce spurious failures

A temporary error with a remote server shouldn't cause a CI run to fail.
Also, put a cap on the time to download to fail faster on a misbehaving
server or connection and use HTTP compression where possible to reduce
download times.

2 years agono-clobber.d: only use long form options in man page text
Daniel Stenberg [Thu, 9 Feb 2023 22:09:36 +0000 (23:09 +0100)] 
no-clobber.d: only use long form options in man page text

... since they are expanded and the short-form gets mentioned
automatically so if the short form is mentioned as well, it gets
repeated.

Fixes #10461
Closes #10462
Reported-by: Dan Fandrich
2 years agoGHA: enable websockets in the torture job
Daniel Stenberg [Thu, 9 Feb 2023 07:35:29 +0000 (08:35 +0100)] 
GHA: enable websockets in the torture job

Closes #10448

2 years agoheader.d: add a header file example
Daniel Stenberg [Thu, 9 Feb 2023 13:23:14 +0000 (14:23 +0100)] 
header.d: add a header file example

Closes #10455

2 years agoHTTP/[23]: continue upload when state.drain is set
Stefan Eissing [Wed, 8 Feb 2023 09:26:58 +0000 (10:26 +0100)] 
HTTP/[23]: continue upload when state.drain is set

- as reported in #10433, HTTP/2 uploads may stall when a response is
  received before the upload is done. This happens when the
  data->state.drain is set for such a transfer, as the special handling
  in transfer.c from then on only cared about downloads.
- add continuation of uploads, if applicable, in this case.
- add pytest case test_07_12_upload_seq_large to reproduce this scenario
  (although, current nghttp2 implementation is using drain less often)

Reported-by: Lucas Pardue
Fixes #10433
Closes #10443

2 years agohttp2: minor buffer and error path fixes
Stefan Eissing [Wed, 8 Feb 2023 14:56:57 +0000 (15:56 +0100)] 
http2: minor buffer and error path fixes

- use memory buffer in full available size
- fail receive of reset/errored streams early

pytest:
- make test_05 error cases more reliable

Closes #10444

2 years agoopenldap: fix missing sasl symbols at build in specific configs
Federico Pellegrin [Wed, 8 Feb 2023 18:44:58 +0000 (19:44 +0100)] 
openldap: fix missing sasl symbols at build in specific configs

If curl is built with openldap support (USE_OPENLDAP=1) but does not
have also some other protocol (IMAP/SMTP/POP3) enabled that brings
in Curl_sasl_* functions, then the build will fail with undefined
references to various symbols:

ld: ../lib/.libs/libcurl.so: undefined reference to `Curl_sasl_decode_mech'
ld: ../lib/.libs/libcurl.so: undefined reference to `Curl_sasl_parse_url_auth_option'
ld: ../lib/.libs/libcurl.so: undefined reference to `Curl_sasl_cleanup'
ld: ../lib/.libs/libcurl.so: undefined reference to `Curl_sasl_can_authenticate'
ld: ../lib/.libs/libcurl.so: undefined reference to `Curl_sasl_continue'
ld: ../lib/.libs/libcurl.so: undefined reference to `Curl_sasl_start'
ld: ../lib/.libs/libcurl.so: undefined reference to `Curl_sasl_init'

This was tracked down to these functions bein used in openldap.c but
defined in curl_sasl.c and then forward in two vauth/ files to have
a guard against a set of #define configurations that was now extended
to cover also this case.

Example configuration targeted that could reproduce the problem:

curl 7.87.1-DEV () libcurl/7.87.1-DEV .... OpenLDAP/2.6.3
Protocols: file ftp ftps http https ldap ldaps

Closes #10445

2 years agows: use %Ou for outputting curl_off_t with info()
Daniel Stenberg [Wed, 8 Feb 2023 07:39:08 +0000 (08:39 +0100)] 
ws: use %Ou for outputting curl_off_t with info()

Reported-by: Mike Duglas
Fixes #10439
Closes #10441

2 years agocurl_setup: Disable by default recv-before-send in Windows
Jay Satiro [Fri, 3 Feb 2023 08:11:49 +0000 (03:11 -0500)] 
curl_setup: Disable by default recv-before-send in Windows

Prior to this change a workaround for Windows to recv before every send
was enabled by default. The way it works is a recv is called before
every send and saves the received data, in case send fails because in
Windows apparently that can wipe out the socket's internal received
data buffer.

This feature has led to several bugs because the way libcurl operates
it waits on a socket to read or to write, and may not at all times
check for buffered receive data.

Two recent significant bugs this workaround caused:
- Broken Schannel TLS 1.3 connections (#9431)
- HTTP/2 arbitrary hangs (#10253)

The actual code remains though it is disabled by default. Though future
changes to connection filter buffering could improve the situation IMO
it's just not tenable to manage this workaround.

Ref: https://github.com/curl/curl/issues/657
Ref: https://github.com/curl/curl/pull/668
Ref: https://github.com/curl/curl/pull/720

Ref: https://github.com/curl/curl/issues/9431
Ref: https://github.com/curl/curl/issues/10253

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

2 years agohttp2: aggregate small SETTINGS/PRIO/WIN_UPDATE frames
Stefan Eissing [Wed, 8 Feb 2023 09:37:36 +0000 (10:37 +0100)] 
http2: aggregate small SETTINGS/PRIO/WIN_UPDATE frames

add a small buffer to nghttp2 session sending in order to aggregate
small SETTINGS/PRIO/WIN_UPDATE frames that nghttp2 "writes" to the
callback individually.

Ref: #10389
Closes #10432

2 years agoopenssl: store the CA after first send (ClientHello)
Stefan Eissing [Wed, 8 Feb 2023 09:39:03 +0000 (10:39 +0100)] 
openssl: store the CA after first send (ClientHello)

move Curl_ssl_setup_x509_store() call after the first send (ClientHello)
this gives time to parse CA anchors while waiting on the server reply

Ref: #10389
Closes #10432

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 8 Feb 2023 08:31:29 +0000 (09:31 +0100)] 
RELEASE-NOTES: synced

2 years agowolfssl: remove deprecated post-quantum algorithms
Anthony Hu [Tue, 7 Feb 2023 22:47:50 +0000 (17:47 -0500)] 
wolfssl: remove deprecated post-quantum algorithms

Closes #10440

2 years agomisc: fix spelling
John Bampton [Tue, 7 Feb 2023 21:50:36 +0000 (07:50 +1000)] 
misc: fix spelling

Closes #10437

2 years agoman pages: call the custom user pointer 'clientp' consistently
Daniel Stenberg [Tue, 7 Feb 2023 14:58:17 +0000 (15:58 +0100)] 
man pages: call the custom user pointer 'clientp' consistently

The variable had a few different names. Now try to use 'clientp'
consistently for all man pages using a custom pointer set by the
application.

Reported-by: Gerrit Renker
Fixes #10434
Closes #10435

2 years agovtls: infof using %.*s needs to provide the length as int
Daniel Stenberg [Tue, 7 Feb 2023 15:09:12 +0000 (16:09 +0100)] 
vtls: infof using %.*s needs to provide the length as int

Fixes a Coverity warning.

Closes #10436

2 years agovrls: addressing issues reported by coverity
Stefan Eissing [Tue, 7 Feb 2023 08:34:49 +0000 (09:34 +0100)] 
vrls: addressing issues reported by coverity

I believe the code was secure before this, but limiting the accepted
name length to what is used in the structures should help Coverity's
analysis.

Closes #10431

2 years agotool_operate: move the 'updated' variable
Daniel Stenberg [Tue, 7 Feb 2023 11:15:26 +0000 (12:15 +0100)] 
tool_operate: move the 'updated' variable

This was already done by Dan Fandrich in the previous PR but somehow I
lost that fixup.

Follow-up to 349c5391f2121e

2 years agotool_operate: Fix error codes during DOS filename sanitize
Dan Fandrich [Mon, 6 Feb 2023 18:40:59 +0000 (10:40 -0800)] 
tool_operate: Fix error codes during DOS filename sanitize

It would return CURLE_URL_MALFORMAT in an OOM condition.

Closes #10414

2 years agotool_operate: Fix error codes on bad URL & OOM
Dan Fandrich [Sun, 5 Feb 2023 00:05:35 +0000 (16:05 -0800)] 
tool_operate: Fix error codes on bad URL & OOM

curl would erroneously report CURLE_OUT_OF_MEMORY in some cases instead
of CURLE_URL_MALFORMAT. In other cases, it would erroneously return
CURLE_URL_MALFORMAT instead of CURLE_OUT_OF_MEMORY.  Add a test case to
test the former condition.

Fixes #10130
Closes #10414

2 years agosetopt: use >, not >=, when checking if uarg is larger than uint-max
Daniel Stenberg [Mon, 6 Feb 2023 16:37:52 +0000 (17:37 +0100)] 
setopt: use >, not >=, when checking if uarg is larger than uint-max

Closes #10421

2 years agovtls: fix failf() format argument type for %.*s handling
Daniel Stenberg [Mon, 6 Feb 2023 16:50:09 +0000 (17:50 +0100)] 
vtls: fix failf() format argument type for %.*s handling

Reported by Coverity

Closes #10422

2 years agoopenssl: fix "Improper use of negative value"
Daniel Stenberg [Mon, 6 Feb 2023 16:52:44 +0000 (17:52 +0100)] 
openssl: fix "Improper use of negative value"

By getting the socket first and returning error in case of bad socket.

Detected by Coverity.

Closes #10423

2 years agopackages: Remove Android.mk from makefile
Dan Fandrich [Mon, 6 Feb 2023 22:02:06 +0000 (14:02 -0800)] 
packages: Remove Android.mk from makefile

This was missed in commit #44141512

Ref: #10418

2 years agocurl_ws_send.3: clarify how to send multi-frame messages
Daniel Stenberg [Mon, 6 Feb 2023 10:24:03 +0000 (11:24 +0100)] 
curl_ws_send.3: clarify how to send multi-frame messages

2 years agows: fix multiframe send handling
Mike Duglas [Mon, 6 Feb 2023 09:34:46 +0000 (10:34 +0100)] 
ws: fix multiframe send handling

Fixes #10413
Closes #10420

2 years agounit2600: make sure numerical curl_easy_setopt sets long
Daniel Stenberg [Mon, 6 Feb 2023 08:52:33 +0000 (09:52 +0100)] 
unit2600: make sure numerical curl_easy_setopt sets long

Follow-up to 671158242db3203

Reported-by: Marcel Raad
Fixes #10410
Closes #10419

2 years agoGHA: move Slackware test into matrix
andy5995 [Sat, 4 Feb 2023 05:50:33 +0000 (23:50 -0600)] 
GHA: move Slackware test into matrix

Closes #10412

2 years agourlapi: fix part of conditional expression is always true: qlen
Pronyushkin Petr [Fri, 3 Feb 2023 06:35:15 +0000 (11:35 +0500)] 
urlapi: fix part of conditional expression is always true: qlen

Closes #10408

2 years agourl: fix part of conditional expression is always true
Pronyushkin Petr [Fri, 3 Feb 2023 06:26:30 +0000 (11:26 +0500)] 
url: fix part of conditional expression is always true

Closes #10407

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 6 Feb 2023 07:35:03 +0000 (08:35 +0100)] 
RELEASE-NOTES: synced

2 years agoGHA/macos.yml: bump to gcc-12
Philip H [Sun, 5 Feb 2023 10:53:19 +0000 (11:53 +0100)] 
GHA/macos.yml: bump to gcc-12

Closes #10415

2 years agopackages: remove Android, update README
Daniel Stenberg [Sun, 5 Feb 2023 22:29:49 +0000 (23:29 +0100)] 
packages: remove Android, update README

- Nobody builds curl for Android using this anymore
- Refreshed the README and converted to markdown

Reported-by: John Porter
Fixes #10416
Closes #10418

2 years agofopen: remove unnecessary assignment
Kvarec Lezki [Thu, 2 Feb 2023 11:16:01 +0000 (16:16 +0500)] 
fopen: remove unnecessary assignment

[CWE-1164] V1048: The '* tempname' variable was assigned the same value.

Ref: https://pvs-studio.com/en/docs/warnings/v1048/

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

2 years agolibtest: add a sleep macro for Windows
Gisle Vanem [Fri, 13 Jan 2023 13:51:55 +0000 (14:51 +0100)] 
libtest: add a sleep macro for Windows

.. because sleep() is used in some libtests.

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

2 years agohttp_aws_sigv4: remove typecasts from HMAC_SHA256 macro
Kvarec Lezki [Thu, 2 Feb 2023 11:56:01 +0000 (16:56 +0500)] 
http_aws_sigv4: remove typecasts from HMAC_SHA256 macro

V220: Suspicious sequence of types castings: memsize -> 32-bit integer -> memsize.

https://pvs-studio.com/en/docs/warnings/v220/

Closes #10400

2 years agomailmap: Thomas1664 on github
Daniel Stenberg [Fri, 3 Feb 2023 09:04:34 +0000 (10:04 +0100)] 
mailmap: Thomas1664 on github

2 years agoCURLOPT_WRITEFUNCTION.3: fix memory leak in example
Thomas1664 [Wed, 1 Feb 2023 12:59:25 +0000 (13:59 +0100)] 
CURLOPT_WRITEFUNCTION.3: fix memory leak in example

Closes #10390

2 years agodoh: ifdef IPv6 code
Kvarec Lezki [Thu, 2 Feb 2023 11:07:51 +0000 (16:07 +0500)] 
doh: ifdef IPv6 code

For disabled IPv6 a condition (conn->ip_version != CURL_IPRESOLVE_V4) is
always false. https://pvs-studio.com/en/docs/warnings/v560/

Closes #10397

2 years agourlapi: remove pathlen assignment
Daniel Stenberg [Thu, 2 Feb 2023 19:56:34 +0000 (20:56 +0100)] 
urlapi: remove pathlen assignment

"Value stored to 'pathlen' is never read"

Follow-up to 804d5293f89

Reported-by: Kvarec Lezki
Closes #10405

2 years agohttp: fix "part of conditional expression is always false"
Kvarec Lezki [Thu, 2 Feb 2023 11:37:42 +0000 (16:37 +0500)] 
http: fix "part of conditional expression is always false"

[CWE-570] V560: A part of conditional expression is always false: conn->bits.authneg.
[CWE-570] V560: A part of conditional expression is always false: conn->handler->protocol & (0 | 0).

https://pvs-studio.com/en/docs/warnings/v560/

Closes #10399

2 years agourlapi: skip the extra dedotdot alloc if no dot in path
Daniel Stenberg [Thu, 2 Feb 2023 10:15:47 +0000 (11:15 +0100)] 
urlapi: skip the extra dedotdot alloc if no dot in path

Saves an allocation for many/most URLs.

Updates test 1395 accordingly

Closes #10403

2 years agoconnections: introduce http/3 happy eyeballs
Stefan Eissing [Wed, 1 Feb 2023 16:13:12 +0000 (17:13 +0100)] 
connections: introduce http/3 happy eyeballs

New cfilter HTTP-CONNECT for h3/h2/http1.1 eyeballing.
- filter is installed when `--http3` in the tool is used (or
  the equivalent CURLOPT_ done in the library)
- starts a QUIC/HTTP/3 connect right away. Should that not
  succeed after 100ms (subject to change), a parallel attempt
  is started for HTTP/2 and HTTP/1.1 via TCP
- both attempts are subject to IPv6/IPv4 eyeballing, same
  as happens for other connections
- tie timeout to the ip-version HAPPY_EYEBALLS_TIMEOUT
- use a `soft` timeout at half the value. When the soft timeout
  expires, the HTTPS-CONNECT filter checks if the QUIC filter
  has received any data from the server. If not, it will start
  the HTTP/2 attempt.

HTTP/3(ngtcp2) improvements.
- setting call_data in all cfilter calls similar to http/2 and vtls filters
  for use in callback where no stream data is available.
- returning CURLE_PARTIAL_FILE for prematurely terminated transfers
- enabling pytest test_05 for h3
- shifting functionality to "connect" UDP sockets from ngtcp2
  implementation into the udp socket cfilter. Because unconnected
  UDP sockets are weird. For example they error when adding to a
  pollset.

HTTP/3(quiche) improvements.
- fixed upload bug in quiche implementation, now passes 251 and pytest
- error codes on stream RESET
- improved debug logs
- handling of DRAIN during connect
- limiting pending event queue

HTTP/2 cfilter improvements.
- use LOG_CF macros for dynamic logging in debug build
- fix CURLcode on RST streams to be CURLE_PARTIAL_FILE
- enable pytest test_05 for h2
- fix upload pytests and improve parallel transfer performance.

GOAWAY handling for ngtcp2/quiche
- during connect, when the remote server refuses to accept new connections
  and closes immediately (so the local conn goes into DRAIN phase), the
  connection is torn down and a another attempt is made after a short grace
  period.
  This is the behaviour observed with nghttpx when we tell it to  shut
  down gracefully. Tested in pytest test_03_02.

TLS improvements
- ALPN selection for SSL/SSL-PROXY filters in one vtls set of functions, replaces
  copy of logic in all tls backends.
- standardized the infof logging of offered ALPNs
- ALPN negotiated: have common function for all backends that sets alpn proprty
  and connection related things based on the negotiated protocol (or lack thereof).

- new tests/tests-httpd/scorecard.py for testing h3/h2 protocol implementation.
  Invoke:
    python3 tests/tests-httpd/scorecard.py --help
  for usage.

Improvements on gathering connect statistics and socket access.
- new CF_CTRL_CONN_REPORT_STATS cfilter control for having cfilters
  report connection statistics. This is triggered when the connection
  has completely connected.
- new void Curl_pgrsTimeWas(..) method to report a timer update with
  a timestamp of when it happend. This allows for updating timers
  "later", e.g. a connect statistic after full connectivity has been
  reached.
- in case of HTTP eyeballing, the previous changes will update
  statistics only from the filter chain that "won" the eyeballing.
- new cfilter query CF_QUERY_SOCKET for retrieving the socket used
  by a filter chain.
  Added methods Curl_conn_cf_get_socket() and Curl_conn_get_socket()
  for convenient use of this query.
- Change VTLS backend to query their sub-filters for the socket when
  checks during the handshake are made.

HTTP/3 documentation on how https eyeballing works.

TLS improvements
- ALPN selection for SSL/SSL-PROXY filters in one vtls set of functions, replaces
  copy of logic in all tls backends.
- standardized the infof logging of offered ALPNs
- ALPN negotiated: have common function for all backends that sets alpn proprty
  and connection related things based on the negotiated protocol (or lack thereof).

Scorecard with Caddy.
- configure can be run with `--with-test-caddy=path` to specify which caddy to use for testing
- tests/tests-httpd/scorecard.py now measures download speeds with caddy

pytest improvements
- adding Makfile to clean gen dir
- adding nghttpx rundir creation on start
- checking httpd version 2.4.55 for test_05 cases where it is needed. Skipping with message if too old.
- catch exception when checking for caddy existance on system.

Closes #10349

2 years agoCODEOWNERS: remove the peeps mentioned as CI owners
Daniel Stenberg [Wed, 1 Feb 2023 08:20:09 +0000 (09:20 +0100)] 
CODEOWNERS: remove the peeps mentioned as CI owners

These owners do not have the bandwidth/energy to do the reviews which
makes PRs stall and this ownership claim flawed. We can bring people
back when the situation is different.

Follow-up to c04c78ac87c4d46737934345a

Closes #10386

2 years agowrite-out.d: add 'since version' to %{header_json} documentation
Martin D'Aloia [Thu, 2 Feb 2023 01:27:23 +0000 (22:27 -0300)] 
write-out.d: add 'since version' to %{header_json} documentation

The documentation of `%{header_json}` missed to mention since which
version this variable for `--write-out` is present.

Based on commit https://github.com/curl/curl/commit/4133a69f2daa476bb
we can determine from the tags were this commit is present that the
first version to include it was `7.83.0`.
This could be also checked with:
`git tag --contains 4133a69f2daa476bb6d902687f1dd6660ea9c3c5`

Closes #10395

2 years agourlapi: avoid Curl_dyn_addf() for hex outputs
Daniel Stenberg [Tue, 31 Jan 2023 23:17:28 +0000 (00:17 +0100)] 
urlapi: avoid Curl_dyn_addf() for hex outputs

Inspired by the recent fixes to escape.c, we should avoid calling
Curl_dyn_addf() in loops, perhaps in particular when adding something so
simple as %HH codes - for performance reasons. This change makes the
same thing for the URL parser's two URL-encoding loops.

Closes #10384

2 years agourlapi: skip path checks if path is just "/"
Daniel Stenberg [Wed, 1 Feb 2023 07:26:08 +0000 (08:26 +0100)] 
urlapi: skip path checks if path is just "/"

As a miniscule optimization, treat a path of the length 1 as the same as
non-existing, as it can only be a single leading slash, and that's what
we do for no paths as well.

Closes #10385

2 years agoGHA/macos: use Xcode_14.0.1 for cmake builds
Philip H [Tue, 31 Jan 2023 14:57:41 +0000 (15:57 +0100)] 
GHA/macos: use Xcode_14.0.1 for cmake builds

Fixes #10356
Closes #10381