Commit Graph

31624 Commits

Author SHA1 Message Date
Daniel Stenberg
d16d18cf64
haproxy-clientip.d: document the arg
The arg keyword was missing and therefore not present in the man page.

Closes #12611
2023-12-31 00:35:30 +01:00
annalee
ae75db3527
configure: fix no default int compile error in ipv6 detection
Closes #12607
2023-12-29 10:47:40 +01:00
Dan Fandrich
0af61bffb1 CI: Fix use of any-glob-to-all-files in the labeler
Despite its name, this atom acts like one-glob-to-all-files and a
different syntax with braces must be used to get
any-glob-to-all-files semantics. Unfortunately, this makes the file
completely unreadable.

Ref: https://github.com/actions/labeler/issues/731
2023-12-28 22:26:02 -08:00
Daniel Stenberg
69b6953681
CURLOPT_AUTOREFERER.3: mention CURLINFO_REFERER 2023-12-29 00:40:03 +01:00
Daniel Stenberg
6f17ead7b3
CURLINFO_REFERER.3: clarify that it is the *request* header
That libcurl itself sent in the most recent request

Closes #12605
2023-12-29 00:39:54 +01:00
Jay Satiro
26f002e02e system_win32: fix a function pointer assignment warning
- Use CURLX_FUNCTION_CAST to suppress a function pointer assignment
  warning.

a6bbc87f added lookups of some Windows API functions and then cast them
like `*(FARPROC*)&Curl_funcname = address`. Some versions of gcc warn
about that as breaking strict-aliasing rules so this PR changes those
assignments to use CURLX_FUNCTION_CAST.

Bug: https://github.com/curl/curl/pull/12581#issuecomment-1869804317
Reported-by: Marcel Raad

Closes https://github.com/curl/curl/pull/12602
2023-12-28 03:38:44 -05:00
Jay Satiro
aa2c2ab837 verify-examples.pl: fail verification on unescaped backslash
- Check that all backslashes in EXAMPLE are properly escaped.

eg manpage must always use `\\n` never `\n`.

This is because the manpage requires we always double blackslash to show
a single backslash. Prior to this change an erroneous single backslash
would pass through and compile even though it would not show correctly
in the manpage.

Co-authored-by: Daniel Stenberg

Ref: https://github.com/curl/curl/pull/12588

Closes https://github.com/curl/curl/pull/12589
2023-12-28 03:34:16 -05:00
Jay Satiro
e251e858b9 vtls: fix missing multissl version info
- Fix erroneous buffer copy logic from ff74cef5.

Prior to this change the MultiSSL version info returned to the user
was empty.

Closes https://github.com/curl/curl/pull/12599
2023-12-27 17:49:27 -05:00
Daniel Stenberg
f111603176
KNOWN_BUGS: [RTSP] Some methods do not support response bodies
Closes #12414
2023-12-27 23:15:09 +01:00
Patrick Monnerat
fa6e123929
openldap: fix an LDAP crash
Reported-by: Ozan Cansel
Fixes #12593
Closes #12600
2023-12-27 14:42:32 +01:00
Daniel Stenberg
68f96fc9bf
getinfo: CURLINFO_QUEUE_TIME_T
Returns the time, in microseconds, during which this transfer was held
in a waiting queue before it started "for real". A transfer might be put
in a queue if after getting started, it cannot create a new connection
etc due to set conditions and limits imposed by the application.

Ref: #12293
Closes #12368
2023-12-27 09:28:48 +01:00
Daniel Stenberg
2b221d4214
RELEASE-NOTES: synced 2023-12-27 09:24:42 +01:00
Jay Satiro
82cbdd8396 examples/sendrecv: fix comment line length
Caught by checksrc.
2023-12-26 03:28:46 -05:00
Haydar Alaidrus
9faeebca88 CURLOPT_POSTFIELDS.3: fix incorrect C string escape in example
- Escape inner quotes with two backslashes.

Two backslashes escapes the backslash for the man page and will show as
a single backslash.

eg: "{\\"name\\": \\"daniel\\"}" shows as "{\"name\": \"daniel\"}".

Closes https://github.com/curl/curl/pull/12588
2023-12-23 15:04:56 -05:00
Viktor Szakats
296cb805cf
appveyor: tidy-ups
- replace two remaining backslashes with forward slashes.
- tidy up the way we form and pass `TFLAGS`.

Follow-up to 2d4d0c1fd3 #12572

