Граф коммитов

6110 Коммитов

Автор SHA1 Сообщение Дата
Daniel Stenberg 196074e73f
gen.pl: remove bold from .IP used for ##
Reported-by: Viktor Szakats
Fixes #12776
Closes #12777
2024-01-25 08:29:41 +01:00
Viktor Szakats a808aab068
cmake: rework options to enable curl and libcurl docs
Rework CMake options for building/using curl tool and libcurl manuals.

- rename `ENABLE_MANUAL` to `ENABLE_CURL_MANUAL`, meaning:
  to build man page and built-in manual for curl tool.

- rename `BUILD_DOCS` to `BUILD_LIBCURL_DOCS`, meaning:
  to build man pages for libcurl.

- `BUILD_LIBCURL_DOCS` now works without having to enable
  `ENABLE_CURL_MANUAL` too.

- drop support for existing CMake-level `USE_MANUAL` option to avoid
  confusion. (It used to work with the effect of current
  `ENABLE_CURL_MANUAL`, but only by accident.)

Assisted-by: Richard Levitte
Ref: #12771
Closes #12773
2024-01-24 23:22:27 +00:00
Daniel Stenberg e5000e797f
GHA: add a job scanning for "bad words" in markdown
This means words, phrases or things we have decided not to use - words that
are spelled right according to the dictionary but we want to avoid. In the
name of consistency and better documentation.

Closes #12764
2024-01-24 08:44:34 +01:00
Viktor Szakats 2620aa930b
cmake: speed up curldown processing, enable by default
- cmake: enable `BUILD_DOCS` by default (this controls converting and
  installing `.3` files from `.md` sources)

- cmake: speed up generating `.3` files by using a single command per
  directory, instead of a single command per file. This reduces external
  commands by about a thousand. (There remains some CMake logic kicking
  in resulting in 500 -one per file- external `-E touch_nocreate` calls.)

- cd2nroff: add ability to process multiple input files.

- cd2nroff: add `-k` option to use the source filename to form the
  output filename. (instead of the default in-file `Title:` line.)

Follow-up to 3f08d80b22
Follow-up to ea0b575dab #12753
Follow-up to eefcc1bda4 #12730

Closes #12762
2024-01-23 23:06:39 +00:00
Richard Levitte fe290cbadd
docs: install curl.1 with cmake as well
Closes #12759
2024-01-23 23:55:08 +01:00
Daniel Stenberg 2494b8dd51
docs/cmdline: change to .md for cmdline docs
- switch all invidual files documenting command line options into .md,
   as the documentation is now markdown-looking.

 - made the parser treat 4-space indents as quotes

 - switch to building the curl.1 manpage using the "mainpage.idx" file,
   which lists the files to include to generate it, instead of using the
   previous page-footer/headers. Also, those files are now also .md
   ones, using the same format. I gave them underscore prefixes to make
   them sort separately:
   _NAME.md, _SYNOPSIS.md, _DESCRIPTION.md, _URL.md, _GLOBBING.md,
   _VARIABLES.md, _OUTPUT.md, _PROTOCOLS.md, _PROGRESS.md, _VERSION.md,
   _OPTIONS.md, _FILES.md, _ENVIRONMENT.md, _PROXYPREFIX.md,
   _EXITCODES.md, _BUGS.md, _AUTHORS.md, _WWW.md, _SEEALSO.md

 - updated test cases accordingly

Closes #12751
2024-01-23 14:30:15 +01:00
Viktor Szakats 3f08d80b22
cmake: add option to disable building docs 2024-01-23 00:29:02 +01:00
Richard Levitte ea0b575dab
cmake: use curldown to build man pages
This throws away the previous HTML and PDF producers, to mimic what
Makefile.am does as faithfully as possible.

Closes #12753
2024-01-23 00:29:02 +01:00
Daniel Stenberg 1647017826
mksymbolsmanpage.pl: provide references to where the symbol is used 2024-01-23 00:29:02 +01:00
Daniel Stenberg eefcc1bda4
docs: introduce "curldown" for libcurl man page format
curldown is this new file format for libcurl man pages. It is markdown
inspired with differences:

- Each file has a set of leading headers with meta-data
- Supports a small subset of markdown
- Uses .md file extensions for editors/IDE/GitHub to treat them nicely
- Generates man pages very similar to the previous ones
- Generates man pages that still convert nicely to HTML on the website
- Detects and highlights mentions of curl symbols automatically (when
  their man page section is specified)

