Commit Graph

31210 Commits

Author SHA1 Message Date
Stefan Eissing
7eb31c852d
RTSP: improved RTP parser
- fix HTTP header parsing to report incomplete
  lines it buffers as consumed!
- re-implement the RTP parser for interleave RTP
  messages for robustness. It is now keeping its
  state at the connection
- RTSP protocol handler "readwrite" implementation
  now tracks if the response is before/in/after
  header parsing or "in" a bod by calling
  "Curl_http_readwrite_headers()" itself. This
  allows it to know when non-RTP bytes are "junk"
  or HEADER or BODY.
- tested with #12035 and various small receive
  sizes where current master fails

Closes #12052
2023-10-21 14:38:21 +02:00
Stefan Eissing
117c9bd978
http2: header conversion tightening
- fold the code to convert dynhds to the nghttp2 structs
  into a dynhds internal method
- saves code duplication
- pacifies compiler analyzers

Closes #12097
2023-10-21 14:36:51 +02:00
Daniel Stenberg
f76fcd6f4d
curl_ntlm_wb: fix elif typo
Reported-by: Manfred Schwarb
Follow-up to d4314cdf65
Bug: d4314cdf65 (r130551295)
2023-10-21 10:29:02 +02:00
Dan Fandrich
31d96af8b5 test1683: remove commented-out check alternatives
Python precheck/postcheck alternatives were included but commented out.
Since these are not used and perl is guaranteed to be available to run
the perl versions anyway, the Python ones are removed.
2023-10-20 15:32:21 -07:00
Daniel Stenberg
b651aba096
hostip: show the list of IPs when resolving is done
Getting 'curl.se' today then gets this verbose output which might help
debugging connectivity related matters.

* Host curl.se:80 was resolved.
* IPv6: 2a04:4e42::347, 2a04:4e42:200::347, 2a04:4e42:400::347,
  2a04:4e42:600::347, 2a04:4e42:800::347, 2a04:4e42:a00::347,
  2a04:4e42:c00::347, 2a04:4e42:e00::347
* IPv4: 151.101.193.91, 151.101.1.91, 151.101.65.91, 151.101.129.91

Co-authored-by: Jay Satiro
Closes #12145
2023-10-20 23:00:10 +02:00
rilysh
276ffedec2
docs: fix function typo in curl_easy_option_next.3
Closes #12170
2023-10-20 22:57:47 +02:00
Daniel Stenberg
8d3ce930f8
vssh: remove the #ifdef for Curl_ssh_init, use empty macro
In the same style as other init calls
2023-10-20 22:56:01 +02:00
Daniel Stenberg
347cf02e9d
easy: remove duplicate wolfSSH init call
It is already done in Curl_ssh_init() where it belongs.

Closes #12168
2023-10-20 22:55:54 +02:00
Daniel Stenberg
24c495a52f
socks: make SOCKS5 use the CURLOPT_IPRESOLVE choice
Fixes #11949
Reported-by: Ammar Faizi
Closes #12163
2023-10-20 17:14:51 +02:00
Daniel Stenberg
fc077bc786
urldata: move the 'internal' boolean to the state struct
... where all the other state bits for the easy handles live.

Closes #12165
2023-10-20 16:59:52 +02:00
Daniel Stenberg
b0bee93dfe
url: don't touch the multi handle when closing internal handles
Reported-by: Maksymilian Arciemowicz
Closes #12165
2023-10-20 16:59:43 +02:00
Faraz Fallahi
d31a8424e8
getenv: PlayStation doesn't have getenv()
Closes #12140
2023-10-19 17:00:35 +02:00
Daniel Stenberg
df9aea22c2
transfer: only reset the FTP wildcard engine in CLEAR state
To avoid the state machine to start over and redownload all the files
*again*.

Reported-by: lkordos on github
Regression from 843b3baa3e (shipped in 8.1.0)
Bisect-by: Dan Fandrich
Fixes #11775
Closes #12156
2023-10-19 16:58:31 +02:00
Stefan Eissing
8cb95850c0
GHA: move mod_h2 version in CI to v2.0.25
Closes #12157
2023-10-19 16:51:59 +02:00
Daniel Stenberg
d4314cdf65
ntlm_wb: use pipe instead of socketpair when possible
Closes #12149
2023-10-19 10:20:12 +02:00
Daniel Stenberg
913eacf773
RELEASE-NOTES: synced 2023-10-18 09:22:07 +02:00
Daniel Stenberg
43eb798da0
asyn-thread: use pipe instead of socketpair for IPC when available
If pipe() is present. Less overhead.

