Commit Graph

31624 Commits

Author SHA1 Message Date
Jacob Hoffman-Andrews
ad040e1262
rustls: implement connect_blocking
Closes #11647
2023-12-04 23:03:45 +01:00
Daniel Stenberg
79147a76cd
examples/rtsp-options.c: add
Just a bare bones RTSP example using CURLOPT_RTSP_SESSION_ID and
CURLOPT_RTSP_REQUEST set to CURL_RTSPREQ_OPTIONS.

Closes #12452
2023-12-04 22:35:38 +01:00
Stefan Eissing
0fbbc80b24
ngtcp2: ignore errors on unknown streams
- expecially in is_alive checks on connections, we might
  see incoming packets on streams already forgotten and closed,
  leading to errors reported by nghttp3. Ignore those.

Closes #12449
2023-12-04 12:57:24 +01:00
Daniel Stenberg
cb521d1f9a
docs: make all examples in all libcurl man pages compile
Closes #12448
2023-12-04 10:50:42 +01:00
Daniel Stenberg
3c4fba8cf5
checksrc.pl: support #line instructions
makes it identify the correct source file and line
2023-12-04 10:50:42 +01:00
Daniel Stenberg
8dbcdc8c09
GHA/man-examples: verify libcurl man page examples 2023-12-04 10:50:42 +01:00
Daniel Stenberg
c5576d8d28
verify-examples.pl: verify that all man page examples compile clean 2023-12-04 10:50:42 +01:00
Daniel Stenberg
54d33862b5
RELEASE-NOTES: synced 2023-12-02 23:21:21 +01:00
Graham Campbell
f6e83a4cb0
http3: bump ngtcp2 and nghttp3 versions
nghttp3 v1.1.0
ngtcp2 v1.1.0

In docs and CI

Closes #12446
2023-12-02 23:02:54 +01:00
Graham Campbell
7b507feff4
CI/quiche: use 3.1.4+quic consistently in CI workflows
Closes #12447
2023-12-02 23:00:36 +01:00
Viktor Szakats
0f10360073
test1545: disable deprecation warnings
Fixes:
https://ci.appveyor.com/project/curlorg/curl/builds/48631551/job/bhx74e0i66yrp6pk#L1205

Same with details:
https://ci.appveyor.com/project/curlorg/curl/builds/48662893/job/ol8a78q9gmilb6wt#L1263
```
tests/libtest/lib1545.c:38:3: error: 'curl_formadd' is deprecated: since 7.56.0. Use curl_mime_init() [-Werror=deprecated-declarations]
   38 |   curl_formadd(&m_formpost, &lastptr, CURLFORM_COPYNAME, "file",
      |   ^~~~~~~~~~~~
[...]
```

Follow-up to 07a3cd83e0 #12421

Fixes #12445
Closes #12444
2023-12-02 20:17:41 +00:00
Daniel Stenberg
586e3c19cd
INSTALL: update list of ports and CPU archs 2023-12-02 17:40:48 +01:00
Daniel Stenberg
018f9cb480
symbols-in-versions: the CLOSEPOLICY options are deprecated
The were used with the CURLOPT_CLOSEPOLICY option, which *never* worked.
2023-12-02 17:07:34 +01:00
z2_
c44671ed43 build: fix builds that disable protocols but not digest auth
- Build base64 functions if digest auth is not disabled.

Prior to this change if some protocols were disabled but not digest auth
then a build error would occur due to missing base64 functions.

Fixes https://github.com/curl/curl/issues/12440
Closes https://github.com/curl/curl/pull/12442
2023-12-01 23:26:53 -05:00
MAntoniak
0eda1f6c9f
connect: reduce number of transportation providers
Use only the ones necessary - the ones that are built-in. Saves a few
bytes in the resulting code.

Closes #12438
2023-12-01 23:14:07 +01:00
David Benjamin
56791f3e23
vtls: consistently use typedef names for OpenSSL structs
The foo_st names don't appear in OpenSSL public API documentation. The
FOO typedefs are more common. This header was already referencing
SSL_CTX via <openssl/ssl.h>. There is a comment about avoiding
<openssl/x509v3.h>, but OpenSSL actually declares all the typedefs in
<openssl/ossl_typ.h>, which is already included by <openssl/ssl.h> (and
every other OpenSSL header), so just use that. Though I've included it
just to be explicit.

(I'm also fairly sure including <openssl/ssl.h> already triggers the
Schannel conflicts anyway. The comment was probably just out of date.)

Closes #12439
2023-12-01 23:00:43 +01:00
Lau
f5ba531ed2
libcurl-security.3: fix typo
Fixed minimal typo.

Closes #12437
2023-12-01 17:54:38 +01:00
Stefan Eissing
781cd3e864
ngtcp2: fix races in stream handling
- fix cases where ngtcp2 invokes callbacks on streams that
  nghttp3 has already forgotten. Ignore the NGHTTP3_ERR_STREAM_NOT_FOUND
  in these cases as it is normal behaviour.

