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

5710 Коммитов

Автор SHA1 Сообщение Дата
andy5995 fd2c9e5e83
page-header: grammar improvement (display transfer rate)
Closes #10068
2022-12-11 12:36:36 +01:00
andy5995 d95a575de3
docs/DEPRECATE.md: grammar improvement and sp correction
The main thing I wanted to do was fix the spelling of "spent", but I
think this rewording improves the flow of the paragraph.

Closes #10067
2022-12-11 12:35:33 +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
andy5995 68ffb4063d misc: Fix incorrect spelling
Fix various uses of connnect by replacing them with connect.

Closes: #10045
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
2022-12-06 23:18:23 +01:00
Andy Alt 8fd218408d
docs/examples: spell correction ('Retrieve')
Closes #10040
2022-12-06 09:23:19 +01:00
Daniel Stenberg f85e932b28
KNOWN_BUGS: remove "Multi perform hangs waiting for threaded resolver"
We now offer a way to avoid that hang, using CURLOPT_QUICK_EXIT.

Follow-up to 49798cac83 fixed via #9147

Closes #9999
2022-11-29 16:14:16 +01:00
Daniel Stenberg 862406c5e1
KNOWN_BUGS: remove "--interface for ipv6 binds to unusable IP address"
Since years back the "if2ip" function verifies that it binds to a local IPv6
address that uses the same scope as the remote address.

This is not a bug.

Fixes #686
Closes #9998
2022-11-29 16:13:10 +01:00
Daniel Stenberg f83610c89d
docs/INSTALL.md: list OSes and CPUs quoted
to make them skip spellcheck. Also added a new CPU.

Follow-up to 4506cbf7f2

Closes #9997
2022-11-29 10:28:31 +01:00
Daniel Stenberg 4506cbf7f2
INSTALL: update operating systems and CPU archs
Update after recent runs on Twitter/Mastodon and my blog

Closes #9994
2022-11-28 17:26:40 +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 975efec61b
tool_operate: override the numeric locale and set "C" by force
Makes curl always use dot as decimal separator for options,
independently of what the locale says. Makes scripts and command lines
portable.

Updated docs accordingly.

Reported-by: Daniel Faust

Fixes #9969
Closes #9972
2022-11-25 08:32:23 +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
Daniel Stenberg c1cdc08cbb
examples: update descriptions
Make them not say "this is an example showing..." and instead just say
what the example shows.

Closes #9960
2022-11-22 14:41:15 +01:00
Daniel Stenberg a28a80d59e examples/10-at-a-time: fix possible skipped final transfers
Prior to this change if curl_multi_perform returned 0 running handles
and then all remaining transfers were added, then the perform loop would
end immediately without performing those transfers.

Reported-by: Mikhail Kuznetsov

Fixes https://github.com/curl/curl/issues/9953
Closes https://github.com/curl/curl/pull/9954
2022-11-22 03:34:01 -05:00
Viktor Szakats a8861b6ccd
Makefile.mk: portable Makefile.m32
Update bare GNU Make `Makefile.m32` to:

- Move objects into a subdirectory.
- Add support for MS-DOS. Tested with DJGPP.
- Add support for Watt-32 (on MS-DOS).
- Add support for AmigaOS.
- Rename `Makefile.m32` to `Makefile.mk`
- Replace `ARCH` with `TRIPLET`.
- Build `tool_hugehelp.c` proper (when tools are available).
- Drop MS-DOS compatibility macro `USE_ZLIB` (replaced by `HAVE_LIBZ`)
- Add support for `ZLIB_LIBS` to override `-lz`.
- Omit object files when building examples.
- Default `CC` to `gcc` once again, for convenience. (Caveat: compiler
  name `cc` cannot be set now.)
- Set `-DCURL_NO_OLDIES` for examples, like autotools does.
- Delete `makefile.dj` files. Notice the configuration details and
  defaults are not retained with the new method.
- Delete `makefile.amiga` files. A successful build needs a few custom
  options. We're also not retaining all build details from the existing
  Amiga make files.
- Rename `Makefile.m32` to `Makefile.mk` to reflect that they are not
  Windows/MinGW32-specific anymore.
