]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
2 years agotests: increase sws timeout for more robust testing
Stefan Eissing [Thu, 6 Apr 2023 09:19:46 +0000 (11:19 +0200)] 
tests: increase sws timeout for more robust testing

- for https CONNECT forwarding, this was fixed at 5 seconds
  which led to spurious CI test failures
- add --keepalive parameter to sws to control this
- let httpserver use 30 seconds

Closes #10898

2 years agohttp2: move HTTP/2 stream vars into local context
Stefan Eissing [Thu, 6 Apr 2023 09:59:12 +0000 (11:59 +0200)] 
http2: move HTTP/2 stream vars into local context

- remove NGHTTP2 members of `struct HTTP`
- add `void *h2_ctx` to `struct HTTP`
- add `void *h3_ctx` to `struct HTTP`
- separate h2/h3 pointers are needed for eyeballing
- manage local stream_ctx in http implementations

Closes #10877

2 years agoproxy: http2 proxy tunnel implementation
Stefan Eissing [Thu, 6 Apr 2023 07:54:57 +0000 (09:54 +0200)] 
proxy: http2 proxy tunnel implementation

- currently only on debug build and when env variable
  CURL_PROXY_TUNNEL_H2 is present.
- will ALPN negotiate with the proxy server and switch
  tunnel filter based on the protocol negotiated.
- http/1.1 tunnel code moved into cf-h1-proxy.[ch]
- http/2 tunnel code implemented in cf-h2-proxy.[ch]
- tunnel start and ALPN set remains in http_proxy.c
- moving all haproxy related code into cf-haproxy.[ch]

VTLS changes
- SSL filters rely solely on the "alpn" specification they
  are created with and no longer check conn->bits.tls_enable_alpn.
- checks on which ALPN specification to use (or none at all) are
  done in vtls.c when creating the filter.

Testing
- added a nghttpx forward proxy to the pytest setup that
  speaks HTTP/2 and forwards all requests to the Apache httpd
  forward proxy server.
- extending test coverage in test_10 cases
- adding proxy tests for direct/tunnel h1/h2 use of basic auth.
- adding test for http/1.1 and h2 proxy tunneling to pytest

Closes #10780

2 years agovtls and h2 improvements
Stefan Eissing [Wed, 5 Apr 2023 12:52:16 +0000 (14:52 +0200)] 
vtls and h2 improvements

- eliminate receive loop in vtls to fill buffer. This may
  lead to partial reads of data which is counter productive
- let http2 instead loop smarter to process pending network
  data without transfer switches

scorecard improvements
- do not start caddy when only httpd is requested
- allow curl -v to stderr file on --curl-verbose

Closes #10891

2 years agotests: 1078 1288 1297 use valid IPv4 addresses
Daniel Stenberg [Wed, 5 Apr 2023 21:44:44 +0000 (23:44 +0200)] 
tests: 1078 1288 1297 use valid IPv4 addresses

With the enhanced URL parser, these tests failed because of their bad
IPv4 use.

2 years agourlapi: detect and error on illegal IPv4 addresses
Daniel Stenberg [Wed, 5 Apr 2023 21:13:33 +0000 (23:13 +0200)] 
urlapi: detect and error on illegal IPv4 addresses

Using bad numbers in an IPv4 numerical address now returns
CURLUE_BAD_HOSTNAME.

I noticed while working on trurl and it was originally reported here:
https://github.com/curl/trurl/issues/78

Updated test 1560 accordingly.

Closes #10894

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 5 Apr 2023 06:34:30 +0000 (08:34 +0200)] 
RELEASE-NOTES: synced

2 years agourlapi: URL encoding for the URL missed the fragment
Daniel Stenberg [Tue, 4 Apr 2023 14:59:59 +0000 (16:59 +0200)] 
urlapi: URL encoding for the URL missed the fragment

Meaning that it would wrongly still store the fragment using spaces
instead of %20 if allowing space while also asking for URL encoding.

Discovered when playing with trurl.

Added test to lib1560 to verify the fix.

Closes #10887

2 years agortsp: convert mallocs to dynbuf for RTP buffering
Daniel Stenberg [Tue, 4 Apr 2023 12:44:25 +0000 (14:44 +0200)] 
rtsp: convert mallocs to dynbuf for RTP buffering

Closes #10786

2 years agotool_writeout: add URL component variables
Daniel Stenberg [Tue, 4 Apr 2023 12:42:44 +0000 (14:42 +0200)] 
tool_writeout: add URL component variables

Output specific components from the used URL. The following variables
are added for this purpose:

  url.scheme, url.user, url.password, url.options, url.host, url.port,
  url.path, url.query, url.fragment, url.zoneid

