Commit Graph

748 Commits

Author SHA1 Message Date
Patrick Monnerat
6967571bf2
lib: feature deprecation warnings in gcc >= 4.3
Add a deprecated attribute to functions and enum values that should not
be used anymore.
This uses a gcc 4.3 dialect, thus is only available for this version of
gcc and newer. Note that the _Pragma() keyword is introduced by C99, but
is available as part of the gcc dialect even when compiling in C89 mode.

It is still possible to disable deprecation at a calling module compile
time by defining CURL_DISABLE_DEPRECATION.

Gcc type checking macros are made aware of possible deprecations.

Some testing support Perl programs are adapted to the extended
declaration syntax.

Several test and unit test C programs intentionally use deprecated
functions/options and are annotated to not generate a warning.

New test 1222 checks the deprecation status in doc and header files.

Closes #9667
2022-11-15 10:57:29 +01:00
Jay Satiro
6d75115406 lib: add CURL_WRITEFUNC_ERROR to signal write callback error
Prior to this change if the user wanted to signal an error from their
write callbacks they would have to use logic to return a value different
from the number of bytes (nmemb) passed to the callback. Also, the
inclination of some users has been to just return 0 to signal error,
which is incorrect as that may be the number of bytes passed to the
callback.

To remedy this the user can now return CURL_WRITEFUNC_ERROR instead.

Ref: https://github.com/curl/curl/issues/9873

Closes https://github.com/curl/curl/pull/9874
2022-11-10 03:13:58 -05:00
Michael Drake
1fdca35ddd
curl.h: add CURLOPT_CA_CACHE_TIMEOUT option
Adds a new option to control the maximum time that a cached
certificate store may be retained for.

Currently only the OpenSSL backend implements support for
caching certificate stores.

Closes #9620
2022-11-08 10:06:12 +01:00
Daniel Stenberg
ec4eec222b
CURLOPT_DEBUGFUNCTION.3: do not assume nul-termination in example
Reported-by: Oskar Sigvardsson

Bug: https://curl.se/mail/lib-2022-11/0016.html

Closes #9862
2022-11-07 12:48:39 +01:00
Daniel Stenberg
b1953c1933
noproxy: tailmatch like in 7.85.0 and earlier
A regfression in 7.86.0 (via 1e9a538e05) made the tailmatch work
differently than before. This restores the logic to how it used to work:

All names listed in NO_PROXY are tailmatched against the used domain
name, if the lengths are identical it needs a full match.

Update the docs, update test 1614.

Reported-by: Stuart Henderson
Fixes #9842
Closes #9858
2022-11-07 08:00:38 +01:00
Patrick Schlangen
b8c302dcba
docs: remove performance note in CURLOPT_SSL_VERIFYPEER
This note became obsolete since PR #7892 (see also discussion in the PR
comments).

Closes #9832
2022-10-30 22:26:24 +01:00
Daniel Stenberg
d4fed2a13a
docs: explain the noproxy CIDR notation support
Follow-up to 1e9a538e05

Closes #9818
2022-10-28 09:02:22 +02:00
Daniel Stenberg
716ad5ea49
CURLMOPT_SOCKETFUNCTION.3: clarify CURL_POLL_REMOVE
The removal is brief or long, don't assume.

Reported-by: Luca Niccoli

Fixes #9799
Closes #9800
2022-10-26 11:23:35 +02:00
Daniel Stenberg
873cc38e89
docs: make sure libcurl opts examples pass in long arguments
Reported-by: Sergey
Fixes #9779
Closes #9780
2022-10-22 23:24:57 +02:00
Daniel Stenberg
1e9a538e05
noproxy: support proxies specified using cidr notation
For both IPv4 and IPv6 addresses. Now also checks IPv6 addresses "correctly"
and not with string comparisons.

Split out the noproxy checks and functionality into noproxy.c

Added unit test 1614 to verify checking functions.

Reported-by: Mathieu Carbonneaux

