Commit Graph

32899 Commits

Author SHA1 Message Date
Dan Fandrich
e48d8821ab Replace nonportable grep -o with awk
This stops an error shown at the end of configure on systems with POSIX
grep and fixes the warning it's trying to convey.

Closes #14469
2024-08-09 08:41:18 -07:00
Viktor Szakats
9cb7f08ef1
lib: fix AIX build issues
- memdebug: replace keyword `malloc` with `__malloc__` to
  not interfere with envs where `malloc` is redefined. Also apply
  the fix to `alloc_size`.
  Fixes:
  ```
  lib/memdebug.h:107:13: warning: unknown attribute 'vec_malloc' ignored [-Wunknown-attributes]
  CURL_EXTERN ALLOC_FUNC FILE *curl_dbg_fdopen(int filedes, const char *mode,
              ^~~~~~~~~~
  lib/memdebug.h:37:37: note: expanded from macro 'ALLOC_FUNC'
  # define ALLOC_FUNC __attribute__((malloc))
                                     ^~~~~~
  /usr/include/stdlib.h:753:16: note: expanded from macro 'malloc'
  #define malloc vec_malloc
                 ^~~~~~~~~~
  ```

- memdebug: always undef before defining.
  Also do this for the rest of functions redefined in the same block.
  Avoids warning on AIX:
  ```
  lib/memdebug.h:117:9: warning: 'malloc' macro redefined [-Wmacro-redefined]
  #define malloc(size) curl_dbg_malloc(size, __LINE__, __FILE__)
          ^
  /usr/include/stdlib.h:753:9: note: previous definition is here
  #define malloc vec_malloc
          ^
  ```

- easy: fix `-Wformat` warning on AIX by adding a cast.
  ```
  lib/easy.c:608:47: warning: format specifies type 'int' but the argument has type 'long' [-Wformat]
  "%" CURL_FORMAT_SOCKET_T ")", fds[i].fd);
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
  ```

- if2ip: silence compiler warning inside AIX system header.

  ```
  /lib/if2ip.c:219:19: warning: signed shift result (0x80000000) sets the sign bit of the shift expression's type ('int') and becomes negative [-Wshift-sign-overflow]
  if(ioctl(dummy, SIOCGIFADDR, &req) < 0) {
                  ^~~~~~~~~~~
  /usr/include/sys/ioctl.h:401:26: note: expanded from macro 'SIOCGIFADDR'
  #define SIOCGIFADDR (int)_IOWR('i',33, struct oifreq) /* get ifnet address */
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /usr/include/sys/ioctl.h:174:23: note: expanded from macro '_IOWR'
  #define _IOWR(x,y,t) (IOC_INOUT|((sizeof(t)&IOCPARM_MASK)<<16)|(x<<8)|y)
                        ^~~~~~~~~
  /usr/include/sys/ioctl.h:168:20: note: expanded from macro 'IOC_INOUT'
  #define IOC_INOUT (IOC_IN|IOC_OUT)
                     ^~~~~~
  /usr/include/sys/ioctl.h:167:28: note: expanded from macro 'IOC_IN'
  #define IOC_IN (0x40000000<<1) /* copy in parameters */
                  ~~~~~~~~~~^ ~
  ```

Ref: https://curl.se/dev/log.cgi?id=20240808180420-3809007
Assisted-by: Dan Fandrich
Closes #14464
2024-08-09 10:45:40 +02:00
Viktor Szakats
a298df7f47
cmake: more small tidy-ups
- prefix local variables with underscore and convert to lowercase.
- list variables accepted by `libcurl.pc` and `curl-config` templates.
- quote more string literals.

Follow-up to 919394ee64 #14450
Closes #14462
2024-08-09 10:45:40 +02:00
Viktor Szakats
b828149b13
tidy-up: delete unused m4/xc-translit.m4
Unused since it was added in 49a8fe5142.
Also missing from the source tarball.

Closes #14459
2024-08-09 10:45:40 +02:00
Viktor Szakats
beb8711805
dist: add missing lib/optiontable.pl
Closes #14467
2024-08-09 10:45:40 +02:00
Viktor Szakats
62b13ecfed
configure: fixup copy-paste mistake
Delete duplicate call to `CURL_DARWIN_CFLAGS`.

