Commit Graph

30658 Commits

Author SHA1 Message Date
Stefan Eissing
873b958d0b
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

Closes #11368
2023-06-22 17:32:15 +02:00
Stefan Eissing
d435bf1baf
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
2023-06-22 17:07:27 +02:00
Daniel Stenberg
27242bbad3
connect-timeout.d: mention that the DNS lookup is included
Closes #11370
2023-06-22 15:00:24 +02:00
Emanuele Torre
099f41e097
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.

Closes #11371
2023-06-22 14:56:40 +02:00
Paul Wise
7f669aa0f1
checksrc: modernise perl file open
Use regular variables and separate file open modes from filenames.

Suggested by perlcritic

Copied from https://github.com/curl/trurl/commit/f2784a9240f47ee28a845

Closes #11358
2023-06-22 11:03:02 +02:00
Dan Fandrich
0526525c33 runtests: work around a perl without SIGUSR1
At least msys2 perl v5.32.1 doesn't seem to define this signal. Since
this signal is only used for debugging, just ignore if setting it fails.

Reported-by: Marcel Raad
Fixes #11350
Closes #11366
2023-06-21 23:22:07 -07:00
Dan Fandrich
3cfd9f2378 runtests: include missing valgrind package
use valgrind was missing which caused torture tests with valgrind
enabled to fail.

Reported-by: Daniel Stenberg
Fixes #11364
Closes #11365
2023-06-21 15:33:01 -07:00
Dan Fandrich
62a9731533 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.
2023-06-21 14:42:37 -07:00
Dan Fandrich
69e3485e0d 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.
2023-06-21 12:39:51 -07:00
Dan Fandrich
47c04d7136 test2600: fix the description
It looks like it was cut-and-pasted.

Closes #11354
2023-06-21 11:46:01 -07:00
Daniel Stenberg
96e4d6809c
TODO: "Support HTTP/2 for HTTP(S) proxies" *done* 2023-06-21 10:08:57 +02:00
humbleacolyte
51f6a0dc1a
cf-socket: move ctx declaration under HAVE_GETPEERNAME
Closes #11352
2023-06-21 08:34:50 +02:00
Daniel Stenberg
93b8be802a
RELEASE-NOTES: synced 2023-06-20 09:20:54 +02:00
Daniel Stenberg
67ebc0d5b0
example/connect-to: show CURLOPT_CONNECT_TO
Closes #11340
2023-06-20 09:13:54 +02:00
Stefan Eissing
81e6793ec9
hyper: unslow
- refs #11203 where hyper was reported as being slow
- fixes hyper_executor_poll to loop until it is out of
  tasks as advised by @seanmonstar in https://github.com/hyperium/hyper/issues/3237
- added a fix in hyper io handling for detecting EAGAIN
- added some debug logs to see IO results
- pytest http/1.1 test cases pass
- pytest h2 test cases fail on connection reuse. HTTP/2
  connection reuse does not seem to work. Hyper submits
  a request on a reused connection, curl's IO works and
  thereafter hyper declares `Hyper: [1] operation was canceled: connection closed`
  on stderr without any error being logged before.

Fixes #11203
Reported-by: Gisle Vanem
Advised-by: Sean McArthur
Closes #11344
2023-06-20 09:11:41 +02:00
Stefan Eissing
65937f0d63
HTTP/2: upload handling fixes
- fixes #11242 where 100% CPU on uploads was reported
- fixes possible stalls on last part of a request body when
  that information could not be fully send on the connection
  due to an EAGAIN
- applies the same EGAIN handling to HTTP/2 proxying

Reported-by: Sergey Alirzaev
Fixed #11242
Closes #11342
2023-06-20 09:09:25 +02:00
Daniel Stenberg
ff1e885632
example/opensslthreadlock: remove
This shows how to setup OpenSSL mutex callbacks, but this is not
necessary since OpenSSL 1.1.0 - meaning that no currently supported
OpenSSL version requires this anymore

Closes #11341
2023-06-20 09:06:23 +02:00
Dan Fandrich
2c5c7abb15 libtest: display the times after a test timeout error
This is to help with test failure debugging.

Ref: #11328
Closes #11329
2023-06-19 17:14:27 -07:00
Dan Fandrich
39c234c429 test2600: bump a test timeout
Case 1 failed at least once on GHA by going 30 msec too long.