Fixes #9773
Fixes #5745
Closes #9775
2022-10-21 13:39:20 +02:00
Brad Harder
6a7c776ee6
CURLMOPT_PIPELINING.3: dedup manpage xref
Closes #9776
2022-10-20 23:17:00 +02:00
Daniel Stenberg
40f3504401
CURLOPT_AUTOREFERER.3: highlight the privacy leak risk
Closes #9757
2022-10-18 16:04:12 +02:00
Daniel Stenberg
d345ebfcda
CURLOPT_POSTFIELDS.3: refer to CURLOPT_MIMEPOST
Not the deprecated CURLOPT_HTTPPOST option.

Also added two see-alsos.

Reported-by: Trail of Bits
Closes #9752
2022-10-17 16:09:22 +02:00
Patrick Monnerat
b0e4ebe960
doc: fix deprecation versions inconsistencies
Ref: https://curl.se/mail/lib-2022-10/0026.html

Closes #9711
2022-10-13 13:59:56 +02:00
Martin Ågren
c96462addc
docs: fix grammar around needing pass phrase
"You never needed a pass phrase" reads like it's about to be followed by
something like "until version so-and-so", but that is not what is
intended. Change to "You never need a pass phrase". There are two
instances of this text, so make sure to update both.
2022-10-11 08:05:26 +02:00
Daniel Stenberg
ea3ce80fa8
CURLOPT_COOKIEFILE: insist on "" for enable-without-file
The former way that also suggested using a non-existing file to just
enable the cookie engine could lead to developers maybe a bit carelessly
guessing a file name that will not exist, and then in a future due to
circumstances, such a file could be made to exist and then accidentally
libcurl would read cookies not actually meant to.

Reported-by: Trail of bits

Closes #9654
2022-10-06 10:17:31 +02:00
Jay Satiro
eada290098 CURLOPT_HTTPPOST.3: bolden the deprecation notice
Ref: https://github.com/curl/curl/pull/9621

Closes https://github.com/curl/curl/pull/9637
2022-10-05 18:41:55 -04:00
Daniel Stenberg
5299301a9b
CURLOPT_MIMEPOST.3: add an (inline) example
Reported-by: Jay Satiro
Bug: https://github.com/curl/curl/pull/9637#issuecomment-1268070723

Closes #9649
2022-10-05 16:04:08 +02:00
Daniel Stenberg
90ddfa465b
CURLOPT_COOKIELIST.3: fix formatting mistake
Also, updated manpage-syntax.pl to make it detect this error in test
1173.

Reported-by: ProceduralMan on github
Fixes #9639
Closes #9640
2022-10-04 11:59:55 +02:00
Patrick Monnerat
2437fac013
lib: sanitize conditional exclusion around MIME
The introduction of CURL_DISABLE_MIME came with some additional bugs:
- Disabled MIME is compiled-in anyway if SMTP and/or IMAP is enabled.
- CURLOPT_MIMEPOST, CURLOPT_MIME_OPTIONS and CURLOPT_HTTPHEADER are
  conditioned on HTTP, although also needed for SMTP and IMAP MIME mail
  uploads.

In addition, the CURLOPT_HTTPHEADER and --header documentation does not
mention their use for MIME mail.

This commit fixes the problems above.

Closes #9610
2022-09-29 10:51:04 +02:00
Daniel Stenberg
ca3efd57c2
CURLSHOPT_UNLOCKFUNC.3: the callback as no 'access' argument
Probably a copy and paste error from the lock function man page.

Reported-by: Robby Simpson
Fixes #9612
Closes #9613
2022-09-28 23:18:54 +02:00
Daniel Stenberg
24ed4314b0
CURLOPT_ACCEPT_ENCODING.3: remove "four" as they are five
... instead just list the supported encodings.

Reported-by: ProceduralMan on github
Fixes #9614
Closes #9615
2022-09-28 23:17:51 +02:00
Daniel Stenberg
bf1571eb6f
docs: tag curl options better in man pages
As it makes them links in the HTML versions.

Verified by the extended test 1176
2022-09-22 17:36:28 +02:00
Daniel Stenberg
7295e62c66
curl.h: fix mention of wrong error code in comment
The same error and comment were also used and is now corrected in
CURLOPT_SSH_KEYFUNCTION.3
2022-09-22 09:43:39 +02:00
Daniel Stenberg
fd1ce3d4b0
docs: spellfixes
Pointed by the new CI job
2022-09-21 15:20:08 +02:00
Daniel Stenberg
307b7543ea
misc: null-terminate
Make use of this term consistently.