Add the following for outputting parts of the "effective URL":

 urle.scheme, urle.user, urle.password, urle.options, urle.host, urle.port,
 urle.path, urle.query, urle.fragment, urle.zoneid

Added test 423 and 424 to verify.

Closes #10853

2 years agotests/http: improved httpd detection
Stefan Eissing [Mon, 3 Apr 2023 09:58:21 +0000 (11:58 +0200)] 
tests/http: improved httpd detection

- better error messages when not found/complete
- handling of `--without-test-httpd`

Reported-by: kwind on github
Fixes #10879
Closes #10883

2 years agoconfigure: make quiche require quiche_conn_send_ack_eliciting
Daniel Stenberg [Tue, 4 Apr 2023 08:47:35 +0000 (10:47 +0200)] 
configure: make quiche require quiche_conn_send_ack_eliciting

curl now requires quiche version >= 1.17.1 to be used and this function
was added in this version and makes a convenient check.

This requirement is because this is the lowest quiche version that
supports peer-initiated key updates correctly.

Closes #10886

2 years agounit tests: use the unit test infrastructure better
Dan Fandrich [Sat, 1 Apr 2023 15:59:38 +0000 (08:59 -0700)] 
unit tests: use the unit test infrastructure better

Allow UNITTEST_STOP to return the error code, use the fail & abort
macros to indicate test failure and return success instead of fail if
the unit test can't test anything because of missing features at
compile-time.  A couple of tests could never fail because they were
overriding the failure return code.

2 years agoruntests: strip EOL on precheck output on Windows, too
Dan Fandrich [Fri, 31 Mar 2023 21:23:46 +0000 (14:23 -0700)] 
runtests: strip EOL on precheck output on Windows, too

Precheck failures would show on two lines in the test summary output
otherwise.

2 years agotests: move server config files under the pid dir
Dan Fandrich [Fri, 31 Mar 2023 04:32:17 +0000 (21:32 -0700)] 
tests: move server config files under the pid dir

These files are generated by the test servers and must therefore be
found in the log directory to make them available to only those servers
once multiple test runners are executing in parallel. They must also not
be deleted with the log files, so they are stored in the pidfile
directory.

Ref: #10818
Closes #10875

2 years agoruntests: use the ssh key filenames from the sshhelp package
Dan Fandrich [Fri, 31 Mar 2023 02:42:06 +0000 (19:42 -0700)] 
runtests: use the ssh key filenames from the sshhelp package

2 years agotests: move pidfiles and portfiles under the log directory
Dan Fandrich [Thu, 30 Mar 2023 20:25:17 +0000 (13:25 -0700)] 
tests: move pidfiles and portfiles under the log directory

This is to segregate all files written by a test process into a single
root to allow for future parallel testing.

Ref: #10818
Closes #10874

2 years agoruntests: minor code cleanups
Dan Fandrich [Thu, 30 Mar 2023 19:21:06 +0000 (12:21 -0700)] 
runtests: minor code cleanups

2 years agoruntests: call processexists() and pidfromfile()
Dan Fandrich [Thu, 30 Mar 2023 19:01:25 +0000 (12:01 -0700)] 
runtests: call processexists() and pidfromfile()

rather than duplicating the logic in several places.

2 years agocmake: do not add zlib headers for openssl
Viktor Szakats [Fri, 31 Mar 2023 18:03:43 +0000 (18:03 +0000)] 
cmake: do not add zlib headers for openssl

Logic copied earlier from wolfSSL. wolfSSL requires zlib headers for its
public headers. OpenSSL does not, so stop adding zlib headers for it.

Follow-up to 1e3319a167d2f32d295603167486e9e88af9bb4e

Closes #10878

2 years agorustls: fix error in recv handling
Stefan Eissing [Fri, 31 Mar 2023 09:07:18 +0000 (11:07 +0200)] 
rustls: fix error in recv handling

- when rustls is told to recieve more TLS data and its internal
  plaintext buffers are full, it returns an IOERROR
- avoid receiving TLS data while plaintext is not read empty

pytest:
- increase curl run timeout when invoking pytest with higher verbosity

Closes #10876

2 years agohttp3: improvements across backends
Stefan Eissing [Thu, 30 Mar 2023 11:00:51 +0000 (13:00 +0200)] 
http3: improvements across backends

- ngtcp2: using bufq for recv stream data
- internal stream_ctx instead of `struct HTTP` members
  for quiche, ngtcp2 and msh3
- no more QUIC related members in `struct HTTP`
- experimental use of recvmmsg(), disabled by default
  - testing on my old debian box shows no throughput improvements.
  - leaving it in, but disabled, for future revisit
