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

2033 Коммитов

Автор SHA1 Сообщение Дата
Daniel Stenberg 1695fcf57d
man pages: call the custom user pointer 'clientp' consistently
The variable had a few different names. Now try to use 'clientp'
consistently for all man pages using a custom pointer set by the
application.

Reported-by: Gerrit Renker

Fixes #10434
Closes #10435
2023-02-07 22:33:47 +01:00
Daniel Stenberg ff7c390b29
curl_ws_send.3: clarify how to send multi-frame messages 2023-02-06 17:27:51 +01:00
Thomas1664 c29ccb35ff
CURLOPT_WRITEFUNCTION.3: fix memory leak in example
Closes #10390
2023-02-03 10:02:47 +01:00
Thomas1664 on github 72d4f7d8f7
curl_free.3: fix return type of `curl_free`
Fixes #10373
Closes #10374
2023-01-31 08:32:37 +01:00
Daniel Stenberg ee51f5847a
CURLOPT_READFUNCTION.3: the callback 'size' arg is always 1
Reported-by: Brian Green
Fixes #10328
Closes #10355
2023-01-29 10:28:17 +01:00
Dan Fandrich 5a70403cff docs: POSTFIELDSIZE must be set to -1 with read function
Reported-by: RanBarLavie on github

Closes #10313
2023-01-20 10:01:43 -08:00
Sergey Bronnikov de07d804fb curl_version_info.3: fix typo
Closes https://github.com/curl/curl/pull/10306
2023-01-17 03:37:38 -05:00
Jay Satiro c4cd0e2be9 openssl: Don't ignore CA paths when using Windows CA store (redux)
.. and remove 'experimental' designation from CURLSSLOPT_NATIVE_CA.

This commit restores the behavior of CURLSSLOPT_NATIVE_CA so that it
does not override CURLOPT_CAINFO / CURLOPT_CAPATH, or the hardcoded
default locations. Instead the native Windows CA store can be used at
the same time.

---

