Commit Graph

30110 Commits

Author SHA1 Message Date
Dan Fandrich
1f631864f4 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
2023-03-30 09:12:52 -07:00
Dan Fandrich
e06eb85b3d 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
2023-03-30 09:12:52 -07:00
Dan Fandrich
d792cd103c runtests: more refactoring for clarity
Ref: #10818
2023-03-30 09:12:52 -07:00
Dan Fandrich
1ae94c0930 runtests: don't start servers if -l is given 2023-03-30 09:12:52 -07:00
Dan Fandrich
44ec1986da runtests: fix typos 2023-03-30 09:12:52 -07:00
Dan Fandrich
53abe3809d 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
2023-03-30 09:12:52 -07:00
Dan Fandrich
6c0ee77c8a 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
2023-03-30 09:12:52 -07:00
Dan Fandrich
1dc3088de3 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
2023-03-30 09:12:52 -07:00
Dan Fandrich
d428f00db0 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
2023-03-30 09:12:52 -07:00
Dan Fandrich
dfeda77573 tests: document that the unittest keyword is special
Also, add other features that were missing.
2023-03-30 09:12:52 -07:00
Stefan Eissing
6d6404aca0
docs: add documentation for bufq
Closes #10869
2023-03-30 17:13:53 +02:00
Daniel Stenberg
a4cedce9bb
RELEASE-NOTES: synced 2023-03-30 16:13:29 +02:00
Matt Jolly
0ae0abbe72
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
2023-03-30 15:51:06 +02:00
Philip H
67546aea90
GHA: update ngtcp2-*.yml to v0.10.0
Closes #10612
2023-03-30 15:43:07 +02:00
Stefan Eissing
f8f010e469
tests/http: fix log formatting on wrong exit code
Closes #10868
2023-03-30 13:09:12 +02:00
Daniel Stenberg
843a72b456
spellcheck.words: unify the AWS-LC spelling
Follow-up to 34ef4fab22

Closes #10867
2023-03-30 11:40:00 +02:00
Jim King
34ef4fab22
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
2023-03-30 10:56:14 +02:00
Viktor Szakats
1e3319a167
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 ebef55a61d
  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
2023-03-30 08:55:20 +00:00
Stefan Eissing
b74bba9aad
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
2023-03-30 10:04:20 +02:00
dengjfzh
6c6306f300
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
2023-03-30 09:59:09 +02:00
Stefan Eissing
61f52a97e9
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
2023-03-30 09:08:05 +02:00
Stefan Eissing
8cabef6fc3
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
2023-03-29 13:25:18 +02:00
Daniel Stenberg
8455013359
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
2023-03-29 13:12:29 +02:00
Daniel Stenberg
9a607fd728
telnet: make MSVC ignore warning for assignment within conditional
Follow-up to d92a5007b6

Closes #10859
2023-03-29 13:07:17 +02:00
Daniel Stenberg
b19cbebbb4
ws: handle reads before EAGAIN better
Reported-by: simplerobot on github
Fixes #10831
Closes #10856
2023-03-29 10:23:29 +02:00
Daniel Stenberg
baeaeecb0a
test1592: add flaky keyword
Closes #10860
2023-03-29 09:11:50 +02:00
Frank Gevaerts
abb9be36f1
lib/sha256.c: typo fix in comment (duplicated "is available")
Closes #10851
2023-03-28 17:52:41 +02:00
Arne Soete
2eadae8673
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
2023-03-28 17:50:59 +02:00
Kamil Dudka
d92a5007b6 telnet: simplify the implementation of str_is_nonascii()
There is no need to traverse the string twice.

Closes #10852
2023-03-28 15:41:55 +02:00
Frank Gevaerts
1903b95e4c
curl_easy_getinfo.3: typo fix (duplicated "from the")
Closes #10850
2023-03-28 11:59:49 +02:00
Philip H
3f3dfb4d0c
wolfssl.yml: bump to version 5.6.0
Closes #10843
2023-03-28 11:30:16 +02:00
Daniel Stenberg
3f9973f4df
RELEASE-NOTES: synced 2023-03-28 11:01:55 +02:00
Ronan Pigott
8d9c1a8aa8
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
2023-03-28 10:32:00 +02:00
Daniel Stenberg
4fe6c91e7a
HTTP-COOKIES.md: mention the #HttpOnly_ prefix
Fixes #10847
Reported-by: Harry Sintonen
Closes #10848
2023-03-28 10:28:33 +02:00
Daniel Stenberg
5a10f48778
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
2023-03-28 10:22:53 +02:00
Daniel Stenberg
c1d6fe2aaa
ftplistparser: replace realloc with dynbuf
Closes #10844
2023-03-28 10:11:33 +02:00
Daniel Stenberg
2203bd13ff
ftplistparser: use ISDIGIT()
Closes #10844
2023-03-28 10:11:33 +02:00
Daniel Stenberg
01114f6efd
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
2023-03-28 10:11:33 +02:00
Daniel Stenberg
e4cd1ffed1
openssl: fix indents - white space edits only
Closes #10840
2023-03-28 10:02:40 +02:00
Daniel Stenberg
5fec927374
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
2023-03-27 23:36:16 +02:00
Daniel Stenberg
843b3baa3e
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
2023-03-26 17:43:28 +02:00
Stefan Eissing
9d107b6954
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
2023-03-26 17:41:46 +02:00
Daniel Stenberg
9c469942e2
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
2023-03-26 17:39:43 +02:00
Patrick Monnerat
61d4260434
doc: curl_mime_init() strong easy handle binding has been relaxed in 7.87.0
Reported-by: Chloe Kudryavtsev
Fixes #10834
Closes #10835
2023-03-26 16:39:58 +02:00
Jay Satiro
e5588ced30 CURLOPT_WRITEFUNCTION.3: fix typo
Reported-by: Osaila@users.noreply.github.com

Fixes https://github.com/curl/curl/issues/10839
2023-03-25 15:54:02 -04:00
Dan Fandrich
43e71fe0fc 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.
2023-03-24 19:59:50 -07:00
Dan Fandrich
90f5250cc2 CI: add and adjust labeler match patterns
Allow cmdline tool alongside other labels.
2023-03-24 19:54:57 -07:00
Kai Pastor
2ffd787a71
CMake: make config version 8 compatible with 7
Reviewed-by: Jakub Zakrzewski
Closes #10819
2023-03-25 00:29:07 +01:00
Daniel Stenberg
fe55a63c83
RELEASE-NOTES: synced
Bumped version-in-progress to 8.1.0
2023-03-24 16:42:09 +01:00
Daniel Stenberg
d03c4dc165
GHA: add a memory-sanitizer job
Closes #10815
2023-03-24 11:04:59 +01:00