- vquic: common UDP receive code for ngtcp2 and quiche
- vquic: common UDP send code for ngtcp2 and quiche
- added pytest skips for known msh3 failures
- fix unit2601 to survive torture testing
- quiche: using latest `master` from quiche and enabling large download
  tests, now that key change is supported
- fixing test_07_21 where retry handling of starting a stream
  was faulty
- msh3: use bufq for recv buffering headers and data
- msh3: replace fprintf debug logging with LOG_CF where possible
- msh3: force QUIC expire timers on recv/send to have more than
  1 request per second served

Closes #10772

2 years agotest1471/2: add http as a required feature
Dan Fandrich [Fri, 31 Mar 2023 06:53:19 +0000 (23:53 -0700)] 
test1471/2: add http as a required feature

curl bails out early with a different error message if http support is
compiled out.

Ref: #10705

2 years agotests: limit return code of unit tests and lib tests
Dan Fandrich [Fri, 31 Mar 2023 02:13:38 +0000 (19:13 -0700)] 
tests: limit return code of unit tests and lib tests

Values greater than 125 have special meanings, so cap it there.  Unit
tests and lib tests use the number of failures as the return code, so a
large number of failures (such as test 2601 as a torture test) can
exceed this causing the test to be erroneously reported as having
failed.

Ref: #10720

2 years agotest1960: point to the correct path for the precheck tool
Dan Fandrich [Thu, 30 Mar 2023 22:36:29 +0000 (15:36 -0700)] 
test1960: point to the correct path for the precheck tool

Otherwise, it might find the binary in .libs which can cause it to use
the system libcurl which can fail. This error is only visible by
noticing that the test is skipped.

Follow-up to e4dfe6fc

Ref: #10651

2 years agotests: use the proper %LOGDIR path on two tests
Dan Fandrich [Thu, 30 Mar 2023 22:34:16 +0000 (15:34 -0700)] 
tests: use the proper %LOGDIR path on two tests

Follow-up to e7a021e1

Ref: #10818

2 years agortsp: fix Value stored to 'skip_size' is never read
Daniel Stenberg [Thu, 30 Mar 2023 21:09:12 +0000 (23:09 +0200)] 
rtsp: fix Value stored to 'skip_size' is never read

Pointed out by scan-build

Follow-up to 6c6306f3008f2c9b20a64

Closes #10872

2 years agotests/http: relax connection check in test_07_02
Stefan Eissing [Thu, 30 Mar 2023 14:30:40 +0000 (16:30 +0200)] 
tests/http: relax connection check in test_07_02

Only 1 connection will be used when curl is slow, happens when
address-sanitized in CI, for example

Closes #10865

2 years agohttp2: flow control and buffer improvements
Stefan Eissing [Thu, 30 Mar 2023 10:13:49 +0000 (12:13 +0200)] 
http2: flow control and buffer improvements

- use bufq for send/receive of network data
- usd bufq for send/receive of stream data
- use HTTP/2 flow control with no-auto updates to control the
  amount of data we are buffering for a stream
  HTTP/2 stream window set to 128K after local tests, defined
  code constant for now
- elminiating PAUSEing nghttp2 processing when receiving data
  since a stream can now take in all DATA nghttp2 forwards

Improved scorecard and adjuste http2 stream window sizes
- scorecard improved output formatting and options default
- scorecard now also benchmarks small requests / second

Closes #10771

2 years agoruntests: show error message if file can't be written
Dan Fandrich [Wed, 29 Mar 2023 21:15:16 +0000 (14:15 -0700)] 
runtests: show error message if file can't be written

2 years agotests: fix remaining servers to run with a dynamic log directory
Dan Fandrich [Wed, 29 Mar 2023 18:27:53 +0000 (11:27 -0700)] 
tests: fix remaining servers to run with a dynamic log directory

This final commit in the series is sufficient to allow the tests succeed
if $LOGDIR is changed in runtests.pl.

Ref: #10818
Closes #10866

2 years agotests: fix fake_ntlm to run with a dynamic log directory
Dan Fandrich [Wed, 29 Mar 2023 19:20:02 +0000 (12:20 -0700)] 
tests: fix fake_ntlm to run with a dynamic log directory

Ref: #10818

2 years agotests: fix http servers to run with a dynamic log directory
Dan Fandrich [Wed, 29 Mar 2023 15:54:57 +0000 (08:54 -0700)] 
tests: fix http servers to run with a dynamic log directory

Ref: #10818

2 years agotests: fix ftpserver to run with a dynamic log directory
Dan Fandrich [Wed, 29 Mar 2023 15:48:03 +0000 (08:48 -0700)] 
tests: fix ftpserver to run with a dynamic log directory

Ref: #10818

