Commit Graph

31650 Commits

Author SHA1 Message Date
Daniel Stenberg
e38a8e0cd0
docs: clean up Protocols: for cmdline options
... and some other minor polish.

Closes #12496
2023-12-11 10:40:16 +01:00
Daniel Stenberg
9fa8652fd5
cmdline/gen: fix the sorting of the man page options
They were previously sorted based on the file names, which use a .d
extension, making "data" get placed after "data-binary" etc. Making the
sort ignore the extention fixes the ordering.

Reported-by: Boris Verkhovskiy
Bug: https://curl.se/mail/archive-2023-12/0014.html
Closes #12494
2023-12-10 14:04:52 +01:00
Daniel Gustafsson
d65b8868c6
doh: remove unused local variable
The nurl variable is no longer used during probing following
a refactoring, so remove.

Closes #12491
2023-12-09 00:14:18 +01:00
Jay Satiro
0f3f384343 build: fix Windows ADDRESS_FAMILY detection
- Include winsock2.h for Windows ADDRESS_FAMILY detection.

Prior to this change cmake detection didn't work because it included
ws2def.h by itself, which is missing needed types from winsock2.h.

Prior to this change autotools detection didn't work because it did not
include any Windows header.

In both cases libcurl would fall back on unsigned short as the address
family type, which is the same as ADDRESS_FAMILY.

Co-authored-by: Viktor Szakats

Closes https://github.com/curl/curl/pull/12441
2023-12-08 13:11:44 -05:00
Daniel Stenberg
7c992dd9f8
lib: rename Curl_strndup to Curl_memdup0 to avoid misunderstanding
Since the copy does not stop at a null byte, let's not call it anything
that makes you think it works like the common strndup() function.

Based on feedback from Jay Satiro, Stefan Eissing and Patrick Monnerat

Closes #12490
2023-12-08 17:22:33 +01:00
Daniel Stenberg
6d8dc2f636
convsrctest.pl: removed: not used, not shipped in tarballs 2023-12-08 12:53:24 +01:00
Daniel Stenberg
c386065878
tests: rename tests scripts to the test number
It is hard to name the scripts sensibly. Lots of them are similarly
named and the name did not tell which test that used them.

The new approach is rather to name them based on the test number that
runs them. Also helps us see which scripts are for individual tests
rather than for general test infra.

 - badsymbols.pl -> test1167.pl
 - check-deprecated.pl -> test1222.pl
 - check-translatable-options.pl -> test1544.pl
 - disable-scan.pl -> test1165.pl
 - error-codes.pl -> test1175.pl
 - errorcodes.pl -> test1477.pl
 - extern-scan.pl -> test1135.pl
 - manpage-scan.pl -> test1139.pl
 - manpage-syntax.pl -> test1173.pl
 - markdown-uppercase.pl -> test1275.pl
 - mem-include-scan.pl -> test1132.pl
 - nroff-scan.pl -> test1140.pl
 - option-check.pl -> test1276.pl
 - options-scan.pl -> test971.pl
 - symbol-scan.pl -> test1119.pl
 - version-scan.pl -> test1177.pl

Closes #12487
2023-12-08 12:53:17 +01:00
MAntoniak
13a1d1ace8
sendf: fix compiler warning with CURL_DISABLE_HEADERS_API
fix MSVC warning C4189: 'htype': local variable is initialized but not
referenced - when CURL_DISABLE_HEADERS_API is defined.

Closes #12485
2023-12-08 09:28:53 +01:00
Viktor Szakats
ede2e812c2
tidy-up: whitespace
Closes #12484
2023-12-08 03:28:50 +00:00
Stefan Eissing
ca6bafce95
test_02_download: fix paramters to test_02_27
- it is a special client that only ever uses http/2

