Commit Graph

30740 Commits

Author SHA1 Message Date
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
Stefan Eissing
f06cc4f85e
tool: add curl command line option --trace-ids
- added and documented --trace-ids to prepend (after the timestamp)
  the transfer and connection identifiers to each verbose log line
- format is [n-m] with `n` being the transfer id and `m` being the
  connection id. In case there is not valid connection id, print 'x'.
- Log calls with a handle that has no transfer id yet, are written
  without any ids.

Closes #11185
2023-06-12 23:53:09 +02:00
Stefan Eissing
e024d5665d
lib: add CURLINFO_CONN_ID and CURLINFO_XFER_ID
- add an `id` long to Curl_easy, -1 on init
- once added to a multi (or its own multi), it gets
  a non-negative number assigned by the connection cache
- `id` is unique among all transfers using the same
  cache until reaching LONG_MAX where it will wrap
  around. So, not unique eternally.
- CURLINFO_CONN_ID returns the connection id attached to
  data or, if none present, data->state.lastconnect_id
- variables and type declared in tool for write out

Closes #11185
2023-06-12 23:53:00 +02:00
Daniel Stenberg
fdda99c6ee
CURLOPT_INFILESIZE.3: mention -1 triggers chunked
Ref: #11300
Closes #11304
2023-06-12 23:23:04 +02:00
Philip H
4397e41be0
CI: openssl-3.0.9+quic
Closes #11296
2023-06-12 16:24:52 +02:00
Karthikdasari0423
b8f10b7e7b
HTTP3.md: update openssl version
Closes #11297
2023-06-12 16:23:12 +02:00
Daniel Stenberg
a4a5e438ae
vtls: avoid memory leak if sha256 call fails
... in the pinned public key handling function.

Reported-by: lizhuang0630 on github
Fixes #11306
Closes #11307
2023-06-12 15:57:46 +02:00
Daniel Stenberg
fdfc2bb6be
examples/ipv6: disable on win32
I can't make if_nametoindex() work there

Follow-up to c23dc42f39

Closes #11305
2023-06-12 15:28:35 +02:00
Daniel Stenberg
9ec099a2bc
tool_operate: allow cookie lines up to 8200 bytes
Since this option might set multiple cookies in the same line, it does
not make total sense to cap this at 4096 bytes, which is the limit for a
single cookie name or value.

Closes #11303
2023-06-12 14:15:37 +02:00
Daniel Stenberg
6c25cd4508
test427: verify sending more cookies than fit in a 8190 bytes line
curl will then only populate the header with cookies that fit, dropping
ones that otherwise would have been sent

Ref: https://curl.se/mail/lib-2023-06/0020.html

Closes #11303
2023-06-12 14:15:37 +02:00
Daniel Stenberg
1899899bb7
testutil: allow multiple %-operators on the same line
Closes #11303
2023-06-12 14:15:34 +02:00
Oleg Jukovec
aaba783d33
docs: update CURLOPT_UPLOAD.3
The behavior of CURLOPT_UPLOAD differs from what is described in the
documentation. The option automatically adds the 'Transfer-Encoding:
chunked' header if the upload size is unknown.

Closes #11300
2023-06-12 09:26:41 +02:00
Daniel Stenberg
2738927bb7
RELEASE-NOTES: synced 2023-06-12 09:16:55 +02:00
Daniel Stenberg
818a347325
CURLOPT_AWS_SIGV4.3: remove unused variable from example
Closes #11302
2023-06-12 09:13:55 +02:00
Daniel Stenberg
555bacd6d5
examples/https.c: use CURLOPT_CA_CACHE_TIMEOUT
for demonstration purposes

Closes #11290
2023-06-11 00:17:41 +02:00
Daniel Stenberg
c23dc42f39
example/ipv6: feature CURLOPT_ADDRESS_SCOPE in use
Closes #11282
2023-06-11 00:17:03 +02:00
Karthikdasari0423
8460ef4fa0 docs: Update HTTP3.md for newer ngtcp2 and nghttp3
Follow-up to fb9b9b58

Ref: #11184
Closes #11295
2023-06-10 11:06:24 -07:00
Dan Fandrich
fb9b9b5882 docs: update the supported ngtcp2 and nghttp3 versions
Follow-up to cae9d10b

Ref: #11184
Closes #11294
2023-06-10 08:27:48 -07:00
Dan Fandrich
b65086a83a tests: fix error messages & handling around sockets
The wrong error code was checked on Windows on UNIX socket failures,
which could have caused all UNIX sockets to be reported as having
errored and the tests therefore skipped. Also, a useless error message
was displayed on socket errors in many test servers on Windows because
strerror() doesn't work on WinSock error codes; perror() is overridden
there to work on all errors and is used instead.

Ref #11258
Closes #11265
2023-06-09 15:05:19 -07:00