2 years agotests: fix C servers to run with a dynamic log directory
Dan Fandrich [Wed, 29 Mar 2023 17:23:28 +0000 (10:23 -0700)] 
tests: fix C servers to run with a dynamic log directory

Ref: #10818

2 years agotests: fix lib tests to run with a dynamic log directory
Dan Fandrich [Wed, 29 Mar 2023 15:29:29 +0000 (08:29 -0700)] 
tests: fix lib tests to run with a dynamic log directory

Ref: #10818

2 years agotests: fix unit tests to run with a dynamic log directory
Dan Fandrich [Wed, 29 Mar 2023 05:30:50 +0000 (22:30 -0700)] 
tests: fix unit tests to run with a dynamic log directory

Ref: #10818

2 years agotests: use %LOGDIR to refer to the log directory
Dan Fandrich [Wed, 29 Mar 2023 01:20:54 +0000 (18:20 -0700)] 
tests: use %LOGDIR to refer to the log directory

This will allow it be set dynamically.

Ref: #10818

2 years agoruntests: track verification time even if no files to compare
Dan Fandrich [Wed, 29 Mar 2023 04:14:13 +0000 (21:14 -0700)] 
runtests: track verification time even if no files to compare

2 years agogetpart: better handle case of file not found
Dan Fandrich [Wed, 29 Mar 2023 04:07:06 +0000 (21:07 -0700)] 
getpart: better handle case of file not found

2 years agotestcurl: bump version date
Dan Fandrich [Tue, 28 Mar 2023 22:14:54 +0000 (15:14 -0700)] 
testcurl: bump version date

It hadn't been updated in 9 years; it's time.

2 years agotests: switch to 3-argument open in test suite
Dan Fandrich [Tue, 28 Mar 2023 20:29:36 +0000 (13:29 -0700)] 
tests: switch to 3-argument open in test suite

The perl 2-argument open has been considered not-quite-deprecated since
the 3-argument form was introduced almost a quarter century ago.

2 years agotests: silence some Perl::Critic warnings in test suite
Dan Fandrich [Tue, 28 Mar 2023 02:58:00 +0000 (19:58 -0700)] 
tests: silence some Perl::Critic warnings in test suite

Not all warnings are fixed; many are as much stylistic suggestions than
anything and IMHO don't do much to actually improve the code.

Ref: #10818
Closes #10861

2 years agodocs: bump the minimum perl version to 5.6
Dan Fandrich [Tue, 28 Mar 2023 04:09:55 +0000 (21:09 -0700)] 
docs: bump the minimum perl version to 5.6

It's actually been this way since at least 2012 (when a 3-argument open
was added to runtests.pl). Given the lack of complaints in the interim,
it's safe to call this 23 year old perl version the minimum.

2 years agoruntests: memoize the getpart* subroutines to speed up access
Dan Fandrich [Fri, 24 Mar 2023 20:08:06 +0000 (13:08 -0700)] 
runtests: memoize the getpart* subroutines to speed up access

The refactored code calls these functions with the same arguments more
often, so this prevents redundant test case file parsing.

Approved-by: Daniel Stenberg
Ref: #10818
Closes #10833

2 years agoruntests: remove duplicated feature variables
Dan Fandrich [Fri, 24 Mar 2023 00:29:59 +0000 (17:29 -0700)] 
runtests: remove duplicated feature variables

Use the feature map stored in the hash table instead. Most of the
variables were only used only once, to set the value in the hash table.

Ref: #10818

2 years agoruntests: also ignore test file problems when ignoring results
Dan Fandrich [Fri, 24 Mar 2023 21:20:32 +0000 (14:20 -0700)] 
runtests: also ignore test file problems when ignoring results

This simplifies error handling in the test verification code and makes
it more consistent.

Ref: #10818

2 years agoruntests: more refactoring for clarity
Dan Fandrich [Thu, 23 Mar 2023 21:38:21 +0000 (14:38 -0700)] 
runtests: more refactoring for clarity

Ref: #10818

2 years agoruntests: don't start servers if -l is given
Dan Fandrich [Thu, 23 Mar 2023 20:30:32 +0000 (13:30 -0700)] 
runtests: don't start servers if -l is given

2 years agoruntests: fix typos
Dan Fandrich [Thu, 23 Mar 2023 18:31:54 +0000 (11:31 -0700)] 
runtests: fix typos

2 years agoruntests: refactor singletest() into separate functions
Dan Fandrich [Wed, 22 Mar 2023 23:48:23 +0000 (16:48 -0700)] 
runtests: refactor singletest() into separate functions

This takes it from a 1200 line behemoth into something more manageable.
The content and order of the functions is taken almost directly from
singletest() so the diff sans whitespace is quite short.

Ref: #10818