This behavior was originally added over two years ago in abbc5d60
(#5585) but then 83393b1a (#7892) broke it over a year ago, I assume
inadvertently.

The CURLSSLOPT_NATIVE_CA feature was marked experimental and likely
rarely used.

Ref: https://github.com/curl/curl/pull/5585
Ref: https://github.com/curl/curl/pull/7892
Ref: https://curl.se/mail/lib-2023-01/0019.html

Closes https://github.com/curl/curl/pull/10244
2023-01-17 03:32:58 -05:00
Daniel Stenberg a56d2b0b94
curl.h: add CURL_HTTP_VERSION_3ONLY
As the previous CURL_HTTP_VERSION_3 option gets a slightly altered meaning.

Closes #10264
2023-01-12 16:17:55 +01:00
Daniel Stenberg 5cb63da771
curl.h: allow up to 10M buffer size
Bump the limit from 512K. There might be reasons for applications using
h3 to set larger buffers and there is no strong reason for curl to have
a very small maximum.

Ref: https://curl.se/mail/lib-2023-01/0026.html

Closes #10256
2023-01-08 20:54:48 +01:00
Jay Satiro d7b56ac75c CURLOPT_HEADERDATA.3: warn DLL users must set write function
- Warn that in Windows if libcurl is running from a DLL and if
  CURLOPT_HEADERDATA is set then CURLOPT_WRITEFUNCTION or
  CURLOPT_HEADERFUNCTION must be set as well, otherwise the user may
  experience crashes.

We already have a similar warning in CURLOPT_WRITEDATA. Basically, in
Windows libcurl could crash writing a FILE pointer that was created by
a different C runtime. In Windows each DLL that is part of a program may
or may not have its own C runtime.

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

Closes https://github.com/curl/curl/pull/10233
2023-01-06 03:45:17 -05:00
Daniel Stenberg 2bc1d775f5
copyright: update all copyright lines and remove year ranges
- they are mostly pointless in all major jurisdictions
- many big corporations and projects already don't use them
- saves us from pointless churn
- git keeps history for us
- the year range is kept in COPYING

checksrc is updated to allow non-year using copyright statements

Closes #10205
2023-01-03 09:19:21 +01:00
Daniel Stenberg afd0a12f8b
curl_global_sslset.3: clarify the openssl situation
and add rustls

Closes #10188
2023-01-01 15:08:06 +01:00
Daniel Stenberg 17f0891184
docs/libcurl/curl_getdate.3: minor whitespace edit
To avoid a fccp quirk that made it render wrongly on the website
2022-12-30 12:58:14 +01:00
Daniel Stenberg 076a2f6291
share: add sharing of HSTS cache among handles
Closes #10138
2022-12-27 15:22:01 +01:00
Daniel Stenberg 901392cbb7
urlapi: add CURLU_PUNYCODE
Allows curl_url_get() get the punycode version of host names for the
host name and URL parts.

Extend test 1560 to verify.

Closes #10109
2022-12-26 23:29:23 +01:00
Daniel Stenberg ee583c68d4
docs: mention indirect effects of --insecure
Warn users that disabling certficate verification allows servers to
"pollute" curl with data it trusts.

Reported-by: Harry Sintonen
Closes #10126
2022-12-21 23:36:58 +01:00
Daniel Stenberg 46441955bf
CURLOPT_DEBUGFUNCTION.3: emphasize that incoming data is "raw"
Closes #10106
2022-12-16 15:02:38 +01:00
Daniel Stenberg 6f40703ba0
curl_url_get.3: remove spurious backtick
Put there by mistake.

Follow-up from 9a8564a92

Closes #10101
2022-12-15 15:56:26 +01:00
Daniel Stenberg af0924210b
curl_url_set.3: document CURLU_DISALLOW_USER
Closes #10099
2022-12-15 12:38:57 +01:00
Emil Engler a20f99de74 curl_url_set.3: fix typo
Closes: #10089
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
2022-12-13 20:29:37 +01:00
Daniel Stenberg 734c1f8909
ws: if no connection is around, return error
- curl_ws_send returns CURLE_SEND_ERROR if data->conn is gone

- curl_ws_recv returns CURLE_GOT_NOTHING on connection close

- curl_ws_recv.3: mention new return code for connection close + example
  embryo

Closes #10084
2022-12-13 15:13:03 +01:00
MonkeybreadSoftware 1a88b6b653 docs/curl_ws_send: Fixed typo in websocket docs
Replace as with is in relevant sentences.

Closes: #10081
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
2022-12-11 20:52:12 +01:00
Daniel Stenberg f0b374f662
KNOWN_BUGS: remove items not considered bugs any more
- CURL_GLOBAL_SSL

This option was changed in libcurl 7.57.0 and clearly it has not caused
too many issues and a lot of time has passed.

- Store TLS context per transfer instead of per connection

This is a possible future optimization. One that is much less important
and interesting since the added support for CA caching.

- Microsoft telnet server

This bug was filed in May 2007 against curl 7.16.1 and we have not
received further reports.

- active FTP over a SOCKS

Actually, proxies in general is not working with active FTP mode. This
is now added in proxy documentation.

- DICT responses show the underlying protocol

curl still does this, but since this is now an established behavior
since forever we cannot change it easily and adding an option for it
seems crazy as this protocol is not so little its not worth it. Let's
just live with it.

- Secure Transport disabling hostname validation also disables SNI

This is an already documented restriction in Secure Transport.

- CURLOPT_SEEKFUNCTION not called with CURLFORM_STREAM

The curl_formadd() function is marked and documented as deprecated. No
point in collecting bugs for it. It should not be used further.

- STARTTRANSFER time is wrong for HTTP POSTs

After close source code inspection I cannot see how this is true or that
there is any special treatment for different HTTP methods. We also have
not received many further reports on this, making me strongly suspect
that this is no (longer an) issue.

- multipart formposts file name encoding

The once proposed RFC 5987-encoding is since RFC 7578 documented as MUST
NOT be used. The since then implemented MIME API allows the user to set
the name on their own and can thus provide it encoded as it wants.

- DoH is not used for all name resolves when enabled

It is questionable if users actually want to use DoH for interface and
FTP port name resolving. This restriction is now documented and we
advice users against using name resolving at all for these functions.

Closes #10043
2022-12-09 13:55:01 +01:00
Daniel Stenberg da8e215f6c
CURLOPT_COOKIEFILE.3: advice => advise
Closes #10063

Reviewed-by: Daniel Gustafsson
2022-12-09 10:51:44 +01:00
Patrick Monnerat eb559c8056
mime: relax easy/mime structures binding
Deprecation and removal of codeset conversion support from the library
have released the strict need for an early binding of mime structures to
an easy handle (https://github.com/curl/curl/commit/2610142).

This constraint currently forces to create the handle before the mime
structure and the latter cannot be attached to another handle once
created (see https://curl.se/mail/lib-2022-08/0027.html).

This commit removes the handle pointers from the mime structures
allowing more flexibility on their use.

When an easy handle is duplicated, bound mime structures must however
still be duplicated too as their components hold send-time dynamic
information.

Closes #9927
2022-11-28 09:09:54 +01:00
Daniel Stenberg 3e33681eaf
KNOWN_BUGS: remove five FTP related issues
- "FTP with CONNECT and slow server"

I believe this is not a problem these days.

- "FTP with NULs in URL parts"

The FTP protocol does not support them properly anyway.

- remove "FTP and empty path parts in the URL"

I don't think this has ever been reported as a real problem but was only
a hypothetical one.

- "Premature transfer end but healthy control channel"

This is not a bug, this is an optimization that *could* be performed but is
not an actual problem.

- "FTP without or slow 220 response"

Instead add to the documentation of the connect timeout that the
connection is considered complete at TCP/TLS/QUIC layer.

Closes #9979
2022-11-26 12:33:58 +01:00
Casey Bodley 7f8e6da6dc
aws_sigv4: consult x-%s-content-sha256 for payload hash
`Curl_output_aws_sigv4()` doesn't always have the whole payload in
memory to generate a real payload hash. this commit allows the user to
pass in a header like `x-amz-content-sha256` to provide their desired
payload hash

some services like s3 require this header, and may support other values
like s3's `UNSIGNED-PAYLOAD` and `STREAMING-AWS4-HMAC-SHA256-PAYLOAD`
with special semantics. servers use this header's value as the payload
hash during signature validation, so it must match what the client uses
to generate the signature

CURLOPT_AWS_SIGV4.3 now describes the content-sha256 interaction

Signed-off-by: Casey Bodley <cbodley@redhat.com>

Closes #9804
2022-11-25 09:24:07 +01:00
Daniel Stenberg 66ca8ace1a
docs: add more "SEE ALSO" links to CA related pages
Closes #9959
2022-11-22 14:43:38 +01:00
Jay Satiro e08382a208 CURLOPT_POST.3: Explain setting to 0 changes request type
Bug: https://github.com/curl/curl/issues/9849
Reported-by:  MonkeybreadSoftware@users.noreply.github.com

Closes https://github.com/curl/curl/pull/9942
2022-11-19 03:19:32 -05:00
Alexandre Ferrieux 49798cac83
CURLOPT_QUICK_EXIT: don't wait for DNS thread on exit
Fixes #2975
Closes #9147
2022-11-18 00:17:27 +01:00
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
Patrick Monnerat e1e482517f
docs: curl_version_info is not thread-safe before libcurl initialization
Closes #9583
2022-11-14 09:19:06 +01:00
Patrick Monnerat e780aae77a
version: add a feature names array to curl_version_info_data
Field feature_names contains a null-terminated sorted array of feature
names. Bitmask field features is deprecated.

Documentation is updated. Test 1177 and tests/version-scan.pl updated to
match new documentation format and extended to check feature names too.

Closes #9583
2022-11-14 09:18:53 +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
Adam Averay 84e2ca7e3c
libcurl-errors.3: remove duplicate word
Closes #9846
2022-11-03 09:34:03 +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
12932 ddeec8feba
misc: nitpick grammar in comments/docs
because the 'u' in URL is actually a consonant *sound* it is only
correct to write "a URL"

sorry this is a bit nitpicky :P

https://english.stackexchange.com/questions/152/when-should-i-use-a-vs-an
https://www.techtarget.com/whatis/feature/Which-is-correct-a-URL-or-an-URL

Closes #9699
2022-10-12 11:32:43 +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