- Add support for new `CFG` options: `-map`, `-debug`, `-trackmem`
- Set `-DNDEBUG` by default.
- Allow using `-DOS=...` in all `lib/config-*.h` headers, syncing this
  with `config-win32.h`.
- Look for zlib parts in `ZLIB_PATH/include` and `ZLIB_PATH/lib`
  instead of bare `ZLIB_PATH`.

Note that existing build configurations for MS-DOS and AmigaOS likely
become incompatible with this change.

Example AmigaOS configuration:
```
export CROSSPREFIX=/opt/amiga/bin/m68k-amigaos-
export CC=gcc
export CPPFLAGS='-DHAVE_PROTO_BSDSOCKET_H'
export CFLAGS='-mcrt=clib2'
export LDFLAGS="${CFLAGS}"
export LIBS='-lnet -lm'
make -C lib -f Makefile.mk
make -C src -f Makefile.mk
```

Example MS-DOS configuration:
```
export CROSSPREFIX=/opt/djgpp/bin/i586-pc-msdosdjgpp-
export WATT_PATH=/opt/djgpp/net/watt
export ZLIB_PATH=/opt/djgpp
export OPENSSL_PATH=/opt/djgpp
export OPENSSL_LIBS='-lssl -lcrypt'
export CFG=-zlib-ssl
make -C lib -f Makefile.mk
make -C src -f Makefile.mk
```

Closes #9764
2022-11-22 08:28:41 +00: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
Daniel Stenberg 8a6a48957f
docs/INSTALL.md: expand on static builds
Remove from KNOWN_BUGS

Closes #9944
2022-11-19 00:13:29 +01:00
Daniel Stenberg 95a8ac6bc5
HTTP-COOKIES.md: update the 6265bis link to draft-11
Closes #9940
2022-11-18 09:59:33 +01:00
Daniel Stenberg 117e3372a8
docs/WEBSOCKET.md: explain the URL use
Fixes #9936
Closes #9941
2022-11-18 09:58:07 +01: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
Daniel Stenberg b473df52bb
HTTP-COOKIES.md: mention that http://localhost is a secure context
Reported-by: Trail of Bits

Closes #9938
2022-11-17 23:16:31 +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
Daniel Stenberg fb7cf93ba9
netrc.d: provide mutext info
Reported-by: xianghongai on github
Fixes #9899
Closes #9901
2022-11-14 10:06:01 +01:00
Daniel Stenberg f20231a5f0
cmdline-opts/page-footer: remove long option nroff formatting
As gen.pl adds them
2022-11-14 10:04:58 +01:00
Daniel Stenberg 4154165e5e
cmdline-opts/gen.pl: fix the linkifier
Improved logic for finding existing --options in text and replacing with
the full version with nroff syntax. This also makes the web version link
options better.

Reported-by: xianghongai on github
Fixes #9899
Closes #9902
2022-11-14 10:04:31 +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
Stefan Eissing dafdb20a26
lib: connection filters (cfilter) addition to curl:
- general construct/destroy in connectdata
 - default implementations of callback functions
 - connect: cfilters for connect and accept
 - socks: cfilter for socks proxying
 - http_proxy: cfilter for http proxy tunneling
 - vtls: cfilters for primary and proxy ssl
 - change in general handling of data/conn
 - Curl_cfilter_setup() sets up filter chain based on data settings,
   if none are installed by the protocol handler setup
 - Curl_cfilter_connect() boot straps filters into `connected` status,
   used by handlers and multi to reach further stages
 - Curl_cfilter_is_connected() to check if a conn is connected,
   e.g. all filters have done their work
 - Curl_cfilter_get_select_socks() gets the sockets and READ/WRITE
   indicators for multi select to work
 - Curl_cfilter_data_pending() asks filters if the have incoming
   data pending for recv
 - Curl_cfilter_recv()/Curl_cfilter_send are the general callbacks
   installed in conn->recv/conn->send for io handling
 - Curl_cfilter_attach_data()/Curl_cfilter_detach_data() inform filters
   and addition/removal of a `data` from their connection
 - adding vtl functions to prevent use of Curl_ssl globals directly
   in other parts of the code.

Reviewed-by: Daniel Stenberg
Closes #9855
2022-11-11 15:17:51 +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
Daniel Stenberg 2bc04d4980
rtsp: fix RTSP auth
Verified with test 3100