Ref: #11328
2023-06-19 17:14:27 -07:00
Dan Fandrich
089a84660d runtests: better detect and handle pipe errors in the controller
Errors reading and writing to the pipes are now better detected and
propagated up to the main test loop so it can be cleanly shut down. Such
errors are usually due to a runner dying so it doesn't make much sense
to try to continue the test run.
2023-06-19 17:14:27 -07:00
Dan Fandrich
7d01ec8b74 runtests: cleanly abort the runner if the controller dies
If the controller dies unexpectedly, have the runner stop its servers
and exit cleanly. Otherwise, the orphaned servers will stay running in
the background.
2023-06-19 17:14:27 -07:00
Dan Fandrich
2fe52412b1 runtests: improve error logging
Give more information about test harness error conditions to help figure
out what might be wrong. Print some internal test state when SIGUSR1 is
sent to runtests.pl.

Ref: #11328
2023-06-19 17:14:27 -07:00
Dan Fandrich
847e42d868 runtests: better handle ^C during slow tests
Since the SIGINT handler now just sets a flag that must be checked in the
main controller loop, make sure that runs periodically.  Rather than
blocking on a response from a test runner near the end of the test run,
add a short timeout to allow it.
2023-06-19 17:14:27 -07:00
Dan Fandrich
1177c741b9 runtests: rename server command file
The name ftpserver.cmd was historical and has been used for more than
ftp for many years now. Rename it to plain server.cmd to reduce
confusion.
2023-06-19 17:14:27 -07:00
Dan Fandrich
72c5bb14e7 tests: improve reliability of TFTP tests
Stop checking the timeout used by the client under test (for most
tests). The timeout will change if the TFTP test server is slow (such as
happens on an overprovisioned CI server) because the client will retry
and reduce its timeout, and the actual value is not important for most
tests.

test285 is changed a different way, by increasing the connect timeout.
This improves test coverage by allowing the changed timeout value to be
checked, but improves reliability with a carefully-chosen timeout that
not only allows twice the time to respond as before, but also allows
several retries before the client will change its timeout value.

Ref: #11328
2023-06-19 17:10:24 -07:00
Daniel Stenberg
355f4144df
cf-socket: skip getpeername()/getsockname for TFTP
Since the socket is not connected then the call fails. When the call
fails, failf() is called to write an error message that is then
surviving and is returned when the *real* error occurs later. The
earlier, incorrect, error therefore hides the actual error message.

This could be seen in stderr for test 1007

Test 1007 has now been extended to verify the stderr message.

Closes #11332
2023-06-19 09:39:49 +02:00
Daniel Stenberg
aef74ae416
example/crawler: make it use a few more options
For show, but reasonable
2023-06-19 09:06:41 +02:00
Daniel Stenberg
7ed832a245
libcurl-ws.3: mention raw mode
Closes #11339
2023-06-18 23:39:51 +02:00
Daniel Stenberg
c6ec264d1f
example/default-scheme: set the default scheme for schemeless URLs
Closes #11338
2023-06-18 23:37:48 +02:00
Daniel Stenberg
e6ad624996
example/hsts-preload: show one way to HSTS preload
Closes #11337
2023-06-18 23:35:40 +02:00
Daniel Stenberg
4e6a07e177
examples/http-options: show how to send "OPTIONS *"
With CURLOPT_REQUEST_TARGET.

Also add use of CURLOPT_QUICK_EXIT to show.

Closes #11333
2023-06-18 11:10:23 +02:00
Daniel Stenberg
741b6853b9
examples: make use of CURLOPT_(REDIR_|)PROTOCOLS_STR
To show how to use them

Closes #11334
2023-06-18 11:09:13 +02:00
Daniel Stenberg
b39181cedc
examples/smtp-mime: use CURLOPT_MAIL_RCPT_ALLOWFAILS
For show

Closes #11335
2023-06-18 11:08:22 +02:00
Daniel Stenberg
d40e5cc9a3
http: rectify the outgoing Cookie: header field size check
Previously it would count the size of the entire outgoing request and
not just the size of only the Cookie: header field - which was the
intention.

This could make the check be off by several hundred bytes in some cases.

Closes #11331
2023-06-18 11:07:23 +02:00
Jay Satiro
fd306e55a0 lib: fix some format specifiers
- Use CURL_FORMAT_CURL_OFF_T where %zd was erroneously used for some
  curl_off_t variables.