2 years agoruntests: refactor singletest() into distinct sections
Dan Fandrich [Wed, 22 Mar 2023 20:35:06 +0000 (13:35 -0700)] 
runtests: refactor singletest() into distinct sections

Namely:
- Verify that this test case should be run
- Start the servers needed to run this test case
- Check that test environment is fine to run this test case
- Prepare the test environment to run this test case
- Run the test command
- Clean up after test command
- Verify test succeeded

Ref: #10818

2 years agoruntests: stop copying a few arrays where not needed
Dan Fandrich [Wed, 22 Mar 2023 19:13:49 +0000 (12:13 -0700)] 
runtests: stop copying a few arrays where not needed

Unlike some other languages that just copy a pointer, perl copies the
entire array contents which takes time for a large array.

Ref: #10818

2 years agoruntests: reduce redundant calls to getpart/getpartattr
Dan Fandrich [Wed, 22 Mar 2023 18:51:47 +0000 (11:51 -0700)] 
runtests: reduce redundant calls to getpart/getpartattr

These functions scan through the entire test file every time to find the
right section, so they can be slow for large test files.

Ref: #10818

2 years agotests: document that the unittest keyword is special
Dan Fandrich [Wed, 22 Mar 2023 21:52:24 +0000 (14:52 -0700)] 
tests: document that the unittest keyword is special

Also, add other features that were missing.

2 years agodocs: add documentation for bufq
Stefan Eissing [Thu, 30 Mar 2023 13:02:01 +0000 (15:02 +0200)] 
docs: add documentation for bufq

Closes #10869

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 30 Mar 2023 14:13:29 +0000 (16:13 +0200)] 
RELEASE-NOTES: synced

2 years agohostip: refuse to resolve the .onion TLD
Matt Jolly [Tue, 7 Mar 2023 15:16:45 +0000 (02:16 +1100)] 
hostip: refuse to resolve the .onion TLD

RFC 7686 states that:

> Applications that do not implement the Tor
> protocol SHOULD generate an error upon the use of .onion and
> SHOULD NOT perform a DNS lookup.

Let's do that.

https://www.rfc-editor.org/rfc/rfc7686#section-2

Add test 1471 and 1472 to verify

Fixes #543
Closes #10705

2 years agoGHA: update ngtcp2-*.yml to v0.10.0
Philip H [Sun, 26 Feb 2023 13:39:19 +0000 (14:39 +0100)] 
GHA: update ngtcp2-*.yml to v0.10.0

Closes #10612

2 years agotests/http: fix log formatting on wrong exit code
Stefan Eissing [Thu, 30 Mar 2023 09:20:24 +0000 (11:20 +0200)] 
tests/http: fix log formatting on wrong exit code

Closes #10868

2 years agospellcheck.words: unify the AWS-LC spelling
Daniel Stenberg [Thu, 30 Mar 2023 08:57:57 +0000 (10:57 +0200)] 
spellcheck.words: unify the AWS-LC spelling

Follow-up to 34ef4fab22d93

Closes #10867

2 years agoopenssl: interop with AWS-LC
Jim King [Wed, 18 Jan 2023 16:54:30 +0000 (11:54 -0500)] 
openssl: interop with AWS-LC

* Configure changes to detect AWS-LC
* CMakeLists.txt changes to detect AWS-LC
* Compile-time branches needed to support AWS-LC
* Correctly set OSSL_VERSION and report AWS-LC release number
* GitHub Actions script to build with autoconf and cmake against AWS-LC

AWS-LC is a BoringSSL/OpenSSL derivative
For more information see https://github.com/awslabs/aws-lc/

Closes #10320

2 years agocmake: picky-linker fixes for openssl, ZLIB, H3 and more
Viktor Szakats [Thu, 30 Mar 2023 08:55:20 +0000 (08:55 +0000)] 
cmake: picky-linker fixes for openssl, ZLIB, H3 and more

- fix HTTP/3 support detection with OpenSSL/quictls built with ZLIB.
  (Requires curl be built with ZLIB option also.)

- fix HTTP/3 support detection with OpenSSL/quictls/LibreSSL and `ld`
  linker on Windows.

- fix HTTP/3 support detection with wolfSSL to automatically add
  `ws2_32` to the lib list on Windows. For all linkers.

- reposition ZLIB (and other compression) detection _after_ TLS
  detection, but before calling HTTP/3-support detection via
  `CheckQuicSupportInOpenSSL`.

  May be a regression from ebef55a61df0094b9790710a42f63c48e7de3c13
  May fix #10832 (Reported-by: Micah Snyder)

  This also seems to fix an odd case, where OpenSSL/quictls is correctly
  detected, but its header path is not set while compiling, breaking
  build at `src/curl_ntlm_core.c`. Reason for this remains undiscovered.