Fixes #4750
Closes #9870
2022-11-09 09:40:00 +01:00
Daniel Stenberg e46d388c87
KNOWN_BUGS: remove eight entries
- 1.2 Multiple methods in a single WWW-Authenticate: header

This is not considered a bug anymore but a restriction and one that we
keep because we have NEVER gotten this reported by users in the wild and
because of this I consider this a fringe edge case we don't need to
support.

- 1.6 Unnecessary close when 401 received waiting for 100

This is not a bug, but possibly an optimization that *can* be done.

- 1.7 Deflate error after all content was received

This is not a curl bug. This happens due to broken servers.

- 2.1 CURLINFO_SSL_VERIFYRESULT has limited support

This is not a bug. This is just the nature of the implementation.

- 2.2 DER in keychain

This is not a bug.

- 5.7 Visual Studio project gaps

This is not a bug.

- 15.14 cmake build is not thread-safe

Fixed in 109e9730ee

- 11.3 Disconnects do not do verbose

This is not a bug.

Closes #9871
2022-11-09 09:37:21 +01:00
Daniel Stenberg b6e1afd069
curl: add --url-query
This option adds a piece of data, usually a name + value pair, to the
end of the URL query part. The syntax is identical to that used for
--data-urlencode with one extension:

If the argument starts with a '+' (plus), the rest of the string is
provided as-is unencoded.

This allows users to "build" query parts with options and URL encoding
even when not doing GET requests, which the already provided option -G
(--get) is limited to.

This idea was born in a Twitter thread.

Closes #9691
2022-11-08 14:37:34 +01: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 1188c6b8ea
WEBSOCKET.md: fix broken link
Reported-by: Felipe Gasper
Bug: https://curl.se/mail/lib-2022-10/0097.html
Closes #9864
2022-11-07 23:54:32 +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
Daniel Stenberg 2d4533996c
docs/EARLY-RELEASE.md: how to determine an early release
URL: https://curl.se/mail/lib-2022-10/0079.html

Closes #9820
2022-11-05 23:52:11 +01:00
Zespre Schmidt c2fecfbf80
docs: add missing parameters for --retry flag
Closes #9848
2022-11-03 09:36:04 +01:00
Adam Averay 84e2ca7e3c
libcurl-errors.3: remove duplicate word
Closes #9846
2022-11-03 09:34:03 +01:00
Patrick Monnerat 3b9af11c77
gen.pl: do not generate CURLHELP bitmask lines > 79 characters
If a command line option is in many help categories, there is a risk
that CURLHELP bitmask source lines generated for listhelp are longer
than 79 characters.

This change takes care of folding such long lines.

Cloes #9834
2022-11-01 12:00:39 +01:00
Daniel Stenberg 52cc4a85fd
style: use space after comment start and before comment end
/* like this */

/*not this*/

checksrc is updated accordingly

Closes #9828
2022-10-30 22:31:29 +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 a55256cfb2
curl: timeout in the read callback
The read callback can timeout if there's nothing to read within the
given maximum period. Example use case is when doing "curl -m 3
telnet://example.com" or anything else that expects input on stdin or
similar that otherwise would "hang" until something happens and then not
respect the timeout.

This fixes KNOWN_BUG 8.1, first filed in July 2009.

Bug: https://sourceforge.net/p/curl/bugs/846/

Closes #9815
2022-10-28 17:57:14 +02: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 19bfaca7cc
spellcheck.words: remove 'github' as an accepted word
Prefer the properly cased version: GitHub

Use markdown for links and GitHub in text.

Closes #9810
2022-10-27 15:53:11 +02:00
Ayesh Karunaratne 4484270afc
misc: typo and grammar fixes
- Replace `Github` with `GitHub`.
- Replace `windows` with `Windows`
- Replace `advice` with `advise` where a verb is used.
- A few fixes on removing repeated words.
- Replace `a HTTP` with `an HTTP`

Closes #9802
2022-10-27 10:01:30 +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 934ecfae17
THANKS: added from the 7.86.0 release 2022-10-26 08:12:46 +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 ef305de95c
cmdline/docs: add a required 'multi' keyword for each option
The keyword specifies how option works when specified multiple times:

 - single: the last provided value replaces the earlier ones
 - append: it supports being provided multiple times
 - boolean: on/off values
 - mutex: flag-like option that disable anoter flag