Closes #12582
2023-12-23 03:33:22 +00:00
Stefan Eissing
e492c7c524
transfer: fix upload rate limiting, add test cases
- add test cases for rate limiting uploads for all
  http versions
- fix transfer loop handling of limits. Signal a re-receive
  attempt only on exhausting maxloops without an EAGAIN
- fix `data->state.selectbits` forcing re-receive to also
  set re-sending when transfer is doing this.

Reported-by: Karthikdasari0423 on github
Fixes #12559
Closes #12586
2023-12-22 16:52:02 +01:00
Daniel Stenberg
8b1d229835
mbedtls: free the entropy when threaded
The entropy_free was never done for threaded builds, causing a small
(fixed) memory leak.

Reported-by: RevaliQaQ on github
Fixes #12584
Closes #12585
2023-12-22 10:58:07 +01:00
Stefan Eissing
35380273b9
http2: improved on_stream_close/data_done handling
- there seems to be a code path that cleans up easy handles without
  triggering DONE or DETACH events to the connection filters. This
  would explain wh nghttp2 still holds stream user data
- add GOOD check to easy handle used in on_close_callback to
  prevent crashes, ASSERTs in debug builds.
- NULL the stream user data early before submitting RST
- add checks in on_stream_close() to identify UNGOOD easy handles

Reported-by: Hans-Christian Egtvedt
Fixes #10936
Closes #12562
2023-12-22 10:06:01 +01:00
Daniel Stenberg
ef2cf58c77
mprintf: overhaul and bugfixes
In a test case using lots of snprintf() calls using many commonly used
%-codes per call, this version is around 30% faster than previous
version.

It also fixes the #12561 bug which made it not behave correctly when
given unknown %-sequences. Fixing that flaw required a different take on
the problem, which resulted in the new two-arrays model.

lib557: extended - Verify the #12561 fix and test more printf features

unit1398: fix test: It used a <num>$ only for one argument, which is not
supported.

Fixes #12561
Closes #12563
2023-12-22 09:51:57 +01:00
Viktor Szakats
2d4d0c1fd3
appveyor: replace PowerShell with bash + parallel autotools
PowerShell works (after a steep development curve), but one property of
it stuck and kept causing unresolvable usability issues: With
`$ErrorActionPreference=Stop`, it does abort on failures, but shows only
the first line of the error message. In `Continue` mode, it shows the
full error message, but doesn't stop on all errors. Another issue is
PowerShell considering any stderr output as if the command failed (this
has been improved in 7.2 (2021-Nov), but fixed versions aren't running
in CI and will not be for a long time in all test images.)

Thus, we're going with bash.

Also:
- use `-j2` with autotools tests, making them finish 5-15 minutes per
  job faster.
- omit `POSIX_PATH_PREFIX`.
- use `WINDIR`.
- prefer forward slashes.

Follow-up to: 75078a415d #11999
Ref: #12444

Fixes #12560
Closes #12572
2023-12-21 22:54:07 +00:00
Pavel P
a6bbc87f9e
asyn-thread: use GetAddrInfoExW on >= Windows 8
For doing async DNS resolution instead of starting a thread for each
request.

Fixes #12481
Closes #12482
2023-12-21 23:25:45 +01:00
Daniel Stenberg
a719be81e9
strerror: repair get_winsock_error()
It would try to read longer than the provided string and crash.

Follow-up to ff74cef5d4
Reported-by: calvin2021y on github
Fixes #12578
Closes #12579
2023-12-21 23:17:15 +01:00
Daniel Stenberg
5d2b0faec2
CURLOPT_SSH_*_KEYFILE: clarify
Closes #12554
2023-12-21 16:24:51 +01:00
ivanfywang
98794c56af
ngtcp2: put h3 at the front of alpn
Closes #12576
2023-12-21 15:28:40 +01:00
Daniel Stenberg
ff41ac8ca2
test460: verify a command line using --expand with no argument
This verifies the fix for #12565
2023-12-21 15:27:12 +01:00
Daniel Stenberg
d187f51948
tool_getparam: do not try to expand without an argument
This would lead to a segfault.

Fixes #12565
Reported-by: Geeknik Labs
Closes #12575
2023-12-21 15:27:05 +01:00
Daniel Stenberg
000c738140
RELEASE-NOTES: synced
Bumped version to 8.6.0 because of changes
2023-12-21 11:33:02 +01:00
Daniel Stenberg
3cd153d21a
Makefile.am: fix the MSVC project generation
It made the vcxproj files not get included in dist tarballs.

Regression since 74423b5df4 (8.5.0)