- satisfy "picky" linkers such as `ld` with MinGW, that are highly
  sensitive to lib order, by also adding brotli to the beginning of the
  lib list.

- satisfy "picky" linkers by adding certain Windows systems libs to
  the lib list for OpenSSL/LibreSSL. (Might need additional ones for
  other forks, such as `pthread` for BoringSSL.)

Note: It'd make sense to _always_ add `ws2_32`, `crypt32` (except
Windows App targets perhaps?), `bcrypt` (except old-mingw!) on Windows
at this point. They are almost always required, and if some aren't,
they are ignored by the linker with no effect on final binaries.

Closes #10857

2 years agovlts: use full buffer size when receiving data if possible
Stefan Eissing [Fri, 10 Mar 2023 12:00:15 +0000 (13:00 +0100)] 
vlts: use full buffer size when receiving data if possible

SSL backends like OpenSSL/wolfSSL and other return the content of one
TLS record on read, but usually there are more available.

Change the vtls cfilter recv() function to fill the given buffer until a
read would block.

Closes #10736

2 years agortsp: skip malformed RTSP interleaved frame data
dengjfzh [Tue, 21 Mar 2023 07:45:59 +0000 (15:45 +0800)] 
rtsp: skip malformed RTSP interleaved frame data

Some IP cameras send malformed RTSP interleaved frames sometimes, which
can cause curl_easy_perform return 1 (CURLE_UNSUPPORTED_PROTOCOL).  This
change attempts to skip clearly incorrect RTSP interleaving frame data.

Closes #10808

2 years agolib: add `bufq` and `dynhds`
Stefan Eissing [Mon, 20 Mar 2023 13:23:53 +0000 (14:23 +0100)] 
lib: add `bufq` and `dynhds`

Adding `bufq`:
- at init() time configured to hold up to `n` chunks of `m` bytes each.
- various methods for reading from and writing to it.
- `peek` support to get access to buffered data without copy
- `pass` support to allow buffer flushing on write if it becomes full
- use case: IO buffers for dynamic reads and writes that do not blow up
- distinct from `dynbuf` in that:
  - it maintains a read position
  - writes on a full bufq return CURLE_AGAIN instead of nuking itself
- Init options:
  - SOFT_LIMIT: allow writes into a full bufq
  - NO_SPARES: free empty chunks right away
- a `bufc_pool` that can keep a number of spare chunks to
  be shared between different `bufq` instances

Adding `dynhds`:
- a straightforward list of name+value pairs as used for HTTP headers
- headers can be appended dynamically
- headers can be removed again
- headers can be replaced
- headers can be looked up
- http/1.1 formatting into a `dynbuf`
- configured at init() with limits on header counts and total string
  sizes
- use case: pass a HTTP request or response around without being version
  specific
- express a HTTP request without a curl easy handle (used in h2 proxy
  tunnels)
- future extension possibilities:
  - conversions of `dynhds` to nghttp2/nghttp3 name+value arrays

Closes #10720

2 years agopytest: improvements for suitable curl and error output
Stefan Eissing [Fri, 24 Mar 2023 12:09:40 +0000 (13:09 +0100)] 
pytest: improvements for suitable curl and error output

- will check built curl for http and https support and
  skip all tests if not there
- will dump stdout/stderr/trace output on errored responses

Closes #10829

2 years agolib: use correct printf flags for sockets and timediffs
Daniel Stenberg [Tue, 28 Mar 2023 14:46:03 +0000 (16:46 +0200)] 
lib: use correct printf flags for sockets and timediffs

Introduces CURL_FORMAT_SOCKET_T for outputting socket numbers.

Fixes #10737
Reported-by: Gisle Vanem
Closes #10855

2 years agotelnet: make MSVC ignore warning for assignment within conditional
Daniel Stenberg [Tue, 28 Mar 2023 21:37:25 +0000 (23:37 +0200)] 
telnet: make MSVC ignore warning for assignment within conditional

Follow-up to d92a5007b60e0af7d

Closes #10859

2 years agows: handle reads before EAGAIN better
Daniel Stenberg [Tue, 28 Mar 2023 15:44:59 +0000 (17:44 +0200)] 
ws: handle reads before EAGAIN better

Reported-by: simplerobot on github
Fixes #10831
Closes #10856

2 years agotest1592: add flaky keyword
Daniel Stenberg [Tue, 28 Mar 2023 22:00:54 +0000 (00:00 +0200)] 
test1592: add flaky keyword

Closes #10860

2 years agolib/sha256.c: typo fix in comment (duplicated "is available")
Frank Gevaerts [Tue, 28 Mar 2023 10:11:04 +0000 (12:11 +0200)] 
lib/sha256.c: typo fix in comment (duplicated "is available")