The 'gen.pl' script then outputs the proper and unified language for
each option's multi-use behavior in the generated man page.

The multi: header is requires in each .d file and will cause build error
if missing or set to an unknown value.

Closes #9759
2022-10-18 18:50:25 +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
Christopher Sauer d91f01f231
docs/INSTALL: update Android Instructions for newer NDKs
Closes #9732
2022-10-14 10:48:14 +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
Daniel Stenberg aafb06c592
test1275: verify upercase after period in markdown
Script based on the #9474 pull-request logic, but implemented in perl.

Updated docs/URL-SYNTAX.md accordingly.

Suggested-by: Dan Fandrich

Closes #9697
2022-10-12 14:19:50 +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
Daniel Stenberg 66313cf4b3
header.d: add category smtp and imap
They were previously (erroneously) added manually to tool_listhelp.c
which would make them get removed again when the file is updated next
time, unless added correctly here in header.d

Follow-up to 2437fac01

Closes #9690
2022-10-11 08:13:27 +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 642404717c
curl_ws_send.3: call the argument 'fragsize'
Since WebSocket works with "fragments" not "frames"

Closes #9668
2022-10-07 18:34:01 +02:00
Daniel Stenberg e3f335148a
websockets: remodeled API to support 63 bit frame sizes
curl_ws_recv() now receives data to fill up the provided buffer, but can
return a partial fragment. The function now also get a pointer to a
curl_ws_frame struct with metadata that also mentions the offset and
total size of the fragment (of which you might be receiving a smaller
piece). This way, large incoming fragments will be "streamed" to the
application. When the curl_ws_frame struct field 'bytesleft' is 0, the
final fragment piece has been delivered.

curl_ws_recv() was also adjusted to work with a buffer size smaller than
the fragment size. (Possibly needless to say as the fragment size can
now be 63 bit large).

curl_ws_send() now supports sending a piece of a fragment, in a
streaming manner, in addition to sending the entire fragment in a single
call if it is small enough. To send a huge fragment, curl_ws_send() can
be used to send it in many small calls by first telling libcurl about
the total expected fragment size, and then send the payload in N number
of separate invokes and libcurl will stream those over the wire.

The struct curl_ws_meta() returns is now called 'curl_ws_frame' and it
has been extended with two new fields: *offset* and *bytesleft*. To help
describe the passed on data chunk when a fragment is delivered in many
smaller pieces.

The documentation has been updated accordingly.

Closes #9636
2022-10-07 12:50:58 +02:00
Patrick Monnerat 83de62babc
docs/examples: avoid deprecated options in examples where possible
Example programs targeting a deprecated feature/option are commented with
a warning about it.
Other examples are adapted to not use deprecated options.

Closes #9661
2022-10-07 09:46:25 +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
John Bampton e80c4ff3d0
misc: fix spelling in docs and comments
also: remove outdated sentence

Closes #9644
2022-10-05 16:12:10 +02: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
Viktor Szakats 784400806c
Makefile.m32: deduplicate build rules [ci skip]
After this patch, we reduce the three copies of most `Makefile.m32`
logic to one. This now resides in `lib/Makefile.m32`. It makes future
updates easier, the code shorter, with a small amount of added
complexity.

`Makefile.m32` reduction:

|                   |  bytes | LOC total |  blank |  comment |  code |
|-------------------|-------:|----------:|-------:|---------:|------:|
| 7.85.0            |  34772 |      1337 |     79 |      192 |  1066 |
| before this patch |  17601 |       625 |     62 |      106 |   457 |
| after this patch  |  11680 |       392 |     52 |      104 |   236 |

Details:

- Change rules to create objects for the `v*` subdirs in the `lib` dir.
  This allows to use a shared compile rule and assumes that filenames
  are not (and will not be) colliding across these directories.
  `Makefile.m32` now also stores a list of these subdirs. They are
  changing rarely though.

- Sync as much as possible between the three `Makefile.m32` scripts'
  rules and their source/target sections.

- After this patch `CPPFLAGS` are all applied to the `src` sources once
  again. This matches the behaviour of cmake/autotools. Only zlib ones
  are actually required there.