Closes #9527
2022-09-17 23:19:29 +02:00
Patrick Monnerat
5261efaed8
docs: tell about disabled protocols in CURLOPT_*PROTOCOLS_STR.
Disabled protocols are now handled as if they were unknown.
Also update the possible protocol list.
2022-09-16 23:29:09 +02:00
Daniel Stenberg
dbaa1e17a6
CURLOPT_CONNECT_ONLY.3: for ws(s) as well
and correct the version number for when that support comes. Even if it
is still experimental for WebSocket.

Closes #9487
2022-09-13 10:31:48 +02:00
Daniel Stenberg
664249d095
ws: initial websockets support
Closes #8995
2022-09-09 15:11:14 +02:00
Daniel Stenberg
fa26f15b19
CURLOPT_PROXY_SSLCERT_BLOB.3: this is for HTTPS proxies
The 'protocols' listed were previously wrong.

Reported-by: ProceduralMan on github
Fixes #9434
Closes #9435
2022-09-06 09:55:23 +02:00
Daniel Stenberg
ad9383bd7d
CURLOPT_DNS_INTERFACE.3: mention it works for almost all protocols
Except file.

Reported-by: ProceduralMan on github
Fixes #9427
Closes #9428
2022-09-05 08:36:06 +02:00
Daniel Stenberg
472f1cbe7e
NPN: remove support for and use of
Next Protocol Negotiation is a TLS extension that was created and used
for agreeing to use the SPDY protocol (the precursor to HTTP/2) for
HTTPS. In the early days of HTTP/2, before the spec was finalized and
shipped, the protocol could be enabled using this extension with some
servers.

curl supports the NPN extension with some TLS backends since then, with
a command line option `--npn` and in libcurl with
`CURLOPT_SSL_ENABLE_NPN`.

HTTP/2 proper is made to use the ALPN (Application-Layer Protocol
Negotiation) extension and the NPN extension has no purposes
anymore. The HTTP/2 spec was published in May 2015.

Today, use of NPN in the wild should be extremely rare and most likely
totally extinct. Chrome removed NPN support in Chrome 51, shipped in
June 2016. Removed in Firefox 53, April 2017.

Closes #9307
2022-09-05 07:39:02 +02:00
Samuel Henrique
464ff5a610
manpages: Fix spelling of "allows to" -> "allows one to"
References:
 https://salsa.debian.org/lintian/lintian/-/blob/master/tags/t/typo-in-manual-page.tag
 https://english.stackexchange.com/questions/60271/grammatical-complements-for-allow/60285#60285

