Commit Graph

28471 Commits

Author SHA1 Message Date
Daniel Stenberg
774dbd520a
CURLOPT_UNRESTRICTED_AUTH.3: extended explanation
Include details about Authentication headers.

Reported-by: Brad Spencer
Fixes #8724
Closes #8726
2022-04-19 18:15:02 +02:00
Daniel Stenberg
c3b27c3141
.github/workflows/macos.yml: add a libssh job with c-ares
... to enable the memdebug system

Closes #8720
2022-04-19 16:31:00 +02:00
Daniel Stenberg
795ed05084
RELEASE-NOTES: synced 2022-04-18 10:27:55 +02:00
Gisle Vanem
64c5982d65 docs/HTTP3.md: fix typo
also fix msh3 section formatting

Ref: https://github.com/curl/curl/commit/37492ebb#r70980087
2022-04-17 23:48:27 -04:00
Marc Hoersken
68035af29d
timediff.[ch]: add curlx helper functions for timeval conversions
Also move timediff_t definitions from timeval.h to timediff.h and
then make timeval.h include the new standalone-capable timediff.h.

Reviewed-by: Jay Satiro
Reviewed-by: Daniel Stenberg

Supersedes #5888
Closes #8595
2022-04-17 13:11:27 +02:00
Balakrishnan Balasubramanian
80eb71a3f5
tests: refactor server/socksd.c to support --unix-socket
Closes #8687
2022-04-17 11:43:57 +02:00
Emanuele Torre
77a6bf8489
tool_paramhlp: use feof(3) to identify EOF correctly when using fread(3)
This loop was using the number of bytes read from the file as condition
to keep reading.

From Linux's fread(3) man page:
> On success, fread() and fwrite() return the number of items read or
> written. This number equals the number of bytes transferred only when
> size is 1. If an error occurs, or the end of the file is reached, the
> return value is a short item count (or zero).
>
> The file position indicator for the stream is advanced by the number
> of bytes successfully read or written.
>
> fread() does not distinguish between end-of-file and error, and
> callers must use feof(3) and ferror(3) to determine which occurred.

This means that nread!=0 doesn't make much sense as an end condition for
the loop: nread==0 doesn't necessarily mean that EOF has been reached or
an error has occured (but that is usually the case) and nread!=0 doesn't
necessarily mean that EOF has not been reached or that no read errors
have occured. feof(3) and ferror(3) should be uses when using fread(3).

Currently curl has to performs an extra fread(3) call to get a return
value equal to 0 to stop looping.

This usually "works" (even though nread==0 shouldn't be interpreted as
EOF) if stdin is a pipe because EOF usually marks the "real" end of the
stream, so the extra fread(3) call will return immediately and the extra
read syscall won't be noticeable:

    bash-5.1$ strace -e read curl -s -F file=@- 0x0.st <<< a 2>&1 |
    > tail -n 5
    read(0, "a\n", 4096)                    = 2
    read(0, "", 4096)                       = 0
    read(0, "", 4096)                       = 0
    http://0x0.st/oRs.txt
    +++ exited with 0 +++
    bash-5.1$

But this doesn't work if curl is reading from stdin, stdin is a
terminal, and the EOF is being emulated using a shell with ^D. Two
consecutive ^D will be required in this case to actually make curl stop
reading:

    bash-5.1$ curl -F file=@- 0x0.st
    a
    ^D^D
    http://0x0.st/oRs.txt
    bash-5.1$

A possible workaround to this issue is to use a program that handles EOF
correctly to indirectly send data to curl's stdin:

    bash-5.1$ cat - | curl -F file=@- 0x0.st
    a
    ^D
    http://0x0.st/oRs.txt
    bash-5.1$

This patch makes curl handle EOF properly when using fread(3) in
file2memory() so that the workaround is not necessary.

Since curl was previously ignoring read errors caused by this fread(3),
ferror(3) is also used in the condition of the loop: read errors and EOF
will have the same meaning; this is done to somewhat preserve the old
behaviour instead of making the command fail when a read error occurs.

Closes #8701
2022-04-17 11:36:28 +02:00
Daniel Stenberg
53399c72ff
gen.pl: change wording for mutexed options
Instead of saying "This option overrides NNN", now say "This option is
mutually exclusive to NNN" in the generated man page ouput, as the
option does not in all cases actually override the others but they are
always mutually exclusive.

