]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
2 years agocookie: clarify that init with data set to NULL reads no file
Daniel Stenberg [Tue, 11 Apr 2023 12:14:09 +0000 (14:14 +0200)] 
cookie: clarify that init with data set to NULL reads no file

... and make Curl_cookie_add() require 'data' being set proper with an
assert.

The function has not worked with a NULL data for quite some time so this
just corrects the code and comment.

This is a different take than the proposed fixed in #10927

Reported-by: Kvarec Lezki
Ref: #10929
Closes #10930

2 years agovtls: remove int typecast for sizeof()
Kvarec Lezki [Tue, 11 Apr 2023 11:11:50 +0000 (16:11 +0500)] 
vtls: remove int typecast for sizeof()

V220 Suspicious sequence of types castings: memsize -> 32-bit integer ->
memsize. The value being cast: 'sizeof
(buf->data)'. curl\lib\vtls\vtls.c 2025

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

Closes #10928

2 years agohttp2: fix copynpaste error reported by coverity
Stefan Eissing [Tue, 11 Apr 2023 08:07:59 +0000 (10:07 +0200)] 
http2: fix copynpaste error reported by coverity

- move all code handling HTTP/2 frames for a particular
  stream into a separate function to keep from confusing
  the call `data` with the stream `data`.

Closes #10924

2 years agotests: log a too-long Unix socket path in sws and socksd
Dan Fandrich [Tue, 11 Apr 2023 17:07:30 +0000 (10:07 -0700)] 
tests: log a too-long Unix socket path in sws and socksd

Ref: #10919

2 years agogen.pl: error on duplicated See-Also fields
Daniel Stenberg [Tue, 11 Apr 2023 09:15:33 +0000 (11:15 +0200)] 
gen.pl: error on duplicated See-Also fields

Updated http2.d accordingly.

Closes #10925

2 years agohttp2: avoid possible null pointer dereference
Daniel Stenberg [Tue, 11 Apr 2023 07:22:08 +0000 (09:22 +0200)] 
http2: avoid possible null pointer dereference

Reported-by: Dan Fandrich
Fixes #10920
Closes #10923

2 years agolib1560: verify that more bad host names are rejected
Daniel Stenberg [Tue, 11 Apr 2023 07:15:41 +0000 (09:15 +0200)] 
lib1560: verify that more bad host names are rejected

when setting the hostname component of a URL

Closes #10922

2 years agocurl_url_set.3: mention that users can set content rather freely
Daniel Stenberg [Tue, 11 Apr 2023 06:59:00 +0000 (08:59 +0200)] 
curl_url_set.3: mention that users can set content rather freely

... which then might render bad URLs if you extract a URL later.

Closes #10921

2 years agoCI: retry failed downloads of aws-lc
Dan Fandrich [Mon, 10 Apr 2023 19:19:11 +0000 (12:19 -0700)] 
CI: retry failed downloads of aws-lc

Don't fail the build in case of a temporary server problem.

2 years agotest1169: fix so it works properly everywhere 10917/head
Dan Fandrich [Mon, 10 Apr 2023 18:05:55 +0000 (11:05 -0700)] 
test1169: fix so it works properly everywhere

- Use an absolute path for the -L option since the module isn't in the
  perl path
- Create the needed test file in a <file> section; <precheck> isn't
  intended for this
- Fix the test number in the file name, which was wrong

Follow-up to f754990a

Ref: #10818
Fixes #10889
Closes #10917

2 years agotests: stop using strndup(), which isn't portable
Dan Fandrich [Mon, 10 Apr 2023 17:35:04 +0000 (10:35 -0700)] 
tests: stop using strndup(), which isn't portable

It's not available on Solaris 10, for example. Since this is just test
code that doesn't need to use an optimized system version, replace it
with the implementation copied from tool_cb_hdr.c.

2 years agoruntests: fix an incorrect comment about the ld_preload feature
Dan Fandrich [Mon, 10 Apr 2023 17:42:21 +0000 (10:42 -0700)] 
runtests: fix an incorrect comment about the ld_preload feature

Follow-up to 1f631864

Ref: #10818

2 years agourlapi: prevent setting invalid schemes with *url_set()
Daniel Stenberg [Sat, 8 Apr 2023 22:38:00 +0000 (00:38 +0200)] 
urlapi: prevent setting invalid schemes with *url_set()