Helped-by: Viktor Szakats
Closes #12146
2023-10-18 08:23:53 +02:00
Dan Fandrich
64936919b9 tests: Fix Windows test helper tool search & use it for handle64
The checkcmd() and checktestcmd() functions would not have worked on
Windows due to hard-coding the UNIX PATH separator character and not
adding .exe file extension. This meant that tools like stunnel, valgrind
and nghttpx would not have been found and used on Windows, and
inspection of previous test runs show none of those being found in pure
Windows CI builds.

With this fixed, they can be used to detect the handle64.exe program
before attempting to use it. When handle64.exe was called
unconditionally without it existing, it caused perl to abort the test
run with the error

    The running command stopped because the preference variable
    "ErrorActionPreference" or common parameter is set to Stop:
    sh: handle64.exe: command not found

Closes #12115
2023-10-17 12:27:21 -07:00
Daniel Stenberg
03a70edc50
multi: use pipe instead of socketpair to *wakeup()
If pipe() is present. Less overhead.

Closes #12142
2023-10-17 15:29:31 +02:00
Jay Satiro
e160d17a02 build: fix 'threadsafe' feature detection for older gcc
- Add 'threadsafe' to the feature list shown during build if POSIX
  threads are being used.

This is a follow-up to 5adb6000 which added support for building a
thread-safe libcurl with older versions of gcc where atomic is not
available but pthread is.

Reported-by: Dan Fandrich
Co-authored-by: Dan Fandrich

Fixes https://github.com/curl/curl/issues/12125
Closes https://github.com/curl/curl/pull/12127
2023-10-17 03:33:42 -04:00
Daniel Stenberg
1a5c0db090
test729: verify socks4a with excessive proxy user name length 2023-10-16 23:47:18 +02:00
Daniel Stenberg
01057d6161
socks: better buffer size checks for socks4a user and hostname
Also limit the proxy user name to 255 bytes, which is the same limit as
in SOCKS5.

Reported-by: sd0 on hackerone
Closes #12139
2023-10-16 23:47:08 +02:00
Daniel Stenberg
0b6d9ac8d9
curl.h: on FreeBSD include sys/param.h instead of osreldate.h
Should things build on Playstation as well

Fixes #12107
Reported-by: Faraz Fallahi
Closes #12123
2023-10-16 19:40:02 +02:00
Marcin Rataj
7f7fa2fd67
tool_operate: fix links in ipfs errors
URL fragment links generated from headers in
https://curl.se/docs/ipfs.html are lowercase.

Closes #12133
2023-10-16 08:42:19 +02:00
Viktor Szakats
84a6579132
cmake: replace check_library_exists_concat()
The idea of `check_library_exists_concat()` is that it detects an
optional component and adds it to the list of libs that we also use in
subsequent component checks. This caused problems when detecting
components with unnecessary dependencies that were not yet built.

CMake offers the `CMAKE_REQUIRED_LIBRARIES` variable to set libs used
for component checks, which we already use in most cases. That left 4
uses of `check_library_exists_concat()`. Only one of these actually
needed the 'concat' feature (ldap/lber).

Delete this function and replace it with standard
`check_library_exists()` and manual management of our `CURL_LIBS`
list we use when linking build targets. And special logic to handle the
ldap/lber case.

(We have a similar function for headers: `check_include_file_concat()`.
It works, but problematic for performance reasons and because it hides
the actual headers required in `check_symbol_exists()` calls.)

Ref: #11537 #11558
Fixes #11285
Fixes #11648
Closes #12070
2023-10-15 20:48:17 +00:00
LoRd_MuldeR
b1b7552803 tool_cb_wrt: fix write output for very old Windows versions
- Pass missing parameter for 'lpNumberOfCharsWritten' to WriteConsoleW()
  function.

Apparently this parameter was *not* optional on older Windows versions.

Issue observed on Windows XP SP2. Issue not observed on Windows 7 SP1.
So at some point between those two Microsoft changed the behavior.

Prior to this change, on those versions if parameter is NULL then the
function call fails with error ERROR_INVALID_ACCESS.

Regression since af3f4e41.

Ref: https://github.com/MicrosoftDocs/Console-Docs/issues/299

Fixes https://github.com/curl/curl/issues/12131
Closes https://github.com/curl/curl/pull/12130
2023-10-15 14:43:11 -04:00
Jay Satiro
82aa0642ec tool_urlglob: fix build for old gcc versions
- Don't use __builtin_mul_overflow for GCC 4 and earlier.