Ref: #8704
Closes #8716
2022-04-17 11:21:16 +02:00
Daniel Stenberg
01a1697a79
curl: error out if -T and -d are used for the same URL
As one implies PUT and the other POST, both cannot be used
simultaneously.

Add test 378 to verify.

Reported-by: Boris Verkhovskiy
Fixes #8704
Closes #8715
2022-04-17 11:18:17 +02:00
Daniel Stenberg
6968fb9d54
lib: remove exclamation marks
... from infof() and failf() calls. Make them less attention seeking.

Closes #8713
2022-04-16 11:55:05 +02:00
Daniel Stenberg
36e09dc302
fail.d: tweak the description
Reviewed-by: Daniel Gustafsson
Suggested-by: Robert Charles Muir
Ref: https://twitter.com/rcmuir/status/1514915401574010887

Closes #8714
2022-04-15 23:50:35 +02:00
Daniel Gustafsson
fe87e10c81 docs: Fix missing semicolon in example code
Multiple share examples were missing a semicolon on the line defining
the CURLSHcode variable.

Closes: #8697
Reported-by: Michael Kaufmann <mail@michael-kaufmann.ch>
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2022-04-15 23:35:15 +02:00
Daniel Gustafsson
34bbf96475 infof: consistent capitalization of warning messages
Ensure that all infof calls with a warning message are capitalized
in the same way.  At some point we should probably set up a style-
guide for infof but until then let's aim for a little consistenncy
where we can.

Closes: #8711
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2022-04-14 21:13:29 +02:00
Daniel Gustafsson
af2dac8298 RELEASE-NOTES: synced 2022-04-14 14:12:17 +02:00
Matteo Baccan
0a6eebfc14 perl: removed a double semicolon at end of line
Remove double semicolons at end of line in Perl code.

Closes: #8709
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
2022-04-14 13:55:32 +02:00
Daniel Gustafsson
b7c0bd68ff curl_easy_header: fix typos in documentation
Closes: #8694
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2022-04-11 11:25:13 +02:00
Marcel Raad
a34a8480c8
appveyor: add Cygwin build
Closes https://github.com/curl/curl/pull/8693
2022-04-11 08:27:31 +02:00
Marcel Raad
84be999672
appveyor: only add MSYS2 to PATH where required
Closes https://github.com/curl/curl/pull/8693
2022-04-11 08:27:24 +02:00
Tatsuhiro Tsujikawa
cd29c1651e
ngtcp2: fix memory leak
Closes #8691
2022-04-10 23:10:21 +02:00
Tatsuhiro Tsujikawa
fa25dab7fd
ngtcp2: remove remote_addr which is not used in a meaningful way
Closes #8689
2022-04-10 23:09:41 +02:00
Tatsuhiro Tsujikawa
f15beb6f30
ngtcp2: enlarge H3_SEND_SIZE
Make h3_SEND_SIZE larger because current value (20KiB) is too small
for the high latency environment.

Closes #8690
2022-04-10 23:08:33 +02:00
Tatsuhiro Tsujikawa
990bfdd7bc
ngtcp2: fix HTTP/3 upload stall and avoid busy loop
This commit fixes HTTP/3 upload stall if upload data is larger than
H3_SEND_SIZE.  Only check writability of socket if a stream is
writable to avoid busy loop when QUIC flow control window is filled
up, or upload buffer is full.

Closes #8688
2022-04-10 23:07:42 +02:00
Nick Banks
37492ebbfa
msh3: add support for QUIC and HTTP/3 using msh3
Considered experimental, as the other HTTP/3 backends.

Closes #8517
2022-04-10 18:23:04 +02:00
Daniel Stenberg
7befbe9ce9
TODO: "SFTP with SCP://" 2022-04-10 10:35:39 +02:00
Daniel Stenberg
7e99db829c
GHA: move bearssl jobs over from zuul
Closes #8684
2022-04-07 08:36:38 +02:00
Daniel Stenberg
9e8c8b145b
data/DISABLED: disable test 313 on bearssl builds
Closes #8684
2022-04-07 08:36:35 +02:00
Daniel Stenberg
71a0e053e9
runtests: add 'bearssl' as testable feature
Closes #8684
2022-04-07 08:36:27 +02:00
Daniel Stenberg
51d271213b
GHA: add openssl3 jobs moved over from zuul
Closes #8683
2022-04-07 08:35:10 +02:00
Daniel Stenberg
fbba7dd796
schannel: remove dead code that will never run
As the condition can't ever evaluate true