A typical mistake would be to try to set "https://" - including the
separator - this is now rejected as that would then lead to
url_get(... URL...) would get an invalid URL extracted.

Extended test 1560 to verify.

Closes #10911

2 years agohttp2: remove unused Curl_http2_strerror function declaration
Biswapriyo Nath [Sun, 9 Apr 2023 05:48:53 +0000 (11:18 +0530)] 
http2: remove unused Curl_http2_strerror function declaration

Curl_http2_strerror was renamed to http2_strerror in
05b100aee247bb9bec8e9a1b0 and then http2_strerror was removed in
5808a0d0f5ea0399d4a2a2

This also fixes the following compiler error

lib/http2.h:41:33: error: unknown type name 'uint32_t'
lib/http2.h:1:1: note: 'uint32_t' is defined in header '<stdint.h>'

Closes #10912

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Sat, 8 Apr 2023 21:57:30 +0000 (23:57 +0200)] 
RELEASE-NOTES: synced

2 years agoconfig-dos.h: fix SIZEOF_CURL_OFF_T for MS-DOS/DJGPP
SuperIlu on github [Sat, 8 Apr 2023 15:50:14 +0000 (17:50 +0200)] 
config-dos.h: fix SIZEOF_CURL_OFF_T for MS-DOS/DJGPP

Fixes #10905
Closes #10910

2 years agolib: remove CURLX_NO_MEMORY_CALLBACKS
Daniel Stenberg [Fri, 7 Apr 2023 22:44:59 +0000 (00:44 +0200)] 
lib: remove CURLX_NO_MEMORY_CALLBACKS

The only user of this define was 'chkdecimalpoint' - a special purpose
test tool that was built but not used anymore (since 17c18fbc3 - Apr
2020).

Closes #10908

2 years agoCURLPROXY_HTTPS2: for HTTPS proxy that may speak HTTP/2
Daniel Stenberg [Thu, 6 Apr 2023 12:33:05 +0000 (14:33 +0200)] 
CURLPROXY_HTTPS2: for HTTPS proxy that may speak HTTP/2

Setting this proxy type allows curl to negotiate and use HTTP/2 with
HTTPS proxies.

Closes #10900

2 years agowrite-out.d: add missing periods
Ali Khodkar [Thu, 6 Apr 2023 09:01:14 +0000 (12:31 +0330)] 
write-out.d: add missing periods

Closes #10897

2 years agohttp2: remove check for !data after it was already dereferenced
Daniel Stenberg [Fri, 7 Apr 2023 17:32:03 +0000 (19:32 +0200)] 
http2: remove check for !data after it was already dereferenced

Pointed out by Coverity

Closes #10906

2 years agohttp_proxy: provide missing arg to infof() call
Daniel Stenberg [Fri, 7 Apr 2023 12:05:00 +0000 (14:05 +0200)] 
http_proxy: provide missing arg to infof() call

Pointed out by Coverity

Closes #10904

2 years agocontent_encoding: only do tranfer-encoding compression if asked to
Daniel Stenberg [Thu, 6 Apr 2023 10:11:42 +0000 (12:11 +0200)] 
content_encoding: only do tranfer-encoding compression if asked to

To reduce surprises. Update test 387 and 418 accordingly.

Closes #10899

2 years agosws: comparison of unsigned expression < 0 is always false
Daniel Stenberg [Thu, 6 Apr 2023 21:55:00 +0000 (23:55 +0200)] 
sws: comparison of unsigned expression < 0 is always false

Follow-up to 356dd0b73a75ed6d5

Closes #10903

2 years agolib/cmake: add HAVE_WRITABLE_ARGV check
Daniel Stenberg [Thu, 6 Apr 2023 08:06:30 +0000 (10:06 +0200)] 
lib/cmake: add HAVE_WRITABLE_ARGV check

Assisted-by: Jakub Zakrzewski
Closes #10896

2 years agoconfigure: don't set HAVE_WRITABLE_ARGV on Windows
Daniel Stenberg [Thu, 6 Apr 2023 07:58:13 +0000 (09:58 +0200)] 
configure: don't set HAVE_WRITABLE_ARGV on Windows

Ref: #10888
Closes #10896

2 years agovtls: fix build error when proxy-disabled
Daniel Stenberg [Thu, 6 Apr 2023 14:34:21 +0000 (16:34 +0200)] 
vtls: fix build error when proxy-disabled

Closes #10901

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