Stefan Eissing [Mon, 24 Jul 2023 13:38:04 +0000 (15:38 +0200)]
http: VLH, very large header test and fixes
- adding tests using very large passwords in auth
- fixes general http sending to treat h3 like h2, and
not like http1.1
- eliminate H2_HEADER max definitions and use the commmon
DYN_HTTP_REQUEST everywhere, different limits do not help
- fix http2 handling of requests denied by nghttp2 on send
to immediately report the refused stream
Andrei Rybak [Sun, 23 Jul 2023 21:33:45 +0000 (23:33 +0200)]
CONTRIBUTE: drop mention of copyright year ranges
Year ranges in copyrights were dropped in commits [1] and [2].
Verification of year ranges in copyrights was dropped from script
'scripts/copyright.pl' in commit [3]. However, the corresponding
passages in file 'docs/CONTRIBUTE.md' weren't updated.
Drop mentions of copyright year ranges from 'docs/CONTRIBUTE.md'.
[1] 2bc1d775f (copyright: update all copyright lines and remove year
ranges, 2023-01-02)
[2] c46761bd8 (tests/http: remove year ranges from copyrights,
2023-03-14)
[3] 0e293bacb (copyright.pl: cease doing year verifications, 2023-01-28)
Andrei Rybak [Sun, 23 Jul 2023 21:32:45 +0000 (23:32 +0200)]
CONTRIBUTE: fix syntax in commit message description
File 'docs/CONTRIBUTE.md' includes a description of how one should write
commit messages in the curl project. Different possible parts of the
message are enclosed in square brackets. One exception is the section
describing how the curl project doesn't use "Signed-off-by" commit
trailers [1], which is enclosed in an opening curly brace paired with a
closing square bracket.
Fix the enclosing square brackets in description of "Signed-off-by"
trailers in commit messages in file 'docs/CONTRIBUTE.md'.
[1] See description of option '--signoff' in Git documentation:
https://git-scm.com/docs/git-commit
These custom `unit1394_LDADD` and similar automake overrides are no
longer neded. They were originally added by added by [8dac7be][] for
metalink support, but are no longer after [265b14d][] removed metalink.
cmake: add `libcurlu`/`libcurltool` for unit tests
Add a `libcurlu`/`libcurltool` static library that is compiled only for
unit tests. We use `EXCLUDE_FROM_ALL` to make sure that they're not
built by default, they're only built if unit tests are built.
These libraries allow us to compile every unit test with CMake.
Jon Rumsey [Wed, 19 Jul 2023 13:49:34 +0000 (14:49 +0100)]
os400: correct EXPECTED_STRING_LASTZEROTERMINATED
Correct EXPECTED_STRING_LASTZEROTERMINATED to account for
CURLOPT_HAPROXY_CLIENT_IP which requires EBCDIC to ASCII conversion when
passed into curl_easy_setopt().
The updated Curl_http_req_make and Curl_http_req_make2 functions spawned
a parameter called m_len. The AmigaOS networking headers, derived from
NetBSD, contain "#define m_len m_hdr.mh_len" which clashes with
this. Since we do not actually use mbuf, force the include file to be
ignored, removing the clash.
cfilters: rename close/connect functions to avoid clashes
Rename `close` and `connect` in `struct Curl_cftype` for
consistency and to avoid clashes with macros of the same name
(the standard AmigaOS networking connect() function is implemented
via a macro).
Stefan Eissing [Thu, 20 Jul 2023 11:08:00 +0000 (13:08 +0200)]
http2: fix regression on upload EOF handling
- a regression introduced by c9ec85121110d7cbbbed2990024222c8f5b8afe5
where optimization of small POST bodies leads to a new code path
for such uploads that did not trigger the "done sending" event
- add triggering this event for early "upload_done" situations
Fixes #11485
Closes #11487 Reported-by: Aleksander Mazur
Stefan Eissing [Wed, 19 Jul 2023 08:42:07 +0000 (10:42 +0200)]
quiche: fix segfault and other things
- refs #11449 where a segfault is reported when IP Eyeballing did
not immediately connect but made several attempts
- The transfer initiating the eyeballing was initialized too early,
leadding to references to the filter instance that was then
replaced in the subsequent eyeball attempts. That led to a use
after free in the buffer handling for the transfer
- transfers are initiated now more lazy (like in the ngtcp2 filter),
when the stream is actually opened
- suppress reporting on quiche event errors for "other" transfers
than the current one to not fail a transfer due to faults in
another one.
- revert recent return value handling for quiche_h3_recv_body()
to not indicate an error but an EAGAIN situation. We wish quiche
would document what functions return.
Stefan Eissing [Tue, 18 Jul 2023 15:37:58 +0000 (17:37 +0200)]
quiche: fix lookup of transfer at multi
- refs #11449 where weirdness in quiche multi connection tranfers was
observed
- fixes lookup of transfer for a quiche event to take the connection
into account
- formerly, a transfer with the same stream_id, but on another connection
could be found
Stefan Eissing [Mon, 17 Jul 2023 10:38:28 +0000 (12:38 +0200)]
http2: treat initial SETTINGS as a WINDOW_UPDATE
- refs #11426 where spurious stalls on large POST requests
are reported
- the issue seems to involve the following
* first stream on connection adds up to 64KB of POST
data, which is the max default HTTP/2 stream window size
transfer is set to HOLD
* initial SETTINGS from server arrive, enlarging the stream
window. But no WINDOW_UPDATE is received.
* curl stalls
- the fix un-HOLDs a stream on receiving SETTINGS, not
relying on a WINDOW_UPDATE from lazy servers
cf-socket: don't bypass fclosesocket callback if cancelled before connect
After upgrading to 8.1.2 from 7.84.0, I found that sockets were being
closed without calling the fclosesocket callback if a request was
cancelled after the associated socket was created, but before the socket
was connected. This lead to an imbalance of fopensocket & fclosesocket
callbacks, causing problems with a custom event loop integration using
the multi-API.
This was caused by cf_socket_close() calling sclose() directly instead
of calling socket_close() if the socket was not active. For regular TCP
client connections, the socket is activated by cf_socket_active(), which
is only called when the socket completes the connect.
As far as I can tell, this issue has existed since 7.88.0. That is,
since the code in question was introduced by:
commit 71b7e0161032927cdfb4e75ea40f65b8898b3956
Author: Stefan Eissing <stefan@eissing.org>
Date: Fri Dec 30 09:14:55 2022 +0100
Stefan Eissing [Thu, 13 Jul 2023 09:40:09 +0000 (11:40 +0200)]
CI: brew fix for openssl in default path
If brew install/update links openssl into /usr/local, it will be found
before anything we add with `-isystem path` to CPP/LDLFAGS. Get rid of
that by unlinking the keg.
Stefan Eissing [Mon, 10 Jul 2023 07:39:19 +0000 (09:39 +0200)]
macOS: fix taget detection
- TARGET_OS_OSX is not always defined on macOS
- this leads to missing symbol Curl_macos_init()
- TargetConditionals.h seems to define these only when
dynamic targets are enabled (somewhere?)
- this PR fixes that on my macOS 13.4.1
- I have no clue why CI builds worked without it
Stan Hu [Mon, 5 Jun 2023 17:05:48 +0000 (10:05 -0700)]
hostip.c: Move macOS-specific calls into global init call
https://github.com/curl/curl/pull/7121 introduced a macOS system call
to `SCDynamicStoreCopyProxies`, which is invoked every time an IP
address needs to be resolved.
However, this system call is not thread-safe, and macOS will kill the
process if the system call is run first in a fork. To make it possible
for the parent process to call this once and prevent the crash, only
invoke this system call in the global initialization routine.
In addition, this change is beneficial because it:
1. Avoids extra macOS system calls for every IP lookup.
2. Consolidates macOS-specific initialization in a separate file.
Stefan Eissing [Tue, 27 Jun 2023 10:06:21 +0000 (12:06 +0200)]
http3/ngtcp2: upload EAGAIN handling
- refs #11389 where IDLE timeouts on upload are reported
- reword ngtcp2 expiry handling to apply to both send+recv
calls into the filter
- EAGAIN uploads similar to the recent changes in HTTP/2, e.g.
report success only when send data was ACKed.
- HOLD sending of EAGAINed uploads to avoid cpu busy loops
- rename internal function for consistency with HTTP/2
implementation
Stefan Eissing [Fri, 7 Jul 2023 08:52:05 +0000 (10:52 +0200)]
http2: raise header limitations above and beyond
- not quite to infinity
- rewrote the implementation of our internal HTTP/1.x request
parsing to work with very large lines using dynbufs.
- new default limit is `DYN_HTTP_REQUEST`, aka 1MB, which
is also the limit of curl's general HTTP request processing.
Stefan Eissing [Mon, 26 Jun 2023 07:03:47 +0000 (09:03 +0200)]
http2: fix crash in handling stream weights
- Delay the priority handling until the stream has been opened.
- Add test2404 to reproduce and verify.
Weights may change "on the run", which is why there are checks in
general egress handling. These must not trigger when the stream has not
been opened yet.
Dan Fandrich [Fri, 23 Jun 2023 19:51:41 +0000 (12:51 -0700)]
CI: enable parallel make in more builds
Most CI services provide at least two cores, so enable parallel make
jobs to take advantage of that for builds. Some dependencies aren't safe
to build in parallel so leave those as-is. Also, rename a few
workflows to eliminate duplicate names and provide a better idea what
they're about.
Daniel Stenberg [Thu, 22 Jun 2023 12:34:49 +0000 (14:34 +0200)]
configure: add check for ldap_init_fd
... as otherwise the configure script will say it is OpenLDAP in the
summary, but not set the USE_OPENLDAP define, therefor not using the
intended OpenLDAP code paths.
Regression since 4d7385446 (7.85.0)
Fixes #11372
Closes #11374 Reported-by: vlkl-sap on github
Michał Petryka [Thu, 22 Jun 2023 19:30:43 +0000 (21:30 +0200)]
cmake: stop CMake from quietly ignoring missing Brotli
The CMake project was set to `QUIET` for Brotli instead of
`REQUIRED`. This makes builds unexpectedly ignore missing Brotli even
when `CURL_BROTLI` is enabled.
Stefan Eissing [Thu, 22 Jun 2023 09:01:53 +0000 (11:01 +0200)]
http2: h2 and h2-PROXY connection alive check fixes
- fix HTTP/2 check to not declare a connection dead when
the read attempt results in EAGAIN
- add H2-PROXY alive check as for HTTP/2 that was missing
and is needed
- add attach/detach around Curl_conn_is_alive() and remove
these in filter methods
- add checks for number of connections used in some test_10
proxy tunneling tests
Stefan Eissing [Wed, 21 Jun 2023 13:59:42 +0000 (15:59 +0200)]
http2: error stream resets with code CURLE_HTTP2_STREAM
- refs #11357, where it was reported that HTTP/1.1 downgrades
no longer works
- fixed with suggested change
- added test_05_03 and a new handler in the curltest module
to reproduce that downgrades work
Fixes #11357
Closes #11362 Reported-by: Jay Satiro
Emanuele Torre [Thu, 22 Jun 2023 11:18:30 +0000 (13:18 +0200)]
quote.d: fix indentation of generated paragraphs
quote.d was missing a .IP at the end which caused the paragraphs
generated for See-also, Multi, and Example to not be indented correctly.
I also remove a redundant "This option can be used multiple times.", and
replaced .IP "item" with .TP .B "item" to make more clear which lines
are part of the list of commands and which aren't.
Dan Fandrich [Wed, 21 Jun 2023 19:43:48 +0000 (12:43 -0700)]
runtests: use more consistent failure lines
After a test failure log a consistent log message to make it easier to
parse the log file. Also, log a consistent message with "ignored" for
failures that cause the test to be not considered at all. These should
perhaps be counted in the skipped category, but this commit does not
change that behaviour.
Dan Fandrich [Wed, 21 Jun 2023 19:39:51 +0000 (12:39 -0700)]
runtests: consistently write the test check summary block
The memory check character was erroneously omitted if the memory
checking file was not available for some reason, making the block of
characters an inconsistent length.