Reported-by: iAroc on github
Fixes #12564
Closes #12567
2023-12-21 09:19:36 +01:00
zengwei2000
8d23a40ba6
altsvc: free 'as' when returning error
Closes #12570

Signed-off-by: zengwei <zengwei1@uniontech.com>
2023-12-21 09:15:19 +01:00
Viktor Szakats
95a882d268
build: fix -Wconversion/-Wsign-conversion warnings
Fix remaining warnings in examples and tests which are not suppressed
by the pragma in `lib/curl_setup.h`.

Silence a toolchain issue causing warnings in `FD_SET()` calls with
older Cygwin/MSYS2 builds. Likely fixed on 2020-08-03 by:
https://cygwin.com/git/?p=newlib-cygwin.git;a=commitdiff;h=5717262b8ecfed0f7fab63e2c09c78991e36f9dd

Follow-up to 2dbe75bd7f #12492

Closes #12557
2023-12-20 15:38:45 +00:00
Viktor Szakats
2dbe75bd7f
build: fix some -Wsign-conversion/-Warith-conversion warnings
- enable `-Wsign-conversion` warnings, but also setting them to not
  raise errors.
- fix `-Warith-conversion` warnings seen in CI.
  These are triggered by `-Wsign-converion` and causing errors unless
  explicitly silenced. It makes more sense to fix them, there just a few
  of them.
- fix some `-Wsign-conversion` warnings.
- hide `-Wsign-conversion` warnings with a `#pragma`.
- add macro `CURL_WARN_SIGN_CONVERSION` to unhide them on a per-build
  basis.
- update a CI job to unhide them with the above macro:
  https://github.com/curl/curl/actions/workflows/linux.yml -> OpenSSL -O3

Closes #12492
2023-12-19 12:45:28 +00:00
Viktor Szakats
68d80a8f9b
cmake: tidy-up OtherTests.cmake
- make more obvious which detection uses which prep steps.
- merge and streamline conditions.
- these should not alter detection results.

Also align log output messages from
`Macros.cmake` / `curl_internal_test` with rest of the build.

Closes #12551
2023-12-19 12:45:24 +00:00
Viktor Szakats
a91746b4c7
appveyor: switch to out-of-tree builds
With cmake and autotools.

Closes #12550
2023-12-19 12:45:14 +00:00
Daniel Stenberg
d482444cc1
DEPRECATE.md: mention that NTLM_WB no longer works
Ref: #12479
Closes #12553
2023-12-19 10:21:45 +01:00
Daniel Stenberg
dd29622f32
CURLOPT_SERVER_RESPONSE_TIMEOUT_MS: add
Proposed-by: Yifei Kong
Ref: https://curl.se/mail/lib-2023-11/0023.html
Closes #12369
2023-12-18 23:09:30 +01:00
Viktor Szakats
0923012758
build: more -Wformat fixes
- memdebug: update to not trigger `-Wformat-nonliteral` warnings.
- imap: mark `imap_sendf()` with  `CURL_PRINTF()`.
- tool_msgs: mark static function with `CURL_PRINTF()`.

Follow-up to 3829759bd0 #12489

Closes #12540
2023-12-18 14:56:57 +00:00
Viktor Szakats
03e7dff8ff
windows: delete redundant headers
`winsock2.h` pulls in `windows.h`. `ws2tcpip.h` pulls in `winsock2.h`.
`winsock2.h` and `ws2tcpip.h` are also pulled by `curl/curl.h`.

Keep only those headers that are not already included, or the code under
it uses something from that specific header.

Closes #12539
2023-12-18 14:56:57 +00:00
Viktor Szakats
7e8fdad2d5
cmake: prefill/cache HAVE_STRUCT_SOCKADDR_STORAGE
Also add missing include to `OtherTests.cmake`. It didn't cause an issue
because the parent already included this earlier by chance.

Closes #12537
2023-12-18 14:56:56 +00:00
Daniel Stenberg
6d8d597431
runner.pm: fix perl warning when running tests
Use of uninitialized value $runner::gdbthis in numeric eq (==) at runner.pm

Follow-up from 3dcf301752

Closes #12549
2023-12-18 14:49:41 +01:00
Daniel Stenberg
3dcf301752
runtests: support -gl. Like -g but for lldb.
Follow-up to 63b5748

Invokes the test case via lldb instead of gdb. Since using gdb is such a
pain on mac, using lldb is sometimes less quirky.