Closes #10851

2 years agotests: update tests/httpd references to tests/http
Arne Soete [Tue, 28 Mar 2023 12:42:48 +0000 (14:42 +0200)] 
tests: update tests/httpd references to tests/http

tests/httpd was renamed to tests/http in #10654. This patch updates some
references in the README

Closes #10854

2 years agotelnet: simplify the implementation of str_is_nonascii()
Kamil Dudka [Tue, 28 Mar 2023 11:41:57 +0000 (13:41 +0200)] 
telnet: simplify the implementation of str_is_nonascii()

There is no need to traverse the string twice.

Closes #10852

2 years agocurl_easy_getinfo.3: typo fix (duplicated "from the")
Frank Gevaerts [Tue, 28 Mar 2023 09:41:00 +0000 (11:41 +0200)] 
curl_easy_getinfo.3: typo fix (duplicated "from the")

Closes #10850

2 years agowolfssl.yml: bump to version 5.6.0
Philip H [Mon, 27 Mar 2023 07:47:20 +0000 (09:47 +0200)] 
wolfssl.yml: bump to version 5.6.0

Closes #10843

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 28 Mar 2023 09:01:55 +0000 (11:01 +0200)] 
RELEASE-NOTES: synced

2 years agodocs/cmdline-opts: document the dotless config path
Ronan Pigott [Tue, 28 Mar 2023 06:24:51 +0000 (23:24 -0700)] 
docs/cmdline-opts: document the dotless config path

The real xdg config path is $XDG_CONFIG_HOME/curlrc, without the dot.
The dotless name seems preferable, so let's match the documentation to
the behavior.

Closes #10849

2 years agoHTTP-COOKIES.md: mention the #HttpOnly_ prefix
Daniel Stenberg [Mon, 27 Mar 2023 21:31:07 +0000 (23:31 +0200)] 
HTTP-COOKIES.md: mention the #HttpOnly_ prefix

Fixes #10847
Reported-by: Harry Sintonen
Closes #10848

2 years agodynbuf: never allocate larger than "toobig"
Daniel Stenberg [Mon, 27 Mar 2023 11:02:08 +0000 (13:02 +0200)] 
dynbuf: never allocate larger than "toobig"

As dynbufs always have a fixed maximum size which they are not allowed
to grow larger than, making sure that it never allocates a larger buffer
makes sure the buffer does not allocate memory that will never be used.

Closes #10845

2 years agoftplistparser: replace realloc with dynbuf
Daniel Stenberg [Mon, 27 Mar 2023 08:59:54 +0000 (10:59 +0200)] 
ftplistparser: replace realloc with dynbuf

Closes #10844

2 years agoftplistparser: use ISDIGIT()
Daniel Stenberg [Mon, 27 Mar 2023 08:54:58 +0000 (10:54 +0200)] 
ftplistparser: use ISDIGIT()

Closes #10844

2 years agoftplistparser: move out private data from public struct
Daniel Stenberg [Mon, 27 Mar 2023 08:48:44 +0000 (10:48 +0200)] 
ftplistparser: move out private data from public struct

The public 'curl_fileinfo' struct contained three fields that are for
internal purposes only. This change makes them unused in the public
struct.

The new private struct fields are also renamed to make this separation
more obvious internally.

Closes #10844

2 years agoopenssl: fix indents - white space edits only
Daniel Stenberg [Sun, 26 Mar 2023 16:16:10 +0000 (18:16 +0200)] 
openssl: fix indents - white space edits only

Closes #10840

2 years agourl: remove call to Curl_llist_destroy in Curl_close
Daniel Stenberg [Mon, 27 Mar 2023 13:54:58 +0000 (15:54 +0200)] 
url: remove call to Curl_llist_destroy in Curl_close

A list that is created with a NULL "destructor" does not need to be
destroyed. Not calling it is faster than calling it.

Closes #10846

2 years agomulti: remove PENDING + MSGSENT handles from the main linked list
Daniel Stenberg [Sun, 26 Mar 2023 15:43:28 +0000 (17:43 +0200)] 
multi: remove PENDING + MSGSENT handles from the main linked list

As they are not driving transfers or any socket activity, the main loop
does not need to iterate over these handles. A performance improvement.

They are instead only held in their own separate lists.

'data->multi' is kept a pointer to the multi handle as long as the easy
handle is actually part of it even when the handle is moved to the
pending/msgsent lists. It needs to know which multi handle it belongs
to, if for example curl_easy_cleanup() is called before the handle is
removed from the multi handle.

