]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
2 years agotests: make CPPFLAGS common to all unit tests
Dan Fandrich [Thu, 9 Mar 2023 20:28:39 +0000 (12:28 -0800)] 
tests: make CPPFLAGS common to all unit tests

There's no need to specify them individually.

2 years agotests: keep cmake unit tests names in sync
Dan Fandrich [Thu, 9 Mar 2023 20:23:14 +0000 (12:23 -0800)] 
tests: keep cmake unit tests names in sync

Put only the test names into Makefile.inc so they can be used by both
cmake and automake. This will prevent the list of tests from becoming
out of date when they are also built under cmake.

2 years agosrc: silence wmain() warning for all build methods
Viktor Szakats [Sat, 11 Mar 2023 15:21:43 +0000 (15:21 +0000)] 
src: silence wmain() warning for all build methods

llvm/clang and gcc doesn't recognize the wmain() function in Unicode
Windows builds:

llvm/clang:
```
../../src/tool_main.c:239:5: warning: no previous prototype for function 'wmain' [-Wmissing-prototypes]
int wmain(int argc, wchar_t *argv[])
    ^
1 warning generated.
```

gcc:
```
../../src/tool_main.c:239:5: warning: no previous prototype for 'wmain' [-Wmissing-prototypes]
  239 | int wmain(int argc, wchar_t *argv[])
      |     ^~~~~
```

Before this patch, we already silenced it with CMake. This patch moves
the silencing to the source, so that it applies to all build tools.

Bug: https://github.com/curl/curl/issues/7229#issuecomment-1464806651

Reviewed-by: Marcel Raad
Closes #10744

2 years agoCI: fix retrying on brew failures
Dan Fandrich [Sat, 11 Mar 2023 00:41:25 +0000 (16:41 -0800)] 
CI: fix retrying on brew failures

The previous attempt didn't consider that the shell would exit
immediately after the false statement in the retry case.

Follow-up to dc141a37

2 years agohttp2: fix error handling during parallel operations
Stefan Eissing [Thu, 9 Mar 2023 10:16:21 +0000 (11:16 +0100)] 
http2: fix error handling during parallel operations

RST and connection close were not handled correctly during parallel
transfers, leading to aborted response bodies being reported complete.

Closes #10715

2 years agourl: only reuse connections with same GSS delegation
Daniel Stenberg [Fri, 10 Mar 2023 08:22:43 +0000 (09:22 +0100)] 
url: only reuse connections with same GSS delegation

Reported-by: Harry Sintonen
Closes #10731

2 years agolib: silence clang/gcc -Wvla warnings in brotli headers
Viktor Szakats [Fri, 10 Mar 2023 22:24:24 +0000 (22:24 +0000)] 
lib: silence clang/gcc -Wvla warnings in brotli headers

brotli v1.0.0 throughout current latest v1.0.9 and latest master [1]
trigger this warning.

It happened with CMake and GNU Make. autotools builds avoid it with
the `convert -I options to -isystem` macro.

llvm/clang:
```
In file included from ./curl/lib/content_encoding.c:36:
./brotli/x64-ucrt/usr/include/brotli/decode.h:204:34: warning: variable length array used [-Wvla]
    const uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(encoded_size)],
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./brotli/x64-ucrt/usr/include/brotli/port.h:253:34: note: expanded from macro 'BROTLI_ARRAY_PARAM'
                                 ^~~~~~
In file included from ./curl/lib/content_encoding.c:36:
./brotli/x64-ucrt/usr/include/brotli/decode.h:206:48: warning: variable length array used [-Wvla]
    uint8_t decoded_buffer[BROTLI_ARRAY_PARAM(*decoded_size)]);
                           ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
./brotli/x64-ucrt/usr/include/brotli/port.h:253:35: note: expanded from macro 'BROTLI_ARRAY_PARAM'
                                 ~^~~~~
```

gcc:
```
In file included from ./curl/lib/content_encoding.c:36:
./brotli/x64-ucrt/usr/include/brotli/decode.h:204:5: warning: ISO C90 forbids variable length array 'encoded_buffer' [-Wvla]
  204 |     const uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(encoded_size)],
      |     ^~~~~
./brotli/x64-ucrt/usr/include/brotli/decode.h:206:5: warning: ISO C90 forbids variable length array 'decoded_buffer' [-Wvla]
  206 |     uint8_t decoded_buffer[BROTLI_ARRAY_PARAM(*decoded_size)]);
      |     ^~~~~~~
```

[1] https://github.com/google/brotli/commit/ed1995b6bda19244070ab5d331111f16f67c8054

Reviewed-by: Daniel Stenberg
Reviewed-by: Marcel Raad
Closes #10738

2 years agocurl_path: create the new path with dynbuf
Daniel Stenberg [Thu, 9 Mar 2023 15:22:11 +0000 (16:22 +0100)] 
curl_path: create the new path with dynbuf