Closes #12547
2023-12-18 11:13:30 +01:00
Daniel Stenberg
f58e493e44
curl.h: add CURLE_TOO_LARGE
A new error code to be used when an internal field grows too large, like
when a dynbuf reaches its maximum. Previously it would return
CURLE_OUT_OF_MEMORY for this, which is highly misleading.

Ref: #12268
Closes #12269
2023-12-18 10:34:22 +01:00
Daniel Stenberg
b7258e4922
CI/circleci: disable MQTT in the HTTP-only build
And remove the use of configure options that don't actually exist

Closes #12546
2023-12-18 10:26:39 +01:00
Yedaya Katsman
ad50d8104c
tests: respect $TMPDIR when creating unix domain sockets
When running on termux, where $TMPDIR isn't /tmp, running the tests
failed, since the server config tried creating sockets in /tmp, without
checking the temp dir config. Use the TMPDIR variable that makes it find
the correct directory everywhere [0]

[0] https://perldoc.perl.org/File::Temp#tempfile

Closes #12545
2023-12-18 08:29:58 +01:00
Viktor Szakats
15b09d9343
ssh: fix namespace of two local macros
Avoid using the libssh and libssh2 macro namespaces by prefixing
these local macro names with `CURL_`.

Follow-up to 413a0fedd0 #12346

Reviewed-by: Daniel Stenberg
Closes #12544
2023-12-17 14:58:22 +00:00
Viktor Szakats
17e61d4e3a
cmake: whitespace tidy-up in OtherTests.cmake
Closes #12538
2023-12-17 00:39:38 +00:00
Mark Sinkovics
a86254b393
cmake: fix generation for system name iOS
This PR fixes a problem that happens during CMake configuration when
the `CMAKE_SYSTEM_NAME` set to `iOS` and not `Darwin`. This value is
available (as far as I remember) version 3.14. The final solution
(thanks to @vszakats) is to use `APPLE` which contains all the Apple
platforms https://cmake.org/cmake/help/latest/variable/APPLE.html.

This issue was found when during vcpkg installation. Running command
`vcpkg install curl:arm64-ios` and `vcpkg install curl:x64-ios` failed
with message:
```
CMake Error: try_run() invoked in cross-compiling mode, please set the following cache variables appropriately:
   HAVE_H_ERRNO_ASSIGNABLE_EXITCODE (advanced)
```
After this fix, I was able to compile the compile the binary without
any issue.

In addition to that fix, this PR also contains an simplification to
check if the platform is not APPLE.

Co-authored-by: Viktor Szakats
Closes #12515
2023-12-16 22:04:40 +00:00
Daniel Stenberg
b29d1e887f
RELEASE-NOTES: synced 2023-12-16 22:17:06 +01:00
Baruch Siach
af520ac9fe
gnutls: fix build with --disable-verbose
infof() parameters must be defined event with --disable-verbose since
commit dac293cfb7 ("lib: apache style infof and trace
macros/functions").

Move also 'ptr' definition under !CURL_DISABLE_VERBOSE_STRINGS.

Fixes the following build failure:

In file included from ../lib/sendf.h:29,
                 from vtls/gtls.c:44:
vtls/gtls.c: In function 'Curl_gtls_verifyserver':
vtls/gtls.c:841:34: error: 'version' undeclared (first use in this function); did you mean 'session'?
  841 |         gnutls_protocol_get_name(version), ptr);
      |                                  ^~~~~~~

Closes #12505
2023-12-16 22:06:21 +01:00
Viktor Szakats
423645a1ef
build: delete unused HAVE_{GSSHEIMDAL,GSSMIT,HEIMDAL}
Stop setting `HAVE_GSSHEIMDAL`, `HAVE_GSSMIT` and `HAVE_HEIMDAL`.
There was no place in the build system or source code that used them.

Reviewed-by: Daniel Stenberg
Closes #12506
2023-12-16 13:16:52 +00:00
Viktor Szakats
ee6992c66a
build: remove redundant CURL_PULL_* settings
These macros were not propagated to the source code from CMake.

autotools set only one of them (`CURL_PULL_SYS_POLL_H`), initially to
address an AIX issue [1]. This later broke when introducing `system.h`
[2] without the logic it enabled. A subsequent fix [3] re-added the
logic, and also enabled it for AIX before its use, directly in
`system.h`.

[1] 2012-11-23: 665adcd4b7
[2] 2017-03-29: 9506d01ee5 #1373
[3] 2017-08-25: 8a84fcc4b5 #1828 #1833

Reviewed-by: Daniel Stenberg
Closes #12502
2023-12-16 13:16:26 +00:00