- Use %zu where %zd was erroneously used for some size_t variables.

Prior to this change some of the Windows CI tests were failing because
in Windows 32-bit targets have a 32-bit size_t and a 64-bit curl_off_t.
When %zd was used for some curl_off_t variables then only the lower
32-bits was read and the upper 32-bits would be read for part or all of
the next specifier.

Fixes https://github.com/curl/curl/issues/11327
Closes https://github.com/curl/curl/pull/11321
2023-06-17 01:38:04 -04:00
Marcel Raad
1eca27f100
test427: add cookies feature and keyword
This test doesn't work with `--disable-cookies`.

Closes https://github.com/curl/curl/pull/11320
2023-06-16 10:37:07 +02:00
Chris Talbot
64aefea3d9 imap: Provide method to disable SASL if it is advertised
- Implement AUTH=+LOGIN for CURLOPT_LOGIN_OPTIONS to prefer plaintext
  LOGIN over SASL auth.

Prior to this change there was no method to be able to fall back to
LOGIN if an IMAP server advertises SASL capabilities. However, this may
be desirable for e.g. a misconfigured server.

Per: https://www.ietf.org/rfc/rfc5092.html#section-3.2

";AUTH=<enc-auth-type>" looks to be the correct way to specify what
authenication method to use, regardless of SASL or not.

Closes https://github.com/curl/curl/pull/10041
2023-06-15 21:31:02 -04:00
Daniel Stenberg
2b6222a64c
RELEASE-NOTES: synced 2023-06-15 15:59:06 +02:00
Daniel Stenberg
b5351c71c1
examples/multi-debugcallback.c: avoid the bool typedef
Apparently this cannot be done in c23

Reported-by: Cristian Rodríguez
Fixes #11299
Closes #11319
2023-06-15 15:54:48 +02:00
Daniel Stenberg
a71288072b
docs/libcurl/libcurl.3: cleanups and improvements
Closes #11317
2023-06-15 08:31:51 +02:00
Daniel Stenberg
0ec806d046
libcurl-ws.3: fix typo 2023-06-15 00:05:51 +02:00
Daniel Stenberg
7bee2ef6ca
curl_ws_*.3: enhance
- all: SEE ALSO the libcurl-ws man page
- send: add example and return value information
- meta: mention that the returned data is read-only

Closes #11318
2023-06-15 00:05:31 +02:00
Daniel Stenberg
f15ded73c8
docs/libcurl/libcurl-ws.3: see also CURLOPT_WS_OPTIONS 2023-06-14 13:36:38 +02:00
Daniel Stenberg
553ad23b4b
docs/libcurl/libcurl-ws.3: minor polish 2023-06-14 13:30:50 +02:00
Daniel Stenberg
4337242345
libcurl-ws.3. WebSocket API overview
Closes #11314
2023-06-14 13:14:57 +02:00
Daniel Stenberg
4257ab41ed
libcurl-url.3: also mention CURLUPART_ZONEID
... and sort the two part-using lists alphabetically
2023-06-14 10:18:14 +02:00
Marcel Raad
06dc599405
fopen: fix conversion warning on 32-bit Android
When building for 32-bit ARM or x86 Android, `st_mode` is defined as
`unsigned int` instead of `mode_t`, resulting in a
-Wimplicit-int-conversion clang warning because `mode_t` is
`unsigned short`. Add a cast to silence the warning.

Ref: https://android.googlesource.com/platform/bionic/+/refs/tags/ndk-r25c/libc/include/sys/stat.h#86
Closes https://github.com/curl/curl/pull/11313
2023-06-14 09:31:47 +02:00
Marcel Raad
0e4c1434ae
http2: fix variable type
`max_recv_speed` is `curl_off_t`, so using `size_t` might result in
-Wconversion GCC warnings for 32-bit `size_t`. Visible in the NetBSD
ARM autobuilds.

Closes https://github.com/curl/curl/pull/11312
2023-06-14 09:30:37 +02:00
Daniel Stenberg
bc1e405ede
vtls: fix potentially uninitialized local variable warnings
Follow-up from a4a5e438ae

Closes #11310
2023-06-13 08:29:25 +02:00
Daniel Stenberg
c92b7228c5
timeval: use CLOCK_MONOTONIC_RAW if available
Reported-by: Harry Sintonen
Ref: #11288
Closes #11291
2023-06-13 00:02:32 +02:00