Closes #10729

2 years agourl: remove dummy protocol handler
Daniel Stenberg [Fri, 10 Mar 2023 07:39:47 +0000 (08:39 +0100)] 
url: remove dummy protocol handler

Just two added checks were needed saves a whole handler struct.

Closes #10727

2 years agoCI: retry a failed brew update too, not just brew install
Dan Fandrich [Fri, 10 Mar 2023 17:53:09 +0000 (09:53 -0800)] 
CI: retry a failed brew update too, not just brew install

Also, make sure an eventual failure ends up returning a failure code so
the job stops.

2 years agourl: fix the SSH connection reuse check
Daniel Stenberg [Fri, 10 Mar 2023 07:22:51 +0000 (08:22 +0100)] 
url: fix the SSH connection reuse check

Reported-by: Harry Sintonen
Closes #10735

2 years agoCURLOPT_PROXY.3: curl+NSS does not handle HTTPS over unix domain socket
Daniel Stenberg [Fri, 10 Mar 2023 09:35:24 +0000 (10:35 +0100)] 
CURLOPT_PROXY.3: curl+NSS does not handle HTTPS over unix domain socket

It results in error "NSS error -5985 (PR_ADDRESS_NOT_SUPPORTED_ERROR)"

Disabled test 1470 for NSS builds and documented the restriction.

Reported-by: Dan Fandrich
Fixes #10723
Closes #10734

2 years agoCURLSHOPT_SHARE.3: HSTS sharing is not thread-safe
Daniel Stenberg [Thu, 9 Mar 2023 17:01:34 +0000 (18:01 +0100)] 
CURLSHOPT_SHARE.3: HSTS sharing is not thread-safe

Reported-by: Hiroki Kurosawa
Closes #10732

2 years agotelnet: only accept option arguments in ascii
Daniel Stenberg [Mon, 6 Mar 2023 11:07:33 +0000 (12:07 +0100)] 
telnet: only accept option arguments in ascii

To avoid embedded telnet negotiation commands etc.

Reported-by: Harry Sintonen
Closes #10728

2 years agotest1903: test use of COOKIEFILE - reset - COOKIEFILE
Daniel Stenberg [Wed, 8 Mar 2023 13:31:33 +0000 (14:31 +0100)] 
test1903: test use of COOKIEFILE - reset - COOKIEFILE

This also tests for the memory leak bug fixed by parent commit b559ef6f.

Ref: #10694

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

2 years agourl: fix cookielist memleak when curl_easy_reset
Jay Satiro [Wed, 8 Mar 2023 08:42:19 +0000 (03:42 -0500)] 
url: fix cookielist memleak when curl_easy_reset

- Free set.cookelist in Curl_freeset instead of Curl_close.

Prior to this change the cookielist linked list wasn't freed by
curl_easy_reset which calls Curl_freeset to free all set.

Bug: https://github.com/curl/curl/issues/10694#issuecomment-1458619157
Reported-by: Sergey Ryabinin
Closes https://github.com/curl/curl/pull/10709

2 years agotests: fix some keywords and unused sections
Dan Fandrich [Fri, 10 Mar 2023 07:22:36 +0000 (23:22 -0800)] 
tests: fix some keywords and unused sections

2 years agotests: fix test1301 to call the right binary
Dan Fandrich [Fri, 10 Mar 2023 06:59:46 +0000 (22:59 -0800)] 
tests: fix test1301 to call the right binary

It was refactored in commit 480ac6e5 but this step was missed.

2 years agotests: add timeout, SLOWDOWN and DELAY keywords to tests
Dan Fandrich [Fri, 10 Mar 2023 06:46:50 +0000 (22:46 -0800)] 
tests: add timeout, SLOWDOWN and DELAY keywords to tests

These are tests that are testing timing and end up being quite slow.

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 10 Mar 2023 07:14:53 +0000 (08:14 +0100)] 
RELEASE-NOTES: synced

2 years agowolfSSL: ressurect the BIO `io_result`
Stefan Eissing [Thu, 9 Mar 2023 10:29:59 +0000 (11:29 +0100)] 
wolfSSL: ressurect the BIO `io_result`

In pytest'ing the situation occored that wolfSSL reported an
IO error when the underlying BIO operation was returning an
CURLE_AGAIN condition.

Readding the `io_result` filter context member to detect such
situations.

Also, making sure that the returned CURLcode is initialized
on all recv operations outcome.

Closes #10716

2 years agogssapi: align global `gss_OID_desc` vars to silence ld warnings on macOS ventura
Stefan Eissing [Thu, 9 Mar 2023 11:32:36 +0000 (12:32 +0100)] 
gssapi: align global `gss_OID_desc` vars to silence ld warnings on macOS ventura

Refs #9975 which first reported this.

Closes #10718