Follow-up to ada8ebe18c #14419
Closes #14468
2024-08-09 10:45:39 +02:00
Daniel Stenberg
4f05f6b3c0
RELEASE-NOTES: synced 2024-08-09 09:43:28 +02:00
Stefan Eissing
f27ba323ad
test677: improve robustness
Do not treat CURLE_AGAIN as error.

Fixes test with CURL_DBG_SOCK_WBLOCK=90 set.

Closes #14455
2024-08-09 09:39:59 +02:00
Stefan Eissing
640febc7d0
test579: improve robustness
Log progress only at start and end of transfer to give normalized
output when upload data is only partially sent or temporarily blocked.

Fixes test with CURL_DBG_SOCK_WBLOCK=90 set.

Closes #14454
2024-08-09 09:39:17 +02:00
Stefan Eissing
ac6349b451
test556: improve robustness
Fix handling of partial/blocked sends.

Fixes test with CURL_DBG_SOCK_WBLOCK=90 set.

Closes #14453
2024-08-09 09:38:19 +02:00
Daniel Stenberg
32f9130ae1
mk-ca-bundle.pl: include a link to the caextract webpage
Makes it easier for users who find the file to find its origin.

Fixes https://github.com/curl/curl-www/issues/374

Closes #14465
2024-08-09 08:20:43 +02:00
Daniel Stenberg
9fa0cf9c53
HISTORY: fill in some events from recent years
Closes #14466
2024-08-09 08:17:26 +02:00
Stefan Eissing
a0ea955f80
ftp: flush pingpong before response
Fix FTP protocol to flush the pingpong's send buffer before receiving a
response from the server, as it may never come otherwise.

Fixes FTP/FTPS tests with `CURL_DBG_SOCK_WBLOCK=90` set.

Closes #14452
2024-08-08 17:52:25 +02:00
Daniel Stenberg
badbd4eb46
manpage: ensure a maximum width for the text version
... using the new script 'maxline' to which we specify the maximum
number of columns we allow any single line to be, or it will cause an
error.

Starting out with a max width at 100 columns.

Bonus: shorten the long line in the --ipfs-gateway section.

Closes #14423
2024-08-08 17:49:37 +02:00
Viktor Szakats
919394ee64
cmake: more small tidy-ups and fixes
- tidy up two `MATCHES` expression by avoiding macros expansion and
  adding quotes. Then convert then to `STREQUAL` to match other places
  in the code doing the same checks.

- fix setting `_ALL_SOURCE` for AIX to match what autotools does.

- delete stray `_ALL_SOURCE` reference from `lib/config_riscos.h`

- simplify/fix two `STREQUAL ""` checks.
  The one in the `openssl_check_symbol_exists()` macro succeeded
  regardless of the value. The other could return TRUE when
  `CMAKE_OSX_SYSROOT` was undefined.

- delete code for CMake versions (<3.7) we no longer support.

- prefer `LIST(APPEND ...)` to extend `CURL_LIBS`.

- use `CURL_LIBS` to add the `network` lib for Haiku.
  Before this patch it was done via raw C flags. I could not test this.

- move `_WIN32_WINNT`-related code next to each other.
  It also moves detection to the top, allowing more code to use
  the result.

- merge two `WIN32` blocks.

- rename internal variables to underscore + lowercase.

- unwrap a line, indent, whitespace.

Closes #14450
2024-08-08 13:48:28 +02:00
Viktor Szakats
d3f6b2ffa7
krb5: add Linux/macOS CI tests, fix cmake GSS detection
- GHA/macos: enable GSS krb5 in a cmake job.
  Uses CMake-native detection.

- GHA/linux: enable GSS krb5 in autotools job and add a cmake job to
  match.
  CMake uses `pkg-config`-based detection.

- GHA/linux: add step to dump configure logs.

- fix and simplify logic digesting FindGSS output.

- cmake: add `heimdal-gssapi` to `libcurl.pc`.

Closes #14447
2024-08-08 13:48:28 +02:00
Viktor Szakats
e042073f9d
cmake: detect and show VCPKG in platform flags
Use `VCPKG_TOOLCHAIN` to detect a vcpkg build environment.