tools:

- cd2nroff: converts from curldown to nroff man page
- nroff2cd: convert an (old) nroff man page to curldown
- cdall: convert many nroff pages to curldown versions
- cd2cd: verifies and updates a curldown to latest curldown

This setup generates .3 versions of all the curldown versions at build time.

CI:

Since the documentation is now technically markdown in the eyes of many
things, the CI runs many more tests and checks on this documentation,
including proselint, link checkers and tests that make sure we capitalize the
first letter after a period...

Closes #12730
2024-01-23 00:29:02 +01:00
Stefan Eissing 0535f6ec71
http3: initial support for OpenSSL 3.2 QUIC stack
- HTTP/3 for curl using OpenSSL's own QUIC stack together
  with nghttp3
- configure with `--with-openssl-quic` to enable curl to
  build this. This requires the nghttp3 library
- implementation with the following restrictions:
  * macOS has to use an unconnected UDP socket due to an
    issue in OpenSSL's datagram implementation
    See https://github.com/openssl/openssl/issues/23251
    This makes connections to non-reponsive servers hang.
  * GET requests will send the indicator that they have
    no body in a separate QUIC packet. This may result
    in processing delays or Transfer-Encodings on proxied
    requests
  * uploads that encounter blocks will use 100% cpu as
    detection of these flow control issue is not working
    (we have not figured out to pry that from OpenSSL).

Closes #12734
2024-01-22 16:15:45 +01:00
Mohammadreza Hendiani ca01aca878
TODO: update broken link to ratelimit-headers draft
Closes #12741
2024-01-19 18:18:05 +01:00
Daniel Stenberg ed420d9329
cmake: when USE_MANUAL=YES, build the curl.1 man page
Fixes KNOWN_BUG 15.4

Closes #12742
2024-01-19 18:14:56 +01:00
Daniel Stenberg 42be71e3ed
cmdline-opts/write-out.d: remove spurious double quotes 2024-01-19 16:37:14 +01:00
Daniel Stenberg 48aaab55a5
curl_easy_getinfo.3: remove the wrong time value count
It said "six" time values but they are eight by now. Remove the mention
of the amount.

Closes #12727
2024-01-18 08:57:41 +01:00
Daniel Stenberg 6b930f1bfb
docs: cleanup nroff format use
- remove use of .BI for code snippet
- stop using .br, just do a blank line
- remove use of .PP
- remove use for .sp
- remove backslash in .IP
- use .IP instead of .TP

Closes #12731
2024-01-17 23:20:17 +01:00
Daniel Stenberg 9034a16d97
docs: mention env vars not used by schannel
Ref: #12704

Co-authored-by: Jay Satiro <raysatiro@yahoo.com>

Closes #12711
2024-01-16 11:02:13 +01:00
Daniel Stenberg ae9f01f336
tool_operate: make --remove-on-error only remove "real" files
Reported-by: Harry Sintonen
Assisted-by: Dan Fandrich

Closes #12710
2024-01-16 10:57:12 +01:00
Daniel Stenberg aaab6cb0c4
cmdline-opts/gen.pl: error on initital blank line
After the "---" separator, there should be no blank line and this script
now errors out if one is detected.

Ref: #12696
Closes #12698
2024-01-14 18:12:14 +01:00
Daniel Stenberg beb2283746
curl_multi_fdset.3: remove mention of null pointer support
... since this funtion has not supported null pointer fd_set arguments since
at least 2006. (That's when I stopped my git blame journey)

Fixes #12691
Reported-by: sfan5 on github
Closes #12692
2024-01-14 14:53:38 +01:00
Mark Huang 3167dab0d5
docs/cmdline: remove unnecessary line breaks
Closes #12696
2024-01-14 14:45:23 +01:00
Daniel Stenberg 9582f20d8a
TODO: TFTP doesn't convert LF to CRLF for mode=netascii
Closes #12655
Closes #12690
2024-01-13 16:26:17 +01:00
Daniel Stenberg 9729560a6f
gen: do italics/bold for a range of letters, not just single word
Previously it would match only on a sequence of non-space, which made it
miss to highlight for example "public suffix list".

Updated the recent cookie.d edit from 5da57193b7 to use bold instead
of italics.

Closes #12689
2024-01-13 16:25:20 +01:00
Daniel Stenberg 5da57193b7
docs: describe and highlight super cookies
Reported-by: Yadhu Krishna M

Closes #12687
2024-01-12 23:55:20 +01:00
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