2 years agolibssh2: only set the memory callbacks when debugging
Daniel Stenberg [Thu, 9 Mar 2023 14:58:02 +0000 (15:58 +0100)] 
libssh2: only set the memory callbacks when debugging

This makes us debug libssh2 less and libcurl more when for example
running torture tests that otherwise will spend a lot of time in libssh2
functions.

We leave libssh2 to test libssh2.

Closes #10721

2 years agodocs/SECURITY-PROCESS.md: updates
Daniel Stenberg [Thu, 9 Mar 2023 12:39:23 +0000 (13:39 +0100)] 
docs/SECURITY-PROCESS.md: updates

- allow Low+Medium issues to be managed through plain PRs
- update the bug-bounty part to reflect current reality

Closes #10719

2 years agotests: fix tag markup issues in some tests
Dan Fandrich [Thu, 9 Mar 2023 18:24:35 +0000 (10:24 -0800)] 
tests: fix tag markup issues in some tests

2 years agotests: add `cookies` features
Marcel Raad [Thu, 9 Mar 2023 10:29:56 +0000 (11:29 +0100)] 
tests: add `cookies` features

These tests don't work with `--disable-cookies`.

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

2 years agotest420: add cookies keyword
Marcel Raad [Wed, 8 Mar 2023 17:00:05 +0000 (18:00 +0100)] 
test420: add cookies keyword

It fails with `--disable-cookies`.

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

2 years agoCI: Add more labeler match patterns
Dan Fandrich [Thu, 9 Mar 2023 00:43:38 +0000 (16:43 -0800)] 
CI: Add more labeler match patterns

Also, add the  CI, tests or libcurl API tags in conjunction with any
others that might also apply.

2 years agoGHA: minor improvements to spellcheck
andy5995 [Tue, 28 Feb 2023 07:57:00 +0000 (01:57 -0600)] 
GHA: minor improvements to spellcheck

Closes #10640

2 years agotest1671: fix after fix
Daniel Stenberg [Wed, 8 Mar 2023 08:08:37 +0000 (09:08 +0100)] 
test1671: fix after fix

2 years agotest421: -w %{header_json} test with multiple same header names
Daniel Stenberg [Tue, 7 Mar 2023 23:32:37 +0000 (00:32 +0100)] 
test421: -w %{header_json} test with multiple same header names

To reproduce the issue in #10704

2 years agotool_writeout_json. fix the output for duplicate header names
Daniel Stenberg [Tue, 7 Mar 2023 23:35:23 +0000 (00:35 +0100)] 
tool_writeout_json. fix the output for duplicate header names

Header entries with index != 0 are handled at the index 0 level so they
should then be skipped when iterated over.

Reported-by: Boris Okunskiy
Fixes #10704
Closes #10707

2 years agoheaders: make curl_easy_header and nextheader return different buffers
Daniel Stenberg [Tue, 7 Mar 2023 23:33:33 +0000 (00:33 +0100)] 
headers: make curl_easy_header and nextheader return different buffers

By letting curl_easy_header() and curl_easy_nextheader() store the
header data in their own struct storage when they return a pointer to
it, it makes it possible for applications to use them both in a loop.
Like the curl tool does.

Reported-by: Boris Okunskiy
Fixes #10704
Closes #10707

2 years agourlapi: take const args in _dup and _get functions
rcombs [Wed, 8 Mar 2023 08:18:39 +0000 (02:18 -0600)] 
urlapi: take const args in _dup and _get functions

Closes #10708

2 years agourlapi: avoid mutating internals in getter routine
rcombs [Wed, 8 Mar 2023 08:12:25 +0000 (02:12 -0600)] 
urlapi: avoid mutating internals in getter routine

This was not intended.

Closes #10708

2 years agourlapi: '%' is illegal in host names
Daniel Stenberg [Wed, 8 Mar 2023 12:49:09 +0000 (13:49 +0100)] 
urlapi: '%' is illegal in host names

Update test 1560 to verify

Ref: #10708
Closes #10711

2 years agoftp: make the 'ftpauth' a more normal 'char *'-array
Daniel Stenberg [Tue, 7 Mar 2023 14:19:09 +0000 (15:19 +0100)] 
ftp: make the 'ftpauth' a more normal 'char *'-array

Closes #10703

2 years agodoc: fix compiler warning in libcurl.m4
Evgeny Grin (Karlson2k) [Tue, 7 Mar 2023 18:37:12 +0000 (21:37 +0300)] 
doc: fix compiler warning in libcurl.m4

Current test for curl_free() may produce warnings with strict compiler
flags or even with default compiler flags with upcoming versions.
These warning could turned into errors by -Werror or similar flags.
Such warnings/errors are avoided by this patch.

Closes #10710

2 years agomisc: fix typos
Viktor Szakats [Wed, 8 Mar 2023 08:00:35 +0000 (08:00 +0000)] 
misc: fix typos