Closes #14451
2024-08-08 13:48:28 +02:00
Viktor Szakats
daf9fdc4ef
GHA/non-native: ignore FTP results in OpenBSD job
They are flaky.
2024-08-08 13:19:57 +02:00
Viktor Szakats
2d6fb0f58f
cmake: tidy up more value comparisons
- unquote numeric value.

- `NOT LESS` -> `GREATER_EQUAL`.

- replace macro with variable name.
  It also avoids this error when the variable is undefined:
  ```
  CMake Error at CMakeLists.txt:1529 (if):
  if given arguments:
    "GREATER" "4"
  Unknown arguments specified
  ```
  https://github.com/curl/curl/actions/runs/10289921657/job/28478722584#step:30:356

Follow-up to 72ae0d86a4 #14409
Follow-up to acbc6b703f #14197

Closes #14449
2024-08-07 23:41:27 +02:00
Viktor Szakats
a3155db43d
cmake: fix version variable references in FindGSS
Assign the value of the variable instead of the name of the variable
when detecting GSS version via `pkg-config` on old (?) CMake.

(On recent CMake, there is an empty value in these variables.)

Closes #14445
2024-08-07 23:41:27 +02:00
Viktor Szakats
c2889a7b41
cmake: more syntax tidy-up
- quote string literals.
  In the hope it improves syntax-highlighting and readability.

- use lowercase, underscore-prefixed local var names.
  As a hint for scope, to help readability.

- prefer `pkg_search_module` (over `pkg_check_modules`).
  They are the same, but `pkg_search_module` stops searching
  at the first hit.

- more `IN LISTS` in `foreach()`.

- OtherTests.cmake: clear `CMAKE_EXTRA_INCLUDE_FILES` after use.

- add `PROJECT_LABEL` for http/client and unit test targets.

- sync `Find*` module comments and formatting.

- drop a few local variables.

- drop bogus `CARES_LIBRARIES` from comment.

- unquote numeric literal.

Follow-up to acbc6b703f #14197
Closes #14388
2024-08-07 23:41:27 +02:00
Alex Snast
63e9e06794
wolfssl: avoid taking cached x509 store ref if sslctx already using it
Closes #14442
2024-08-07 23:14:20 +02:00
Stefan Eissing
3ac1569c16
tracing: allow CURL_DEBUG override
On debug builds, allow environment variable CURL_DEBUG to override any
setting done via '-v' or '--no-verbose'.

Closes #14436
2024-08-07 20:35:16 +02:00
Stefan Eissing
0bc5b2e37c
http/2: simplify eos/blocked handling
- rely on the new flush to handle blocked sends. No longer
  do simulated EAGAIN on (partially) blocked sends with their
  need to handle repeats.
- fix some debug handling CURL_SMALLREQSEND env var
- add some assertings in request.c for affirming we do it right
- enhance assertion output in test_16 for easier analysis

Closes #14435
2024-08-07 18:28:49 +02:00
Jan Venekamp
1e9c1e8f2e
curl: fix --proxy-pinnedpubkey
This option was added in #2268 but never connected in
tool_operate.c.

Closes #14438
2024-08-07 18:27:32 +02:00
Daniel Stenberg
cf7a080c3f
verbose.md: polish, mostly remove back-ticks
To make the page render nicer as manpage and text-only.

Closes #14441
2024-08-07 18:17:44 +02:00
Daniel Stenberg
d41916c434
max-filesize.md: mention zero disables the limit
Reported-by: MasterInQuestion on github
Fixes #14440
Closes #14443
2024-08-07 18:16:26 +02:00
Viktor Szakats
146759716c
cmake: fix pkg-config-based detection in FindGSS.cmake
Before this patch `pkg-config`-based detection was ignored, and used
solely as a path hint for native detection.

- fix `pkg_search_module()` result prefix to match what code expects:
  `_GSS` (was: `_GSS_PKG`). Update variable that were in sync with old
  prefix.

- update the pkg-config codepath to use `_GSS_MODULE_NAME` to detect
  GSS flavour. This requires CMake 3.16.
  Otherwise fall back to the old method. (The old method doesn't seem to
  work anymore (?) as of CMake 3.30.1. Documented
  `<prefix>_<modulename>_VERSION` variable is defined, but empty.)