- Use `.rc` names from `Makefile.inc` instead of keeping a duplicate.

- Change examples to link `libcurl.dll` by default. This makes building
  trivial, even as a cross-build:
    `CC=x86_64-w64-mingw32-gcc make -f Makefile.m32`
  To run them, you need to move/copy or add-to-path `libcurl.dll`.
  You can select static mode via `CFG=-static`.

- List more of the `Makefile.m32` config variables.

- Drop `.rc` support from examples. It made it fragile without much
  benefit.

- Include a necessary system lib for the `externalsocket.c` example.

- Exclude unnecessary systems libs when building in `-dyn` mode.

Closes #9642
2022-10-04 17:11:02 +00: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
Viktor Szakats 10fbd8b4e3
Makefile.m32: major rework [ci skip]
This patch overhauls `Makefile.m32` scripts, fixing a list of quirks,
making its behaviour and customization envvars align better with other
build systems, aiming for less code, that is easier to read, use and
maintain.

Details:
- Rename customization envvars:
  `CURL_CC` -> `CC`
  `CURL_RC` -> `RC`
  `CURL_AR` -> `AR`
  `CURL_LDFLAG_EXTRAS_DLL` -> `CURL_LDFLAGS_LIB`
  `CURL_LDFLAG_EXTRAS_EXE` -> `CURL_LDFLAGS_BIN`
- Drop `CURL_STRIP` and `CURL_RANLIB`. These tools are no longer used.
- Accept `CFLAGS`, `CPPFLAGS`, `RCFLAGS`, `LDFLAGS` and `LIBS` envvars.
- Drop `CURL_CFLAG_EXTRAS`, `CURL_LDFLAG_EXTRAS`, `CURL_RCFLAG_EXTRAS` in
  favor of the above.
- Do not automatically enable `zlib` with `libssh2`. `zlib` is optional
  with `libssh2`.
- Omit unnecessary `CPPFLAGS` options when building `curl.exe` and
  examples.
- Drop support for deprecated `-winssl` `CFG` option. Use `-schannel`
  instead.
- Avoid late evaluation where not necessary (`=` -> `:=`).
- Drop support for `CURL_DLL_A_SUFFIX` to override the implib suffix.
  Instead, use the standard naming scheme by default: `libcurl.dll.a`.
  The toolchain recognizes the name, and selects it automatically when
  asking for a `-shared` vs. `-static` build.
- Stop applying `strip` to `libcurl.a`. Follow-up from
  16a58e9f93. There was no debug info to
  strip since then.
- Stop setting `-O3`, `-W`, `-Wall` options. You can add these to
  `CFLAGS` as desired.
- Always enable `-DCURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG` with OpenSSL,
  to avoid that vulnerability on Windows.
- Add `-lbrotlicommon` to `LIBS` when using `brotli`.
- Do not enable `-nghttp3` without `-ngtcp2`.
- `-ssh2` and `-rtmp` options no longer try to auto-select a TLS-backend.
  You need to set the backend explicitly. This scales better and avoids
  issues with certain combinations (e.g. `libssh2` + `wolfssl` with no
  `schannel`).
- Default to OpenSSL TLS-backend with `ngtcp2`. Possible to override via
  `NGTCP2_LIBS`.
- Old, alternate method of enabling components (e.g. `SSH2=1`) no longer
  supported.
- Delete `SPNEGO` references. They were no-ops.
- Drop support for Win9x environments.
- Allow setting `OPENSSL_LIBS` independently from `OPENSSL_LIBPATH`.
- Support autotools/CMake `libssh2` builds by default.
- Respect `CURL_DLL_SUFFIX` in `-dyn` mode when building `curl.exe` and
  examples.
- Assume standard directory layout with `LIBCARES_PATH`. (Instead of the
  long gone embedded one.)
- Stop static linking with c-ares by default. Add
  `CPPFLAGS=-DCARES_STATICLIB` to enable it.
- Reorganize internal layout to avoid redundancy and emit clean diffs
  between src/lib and example make files.
- Delete unused variables.
- Code cleanups/rework.
- Comment and indentation fixes.