Reported-by: Andrey Alifanov
Ref: #8675
Closes #8677
2022-04-06 08:33:20 +02:00
Daniel Stenberg
d4cf98bbd1
connecache: remove duplicate connc->closure_handle check
The superfluous extra check could cause analyzer false positives
and doesn't serve any purpose.

Closes #8676
2022-04-06 08:32:04 +02:00
MAntoniak
ba83c522f5
mbedtls: remove server_fd from backend
Closes #8682
2022-04-06 08:31:12 +02:00
Tatsuhiro Tsujikawa
92c0123585
ngtcp2: use token when detecting :status header field
Closes #8679
2022-04-05 16:48:44 +02:00
Tatsuhiro Tsujikawa
913b80d5fd
ngtcp2: make curl 1ms faster
Pass 0 for an already expired timer.

Closes #8678
2022-04-05 16:47:18 +02:00
Tatsuhiro Tsujikawa
1b1443a8ed
ngtcp2: fix QUIC_IDLE_TIMEOUT
QUIC_IDLE_TIMEOUT should be of type ngtcp2_duration which is
nanoseconds resolution.

Closes #8678
2022-04-05 16:47:07 +02:00
Daniel Stenberg
4a8f6869db
English: use American spelling consistently
Authorization, Initialization, Organization etc.

Closes #8673
2022-04-05 14:55:47 +02:00
Sascha Zengler
b47bda5594 BUGS: Fix incorrect punctuation
Closes #8672
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
2022-04-05 08:53:19 +02:00
Daniel Stenberg
f48a0ce814
tool_listhelp.c: uppercase URL 2022-04-04 14:43:33 +02:00
Daniel Stenberg
41ea595ec4
RELEASE-NOTES: synced 2022-04-04 11:11:39 +02:00
Daniel Stenberg
854ec76551
http: streamclose "already downloaded"
Instead of connclose()ing, since when HTTP/2 is used it doesn't need to
close the connection as stopping the current transfer is enough.

Reported-by: Evangelos Foutras
Closes #8665
2022-04-01 23:30:43 +02:00
Jay Satiro
9ca6cd924c ftp: fix error message for partial file upload
- Show the count of bytes written on partial file upload.

Prior to this change the error message mistakenly showed the count of
bytes read, not written.

Bug: https://github.com/curl/curl/discussions/8637
Reported-by: Taras Kushnir

Closes https://github.com/curl/curl/pull/8649
2022-04-01 13:52:13 -04:00
Daniel Stenberg
218cc70028
http: correct the header error message to say colon
Not semicolon

Reported-by: Gisle Vanem
Ref: #8666
Closes #8667
2022-04-01 17:00:18 +02:00
Daniel Stenberg
b716b5aa7e
lib: #ifdef on USE_HTTP2 better
... as nghttp2 might not be the library that provides HTTP/2 support.

Closes #8661
2022-04-01 13:45:52 +02:00
MAntoniak
266627b0bc
mbedtls: remove 'protocols' array from backend when ALPN is not used
Closes #8663
2022-04-01 13:43:11 +02:00
Daniel Stenberg
fda4b81635
http2: RST the stream if we stop it on our own will
For the "simulated 304" case the done-call isn't considered "premature"
but since the server didn't close the stream it needs to be reset to
stop delivering data.

Closes #8664
2022-04-01 13:23:04 +02:00
Daniel Stenberg
3fa634a337
http: close the stream (not connection) on time condition abort
Closes #8664
2022-04-01 13:22:59 +02:00
Daniel Stenberg
b5a9680577
http2: handle DONE called for the paused stream
As it could otherwise stall all streams on the connection

Reported-by: Evangelos Foutras
Fixes #8626
Closes #8664
2022-04-01 13:22:58 +02:00
Daniel Stenberg
7c1acaf61e
tls: make mbedtls and NSS check for h2, not nghttp2
This makes them able to also negotiate HTTP/2 even when built to use
hyper for h2.

Closes #8656
2022-03-31 16:04:00 +02:00
Daniel Stenberg
0239a5fbfb
tests/libtest/lib670.c: fixup the copyright year range
follow-up to b54e18640e
2022-03-31 16:04:00 +02:00
Leandro Coutinho
b54e18640e
lib670: avoid double check result
Closes #8660
2022-03-31 14:27:13 +02:00
Daniel Stenberg
34ebf3f90d
vtls: use a generic "ALPN, server accepted" message
Closes #8657
2022-03-31 14:21:01 +02:00