- update the pkg-config codepath to use `_GSS_VERSION` set by CMake.
  Resort to the old code when this variable is empty. (The old code
  doesn't seem to work anymore (?) as of CMake 3.30.1)

- fix pkg-config codepath to set the documented result variables.

- align native detection variable names with those generated by
  `pkg_search_module()` in the pkg-config codepath.

- GHA/macos: enable GSS Heimdal in a cmake job.
  Uses the native detection.

- GHA/linux: enable GSS Heimdal in cmake and autotools jobs.
  CMake uses `pkg-config`-based detection.

- suppress test 2077 and 2078 results on Linux + Heimdal.
  ```
  FAIL-IGNORED 2077: 'curl --fail --negotiate to unauthenticated service fails' HTTP, HTTP GET, GSS-API
  FAIL-IGNORED 2078: 'curl --negotiate should not send empty POST request only' HTTP, HTTP GET, GSS-API
  ```
  Failing with valgrind errors in both autotools and cmake builds:
  https://github.com/curl/curl/actions/runs/10282222581/job/28453472068?pr=14430#step:38:3638
  https://github.com/curl/curl/actions/runs/10282222581/job/28453473398?pr=14430#step:38:7831

Closes #14430
2024-08-07 15:13:07 +02:00
Viktor Szakats
2154f7c5f3
krb5: fix -Wcast-align
```
lib/krb5.c:343:39: warning: cast from 'void **' to 'unsigned char **' increases required alignment from 2 to 8 [-Wcast-align]
                               (unsigned char **)&_gssresp.value,
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
Seen on macOS Intel with Apple clang and brew heimdal 7.8.0_1.

Closes #14433
2024-08-07 15:13:07 +02:00
Viktor Szakats
cd51bb503a
cmake: add debug function to dump all variables
Place a `curl_dumpvars()` call anywhere in the CMake code to use it.

Closes #14439
2024-08-07 15:10:52 +02:00
Viktor Szakats
e20413980c
GHA/macos: tweak toolchain dump steps
- use documented flavour of `xcrun` option.

- show SDK version with a dedicated command.
  (Sometimes the SDK path is a symlink and doesn't tell the version.
  This is not at the moment the case in CI, but handle it anyway.)

- align group header with reality.
  Preinstalled vs. installed Homebrew packages can be recognized
  by their directory timestamps. Installed ones have a current date.

Closes #14434
2024-08-07 15:10:51 +02:00
Bo Anderson
588a6e334a
idn: more strictly check AppleIDN errors
UIDNA API returns two error values but we were only checking one.
Checking both better aligns the behaviour with that of libidn2.

Closes #14431
2024-08-07 14:59:07 +02:00
Bo Anderson
a35687831f
idn: support non-UTF-8 input under AppleIDN
This aligns the behaviour with libidn2 and the curl documentation.

Closes #14431
2024-08-07 14:59:01 +02:00
Jiacai Liu
07843d8167
BINDINGS: add zig binding
Closes #14437
2024-08-07 14:51:09 +02:00
Viktor Szakats
493c6d79eb
cmake: delete MSVC warning suppression for tests/server
Server code no longer produces this warning.

Closes #14428
2024-08-07 11:35:16 +02:00
Viktor Szakats
b1153820f4
dist: add missing test_*.py scripts
Closes #14427
2024-08-07 11:35:16 +02:00
Dan Fandrich
5f9426ec43 tests: show snapshot commit in testcurl
This disambiguates the source code being tested. The output format is
the same as when testing out of a git repo, but with no description and
a long hash.

Ref: #14363
Closes #14429
2024-08-07 00:22:38 -07:00
Pete Cordell
0011df47bc
ws: flags to opcodes should ignore CURLWS_CONT flag
When converting WebSocket flags such as CURLWS_TEXT | CURLWS_CONT we
want to exclude CURLWS_CONT from the lookup.

Closes #14397
2024-08-07 09:06:30 +02:00
Stefan Eissing
b102763c19
curl: fix --test-event --parallel
(in debug-builds)

Fix implementation in curl using libuv to process parallel transfers.
Add pytest capabilities to run test cases with --test-event.

- fix uv_timer handling to carry correct 'data' pointing to uv context.
- fix uv_loop handling to reap and add transfers when possible
- fix return code when a transfer errored

Closes #14413
2024-08-07 08:57:05 +02:00
Jan Venekamp
1b25448760
curl: warn on unsupported SSL options
Closes #14406
2024-08-07 08:50:53 +02:00
Jan Venekamp
5c2ab55abe
vtls: add SSLSUPP_CIPHER_LIST
Added SSLSUPP_CIPHER_LIST so be able to differniate SSL Backends
that support CURLOPT_SSL_CIPHER_LIST.

Closes #14406
2024-08-07 08:50:42 +02:00
Daniel Stenberg
cd4aee156f
tests: ignore QUIT from FTP protocol comparisons
- QUIT is not an important FTP command
- curl only sends it "best effort", meaning it might not be sent
- it is a known "flaky" thing in test output because of this

Closes #14404
2024-08-07 08:48:56 +02:00
Daniel Stenberg
b3490c5bc4
RELEASE-NOTES: synced 2024-08-07 08:25:43 +02:00
Stefan Eissing
06c5829dab
curl: support repeated use of the verbose option; -vv etc
- make mentioning `-v` on the curl command line increase the
  verbosity of the trace output
- related discussion https://github.com/curl/curl/discussions/13810
- make a single -v revert all previous -v+ changes
- make --no-verbose also reset all trace configs

Closes #13977
2024-08-07 08:14:36 +02:00
Daniel Stenberg
53146dd262
tool_help: handle longer lines, exit on too long
Follow-up to 9a0cf56471

- increase the buffer to handle 160 characters manpage lines
- add another assert
- if the line buffer gets full, abort

Ideally, we add another step in the build process that makes the build
fail if this long lines are used.

Closes #14422
2024-08-07 00:31:07 +02:00
Daniel Stenberg
48818a41af
tests/runner: only allow [!A-Za-z0-9_-] in %if feature names
... in the %if preprocessor parser.

This guards against accidentally getting a carriage-return part of the
feature name.

Fixes #14403
Closes #14411
2024-08-07 00:30:17 +02:00
Daniel Stenberg
b0394b1535
runtests: if DISABLED cannot be read, error out
Because then runtests cannot disable the right set of tests and things
will be annoying.

Closes #14411
2024-08-07 00:30:17 +02:00
Viktor Szakats
c6fb9895b6
cmake: cleanup header paths
- sync build-dir/source-dir header path order with autotools, by
  including build-dir first, then source-dir.
  This prevents out-of-tree builds breaking due to leftover generated
  headers in the source tree.

- tests/unit: move `src` ahead of `libtest` in header path, syncing with
  autotools.

- stop adding non-existing generated `include` dir to header path.
  There are no generated `include` headers and this directory is either
  missing in out-of-tree builds or the same as the one already added
  globally via the root `CMakeLists.txt`.

- lib: stop adding a duplicate source include directory to the header
  path.
  It's already added globally via the root `CMakeLists.txt`.

- lib: stop adding the project root to the header path.

- docs/examples: drop internal header paths.
  Examples do not and should not use internal headers.

- replace `curl_setup_once.h` in comments with `curl_setup.h`,
  the header actually used, and also referred to in autotools comments.

- add comment why we need `src` in include path for `tests/server`.

- add quotes around header directories.

Closes #14416
2024-08-06 22:33:05 +02:00
Viktor Szakats
ada8ebe18c
GHA/macos: enable AppleIDN in autotools job
- make `--with-apple-idn` override libidn2, in sync with cmake and
  `lib/curl_setup.h`.

- sync detection function name with cmake.

- limit AppleIDN feature check to Darwin.
  (also drop !WinIDN precondition check.)

Follow-up to 8de8fe8c98 #14401
Closes #14419
2024-08-06 22:33:05 +02:00
Viktor Szakats
7b1c0ab75e
Makefile.mk: fixup enabling libidn2
Replicate the method used by autotools and cmake to enable libidn2.
This way `lib/curl_setup.h` sets `USE_LIBIDN2` automatically.

Before this patch, `USE_LIBIDN2` was enabled directly, shortcutting
internal logic prioritizing IDN backends.

(This is academic now because `Makefile.mk` no longer supports
other IDN backends. But still useful for clarity.)

Closes #14421
2024-08-06 22:33:05 +02:00