Closes #9632
2022-10-03 19:46:56 +00:00
Viktor Szakats e604a82cae
Makefile.m32: delete legacy component bits [ci skip]
- Drop auto-detection of OpenSSL 1.0.2 and earlier. Now always defaulting
  to OpenSSL 1.1.0 and later, LibreSSL and BoringSSL.

- Drop `Invalid path to OpenSSL package` detection. OpenSSL has been
  using a standard file layout since 1.1.0, so this seems unnecessary
  now.

- Drop special logic to enable Novell LDAP SDK support.

- Drop special logic to enable OpenLDAP LDAP SDK support. This seems
  to be distinct from native OpenLDAP, with support implemented inside
  `lib/ldap.c` (vs. `lib/openldap.c`) back when the latter did not exist
  yet in curl.

- Add `-lwldap32` only if there is no other LDAP library (either native
  OpenLDAP, or SDKs above) present.

- Update `doc/INSTALL.md` accordingly.

After this patch, it's necessary to make configration changes when using
OpenSSL 1.0.2 or earlier, or the two LDAP SDKs.

OpenSSL 1.0.2 and earlier:
```
export OPENSSL_INCLUDE = <path-to-openssl>/outinc
export OPENSSL_LIBPATH = <path-to-openssl>/out
export OPENSSL_LIBS = -lssl32 -leay32 -lgdi32
```

Novell LDAP SDK, previously enabled via `USE_LDAP_NOVELL=1`:
```
export CURL_CFLAG_EXTRAS = -I<path-to-sdk>/inc -DCURL_HAS_NOVELL_LDAPSDK
export CURL_LDFLAG_EXTRAS = -L<path-to-sdk>/lib/mscvc -lldapsdk -lldapssl -lldapx
```

OpenLDAP LDAP SDK, previously enabled via `USE_LDAP_OPENLDAP=1`:
```
export CURL_CFLAG_EXTRAS = -I<path-to-sdk>/include -DCURL_HAS_OPENLDAP_LDAPSDK
export CURL_LDFLAG_EXTRAS = -L<path-to-sdk>/lib -lldap -llber
```

I haven't tested these scenarios, and in general we recommend using
a recent OpenSSL release. Also, WinLDAP (the Windows default) and
OpenLDAP (via `-DUSE_OPENLDAP`) are the LDAP options actively worked on
in curl.

Closes #9631
2022-10-02 09:50:10 +00:00
Viktor Szakats 265fbd937e
docs: update sourceforge project links [ci skip]
SourceForge projects can now choose between two hostnames, with .io and
.net ending. Both support HTTPS by default now. Opening the other variant
will perm-redirected to the one chosen by the project.

The .io -> .net redirection is done insecurely.

Let's update the URLs to point to the current canonical endpoints to
avoid any redirects.

Closes #9630
2022-10-01 18:40:47 +00:00
Daniel Stenberg f77bde42d5
curl_url_set.3: document CURLU_APPENDQUERY proper
Listed among the other supported flags.

Reported-by: Robby Simpson
Fixes #9628
Closes #9629
2022-10-01 16:22:53 +02:00
Viktor Szakats 07a0047882
Makefile.m32: cleanups and fixes [ci skip]
- Add `-lcrypt32` once, and add it always for simplicity.
- Delete broken link and reference to the pre-Vista WinIDN add-on.
  MS no longer distribute it.
- Delete related `WINIDN_PATH` option. IDN is a system lib since Vista.
- Sync `LIBCARES_PATH` default with the rest of dependencies.
- Delete version numbers from dependency path defaults.
- `libgsasl` package is now called `gsasl`.
- Delete `libexpat` and `libxml2` references. No longer used by curl.
- Delete `Edit the path below...` comments. We recommend to predefine
  those envvars instead.
- `libcares.a` is not an internal dependency anymore. Stop using it as
  such.
- `windres` `--include-dir` -> `-I`, `-F` -> `--target=` for readability.
- Delete `STRIP`, `CURL_STRIP`, `AR` references from `src/Makefile.m32`.
  They were never used.
- Stop to `clean` some objects twice in `src/Makefile.m32`.
- Delete cvs-specific leftovers.
- Finish resource support in examples make file.
- Delete `-I<root>/lib` from examples make file.
- Fix copyright start year in examples make file.
- Delete duplicate `ftpuploadresume` input in examples make file.
- Sync OpenSSL lib order, `SYNC` support, `PROOT` use, dependency path
  defaults, variables names and other internal bits between the three
  make files.