Closes #12435
2023-12-01 17:52:36 +01:00
Emanuele Torre
6c7da81561
tool_writeout_json: fix JSON encoding of non-ascii bytes
char variables if unspecified can be either signed or unsigned depending
on the platform according to the C standard; in most platforms, they are
signed.

This meant that the  *i<32  waas always true for bytes with the top bit
set. So they were always getting encoded as \uXXXX, and then since they
were also signed negative, they were getting extended with 1s causing
'\xe2' to be expanded to \uffffffe2, for example:

  $ curl --variable 'v=“' --expand-write-out '{{v:json}}\n' file:///dev/null
  \uffffffe2\uffffff80\uffffff9c

I fixed this bug by making the code use explicitly unsigned char*
variables instead of char* variables.

Test 268 verifies

Reported-by: iconoclasthero
Closes #12434
2023-12-01 10:39:13 +01:00
Stefan Eissing
83e4d61981
cf-socket: TCP trace output local address used in connect
Closes #12427
2023-12-01 10:18:19 +01:00
Jay Satiro
841427376e CURLINFO_PRETRANSFER_TIME_T.3: fix time explanation
- Change CURLINFO_PRETRANSFER_TIME_T explanation to say that it
  includes protocol-specific instructions that trigger a transfer.

Prior to this change it explicitly said that it did not include those
instructions in the time, but that is incorrect.

The change is a copy of the fixed explanation already in
CURLINFO_PRETRANSFER_TIME, fixed by ec8dcd7b.

Reported-by: eeverettrbx@users.noreply.github.com

Fixes https://github.com/curl/curl/issues/12431
Closes https://github.com/curl/curl/pull/12432
2023-12-01 02:58:00 -05:00
Daniel Stenberg
d1c2bb3d8d
multi: during ratelimit multi_getsock should return no sockets
... as there is nothing to wait for then, it just waits. Otherwise, this
causes much more CPU work and updates than necessary during ratelimit
periods.

Ref: https://curl.se/mail/lib-2023-11/0056.html
Closes #12430
2023-11-30 15:53:22 +01:00
Dmitry Karpov
6a0dc7cf23
transfer: abort pause send when connection is marked for closing
This handles cases of some bi-directional "upgrade" scenarios
(i.e. WebSockets) where sending is paused until some "upgrade" handshake
is completed, but server rejects the handshake and closes the
connection.

Closes #12428
2023-11-30 09:30:51 +01:00
Daniel Stenberg
a4ed3e766a
RELEASE-NOTES: synced 2023-11-28 23:04:09 +01:00
Daniel Stenberg
395365ad2d
openssl: when a session-ID is reused, skip OCSP stapling
Fixes #12399
Reported-by: Alexey Larikov
Closes #12418
2023-11-28 22:59:10 +01:00
Daniel Stenberg
07a3cd83e0
test1545: test doing curl_formadd twice with missing file
Reproduces #12410
Verifies the fix
Closes #12421
2023-11-28 22:57:42 +01:00
Daniel Stenberg
34e319954a
Curl_http_body: cleanup properly when Curl_getformdata errors
Reported-by: yushicheng7788 on github
Based-on-work-by: yushicheng7788 on github
Fixes #12410
Closes #12421
2023-11-28 22:57:22 +01:00
Daniel Stenberg
0ca3a4ec9a
test1477: verify that libcurl-errors.3 and public headers are synced
The script errorcodes.pl extracts all error codes from all headers and
checks that they are all documented, then checks that all documented
error codes are also specified in a header file.

Closes #12424
2023-11-28 22:55:50 +01:00
Daniel Stenberg
66ec950004
libcurl-errors.3: sync with current public headers
Closes #12424
2023-11-28 22:55:33 +01:00
Stefan Eissing
39778f95fd
test459: fix for parallel runs
- change warniing message to work better with varying filename
  length.
- adapt test output check to new formatting

Follow-up to 97ccc4479f
Closes #12423
2023-11-28 14:23:06 +01:00
Daniel Stenberg
e6bf2001c7
tool_cb_prg: make the carriage return fit for wide progress bars
When the progress bar was made max width (256 columns), the fly()
function attempted to generate its output buffer too long so that the
trailing carriage return would not fit and then the output would show
wrongly. The fly function is called when the expected total transfer is
unknown, which could be one or more progress calls before the actual
progress meter get shown when the expected transfer size is provided.

This new take also replaces the msnprintf() call with a much simpler
memset() for speed.

Reported-by: Tim Hill
Fixes #12407
Closes #12415
2023-11-27 19:16:05 +01:00
Daniel Stenberg
97ccc4479f
tool_parsecfg: make warning output propose double-quoting
When the config file parser detects a word that *probably* should be
quoted, mention double-quotes as a possible remedy.

Test 459 verifies.

Proposed-by: Jiehong on github
Fixes #12409
Closes #12412
2023-11-27 14:02:50 +01:00
Jay Satiro
1b04dfa371 curl.rc: switch out the copyright symbol for plain ASCII
.. like we already do for libcurl.rc.

libcurl.rc copyright symbol used to cause a "non-ascii 8-bit codepoint"
warning so it was switched to ascii.