Closes #10706

2 years agoftp: active mode with SSL, add the damn filter
Stefan Eissing [Fri, 3 Mar 2023 14:15:31 +0000 (15:15 +0100)] 
ftp: active mode with SSL, add the damn filter

- since 7.87.0 we lost adding the SSL filter for an active
  FTP connection that uses SSL. This leads to hangers and timeouts
  as reported in #10666.

Reported-by: SandakovMM on github
Fixes #10666
Closes #10669

2 years agodocs: extend the URL API descriptions
Daniel Stenberg [Tue, 7 Mar 2023 10:01:15 +0000 (11:01 +0100)] 
docs: extend the URL API descriptions

Closes #10701

2 years agourl: fix logic in connection reuse to deny reuse on "unclean" connections
Stefan Eissing [Mon, 6 Mar 2023 11:44:45 +0000 (12:44 +0100)] 
url: fix logic in connection reuse to deny reuse on "unclean" connections

- add parameter to `conn_is_alive()` cfilter method that returns
  if there is input data waiting on the connection
- refrain from re-using connnection from the cache that have
  input pending
- adapt http/2 and http/3 alive checks to digest pending input
  to check the connection state
- remove check_cxn method from openssl as that was just doing
  what the socket filter now does.
- add tests for connection reuse with special server configs

Closes #10690

2 years agox509asn1: use plain %x, not %lx, when the arg is an int
Daniel Stenberg [Mon, 6 Mar 2023 10:32:55 +0000 (11:32 +0100)] 
x509asn1: use plain %x, not %lx, when the arg is an int

Pointed out by Coverity.

Closes #10689

2 years agohttp2: fix handling of RST and GOAWAY to recognize partial transfers
Stefan Eissing [Mon, 6 Mar 2023 16:16:01 +0000 (17:16 +0100)] 
http2: fix handling of RST and GOAWAY to recognize partial transfers

- a reset transfer (HTTP/2 RST) did not always lead to the proper
  error message on receiving its response, leading to wrong reports
  of a successful transfer
- test_05_02 was able to trigger this condition with increased transfer
  count. The simulated response errors did not carry a 'Content-Length'
  so only proper RST handling could detect the abort
- When doing such transfers in parallel, a connection could enter the
  state where
  a) it had been closed (GOAWAY received)
  b) the RST had not been "seen" for the transfer yet
  or c) the GOAWAY announced an error and the last successful
  stream id was not checked against ongoing transfers

Closes #10693

2 years agotests: use dynamic ports numbers in pytest suite
Stefan Eissing [Mon, 6 Mar 2023 15:11:11 +0000 (16:11 +0100)] 
tests: use dynamic ports numbers in pytest suite

- necessary ports are bound at start of test suite and then
  given to server fixtures for use.
- this make parallel use of pytest (in separate directories),
  practically safe for use as OS tend to not reuse such port numbers
  for a while

Closes #10692

2 years agoconnect: fix time_connect and time_appconnect timer statistics
Stefan Eissing [Fri, 3 Mar 2023 16:54:44 +0000 (17:54 +0100)] 
connect: fix time_connect and time_appconnect timer statistics

- time_connect was not updated when the overall connection failed,
  e.g. when SSL verification was unsuccessful, refs #10670
- rework gather those values to interrogate involved filters,
  also from all eyeballing attempts, to report the maximum of
  those values.
- added 3 test cases in test_06 to check reported values on
  successful, partially failed and totally failed connections.

Reported-by: Master Inspire
Fixes #10670
Closes #10671

2 years agotest1905: update output cookie order
Daniel Stenberg [Mon, 6 Mar 2023 07:19:35 +0000 (08:19 +0100)] 
test1905: update output cookie order

After the #10685 update

2 years agotest420: verify expiring cookies
Daniel Stenberg [Sun, 5 Mar 2023 23:19:35 +0000 (00:19 +0100)] 
test420: verify expiring cookies

Cookies that are loaded fine from a jar but then are expired in headers.

2 years agocookie: don't load cookies again when flushing
Daniel Stenberg [Sun, 5 Mar 2023 23:18:41 +0000 (00:18 +0100)] 
cookie: don't load cookies again when flushing

Reported-by: Sergio Mijatovic
Fixes #10677
Closes #10685

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 6 Mar 2023 14:48:54 +0000 (15:48 +0100)] 
RELEASE-NOTES: synced

2 years agodocs: note '--data-urlencode' option
andy5995 [Mon, 6 Mar 2023 07:00:38 +0000 (01:00 -0600)] 
docs: note '--data-urlencode' option

Closes #10687

2 years agoDEPRECATE: the original legacy mingw version 1
Daniel Stenberg [Fri, 3 Mar 2023 13:49:21 +0000 (14:49 +0100)] 
DEPRECATE: the original legacy mingw version 1