The function was added in GCC 5.

Ref: https://gcc.gnu.org/gcc-5/changes.html

Reported-by: Dan Fandrich

Fixes https://github.com/curl/curl/issues/12124
Closes https://github.com/curl/curl/pull/12128
2023-10-15 14:39:42 -04:00
Carlos Henrique Lima Melara
e4de693bf6 docs/libcurl: fix three minor man page format mistakes
Reported-by: Samuel Henrique

Closes https://github.com/curl/curl/pull/12126
2023-10-14 23:19:53 -04:00
Jay Satiro
0dd0bb0d1a tests/server: add more SOCKS5 handshake error checking
- Add additional checking for missing and too-short SOCKS5 handshake
  messages.

Prior to this change the SOCKS5 test server did not check that all parts
of the handshake were received successfully. If those parts were missing
or too short then the server would access uninitialized memory.

This issue was discovered in CI job 'memory-sanitizer' test results.
Test 2055 was failing due to the SOCKS5 test server not running. It was
not running because either it crashed or memory sanitizer aborted it
during Test 728. Test 728 connects to the SOCKS5 test server on a
redirect but does not send any data on purpose. The test server was not
prepared for that.

Reported-by: Dan Fandrich

Fixes https://github.com/curl/curl/issues/12117
Closes https://github.com/curl/curl/pull/12118
2023-10-14 22:42:49 -04:00
Daniel Stenberg
475cf0cc85
RELEASE-NOTES: synced 2023-10-14 23:10:36 +02:00
Sohom Datta
8993efc2a5
tool_getparam: limit --rate to be smaller than number of ms
Currently, curl allows users to specify absurd request rates that might
be higher than the number of milliseconds in the unit (ex: curl --rate
3600050/h http://localhost:8080 does not error out despite there being
only 3600000ms in a hour).

This change adds a conditional check before the millisecond calculation
making sure that the number is not higher than the numerator (the unit)
If the number is higher, curl errors out with PARAM_NUMBER_TOO_LARGE

Closes #12116
2023-10-14 23:05:54 +02:00
Daniel Stenberg
e2006b5d58
opts: fix two minor man page format mistakes 2023-10-14 18:22:24 +02:00
Jay Satiro
f80ab60c27 curl_trc: remove a bad assertion
- Remove DEBUGASSERT that an internal handle must not have user
  private_data set before calling the user's debug callback.

This is a follow-up to 0dc40b2a. The user can distinguish their easy
handle from an internal easy handle by setting CURLOPT_PRIVATE on their
easy handle. I had wrongly assumed that meant the user couldn't then
set CURLOPT_PRIVATE on an internal handle as well.

Bug: https://github.com/curl/curl/pull/12060#issuecomment-1754594697
Reported-by: Daniel Stenberg

Closes https://github.com/curl/curl/pull/12104
2023-10-14 03:19:59 -04:00
Dan Fandrich
a2b4391a1d test613: stop showing an error on missing output file
This test would show an error message if the output was missing during
the log post-processing step, but the message was not captured by the
test harness and wasn't useful since the normal golden log file
comparison would the problem more clearly.
2023-10-13 20:28:58 -07:00
Stefan Eissing
9cc5787577
quic: manage connection idle timeouts
- configure a 120s idle timeout on our side of the connection
- track the timestamp when actual socket IO happens
- check IO timestamp to our *and* the peer's idle timeouts
  in "is this connection alive" checks

Reported-by: calvin2021y on github
Fixes #12064
Closes #12077
2023-10-13 23:15:47 +02:00
Dan Fandrich
f1e05a6e6e CI: ignore test 286 on Appveyor gcc 9 build
This test fails sometimes with a super fast retry loop due to what may
just be a compiler bug. The test results are ignored on the one CI job
where it occurs because there seems to be nothing we can do to fix it.

Fixes #12040
Closes #12106
2023-10-13 09:01:16 -07:00
Viktor Szakats
4e57d0f0cb
lib: fix gcc warning in printf call
Do not pass NULL to printf %s.

Seen with gcc 13.2.0 on Debian:
```
.../curl/lib/connect.c:696:27: warning: '%s' directive argument is null [-Wformat-overflow=]
```
Ref: https://github.com/curl/curl-for-win/actions/runs/6476161689/job/17584426483#step:3:11104