Closes #9419
2022-09-02 14:45:01 +02:00
Samuel Henrique
5c095a4435
CURLOPT_WILDCARDMATCH.3: Fix backslash escaping under single quotes
Lintian (on Debian) has been complaining about this for a while but
 I didn't bother initially as the groff parser that we use is not
 affected by this.

 But I have now noticed that the online manpage is affected by it:
 https://curl.se/libcurl/c/CURLOPT_WILDCARDMATCH.html

 (I'm using double quotes for quoting-only down below)

 The section that should be parsed as "'\'" ends up being parsed as
 "'´".

 This is due to roffit not parsing "'\\'" correctly, which is fine
 as the "correct" way of writing "'\'" is "'\e'" instead.

 Note that this fix is not enough to fix the online manpage at
 curl's website, as roffit seems to parse it wrongly either way.

 My intent is to at least fix the manpage so that roffit can
 be changed to parse "'\e'" correctly (although I suggest making
 roffit parse both ways correctly, since that's what groff does).

 More details at:
 https://bugs.debian.org/966803
 930b18e4b2/tags/a/acute-accent-in-manual-page.tag

Closes #9418
2022-09-02 14:43:32 +02:00
Daniel Stenberg
cf6e9ce80b
CURLOPT_BUFFERSIZE.3: add upload buffersize to see also
Closes #9354
2022-08-23 14:54:55 +02:00
Daniel Stenberg
b6dd849fa3
CURLINFO_SPEED_UPLOAD/DOWNLOAD.3: fix examples
Reported-by: jvvprasad78 on github
Assisted-by: Jay Satiro
Fixes #9239
Closes #9241
2022-08-07 14:25:55 +02:00
Daniel Stenberg
ba670b318c
CURLOPT_CONNECT_ONLY.3: clarify multi API use
Reported-by: Maxim Ivanov
Fixes #9244
Closes #9262
2022-08-07 14:07:23 +02:00
Wyatt O'Day
8beff43559 schannel: Add TLS 1.3 support
- Support TLS 1.3 as the default max TLS version for Windows Server 2022
  and Windows 11.

- Support specifying TLS 1.3 ciphers via existing option
  CURLOPT_TLS13_CIPHERS (tool: --tls13-ciphers).

Closes https://github.com/curl/curl/pull/8419
2022-08-02 13:54:31 -04:00
Daniel Stenberg
be43dd600a
CURLOPT_SERVER_RESPONSE_TIMEOUT: the new name
Starting now, CURLOPT_FTP_RESPONSE_TIMEOUT is the alias instead of the
other way around.

Since 7.20.0, CURLOPT_SERVER_RESPONSE_TIMEOUT has existed as an alias
but since the option is for more protocols than FTP the more "correct"
version of the option is the "server" one so now we switch.

Closes #9104
2022-07-05 10:16:05 +02:00
Daniel Stenberg
1d85d2e4f9
urldata: make 'use_port' an usigned short
... instead of a long. It is already enforced to not attempt to set any
value outside of 16 bits unsigned.

Closes #9099
2022-07-04 19:42:40 +02:00
Daniel Stenberg
e6f8445ede
setopt: add CURLOPT_PROTOCOLS_STR and CURLOPT_REDIR_PROTOCOLS_STR
... as replacements for deprecated CURLOPT_PROTOCOLS and
CURLOPT_REDIR_PROTOCOLS as these new ones do not risk running into the
32 bit limit the old ones are facing.

CURLINFO_PROTCOOL is now deprecated.

The curl tool is updated to use the new options.

Added test 1597 to verify the libcurl protocol parser.

Closes #8992
2022-07-04 08:35:09 +02:00
Daniel Stenberg
d56dbf0a16
CURLOPT_ALTSVC.3: document the file format
Closes #9033
2022-06-21 23:48:00 +02:00
divinity76
8dcbb0f191
CURLOPT_HTTPHEADER.3: improve comment in example
Closes #9025
2022-06-17 23:12:17 +02:00
Daniel Stenberg
a36e6987e5
misc: add missing SPDX-License-Identifier info
For some reason the REUSE CI job did not find these.

Closes #8999
2022-06-13 10:08:17 +02:00
max.mehl
ad9bc5976d
copyright: make repository REUSE compliant
Add licensing and copyright information for all files in this repository. This
either happens in the file itself as a comment header or in the file
`.reuse/dep5`.

This commit also adds a Github workflow to check pull requests and adapts
copyright.pl to the changes.

Closes #8869
2022-06-13 09:13:00 +02:00
Jay Satiro
c11380d213 CURLOPT_RANGE.3: remove ranged upload advice
The e-mail link in the advice contains instructions that are prone to
error. We need an example that works and can demonstrate how to properly
perform a ranged upload, and then we can refer to that example instead.

Bug: https://github.com/curl/curl/issues/8969
Reported-by: Simon Berger

Closes https://github.com/curl/curl/pull/8970
2022-06-08 01:47:17 -04:00
Fabian Keil
9dbce9b3d0
misc: spelling improvements
Closes #8956
2022-06-05 12:15:23 +02:00
Wolf Vollprecht
4d4eb8e587
netrc: check %USERPROFILE% as well on Windows
Closes #8855
2022-06-02 09:32:51 +02:00
Daniel Stenberg
665138b2dd
CURLOPT_SSH_HOSTKEYDATA/FUNCTION.3: minor polish 2022-06-02 09:30:52 +02:00
michael musset
1544513958
libssh2: add CURLOPT_SSH_HOSTKEYFUNCTION
The callback set by CURLOPT_SSH_HOSTKEYFUNCTION is called to check
wether or not the connection should continue.

The host key is passed in argument with a custom handle for the
application.

It overrides CURLOPT_SSH_KNOWNHOSTS

Closes #7959
2022-06-02 08:34:31 +02:00