Remove completely in September 2023

Closes #10667

2 years agorand: use arc4random as fallback when available
Harry Sintonen [Sat, 4 Mar 2023 07:02:14 +0000 (09:02 +0200)] 
rand: use arc4random as fallback when available

Normally curl uses cryptographically strong random provided by the
selected SSL backend. If compiled without SSL support, a naive built-in
function was used instead.

Generally this was okay, but it will result in some downsides for non-
SSL builds, such as predictable temporary file names.

This change ensures that arc4random will be used instead, if available.

Closes #10672

2 years agotool: dump headers even if file is write-only
Grisha Levit [Sat, 4 Mar 2023 21:32:56 +0000 (16:32 -0500)] 
tool: dump headers even if file is write-only

The fixes in #10079 brought a (seemingly unrelated) change of open mode
from `wb`/`ab` to `wb+`/`ab+` for the headerfile. This makes it no
longer possible to write the header file to e.g. a pipe, like:

    curl -D >(grep ...) file:///dev/null

Which presently results in `Warning: Failed to open /dev/fd/63`

See #10079
Closes #10675

2 years agotests: fix gnutls-serv check
Jay Satiro [Mon, 6 Mar 2023 08:47:16 +0000 (03:47 -0500)] 
tests: fix gnutls-serv check

- If gnutls-serv doesn't exist then don't try to execute it.

Follow-up to 2fdc1d81.

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

2 years agolib1560: fix enumerated type mixed with another type
Daniel Stenberg [Sun, 5 Mar 2023 23:09:19 +0000 (00:09 +0100)] 
lib1560: fix enumerated type mixed with another type

Follow-up to c84c0f9aa3bb006

Closes #10684

2 years agocmake: fix enabling LDAPS on Windows
Viktor Szakats [Sun, 5 Mar 2023 19:55:14 +0000 (19:55 +0000)] 
cmake: fix enabling LDAPS on Windows

Before this patch, enabling LDAPS required a manual C flag:
https://github.com/curl/curl-for-win/blob/c1cfc31cfc04f24f7a4f946564d6f0e1b4d7dd36/curl-cmake.sh#L105

Fix this and enable LDAPS automatically when using `wldap32` (and
when not explicitly disabled). This matches autotools and `Makefile.mk`
behavior. Also remove issue from KNOWN_BUGS.

Add workaround for MSVS 2010 warning triggered by LDAPS now enabled
in more CI tests:
`ldap.c(360): warning C4306: 'type cast' : conversion from 'int' to 'void *' of greater size`
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/46408284/job/v8mwl9yfbmoeqwlr#L312

Reported-by: JackBoosY on github
Reviewed-by: Jay Satiro
Reviewed-by: Marcel Raad
Fixes #6284
Closes #10674

2 years agoMakefile.mk: delete redundant `HAVE_LDAP_SSL` macro [ci skip]
Viktor Szakats [Sun, 5 Mar 2023 19:52:21 +0000 (19:52 +0000)] 
Makefile.mk: delete redundant `HAVE_LDAP_SSL` macro [ci skip]

Since abebb2b8939c6b3e0f951eb2d9ec3729b569aa2c, we set this macro for
all Windows `wldap32` builds using `Makefile.mk`.

For OpenLDAP builds this macro is not enough to enable LDAPS, and
OpenLDAP is not an option in `Makefile.mk`. For Novell LDAP it might
have helped, but it's also not an option anymore in `Makefile.mk`.

The future for LDAPS is that we should enable it by default without
extra build knobs.

Reviewed-by: Marcel Raad
Closes #10681

2 years agocmake: skip CA-path/bundle auto-detection in cross-builds
Viktor Szakats [Sun, 5 Mar 2023 19:51:52 +0000 (19:51 +0000)] 
cmake: skip CA-path/bundle auto-detection in cross-builds

Also remove issue from KNOWN_BUGS.

Reported-by: Cristian Morales Vega
Reviewed-by: Marcel Raad
Fixes #6178
Closes #10676

2 years agoschannel: loop over the algos to pick the selected one
Daniel Stenberg [Wed, 1 Mar 2023 08:59:21 +0000 (09:59 +0100)] 
schannel: loop over the algos to pick the selected one

Avoid using the funny macro and the extra buffer copy.

Closes #10647

2 years agowildcard: remove files and move functions into ftplistparser.c
Daniel Stenberg [Tue, 28 Feb 2023 08:22:46 +0000 (09:22 +0100)] 
wildcard: remove files and move functions into ftplistparser.c

2 years agoftp: allocate the wildcard struct on demand
Daniel Stenberg [Mon, 27 Feb 2023 22:57:23 +0000 (23:57 +0100)] 
ftp: allocate the wildcard struct on demand

The feature is rarely used so this frees up data for the vast majority
of easy handles that don't use it.

