Commit Graph

6086 Commits

Author SHA1 Message Date
Daniel Stenberg
77c3c1a8fb
curl_easy_header.3: tiny language fix
Closes #12672
2024-01-10 09:42:49 +01:00
Daniel Stenberg
5d75bcd2ea
examples/range.c: add
Closes #12671
2024-01-10 09:33:08 +01:00
Daniel Stenberg
1404bcdeae
examples/netrc.c: add
Closes #12671
2024-01-10 09:33:06 +01:00
Daniel Stenberg
dd09f88f13
examples/ipv6.c: new example showing IPv6-only internet transfer
Closes #12671
2024-01-10 09:33:03 +01:00
Daniel Stenberg
ebbc6243d7
examples/address-scope.c: renamed from ipv6.c
It shows address scope use really

Closes #12671
2024-01-10 09:32:54 +01:00
Daniel Stenberg
6d9bf0db7e
WEBSOCKET.md: remove dead link 2024-01-09 16:00:29 +01:00
Daniel Stenberg
89bb115e4a
cmdline/docs/*.d: switch to using ## instead of .IP
To make the editing easier. To write and to read.

Closes #12667
2024-01-09 16:00:23 +01:00
Daniel Stenberg
a859e29a60
gen.pl: support ## for doing .IP in table-like lists
Warn on use of .RS/.IP/.RE

Closes #12667
2024-01-09 16:00:16 +01:00
Jay Satiro
0ad13e0618 cookie.d: Document use of empty string to enable cookie engine
- Explain that --cookie "" can be used to enable the cookie engine
  without reading any initial cookies.

As is documented in CURLOPT_COOKIEFILE.

Ref: https://curl.se/libcurl/c/CURLOPT_COOKIEFILE.html

Bug: https://github.com/curl/curl/issues/12643#issuecomment-1879844420
Reported-by: janko-js@users.noreply.github.com

Closes https://github.com/curl/curl/pull/12646
2024-01-09 03:40:47 -05:00
Daniel Stenberg
373d34494c
cmdline-opts: update availability for the *-ca-native options
Closes #12613
2024-01-01 00:46:08 +01:00
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
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
Daniel Stenberg
f111603176
KNOWN_BUGS: [RTSP] Some methods do not support response bodies
Closes #12414
2023-12-27 23:15:09 +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
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
Daniel Stenberg
5d2b0faec2
CURLOPT_SSH_*_KEYFILE: clarify
Closes #12554
2023-12-21 16:24:51 +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
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
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
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
Viktor Szakats
c1bc090d65
windows: simplify detecting and using system headers
- autotools, cmake: assume that if we detect Windows, `windows.h`,
  `winsock2.h` and `ws2tcpip.h` do exist.
- lib: fix 3 outlier `#if` conditions to use `USE_WINSOCK` instead of
  looking for `winsock2.h`.
- autotools: merge 3 Windows check methods into one.
- move Watt-32 and lwIP socket support to `setup-win32.h` from
  `config-win32.h`. It opens up using these with all build tools. Also
  merge logic with Windows Sockets.
- fix to assume Windows sockets with the mingw32ce toolchain.
  Follow-up to: 2748c64d60
- cmake: delete unused variable `signature_call_conv` since
  eb33ccd533.
- autotools: simplify `CURL_CHECK_WIN32_LARGEFILE` detection.
- examples/externalsocket: fix header order.
- cmake/OtherTests.cmake: delete Windows-specific `_source_epilogue`
  that wasn't used anymore.
- cmake/OtherTests.cmake: set `WIN32_LEAN_AND_MEAN` for test
  `SIZEOF_STRUCT_SOCKADDR_STORAGE`.

After this patch curl universally uses `_WIN32` to guard
Windows-specific logic. It guards Windows Sockets-specific logic with
`USE_WINSOCK` (this might need further work).

Reviewed-by: Jay Satiro
Closes #12495
2023-12-16 13:13:44 +00:00
Viktor Szakats
3829759bd0
build: enable missing OpenSSF-recommended warnings, with fixes
https://best.openssf.org/Compiler-Hardening-Guides/Compiler-Options-Hardening-Guide-for-C-and-C++.html
as of 2023-11-29 [1].

Enable new recommended warnings (except `-Wsign-conversion`):

- enable `-Wformat=2` for clang (in both cmake and autotools).
- add `CURL_PRINTF()` internal attribute and mark functions accepting
  printf arguments with it. This is a copy of existing
  `CURL_TEMP_PRINTF()` but using `__printf__` to make it compatible
  with redefinting the `printf` symbol:
  https://gcc.gnu.org/onlinedocs/gcc-3.0.4/gcc_5.html#SEC94
- fix `CURL_PRINTF()` and existing `CURL_TEMP_PRINTF()` for
  mingw-w64 and enable it on this platform.
- enable `-Wimplicit-fallthrough`.
- enable `-Wtrampolines`.
- add `-Wsign-conversion` commented with a FIXME.
- cmake: enable `-pedantic-errors` the way we do it with autotools.
  Follow-up to d5c0351055 #2747
- lib/curl_trc.h: use `CURL_FORMAT()`, this also fixes it to enable format
  checks. Previously it was always disabled due to the internal `printf`
  macro.

Fix them:

- fix bug where an `set_ipv6_v6only()` call was missed in builds with
  `--disable-verbose` / `CURL_DISABLE_VERBOSE_STRINGS=ON`.
- add internal `FALLTHROUGH()` macro.
- replace obsolete fall-through comments with `FALLTHROUGH()`.
- fix fallthrough markups: Delete redundant ones (showing up as
  warnings in most cases). Add missing ones. Fix indentation.
- silence `-Wformat-nonliteral` warnings with llvm/clang.
- fix one `-Wformat-nonliteral` warning.
- fix new `-Wformat` and `-Wformat-security` warnings.
- fix `CURL_FORMAT_SOCKET_T` value for mingw-w64. Also move its
  definition to `lib/curl_setup.h` allowing use in `tests/server`.
- lib: fix two wrongly passed string arguments in log outputs.
  Co-authored-by: Jay Satiro
- fix new `-Wformat` warnings on mingw-w64.

[1] 56c0fde389/docs/Compiler-Hardening-Guides/Compiler-Options-Hardening-Guide-for-C-and-C%2B%2B.md

Closes #12489
2023-12-16 13:12:37 +00:00
Viktor Szakats
ba8752e556
Makefile.mk: drop Windows support
And DLL-support with it. This leaves `Makefile.mk` for MS-DOS and Amiga.

We recommend CMake instead. With unity mode it's much faster, and about
the same without.

Ref: https://github.com/curl/curl/pull/12221#issuecomment-1783761806
Reviewed-by: Daniel Stenberg
Closes #12224
2023-12-16 13:12:22 +00:00
Daniel Stenberg
67211e9540
cmdline-docs: use .IP consistently
Remove use of .TP and some .B. The idea is to reduce nroff syntax as
much as possible and to use it consistently. Ultimately, we should be
able to introduce our own easier-to-use-and-read syntax/formatting and
convert on generation time.

Closes #12535
2023-12-16 13:22:05 +01:00
Stefan Eissing
3be759610f
CLIENT-WRITERS: design and use documentation
Closes #12507
2023-12-12 17:37:52 +01:00
Stefan Eissing
02d81c5a68
CONNECTION-FILTERS: update documentation
Closes #12497
2023-12-11 23:30:26 +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
Viktor Szakats
ede2e812c2
tidy-up: whitespace
Closes #12484
2023-12-08 03:28:50 +00:00
Daniel Stenberg
7161cb17c0
RELEASE-NOTES: synced
The curl 8.5.0 release.
2023-12-06 08:11:44 +01: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
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
Daniel Stenberg
cb521d1f9a
docs: make all examples in all libcurl man pages compile
Closes #12448
2023-12-04 10:50:42 +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
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
Lau
f5ba531ed2
libcurl-security.3: fix typo
Fixed minimal typo.

Closes #12437
2023-12-01 17:54:38 +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
66ec950004
libcurl-errors.3: sync with current public headers
Closes #12424
2023-11-28 22:55:33 +01:00
Daniel Stenberg
ad1dfc594f
docs/libcurl: SYNSOPSIS cleanup
- use the correct include file
- make sure they are declared as in the header file
- fix minor nroff syntax mistakes (missing .fi)

These are verified by verify-synopsis.pl, which extracts the SYNPOSIS
code and runs it through gcc.

Closes #12402
2023-11-24 20:35:38 +01:00
Viktor Szakats
e9a7d4a1c8
windows: use built-in _WIN32 macro to detect Windows
Windows compilers define `_WIN32` automatically. Windows SDK headers
or build env defines `WIN32`, or we have to take care of it. The
agreement seems to be that `_WIN32` is the preferred practice here.
Make the source code rely on that to detect we're building for Windows.

Public `curl.h` was using `WIN32`, `__WIN32__` and `CURL_WIN32` for
Windows detection, next to the official `_WIN32`. After this patch it
only uses `_WIN32` for this. Also, make it stop defining `CURL_WIN32`.

There is a slight chance these break compatibility with Windows
compilers that fail to define `_WIN32`. I'm not aware of any obsolete
or modern compiler affected, but in case there is one, one possible
solution is to define this macro manually.

grepping for `WIN32` remains useful to discover Windows-specific code.

Also:

- extend `checksrc` to ensure we're not using `WIN32` anymore.

- apply minor formatting here and there.

- delete unnecessary checks for `!MSDOS` when `_WIN32` is present.

Co-authored-by: Jay Satiro
Reviewed-by: Daniel Stenberg

Closes #12376
2023-11-22 15:42:25 +00:00
Daniel Stenberg
9a8bb20d48
CURLMOPT_MAX_CONCURRENT_STREAMS: make sure the set value is within range
... or use the default value.

Also clarify the documentation language somewhat.

Closes #12382
2023-11-22 15:01:04 +01:00
Daniel Stenberg
14612e5fbe
FEATURES: update the URL phrasing
The URL is length limited since a while back so "no limit" simply is not
true anymore. Mention the URL RFC standard used instead.

Closes #12383
2023-11-22 13:26:51 +01:00
Jacob Hoffman-Andrews
b9b50f3193
hyper: temporarily remove HTTP/2 support
The current design of the Hyper integration requires rebuilding the
Hyper clientconn for each request. However, building the clientconn
requires resending the HTTP/2 connection preface, which is incorrect
from a protocol perspective. That in turn causes servers to send GOAWAY
frames, effectively degrading performance to "no connection reuse" in
the best case. It may also be triggering some bugs where requests get
dropped entirely and reconnects take too long.

This doesn't rule out HTTP/2 support with Hyper, but it may take a
redesign of the Hyper integration in order to make things work.

Closes #12191
2023-11-20 11:01:48 +01:00
Daniel Stenberg
f996d4aad4
TODO: Some TLS options are not offered for HTTPS proxies
Closes #12286
Closes #12342
2023-11-16 23:41:21 +01:00
Daniel Stenberg
5b686e34fb
curl_easy_duphandle.3: clarify how HSTS and alt-svc are duped
Closes #12315
2023-11-13 15:36:27 +01:00
Jay Satiro
cdac7cd3f3 CURLOPT_CAINFO_BLOB.3: explain what CURL_BLOB_COPY does
- Add an explanation of the CURL_BLOB_COPY flag to CURLOPT_CAINFO_BLOB
  and CURLOPT_PROXY_CAINFO_BLOB docs.

All the other _BLOB option docs already have the same explanation.

Closes https://github.com/curl/curl/pull/12277
2023-11-12 14:29:01 -05:00