Closes #12467
2023-12-07 09:32:46 +01:00
MAntoniak
4dbc7acc19
vtls: remove the Curl_cft_ssl_proxy object if CURL_DISABLE_PROXY
Closes #12459
2023-12-07 09:31:05 +01:00
Daniel Stenberg
7309b9cbbf
lib: strndup/memdup instead of malloc, memcpy and null-terminate
- bufref: use strndup
 - cookie: use strndup
 - formdata: use strndup
 - ftp: use strndup
 - gtls: use aprintf instead of malloc + strcpy * 2
 - http: use strndup
 - mbedtls: use strndup
 - md4: use memdup
 - ntlm: use memdup
 - ntlm_sspi: use strndup
 - pingpong: use memdup
 - rtsp: use strndup instead of malloc, memcpy and null-terminate
 - sectransp: use strndup
 - socks_gssapi.c: use memdup
 - vtls: use dynbuf instead of malloc, snprintf and memcpy
 - vtls: use strdup instead of malloc + memcpy
 - wolfssh: use strndup

Closes #12453
2023-12-07 08:47:44 +01:00
Daniel Stenberg
63cdaefbc3
strdup: remove the memchr check from Curl_strndup
It makes it possible to clone a binary chunk of data.

Closes #12453
2023-12-07 08:47:28 +01:00
Daniel Stenberg
c0dd06ecb3
ftp: handle the PORT parsing without allocation
Also reduces amount of *cpy() calls.

Closes #12456
2023-12-07 08:46:22 +01:00
Daniel Stenberg
f899e91431
RELEASE-NOTES: synced
Bumped to 8.5.1
2023-12-06 23:23:06 +01:00
Daniel Stenberg
45cf4755e7
url: for disabled protocols, mention if found in redirect
To help users better understand where the URL (and denied scheme) comes
from. Also removed "in libcurl" from the message, since the disabling
can be done by the application.

The error message now says "not supported" or "disabled" depending on
why it was denied:

 Protocol "hej" not supported
 Protocol "http" disabled

And in redirects:

 Protocol "hej" not supported (in redirect)
 Protocol "http" disabled (in redirect)

Reported-by: Mauricio Scheffer
Fixes #12465
Closes #12469
2023-12-06 23:05:21 +01:00
Stefan Eissing
8b99e6f23f
sectransp_ make TLSCipherNameForNumber() available in non-verbose config
Reported-by: Cajus Pollmeier
Closes #12476
Fixes #12474
2023-12-06 23:03:35 +01:00
YX Hao
a17f041bea
lib: fix variable undeclared error caused by infof changes
`--disable-verbose` yields `CURL_DISABLE_VERBOSE_STRINGS` defined.
`infof` isn't `Curl_nop_stmt` anymore: dac293c.

Follow-up to dac293c

Closes #12470
2023-12-06 23:01:54 +01:00
Viktor Szakats
8b76591b6b
tidy-up: fix yamllint whitespace issues in labeler.yml
Follow-up to bda2129114 #12466

Reviewed-by: Dan Fandrich
Closes #12475
2023-12-06 20:33:04 +00:00
Viktor Szakats
bda2129114
tidy-up: fix yamllint whitespace issues
Closes #12466
2023-12-06 17:25:59 +00:00
Chris Sauer
a2e75af3fb
cmake: fix typo
Follow-up to aace27b
Closes #12464
2023-12-06 13:13:41 +01:00
Daniel Stenberg
da8c1d1578
dist: add tests/errorcodes.pl to the tarball
Used by test 1477

Reported-by: Xi Ruoyao
Follow-up to 0ca3a4ec9a
Fixes #12462
Closes #12463
2023-12-06 11:28:41 +01:00
Dan Fandrich
ee2e8bfa36 github/labeler: update a missed key in the v5 upgrade
Follow-up to ce03fe3ba
2023-12-06 00:59:53 -08:00
Daniel Stenberg
7161cb17c0
RELEASE-NOTES: synced
The curl 8.5.0 release.
2023-12-06 08:11:44 +01:00
Dan Fandrich
ce03fe3bae github/labeler: switch from the beta to labeler v5
Some keys were renamed and the dot option was made default.

Closes #12458
2023-12-05 13:30:35 -08:00
Daniel Stenberg
04540f69cf
DEPRECATE: remove NTLM_WB in June 2024
Ref: https://curl.se/mail/lib-2023-12/0010.html

Closes #12451
2023-12-05 08:02:59 +01:00
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