Commit Graph

31469 Commits

Author SHA1 Message Date
Tatsuhiko Miyagawa
1e9db6997a
http: fix off-by-one error in request method length check
It should allow one more byte.

Closes #12534
2023-12-16 13:20:09 +01:00
Daniel Stenberg
102de7aa8d
curl: show ipfs and ipns as supported "protocols"
They are accepted schemes in URLs passed to curl (the tool, not the
library).

Also makes curl-config show the same list.

Co-Authored-by: Jay Satiro
Reported-by: Chara White
Bug: https://curl.se/mail/archive-2023-12/0026.html
Closes #12508
2023-12-15 14:03:44 +01:00
Daniel Stenberg
907eea0804
Revert "urldata: move async resolver state from easy handle to connectdata"
This reverts commit 56a4db2e4e (#12198)

We want the c-ares channel to be held in the easy handle, not per
connection - for performance.

Closes #12524
2023-12-15 12:57:35 +01:00
Viktor Szakats
9f2d2290d1
openssl: re-match LibreSSL deinit with init
Earlier we switched to use modern initialization with LibreSSL v2.7.0
and up, but did not touch deinitialization [1]. Fix it in this patch.

Regression from bec0c5bbf3 #11611

[1] https://github.com/curl/curl/pull/11611#issuecomment-1668654014

Reported-by: Mike Hommey
Reviewed-by: Daniel Stenberg
Fixes #12525
Closes #12526
2023-12-15 09:26:04 +00:00
Daniel Stenberg
78a1814b33
libssh: supress warnings without version check
Define unconditionally.

Follow-up from d21bd2190c

Closes #12523
2023-12-14 23:47:48 +01:00
Daniel Stenberg
907dce2dc0
hostip: return error immediately when Curl_ip2addr() fails
Closes #12522
2023-12-14 22:57:28 +01:00
Theo
d21bd2190c
libssh: improve the deprecation warning dismissal
Previous code was compiler dependant, and dismissed all deprecation warnings
indiscriminately.

libssh provides a way to disable the deprecation warnings for libssh only, and
naturally this is the preferred way.

This commit uses that, to prevent the erroneous hiding of potential, unrelated
deprecation warnings.

Fixes #12519
Closes #12520
2023-12-14 18:05:53 +01:00
Daniel Stenberg
de0cd5e8e7
test1474: removed
The test was already somewhat flaky and disabled on several platforms,
and after 1da640abb6 even more unstable.
2023-12-14 16:14:00 +01:00
Daniel Stenberg
1da640abb6
readwrite_data: loop less
This function is made to loop in order to drain incoming data
faster. Completely removing the loop has a measerably negative impact on
transfer speeds.

Downsides with the looping include

- it might call the progress callback much more seldom. Especially if
  the write callback is slow.

- rate limiting becomes less exact

- a single transfer might "starve out" other parallel transfers

- QUIC timers for other connections can't be maintained correctly

The long term fix should be to remove the loop and optimize coming back
to avoid the transfer speed penalty.

This fix lower the max loop count to reduce the starvation problem, and
avoids the loop completely for when rate-limiting is in progress.

Ref: #12488
Ref: https://curl.se/mail/lib-2023-12/0012.html
Closes #12504
2023-12-14 16:13:28 +01:00
Stefan Eissing
8706b68010
lib: eliminate conn->cselect_bits
- use `data->state.dselect_bits` everywhere instead
- remove `bool *comeback` parameter as non-zero
  `data->state.dselect_bits` will indicate that IO is
  incomplete.

Closes #12512
2023-12-14 15:20:05 +01:00
Stefan Eissing
0f052808b3
connect: refactor Curl_timeleft()
- less local vars, "better" readability
- added documentation

Closes #12518
2023-12-14 15:18:32 +01:00
Dmitry Karpov
1e4cd51935
cookie: avoid fopen with empty file name
Closes #12514
2023-12-14 00:15:57 +01:00
Viktor Szakats
246e0d805a
tests/server: delete workaround for old-mingw
mingw-w64 1.0 comes with w32api v3.12, thus doesn't need this.

Follow-up to 38029101e2 #11625

Reviewed-by: Jay Satiro
Closes #12510
2023-12-13 08:01:33 +00:00
Viktor Szakats
043523a89b
cmake: delete obsolete TODOs more [ci skip]
- manual completed: 898b012a9b #1288
- soname completed: 5de6848f10 #10023
- bunch of others that are completed
- `NTLM_WB_ENABLED` is implemented in a basic form, and now also
  scheduled for removal, so a TODO at this point isn't useful.

And this 'to-check' item:

Q: "The cmake build selected to run gcc with -fPIC on my box while the
   plain configure script did not."

A: With CMake, since 2ebc74c36a #11546
   and fc9bfb1452 #11627, we explicitly
   enable PIC for libcurl shared lib. Or when building libcurl for
   shared and static lib in a single pass. We do this by default for
   Windows or when enabled by the user via `SHARE_LIB_OBJECT`.
   Otherwise we don't touch this setting. Meaning the default set by
   CMake (if any) or the toolchain is used. On Debian Bookworm, this
   means that PIC is disabled for static libs by default. Some platforms
   (like macOS), has PIC enabled by default.
   autotools supports the double-pass mode only, and in that case
   CMake seems to match PIC behaviour now (as tested on Linux with gcc.)

Follow-up to 5d5dfdbd1a #12500

Reviewed-by: Jay Satiro
Closes #12509
2023-12-13 08:01:33 +00:00
Stefan Eissing
3be759610f
CLIENT-WRITERS: design and use documentation
Closes #12507
2023-12-12 17:37:52 +01:00
Viktor Szakats
5d5dfdbd1a
cmake: delete obsolete TODO items [ci skip]
There is always room for improvement, but CMake is up to par now with
autotools, so there is no longer a good reason to keep around these
inline TODO items.

Answering one of questions:

Q: "The gcc command line use neither -g nor any -O options. As a
   developer, I also treasure our configure scripts's --enable-debug
   option that sets a long range of "picky" compiler options."

A: CMake offers the `CMAKE_BUILD_TYPE` variable to control debug info
   and optimization level. E.g.:
   - `Release`    = `-O3` + no debug info
   - `MinSizeRel` = `-Os` + no debug info
   - `Debug`      = `-O0` + debug info

   https://stackoverflow.com/questions/48754619/what-are-cmake-build-type-debug-release-relwithdebinfo-and-minsizerel/59314670#59314670
   https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#default-and-custom-configurations

   For picky warnings we have the `PICKY_COMPILER` options, enabled by
   default.

Closes #12500
2023-12-12 11:54:35 +00:00
Stefan Eissing
02d81c5a68
CONNECTION-FILTERS: update documentation
Closes #12497
2023-12-11 23:30:26 +01:00
Daniel Stenberg
ff74cef5d4
lib: reduce use of strncpy
- bearssl: select cipher without buffer copies
- http_aws_sigv4: avoid strncpy, require exact timestamp length
- http_aws_sigv4: use memcpy isntead of strncpy
- openssl: avoid strncpy calls
- schannel: check for 1.3 algos without buffer copies
- strerror: avoid strncpy calls
- telnet: avoid strncpy, return error on too long inputs
- vtls: avoid strncpy in multissl_version()

Closes #12499
2023-12-11 23:29:02 +01:00
Daniel Stenberg
9efdefe6b1
CI/distcheck: run full tests
To be able to detect missing files better, this now runs the full CI
test suite. If done before, it would have detected #12462 before
release.

Closes #12503
2023-12-11 23:26:04 +01:00
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