Ref: https://github.com/curl/curl/commit/1ca62bb5#commitcomment-133474972

Suggested-by: Robert Southee

Closes https://github.com/curl/curl/pull/12403
2023-11-26 18:42:02 -05:00
Daniel Stenberg
dbf4c4030a
conncache: use the closure handle when disconnecting surplus connections
Use the closure handle for disconnecting connection cache entries so
that anything that happens during the disconnect is not stored and
associated with the 'data' handle which already just finished a transfer
and it is important that details from the unrelated disconnect does not
taint meta-data in the data handle.

Like storing the response code.

This also adjust test 1506. Unfortunately it also removes a key part of
the test that verifies that a connection is closed since when this
output vanishes (because the closure handle is used), we don't know
exactly that the connection actually gets closed in this test...

Reported-by: ohyeaah on github
Fixes #12367
Closes #12405
2023-11-26 17:49:15 +01:00
Daniel Stenberg
50a1c30b91
RELEASE-NOTES: synced 2023-11-24 21:01:54 +01:00
Stefan Eissing
247defa753
quic: make eyeballers connect retries stop at weird replies
- when a connect immediately goes into DRAINING state, do
  not attempt retries in the QUIC connection filter. Instead,
  return CURLE_WEIRD_SERVER_REPLY
- When eyeballing, interpret CURLE_WEIRD_SERVER_REPLY as an
  inconclusive answer. When all addresses have been attempted,
  rewind the address list once on an inconclusive answer.
- refs #11832 where connects were retried indefinitely until
  the overall timeout fired

Closes #12400
2023-11-24 20:58:54 +01:00
Daniel Stenberg
e7112a726b
CI: verify libcurl function SYNPOSIS sections
With the .github/scripits/verify-synopsis.pl script

Closes #12402
2023-11-24 20:35:50 +01:00
Daniel Stenberg
ad1dfc594f
docs/libcurl: SYNSOPSIS cleanup
- use the correct include file
- make sure they are declared as in the header file
- fix minor nroff syntax mistakes (missing .fi)

These are verified by verify-synopsis.pl, which extracts the SYNPOSIS
code and runs it through gcc.

Closes #12402
2023-11-24 20:35:38 +01:00
Daniel Stenberg
3c30c165a8
sendf: fix comment typo 2023-11-24 14:36:25 +01:00
Daniel Stenberg
f27b8dba73
fopen: allocate the dir after fopen
Move the allocation of the directory name down to after the fopen() call
to allow that shortcut code path to avoid a superfluous malloc+free
cycle.

Follow-up to 73b65e94f3

Closes #12398
2023-11-24 13:24:08 +01:00
Stefan Eissing
5b65e7d1ae
transfer: cleanup done+excess handling
- add `SingleRequest->download_done` as indicator that
  all download bytes have been received
- remove `stop_reading` bool from readwrite functions
- move excess body handling into client download writer

Closes #12371
2023-11-24 13:22:07 +01:00
Daniel Stenberg
03cb1ff4d6
fopen: create new file using old file's mode
Because the function renames the temp file to the target name as a last
step, if the file was previously owned by a different user, not ORing
the old mode could otherwise end up creating a file that was no longer
readable by the original owner after save.

Reported-by: Loïc Yhuel
Fixes #12299
Closes #12395
2023-11-23 22:30:42 +01:00
Daniel Stenberg
242e6d019f
test1476: require proxy
Follow-up from 323df4261c

Closes #12394
2023-11-23 19:56:12 +01:00
Daniel Stenberg
73b65e94f3
fopen: create short(er) temporary file name
Only using random letters in the name plus a ".tmp" extension. Not by
appending characters to the final file name.

Reported-by: Maksymilian Arciemowicz

Closes #12388
2023-11-23 15:46:34 +01:00
Stefan Eissing
2692d41c23
tests: git ignore generated second-hsts.txt file
File is generated in test lib1900

Follow-up to 7cb03229d9

Closes #12393
2023-11-23 15:35:58 +01:00
Viktor Szakats
294194d689
openssl: enable infof_certstack for 1.1 and LibreSSL 3.6
Lower the barrier to enable `infof_certstack()` from OpenSSL 3 to
OpenSSL 1.1.x, and LibreSSL 3.6 or upper.

With the caveat, that "group name" and "type name" are missing from
the log output with these TLS backends.

Follow-up to b6e6d4ff8f #12030

Reviewed-by: Daniel Stenberg
Closes #12385
2023-11-23 12:41:48 +00:00
Daniel Stenberg
fafefdf9dc
urldata: fix typo in comment 2023-11-23 13:07:53 +01:00
Daniel Stenberg
481755955b
CI: codespell
The list of words to ignore is in the file
.github/scripts/codespell-ignore.txt

Closes #12390
2023-11-23 13:07:26 +01:00
Daniel Stenberg
0510e8b58c
lib: fix comment typos
Five separate ones, found by codespell

Closes #12390
2023-11-23 12:35:59 +01:00
Daniel Stenberg
323df4261c
test1476: verify cookie PSL mixed case 2023-11-23 10:09:01 +01:00