Alll 'data->multi' pointers of handles still part of the multi handle
gets cleared by curl_multi_cleanup() which "orphans" all previously
attached easy handles.

This is take 2. The first version was reverted for the 8.0.1 release.

Assisted-by: Stefan Eissing
Closes #10801

2 years agotests/http: add timeout to running curl in test cases
Stefan Eissing [Fri, 17 Mar 2023 08:30:02 +0000 (09:30 +0100)] 
tests/http: add timeout to running curl in test cases

- we had a CI case once where `curl` seemingly did not
  return and it was hard to guess what happened.
- make curl execution in test cases time out after 60 seconds

Closes #10783

2 years agoRELEASE-PROCEDURE: update to new schedule
Daniel Stenberg [Fri, 24 Mar 2023 10:44:42 +0000 (11:44 +0100)] 
RELEASE-PROCEDURE: update to new schedule

Ref: https://curl.se/mail/lib-2023-03/0062.html

Assisted-by: Andy Alt
Assisted-by: Dan Frandrich
Closes #10827

2 years agodoc: curl_mime_init() strong easy handle binding has been relaxed in 7.87.0
Patrick Monnerat [Sat, 25 Mar 2023 14:22:57 +0000 (15:22 +0100)] 
doc: curl_mime_init() strong easy handle binding has been relaxed in 7.87.0

Reported-by: Chloe Kudryavtsev
Fixes #10834
Closes #10835

2 years agoCURLOPT_WRITEFUNCTION.3: fix typo
Jay Satiro [Sat, 25 Mar 2023 19:54:02 +0000 (15:54 -0400)] 
CURLOPT_WRITEFUNCTION.3: fix typo

Reported-by: Osaila@users.noreply.github.com
Fixes https://github.com/curl/curl/issues/10839

2 years agoCI: skip some more builds when possible
Dan Fandrich [Sat, 25 Mar 2023 01:10:08 +0000 (18:10 -0700)] 
CI: skip some more builds when possible

When a commit only contains tests, documentation, or cmake files, skip
those builds that aren't affected by those.

The file filters available on the CI services don't seem to allow
skipping individual jobs, only the entire workflow, so we can't get any
more fine-grained than this.

2 years agoCI: add and adjust labeler match patterns
Dan Fandrich [Mon, 13 Mar 2023 18:33:51 +0000 (11:33 -0700)] 
CI: add and adjust labeler match patterns

Allow cmdline tool alongside other labels.

2 years agoCMake: make config version 8 compatible with 7
Kai Pastor [Wed, 22 Mar 2023 20:50:59 +0000 (21:50 +0100)] 
CMake: make config version 8 compatible with 7

Reviewed-by: Jakub Zakrzewski
Closes #10819

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 24 Mar 2023 15:40:33 +0000 (16:40 +0100)] 
RELEASE-NOTES: synced

Bumped version-in-progress to 8.1.0

2 years agoGHA: add a memory-sanitizer job
Daniel Stenberg [Wed, 22 Mar 2023 12:39:05 +0000 (13:39 +0100)] 
GHA: add a memory-sanitizer job

Closes #10815

2 years agoCI: fix brew retries on GHA
Dan Fandrich [Fri, 24 Mar 2023 04:21:31 +0000 (21:21 -0700)] 
CI: fix brew retries on GHA

The fix in the previous commit was complete for Cirrus but accidentally
left off a part for GHA.

Follow-up to c2b7249d

2 years agoCI: skip Azure for more commits which change only GHA
Dan Fandrich [Wed, 22 Mar 2023 18:25:04 +0000 (11:25 -0700)] 
CI: skip Azure for more commits which change only GHA

2 years agocmake: set SONAME for SunOS too
Daniel Stenberg [Wed, 22 Mar 2023 13:07:54 +0000 (14:07 +0100)] 
cmake: set SONAME for SunOS too

Provided-by: Brian Lund
Closes #10816

2 years agongtcp2: adjust config and code checks for ngtcp2 without nghttp3
Stefan Eissing [Thu, 23 Mar 2023 08:39:37 +0000 (09:39 +0100)] 
ngtcp2: adjust config and code checks for ngtcp2 without nghttp3

- make configure show on HTTP3 feature that both ngtcp2 and nghttp3
  are in play
- define ENABLE_QUIC only when USE_NGTCP2 and USE_NGHTTP3 are defined
- add USE_NGHTTP3 in the ngtcp2 implementation

Fixes #10793
Closes #10821

2 years agodata.d: emphasize no conversion
Daniel Stenberg [Thu, 23 Mar 2023 10:48:45 +0000 (11:48 +0100)] 
data.d: emphasize no conversion

When asking curl to send a POST, curl does not encode or change the data.

Ref: #10820
Closes #10823