Rename "protdata" to "ftpwc" since it is always an FTP wildcard struct
pointer. Made the state struct field an unsigned char to save space.

Closes #10639

2 years agolib1560: test parsing URLs with ridiculously large fields
Daniel Stenberg [Fri, 3 Mar 2023 07:32:45 +0000 (08:32 +0100)] 
lib1560: test parsing URLs with ridiculously large fields

In the order of 120K.

Closes #10665

2 years agourlapi: parse IPv6 literals without ENABLE_IPV6
Brad Spencer [Fri, 17 Feb 2023 20:01:05 +0000 (16:01 -0400)] 
urlapi: parse IPv6 literals without ENABLE_IPV6

This makes the URL parser API stable and working the same way
independently of libcurl supporting IPv6 transfers or not.

Closes #10660

2 years agobuild: drop the use of XC_AMEND_DISTCLEAN
Jan Engelhardt [Thu, 2 Mar 2023 15:08:22 +0000 (16:08 +0100)] 
build: drop the use of XC_AMEND_DISTCLEAN

Because automake used to delete depdirs at once (.deps) and there was an issue
with portability, curl's XC_AMEND_DISTCLEAN greps the Makefiles in an attempt
to build a list of all depfiles and delete them individually instead.

Since commit 08849db866b44510f6b8fd49e313c91a43a3dfd3, automake switched from
deleting directories to individual files. curl's custom logic now finds a lot
more results with the grep (the filtering of these results isn't great), which
causes a massive bloating of the Makefile in the order of O(n^2).

Also remove now-unused XC_AMEND_DISTCLEAN macro group

References: https://github.com/curl/curl/issues/9843
References: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59288

Reported-by: Ilmari Lauhakangas
Fixes #9843
Closes #10661

2 years agotest1470: test socks proxy using unix sockets and connect to https
Balakrishnan Balasubramanian [Thu, 2 Mar 2023 17:16:13 +0000 (12:16 -0500)] 
test1470: test socks proxy using unix sockets and connect to https

Similar to test1468 except using https instead of http

Closes #10662

2 years agotest1960: verify CURL_SOCKOPT_ALREADY_CONNECTED
Daniel Stenberg [Wed, 1 Mar 2023 10:39:17 +0000 (11:39 +0100)] 
test1960: verify CURL_SOCKOPT_ALREADY_CONNECTED

When returned from the CURLOPT_SOCKOPTFUNCTION, like when we have a
custom socket connected in the app, passed in to libcurl.

Verifies the fix in #10648

Closes #10651

2 years agotests: rename tests/tests-httpd to tests/http
Stefan Eissing [Wed, 1 Mar 2023 15:55:31 +0000 (16:55 +0100)] 
tests: rename tests/tests-httpd to tests/http

 - httpd is only one server we test with
 - the suite coveres the HTTP protocol in general where
   the default test cases need a more beefy environment

Closes #10654

2 years agosocket: detect "dead" connections better, e.g. not fit for reuse
Stefan Eissing [Wed, 1 Mar 2023 12:05:09 +0000 (13:05 +0100)] 
socket: detect "dead" connections better, e.g. not fit for reuse

- refs #10646 where reuse was attempted on closed connections in the
  cache, leading to an exhaustion of retries on a transfer
- the mistake was that poll events like POLLHUP, POLLERR, etc
  were regarded as "not dead".
- change cf-socket filter check to regard such events as inidication
  of corpsiness.
- vtls filter checks: fixed interpretation of backend check result
  when inconclusive to interrogate status further down the filter
  chain.

Reported-by: SendSonS on github
Fixes #10646
Closes #10652

2 years agolib: give source files cf-http.* better fitting names
Stefan Eissing [Wed, 1 Mar 2023 15:40:22 +0000 (16:40 +0100)] 
lib: give source files cf-http.* better fitting names

Closes #10656

2 years agohttp2: fix code indent
Stefan Eissing [Wed, 1 Mar 2023 15:18:12 +0000 (16:18 +0100)] 
http2: fix code indent

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

2 years agocf-socket: if socket is already connected, return CURLE_OK
Shankar Jadhavar [Wed, 1 Mar 2023 09:02:08 +0000 (14:32 +0530)] 
cf-socket: if socket is already connected, return CURLE_OK

In 7.87.0, if callback method for CURLOPT_SOCKOPTFUNCTION returns
CURL_SOCKOPT_ALREADY_CONNECTED then curl library used to return
CURLE_OK.  n 7.88.0, now even if callback returns
CURL_SOCKOPT_ALREADY_CONNECTED, curl library still tries to connect to
socket by invoking method do_connect().

This is regression caused by commit
https://github.com/curl/curl/commit/71b7e0161032927cdfb

Fix: Check if we are already connected and return CURLE_OK.

Fixes #10626
Closes #10648

2 years agoDYNBUF.md: note Curl_dyn_add* calls Curl_dyn_free on failure
Jay Satiro [Wed, 1 Mar 2023 03:45:28 +0000 (22:45 -0500)] 
DYNBUF.md: note Curl_dyn_add* calls Curl_dyn_free on failure

This is the existing behavior and it has been widely assumed in the
codebase.

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

2 years agohttp2: fix upload busy loop
Stefan Eissing [Thu, 9 Feb 2023 09:16:50 +0000 (10:16 +0100)] 
http2: fix upload busy loop

- Set KEEP_SEND_PAUSE when exhausting remote HTTP/2 window size of a
  stream.

- Clear KEEP_SEND_PAUSE when receiving HTTP/2 window updates on a paused
  stream.

- Also fix http2 send compiler warnings reported in #10449.

Prior to this change, starting in 71b7e016 which precedes 7.88.0,
libcurl may eat CPU during HTTP/2 upload.

Reported-by: Jay Satiro
Fixes https://github.com/curl/curl/issues/10449
Fixes https://github.com/curl/curl/issues/10618
Closes https://github.com/curl/curl/pull/10627

2 years agosectransp: make read_cert() use a dynbuf when loading
Daniel Stenberg [Mon, 27 Feb 2023 19:36:22 +0000 (20:36 +0100)] 
sectransp: make read_cert() use a dynbuf when loading

Closes #10632

2 years agotransfer: limit Windows SO_SNDBUF updates to once a second
Jay Satiro [Sun, 26 Feb 2023 08:44:38 +0000 (03:44 -0500)] 
transfer: limit Windows SO_SNDBUF updates to once a second

- Change readwrite_upload() to call win_update_buffer_size() no more
  than once a second to update SO_SNDBUF (send buffer limit).

Prior to this change during an upload readwrite_upload() could call
win_update_buffer_size() anywhere from hundreds of times per second to
an extreme test case of 100k per second (which is likely due to a bug,
see #10618). In the latter case WPA profiler showed
win_update_buffer_size was the highest capture count in
readwrite_upload. In any case the calls were excessive and unnecessary.

Ref: https://github.com/curl/curl/pull/2762

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

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 28 Feb 2023 22:08:14 +0000 (23:08 +0100)] 
RELEASE-NOTES: synced

2 years agohttp2: fix for http2-prior-knowledge when reusing connections
Stefan Eissing [Tue, 28 Feb 2023 10:43:50 +0000 (11:43 +0100)] 
http2: fix for http2-prior-knowledge when reusing connections

- refs #10634 where errors in the HTTP/2 framing layer are observed.
- the bug was that on connection reuse, the code attempted to switch
  in yet another layer of HTTP/2 handling instead of detecting that
  this was already in place.
- added pytest testcase reproducing the issue.

Reported-by: rwmjones on github
Fixes #10634
Closes #10643

2 years agocf-socket: fix handling of remote addr for accepted tcp sockets
Stefan Eissing [Tue, 28 Feb 2023 10:05:06 +0000 (11:05 +0100)] 
cf-socket: fix handling of remote addr for accepted tcp sockets

- do not try to determine the remote address of a listen socket. There
  is none.
- Update remote address of an accepted socket by getpeername() if
  available.

Reported-by: Harry Sintonen
Fixes #10622
Closes #10642

2 years agohttp: fix unix domain socket use in https connects
Stefan Eissing [Tue, 28 Feb 2023 09:07:21 +0000 (10:07 +0100)] 
http: fix unix domain socket use in https connects

- when h2/h3 eyeballing was involved, unix domain socket
  configurations were not honoured
- configuring --unix-socket will disable HTTP/3 as candidate for eyeballing
- combinatino of --unix-socket and --http3-only will fail during initialisation
- adding pytest test_11 to reproduce

Reported-by: Jelle van der Waa
Fixes #10633
Closes #10641

2 years agosetopt: move the CURLOPT_CHUNK_DATA pointer to the set struct
Daniel Stenberg [Mon, 27 Feb 2023 22:44:39 +0000 (23:44 +0100)] 
setopt: move the CURLOPT_CHUNK_DATA pointer to the set struct

To make duphandle work etc

Closes #10635

2 years agoquic/schannel: fix compiler warnings
Viktor Szakats [Mon, 27 Feb 2023 00:19:58 +0000 (00:19 +0000)] 
quic/schannel: fix compiler warnings

Fixes #10603
Closes #10616

2 years agopage-footer: add explanation for three missing exit codes
Daniel Stenberg [Mon, 27 Feb 2023 18:47:28 +0000 (19:47 +0100)] 
page-footer: add explanation for three missing exit codes

Added in 7.73.0, 7.77.0 and 7.84.0

Closes #10630

2 years agorate.c: single URLs make no sense in --rate example
積丹尼 Dan Jacobson [Tue, 28 Feb 2023 01:36:30 +0000 (09:36 +0800)] 
rate.c: single URLs make no sense in --rate example

Here somehow you need to put more than one URL in these examples, else
they will make no sense, as --rate only affects the second and beyond
URLs. The first URL will always finish the same time no matter what
--rate is given.

Closes #10638

2 years agolibcurl-errors.3: add the CURLHcode errors from curl_easy_header.3
Daniel Stenberg [Mon, 27 Feb 2023 18:43:35 +0000 (19:43 +0100)] 
libcurl-errors.3: add the CURLHcode errors from curl_easy_header.3

Closes #10629

2 years agomqtt: on send error, return error
Daniel Stenberg [Mon, 27 Feb 2023 09:02:22 +0000 (10:02 +0100)] 
mqtt: on send error, return error

Reported-by: Maciej Domanski
Closes #10623

2 years agows: keep the socket non-blocking
Daniel Stenberg [Mon, 27 Feb 2023 15:55:57 +0000 (16:55 +0100)] 
ws: keep the socket non-blocking

Reported-by: marski on github
Fixes #10615
Closes #10625

2 years agohostip: avoid sscanf and extra buffer copies
Daniel Stenberg [Fri, 24 Feb 2023 08:20:51 +0000 (09:20 +0100)] 
hostip: avoid sscanf and extra buffer copies

Also made create_hostcache_id() return the id length.

Closes #10601

2 years agoPARALLEL-TRANSFERS.md: not "early days" for this anymore
Daniel Stenberg [Mon, 27 Feb 2023 15:41:36 +0000 (16:41 +0100)] 
PARALLEL-TRANSFERS.md: not "early days" for this anymore

Refresh the language as the support is now over three years old

Closes #10624

2 years agoeasy: remove infof() debug leftover from curl_easy_recv
Daniel Stenberg [Mon, 27 Feb 2023 17:12:07 +0000 (18:12 +0100)] 
easy: remove infof() debug leftover from curl_easy_recv

It said "reached [path]/easy.c:1231"

Closes #10628

2 years agoidn: return error if the conversion ends up with a blank host
Daniel Stenberg [Fri, 24 Feb 2023 17:17:33 +0000 (18:17 +0100)] 
idn: return error if the conversion ends up with a blank host

Some IDN sequences are converted into "" (nothing), which can make this
function end up with a zero length host name and we cannot consider that
a valid host to continue with.

Reported-by: Maciej Domanski
Closes #10617

2 years agoexamples/http3.c: use CURL_HTTP_VERSION_3
Daniel Stenberg [Mon, 27 Feb 2023 09:12:59 +0000 (10:12 +0100)] 
examples/http3.c: use CURL_HTTP_VERSION_3

and update the comment

Closes #10619

2 years agox509asn1.c: use correct format specifier for infof() call
Daniel Stenberg [Sun, 26 Feb 2023 22:03:33 +0000 (23:03 +0100)] 
x509asn1.c: use correct format specifier for infof() call

Detected by Coverity

Closes #10614

2 years agoRevert "GHA: add Microsoft C++ Code Analysis"
Daniel Stenberg [Sun, 26 Feb 2023 16:38:53 +0000 (17:38 +0100)] 
Revert "GHA: add Microsoft C++ Code Analysis"

This reverts commit e0db842b2a082dffad4a9fbe31321e9a75c74041.

This tool seems very restricted in how often it might be used by a
project and thus very quickly start to report fails simply because it
refuses to run when "there are more runs than allowed".

Closes #10613

2 years agotests: test secure mail protocols with explicit SSL requests
Patrick Monnerat [Sat, 25 Feb 2023 10:49:31 +0000 (11:49 +0100)] 
tests: test secure mail protocols with explicit SSL requests

New tests 987, 988 and 989, disabled for rustls (hanging).

Closes #10077

2 years agotests: support for imaps/pop3s/smtps protocols
Patrick Monnerat [Sat, 25 Feb 2023 10:49:31 +0000 (11:49 +0100)] 
tests: support for imaps/pop3s/smtps protocols

Closes #10077

2 years agoruntests: use a hash table for server port numbers
Patrick Monnerat [Sat, 25 Feb 2023 10:49:31 +0000 (11:49 +0100)] 
runtests: use a hash table for server port numbers

Closes #10077

2 years agoINTERNALS.md: grammar
andy5995 [Sat, 25 Feb 2023 07:00:40 +0000 (01:00 -0600)] 
INTERNALS.md: grammar

Closes #10607

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 24 Feb 2023 23:20:06 +0000 (00:20 +0100)] 
RELEASE-NOTES: synced

2 years ago.cirrus.yml: Bump to FreeBSD 13.2
Philip H [Tue, 10 Jan 2023 11:11:23 +0000 (12:11 +0100)] 
.cirrus.yml: Bump to FreeBSD 13.2

Closes #10270