- `lib/Makefile.m32` accepted custom options via `DLL_LIBS` envvar. This
  was lib-specific and possibly accidental. Use `CURL_LDFLAG_EXTRAS_DLL`
  envvar for the same effect.
- Fix linking `curl.exe` and examples to wrong static libs with
  auto-detected OpenSSL 1.0.2 or earlier.
- Add `-lgdi32` for OpenSSL 1.0.2 and earlier only.
- Add link to Novell LDAP SDK and use a relative default path. Latest
  version is from 2016, linked to an outdated OpenSSL 1.0.1.
- Whitespace and comment cleanups.

TODO in a next commit:

Delete built-in detection/logic for OpenSSL 1.0.2 and earlier, the Novell
LDAP SDK and the other LDAP SDK (which is _not_ OpenLDAP). Write up the
necessary custom envvars to configure them.

Closes #9616
2022-10-01 10:14:18 +00:00
Matt Holt 16a3ed4038
HTTP3.md: update Caddy example
Closes #9623
2022-09-30 08:21:15 +02:00
Viktor Szakats 7313ffebfe
docs: spelling nits
- MingW -> MinGW (Minimalist GNU for Windows)
- f.e. -> e.g.
- some whitespace and punctuation.

Reviewed-by: Daniel Stenberg

Closes #9622
2022-09-29 21:29:04 +00: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
Thiago Suchorski 75670e4573
docs: minor grammar fixes
Closes #9609
2022-09-29 10:44:12 +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 267668308b
configure: deprecate builds with small curl_off_t
If curl_off_t turns out to be smaller than 8 bytes,
--with-n64-deprecated needs to be used to allow the build to
continue. This is to highlight the fact that support for such builds is
going away next year.

Also mentioned in DEPRECATED.md

Closes #9605
2022-09-28 08:19:06 +02:00
Daniel Stenberg 8ac54a992f
DEPRECATE.md: Support for systems without 64 bit data types
Closes #9604
2022-09-27 12:51:49 +02:00
Daniel Stenberg a6fc1f544d
TODO: Provide the error body from a CONNECT response
Spellchecked-by: Jay Satiro

Closes #9513
Closes #9581
2022-09-23 23:31:08 +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 70b6c701f8
symbols-in-versions: CURLOPT_ENCODING is deprecated since 7.21.6 2022-09-22 17:35:23 +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 16814d8f8c
symbols-in-versions: add missing LIBCURL* symbols 2022-09-22 09:43:34 +02:00
Daniel Stenberg 4c8d180354
docs/libcurl/symbols-in-versions: add several missing symbols 2022-09-22 09:43:22 +02:00
Patrick Monnerat c3e634d066
examples/chkspeed: improve portability
The example program chkspeed uses strncasecmp() which is not portable
across systems. Replace calls to this function by tests on characters.

Closes #9562
2022-09-21 23:52:34 +02:00
Daniel Stenberg fd1ce3d4b0
docs: spellfixes
Pointed by the new CI job
2022-09-21 15:20:08 +02:00
Daniel Stenberg 9eec75452c
httpput-postfields.c: shorten string for C89 compliance
httpput-postfields.c:41:3: error: string length ‘522’ is greater than the length ‘509’ ISO C90 compilers are required to support [-Woverlength-strings]
   41 |   "this chapter.";
      |   ^~~~~~~~~~~~~~~

Closes #9555
2022-09-21 09:59:40 +02:00
Tobias Schaefer 8e5b1b66c1
curl_strequal.3: fix typo
Closes #9548
2022-09-20 23:21:47 +02:00
Daniel Stenberg e9a85c4623
TODO: Reduce CA certificate bundle reparsing
By adding some sort of cache.

Reported-by: Michael Drake
Closes #9379
Closes #9538
2022-09-20 08:35:52 +02:00
Daniel Stenberg fda897f5a1
docs: fix proselint complaints 2022-09-19 17:32:12 +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 79e404d039
curl: warn for --ssl use, considered insecure
Closes #9519
2022-09-16 21:27:20 +02:00