Ref: #10284
Co-authored-by: Jay Satiro
Closes #12082
2023-10-13 09:19:05 +00:00
Alex Klyubin
465f02bf17
http2: safer invocation of populate_binsettings
populate_binsettings now returns a negative value on error, instead of a
huge positive value. Both places which call this function have been
updated to handle this change in its contract.

The way populate_binsettings had been used prior to this change the huge
positive values -- due to signed->unsigned conversion of the potentially
negative result of nghttp2_pack_settings_payload which returns negative
values on error -- are not possible. But only because http2.c currently
always provides a large enough output buffer and provides H2 SETTINGS
IVs which pass the verification logic inside nghttp2.  If the
verification logic were to change or if http2.c started passing in more
IVs without increasing the output buffer size, the overflow could become
reachable, and libcurl/curl might start leaking memory contents to
servers/proxies...

Closes #12101
2023-10-13 11:07:28 +02:00
Daniel Stenberg
b9f832edcc
openssl: avoid BN_num_bits() NULL pointer derefs
Reported-by: icy17 on github
Fixes #12099
Closes #12100
2023-10-13 11:00:18 +02:00
Daniel Stenberg
4dbc2ad467
wolfssl: require WOLFSSL_SYS_CA_CERTS for loading system CA
This define is set in wolfssl's options.h file when this function and
feature is present. Handles both builds with the feature explicitly
disabled and wolfSSL versions before 5.5.2 - which introduced this API
call.

Closes #12108
2023-10-13 10:58:23 +02:00
Daniel Stenberg
8a45a495af
tool_urlglob: make multiply() bail out on negative values
- Does not work correctly with negative values
- use __builtin_mul_overflow() on gcc

Reported-by: Torben Dury
Closes #12102
2023-10-13 10:18:09 +02:00
Loïc Yhuel
732d8ef758 cmake: fix CURL_DISABLE_GETOPTIONS
- Add CURL_DISABLE_GETOPTIONS to curl_config.h.cmake.

Prior to this change the option had no effect because it was missing
from that file.

Closes https://github.com/curl/curl/pull/12091
2023-10-13 00:57:09 -04:00
Loïc Yhuel
5adb6000ff easy_lock: add a pthread_mutex_t fallback
This allows to keep the init threadsafe with gcc < 4.9.0 (no C11
atomics).

Closes https://github.com/curl/curl/pull/12090
2023-10-12 23:40:08 -04:00
Viktor Szakats
2e283c69e0
CI: add autotools, out-of-tree, debug build to distro check job
Add a job that builds curl from a generated source tarball sample, with
autotools, out-of-tree, in debug mode.

Ref: #12085
Closes #12088
2023-10-12 23:29:39 +00:00
Daniel Stenberg
f2de575242
http: avoid Expect: 100-continue if Upgrade: is used
Reported-by: Daniel Jelinski
Fixes #12022
Closes #12062
2023-10-12 16:31:41 +02:00
Jan Alexander Steffens (heftig)
1f7d8cd478
docs: use SOURCE_DATE_EPOCH for generated manpages
This should make builds from Git reproducible.

Closes #12092
2023-10-12 09:45:41 +02:00
Daniel Stenberg
a20d7bd974
RELEASE-NOTES: synced
Bumped to 8.4.1
2023-10-12 09:09:49 +02:00
Viktor Szakats
104767ae48
cmake: fix HAVE_H_ERRNO_ASSIGNABLE detection
Fix `HAVE_H_ERRNO_ASSIGNABLE` to not run, only compile its test snippet,
aligning this with autotools. This fixes an error when doing
cross-builds and also actually detects this feature. It affected systems
not allowlisted into this, e.g. SerenityOS.

We used this detection result to enable `HAVE_GETADDRINFO_THREADSAFE`.

Follow-up to 04a3a377d8 #11979
Ref: #12095 (closed in favour of this patch)
Ref: #11964 (effort to sync cmake detections with autotools)

Reported-by: Kartatz on Github
Assisted-by: Kartatz on Github
Fixes #12093
Closes #12094
2023-10-12 06:46:21 +00:00
Viktor Szakats
fac90bd5c1
build: add src/.checksrc to source tarball
Regression from e5bb88b8f8 #11958

Bug: https://github.com/curl/curl/pull/11958#issuecomment-1757079071
Reported-by: Romain Geissler
Fixes #12084
Closes #12085
2023-10-11 14:04:33 +00:00
Daniel Stenberg
d755a5f7c0
RELEASE-NOTES: synced 2023-10-11 07:34:19 +02:00