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

2033 Коммитов

Автор SHA1 Сообщение Дата
Jay Satiro 9135275f86 curl_easy_pause.3: remove explanation of progress function
- Remove misleading text that says progress function "gets called at
  least once per second, even if the connection is paused."

The progress function behavior is more nuanced and the user is better
served reading the progress function doc rather than attempt to explain
it in the curl_easy_pause doc.

The progress function can only be called at least once per second if an
appropriate multi transfer function is called (eg curl_multi_perform) in
that time. For a paused transfer there may not be such a call. Rather
than explain this in detail in the curl_easy_pause doc, rely on the user
reading the CURLOPT_PROGRESSFUNCTION doc.

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

Closes https://github.com/curl/curl/pull/9015
2022-06-16 03:18:04 -04:00
Daniel Stenberg 2b7f7d04f7
reuse/dep5: adjusted to parse better
... adjusted a few files to contain copyright and license info.

Closes #9006
2022-06-14 14:07:02 +02:00
Viktor Szakats a94d6fe706
version: rename threadsafe-init to threadsafe
Referring to Daniel's article [1], making the init function thread-safe
was the last bit to make libcurl thread-safe as a whole. So the name of
the feature may as well be the more concise 'threadsafe', also telling
the story that libcurl is now fully thread-safe, not just its init
function. Chances are high that libcurl wants to remain so in the
future, so there is little likelihood of ever needing any other distinct
`threadsafe-<name>` feature flags.

For consistency we also shorten `CURL_VERSION_THREADSAFE_INIT` to
`CURL_VERSION_THREADSAFE`, update its description and reference libcurl's
thread safety documentation.

[1]: https://daniel.haxx.se/blog/2022/06/08/making-libcurl-init-more-thread-safe/

Reviewed-by: Daniel Stenberg
Reviewed-by: Jay Satiro
Closes #8989
2022-06-13 18:59:45 +00: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
Daniel Stenberg 965119855d
curl_url_set.3: clarify by default using known schemes only
Closes #8994
2022-06-12 23:10:51 +02:00
Daniel Stenberg 5912da253b
select: return error from "lethal" poll/select errors
Adds two new error codes: CURLE_UNRECOVERABLE_POLL and
CURLM_UNRECOVERABLE_POLL one each for the easy and the multi interfaces.

Reported-by: Harry Sintonen
Fixes #8921
Closes #8961
2022-06-08 11:07:01 +02:00
Jay Satiro ae8a329e81 curl_global_init.3: Separate the Windows loader lock warning
This is a slight correction of the parent commit which implied the
loader lock warning only applied if not thread-safe. In fact the loader
lock warning applies either way.

Ref: https://github.com/curl/curl/pull/8972#discussion_r891987030
2022-06-08 03:02:51 -04:00
Daniel Stenberg ba47566863
curl_global_init.3: this is now (usually) thread-safe
Follow-up to 23af112f55

Closes #8972
2022-06-08 08:50:15 +02:00
Haxatron 23408f1fd2 libcurl-security.3: Document CRLF header injection
- Document that user input to header options is not sanitized, which
  could result in CRLF used to modify the request in a way other than
  what was intended.

Ref: https://hackerone.com/reports/1589877
Ref: https://medium.com/@tomnomnom/crlf-injection-into-phps-curl-options-e2e0d7cfe545

Closes https://github.com/curl/curl/pull/8964
2022-06-08 02:32:35 -04: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
Thomas Guillem 2ed1012564
curl_version_info: add CURL_VERSION_THREADSAFE_INIT
This flag can be used to make sure that curl_global_init() is
thread-safe.

This can be useful for libraries that can't control what other
dependencies are doing with Curl.

Closes #8680
2022-06-07 13:34:03 +02: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
Daniel Stenberg 8b1ae28509
urldata: store tcp_keepidle and tcp_keepintvl as ints
They can't be set larger than INT_MAX in the setsocket API calls.

Also document the max values in their respective man pages.

Closes #8940
2022-06-01 08:12:09 +02:00
Daniel Stenberg c80f0aebbb
CURLOPT_FILETIME.3: fix the protocols this works with 2022-05-31 17:40:47 +02:00
Daniel Stenberg b2175acc76
CURLOPT_PORT.3: We discourage using this option
Closes #8941
2022-05-31 15:58:20 +02:00
Daniel Stenberg c31752a50e
CURLOPT_NETRC.3: document the .netrc file format 2022-05-31 09:05:01 +02:00
Daniel Stenberg b1f8d50a92
curl_getdate.3: document that some illegal dates pass through
Closes #8938
2022-05-31 09:03:50 +02:00
Daniel Stenberg 4d94fac9f0
headers api: remove EXPERIMENTAL tag
Closes #8900
2022-05-30 14:13:48 +02:00
Daniel Stenberg 22eab9d413
CURLINFO_CAINFO/PATH.3: clarify the multiple TLS situation
Spell out the multi-TLS situation.

Reported-by: Dan Fandrich
Fixes #8926
Closes #8932
2022-05-29 17:01:42 +02:00
Daniel Stenberg c9b60f0053
http: restore header folding behavior
Folded header lines will now get passed through like before. The headers
API is adapted and will provide the content unfolded.

Added test 1274 and extended test 1940 to verify.

Reported-by: Petr Pisar
Fixes #8844
Closes #8899
2022-05-24 23:33:47 +02:00
Daniel Stenberg 7bc785387d
CURLINFO_CAPATH/CAINFO: get the default CA paths from libcurl
Closes #8888
2022-05-23 08:44:29 +02:00
Daniel Stenberg 7f2e1d345a
libcurl-security.3: add "Secrets in memory"
Closes #8881
2022-05-20 17:36:25 +02:00
Balakrishnan Balasubramanian dfa84a0450
socks: support unix sockets for socks proxy
Usage:
  curl -x "socks5h://localhost/run/tor/socks" "https://example.com"

Updated runtests.pl to run a socksd server listening on unix socket

Added tests test1467 test1468

Added documentation for proxy command line option and socks proxy
options

Closes #8668
2022-05-19 15:35:03 +02:00
Daniel Stenberg 8d86718f3f
opts: deprecate RANDOM_FILE and EGDSOCKET
These two options were only ever used for the OpenSSL backend for
versions before 1.1.0. They were never used for other backends and they
are not used with recent OpenSSL versions. They were never used much by
applications.

The defines RANDOM_FILE and EGD_SOCKET can still be set at build-time
for ancient EOL OpenSSL versions.

Closes #8670
2022-05-17 11:05:54 +02:00
Daniel Gustafsson 2df67e93c3 docs: clarify data replacement policy for MIME API
The API documentation for the MIME functions specify that the parts
can be set twice, with the last call winning.  While true, the user
can set the parts n times for n > 2, reword to specify multiple API
calls instead.

Closes: #8860
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2022-05-16 20:32:38 +02:00
Daniel Stenberg dd4f2622bc
CURLOPT_SSH_AUTH_TYPES.3: fix the default
The default is all possible methods.

Closes #8792
2022-05-04 23:31:24 +02:00
Daniel Stenberg 851fb743db
CURLOPT_DOH_URL.3: mention the known bug
It is mostly duplicating info from KNOWN_BUGS but make it easier to find
for users of this option.

Closes #8790
2022-05-04 14:44:16 +02:00
Daniel Stenberg 55e137bdf5
CURLOPT_HSTS*FUNCTION.3: document the involved structs as well
Reviewed-By: Daniel Gustafsson
Closes #8788
2022-05-03 17:18:28 +02:00
Daniel Stenberg d2a36beee6
CURLOPT*TLSAUTH: they only work with OpenSSL or GnuTLS
Closes #8753
2022-04-26 07:45:08 +02:00
Daniel Stenberg 4ec0549c39
misc: update copyright year ranges 2022-04-25 09:31:09 +02:00
Kushal Das 94ac2ca775
docs: updates spellings with full words
Closes #8730
2022-04-21 17:07:10 +02:00
Daniel Stenberg d794d4bce2
libcurl-tutorial.3: spellfix and minor polish 2022-04-20 10:56:41 +02:00
Daniel Stenberg 1c92b101c4
CURLINFO_PRIMARY_PORT.3: spellfix
Reported-by: Patrick Monnerat
2022-04-20 10:46:51 +02:00
Daniel Stenberg f7f26077bc
CURLINFO_PRIMARY_PORT.3: clarify which port this is
As it was not entirely clear previously.

Closes #8725
2022-04-19 23:06:12 +02:00
Daniel Stenberg 774dbd520a
CURLOPT_UNRESTRICTED_AUTH.3: extended explanation
Include details about Authentication headers.

Reported-by: Brad Spencer
Fixes #8724
Closes #8726
2022-04-19 18:15:02 +02:00
Daniel Gustafsson fe87e10c81 docs: Fix missing semicolon in example code
Multiple share examples were missing a semicolon on the line defining
the CURLSHcode variable.

Closes: #8697
Reported-by: Michael Kaufmann <mail@michael-kaufmann.ch>
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2022-04-15 23:35:15 +02:00
Daniel Gustafsson b7c0bd68ff curl_easy_header: fix typos in documentation
Closes: #8694
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2022-04-11 11:25:13 +02:00
Daniel Stenberg 4a8f6869db
English: use American spelling consistently
Authorization, Initialization, Organization etc.

Closes #8673
2022-04-05 14:55:47 +02:00
Daniel Stenberg 89e6129e5a
CURLOPT_PREQUOTE.3: only works for FTP file transfers, not dirs
Also add to quote.d. Add to TODO as something to add in a future.

Reported-by: anon00000000 on github
Closes #8602
Closes #8648
2022-03-29 18:15:44 +02:00
Daniel Stenberg 3a4182d468
docs: lots of minor language polish
Mostly based on recent language decisions from "everything curl":

- remove contractions (isn't => is not)
- *an* HTTP (consistency)
- runtime (no hyphen)
- backend (no hyphen)
- URL is uppercase

Closes #8646
2022-03-29 13:58:14 +02:00
Daniel Stenberg 301bd97965
CURLOPT_DISALLOW_USERNAME_IN_URL.3: use uppercase URL 2022-03-28 19:40:47 +02:00
Farzin 47048e0287
CURLOPT_PROGRESSFUNCTION.3: fix typo in example
Closes #8636
2022-03-25 16:53:30 +01:00
Jay Satiro cabcf403ed docs/opts: Mention Schannel client cert type is P12
Schannel backend code behaves same as Secure Transport, it expects a P12
certificate file or the name of a certificate already in the user's OS
key store. Also, both backends ignore CURLOPT_SSLKEY (tool: --key)
because they expect the private key to already be available from the
keystore or P12 certificate.

Ref: https://github.com/curl/curl/discussions/8581#discussioncomment-2337260

Closes https://github.com/curl/curl/pull/8587
2022-03-22 14:24:06 -04:00
Daniel Stenberg f07be5d1fa
curl_easy_nextheader.3: fix two typos
Reported-by: Timothe Litt
Bug: https://curl.se/mail/lib-2022-03/0060.html
2022-03-22 11:52:37 +01:00
Daniel Stenberg d1e4a67734
header api: add curl_easy_header and curl_easy_nextheader
Add test 1940 to 1946 to verify.

Closes #8593
2022-03-22 08:24:22 +01:00
Jan Venekamp 3b4a353025
BearSSL: add CURLOPT_SSL_CTX_FUNCTION support
Closes #8478
2022-03-12 23:03:37 +01:00
Jan Venekamp f5d79619b1
BearSSL: add CURLOPT_SSL_CIPHER_LIST support
Closes #8477
2022-03-12 22:59:45 +01:00
Daniel Stenberg 475e451766
CURLSHOPT_UNLOCKFUNC.3: fix the callback prototype
Copy and paste error

Reported-by: Francisco Olarte
Fixes #8573
Closes #8577
2022-03-10 23:01:37 +01:00
Daniel Stenberg 1fa09990ab
misc: update copyright year ranges 2022-03-05 09:41:24 +01:00
Farzin 0aa9ea99d2 CURLOPT_XFERINFOFUNCTION.3: fix example struct assignment
Closes https://github.com/curl/curl/pull/8519
2022-02-27 12:17:51 -05:00
Farzin 4517d8eb6f CURLOPT_PROGRESSFUNCTION.3: fix example struct assignment
Closes https://github.com/curl/curl/pull/8500
2022-02-23 03:13:11 -05:00
Daniel Stenberg a63c91adfa
CURLOPT_XFERINFOFUNCTION.3: fix typo in example
Reported-by: coralw on github
Fixes #8487
Closes #8488
2022-02-21 10:28:34 +01:00
Jay Satiro e0dc9765a7 multi: allow user callbacks to call curl_multi_assign
Several years ago a change was made to block user callbacks from calling
back into the API when not supported (recursive calls). One of the calls
blocked was curl_multi_assign. Recently the blocking was extended to the
multi interface API, however curl_multi_assign may need to be called
from within those user callbacks (eg CURLMOPT_SOCKETFUNCTION).

I can't think of any callback where it would be unsafe to call
curl_multi_assign so I removed the restriction entirely.

Reported-by: Michael Wallner

Ref: https://github.com/curl/curl/commit/b46cfbc
Ref: https://github.com/curl/curl/commit/340bb19

Fixes https://github.com/curl/curl/issues/8480
Closes https://github.com/curl/curl/pull/8483
2022-02-21 03:23:12 -05:00
Daniel Stenberg 2610142139
lib: remove support for CURL_DOES_CONVERSIONS
TPF was the only user and support for that was dropped.

Closes #8378
2022-02-04 08:05:35 +01:00
Bjarni Ingi Gislason 1ce1f0b5a0
curl_getdate.3: remove pointless .PP line
mandoc: WARNING: skipping paragraph macro: PP empty

Reported-by: Samuel Henrique
Closes #8365
2022-02-01 09:45:37 +01:00
Samuel Henrique 7e30252ec3
CURLSHOPT_LOCKFUNC.3: fix typo "relased" -> "released"
Found when packaging 7.81.0 for Debian.

Closes #8364
2022-01-31 22:43:30 +01:00
Daniel Stenberg cdb495f743
docs: document HTTP/2 not insisting on TLS 1.2
Both for --http2 and CURLOPT_HTTP_VERSION.

Reported-by: jhoyla on github
Fixes #8235
Closes #8300
2022-01-19 23:30:07 +01:00
Daniel Stenberg c24764ef59
CURLMOPT_TIMERFUNCTION/DATA.3: fix the examples
... to not call libcurl recursively back.

Closes #8286
2022-01-17 16:45:28 +01:00
Niels Martignène 6c084fd47c mbedtls: fix CURLOPT_SSLCERT_BLOB (again)
- Increase the buffer length passed to mbedtls_x509_crt_parse to account
  for the null byte appended to the temporary blob.

Follow-up to 867ad1c which uses a null terminated copy of the
certificate blob, because mbedtls_x509_crt_parse requires PEM data
to be null terminated.

Ref: https://github.com/curl/curl/commit/867ad1c#r63439893
Ref: https://github.com/curl/curl/pull/8146

Closes https://github.com/curl/curl/pull/8260
2022-01-15 16:57:36 -05:00
Daniel Stenberg cb0c7970f0
curl_multi_socket.3: remove callback and typical usage descriptions
1. The callback is better described in the option for setting it. Having
it in a single place reduces the risk that one of them is wrong.

2. The "typical usage" is wrong since the functions described in this
man page are both deprecated so they cannot be used in any "typical" way
anymore.

Closes #8262
2022-01-12 09:30:48 +01:00
Patrick Monnerat eeca818b1e
openldap: implement SASL authentication
As credentials can be quite different depending on the mechanism used,
there are no default mechanisms for LDAP and simple bind with a DN is
then used.

The caller has to provide mechanism(s) using CURLOPT_LOGIN_OPTIONS to
enable SASL authentication and disable simple bind.

Closes #8152
2022-01-11 11:17:27 +01:00
Cameron Will ce5463e60c CURLOPT_RESOLVE.3: change example port to 443
83cc966 changed documentation from using http to https. However,
CURLOPT_RESOLVE being set to port 80 in the documentation means that it
isn't valid for the new URL. Update to 443.

Closes https://github.com/curl/curl/pull/8258
2022-01-10 22:23:57 -05:00
Daniel Stenberg 223f26c28a
mesalink: remove support
Mesalink has ceased development. We can no longer encourage use of it.
It seems to be continued under the name TabbySSL, but no attempts have
(yet) been to make curl support it.

Fixes #8188
Closes #8191
2022-01-10 11:27:59 +01:00
Daniel Stenberg 7edb0fcf3f
ldap: return CURLE_URL_MALFORMAT for bad URL
For consistency, use the same return code for URL malformats,
independently of what scheme that is used. Previously this would return
CURLE_LDAP_INVALID_URL, but starting now that error cannot be returned.

Closes #8170
2022-01-10 09:37:47 +01:00
Stephen M. Coakley 3be94d84fc
rustls: add CURLOPT_CAINFO_BLOB support
Add support for `CURLOPT_CAINFO_BLOB` `CURLOPT_PROXY_CAINFO_BLOB` to the
rustls TLS backend. Multiple certificates in a single PEM string are
supported just like OpenSSL does with this option.

This is compatible at least with rustls-ffi 0.8+ which is our new
minimum version anyway.

I was able to build and run this on Windows, pulling trusted certs from
the system and then add them to rustls by setting
`CURLOPT_CAINFO_BLOB`. Handy!

Closes #8255
2022-01-10 09:30:12 +01:00
Daniel Stenberg d1237ac906
url: given a user in the URL, find pwd for that user in netrc
Add test 380 and 381 to verify, edited test 133

Reported-by: Manfred Schwarb
Fixes #8241
Closes #8243
2022-01-09 14:16:41 +01:00
Daniel Stenberg 40eec3f80e
curl_url_set.3: mention when CURLU_ALLOW_SPACE was added 2022-01-08 00:28:52 +01:00
Daniel Stenberg a338d86885
docs: fix mandoc -T lint formatting complaints
Closes #8228
2022-01-05 22:45:02 +01:00
Daniel Stenberg 0c416edbec
curl_multi_init.3: fix the copyright year range 2022-01-05 00:35:58 +01:00
Jay Satiro 53a3e90e06 curl_multi_init.3: fix EXAMPLE formatting 2022-01-03 15:14:45 -05:00
Daniel Stenberg 193053e2ed
libcurl-multi.3: "SOCKS proxy handshakes" are not blocking
Since 4a4b63daaa
2021-12-23 10:19:06 +01:00
Daniel Stenberg e7e5cc4c63
language: "email"
Missed three occurrences.

Follow-up to 7a92f86
2021-12-20 13:49:37 +01:00
Daniel Stenberg 7a92f865b4
misc: s/e-mail/email
Consistency is king. Following the lead in everything curl.

Closes #8159
2021-12-19 23:48:13 +01:00
Dan Fandrich bedd44f434 libcurl-security.3: mention address and URL mitigations
The new CURLOPT_PREREQFUNCTION callback is another way to sanitize
addresses.
Using the curl_url API is a way to mitigate against attacks relying on
URL parsing differences.
2021-12-15 00:14:29 -08:00
Patrick Monnerat cdc1da9120
openldap: several minor improvements
- Early check proper LDAP URL syntax. Reject URLs with a userinfo part.
- Use dynamic memory for ldap_init_fd() URL rather than a
  stack-allocated buffer.
- Never chase referrals: supporting it would require additional parallel
  connections and alternate authentication credentials.
- Do not wait 1 microsecond while polling/reading query response data.
- Store last received server code for retrieval with CURLINFO_RESPONSE_CODE.

Closes #8140
2021-12-15 08:07:53 +01:00
RekGRpth 98ae5d8ebc
CURLSHOPT_USERDATA.3: fix copy-paste mistake
Closes #8124
2021-12-09 14:31:22 +01:00
Daniel Stenberg d6934d393d
docs: fix minor nroff format nits
Repairs test 1140

Follow-up to 436cdf8204
2021-12-09 13:18:27 +01:00
Daniel Stenberg 436cdf8204
curl_multi_perform/socket_action.3: clarify what errors mean
An error returned from one of these funtions mean that ALL still ongoing
transfers are to be considered failed.

Ref: #8114
Closes #8120
2021-12-09 10:23:19 +01:00
Daniel Stenberg e067f46c4d
libcurl-errors.3: add CURLM_ABORTED_BY_CALLBACK
Follow-up to #8089 (2b3dd01)

Closes #8116
2021-12-09 10:21:36 +01:00
Daniel Stenberg 51a2e3ff1b
CURLOPT_RESOLVE.3: minor polish
Minor rephrasing for some explanations.

Put the format strings in stand-alone lines with .nf/.fi to be easier to spot.

Move "added in" to AVAILABILITY

Closed #8110
2021-12-07 17:13:55 +01:00
Daniel Stenberg 1a4c14cbac
CURLOPT_STDERR.3: does not work with libcurl as a win32 DLL
This is the exact same limitation already documented for
CURLOPT_WRITEDATA but should be clarified here. It also has a different
work-around.

Reported-by: Stephane Pellegrino
Bug: https://github.com/curl/curl/issues/8102
Closes #8103
2021-12-06 16:43:28 +01:00
Daniel Stenberg 2b3dd01b77
multi: handle errors returned from socket/timer callbacks
The callbacks were partially documented to support this. Now the
behavior is documented and returning error from either of these
callbacks will effectively kill all currently ongoing transfers.

Added test 530 to verify

Reported-by: Marcelo Juchem
Fixes #8083
Closes #8089
2021-12-06 14:55:52 +01:00
Patrick Monnerat a40160aee8
openldap: implement STARTTLS
As this introduces use of CURLOPT_USE_SSL option for LDAP, also check
this option in ldap.c as it is not supported by this backend.

Closes #8065
2021-12-06 07:53:04 +01:00
Jun Tseng a6e2643433
curl_easy_unescape.3: call curl_easy_cleanup in example
Closes #8097
2021-12-06 07:50:37 +01:00
Jun Tseng a42f60d94f
curl_easy_escape.3: call curl_easy_cleanup in example
Closes #8097
2021-12-06 07:50:29 +01:00
Daniel Stenberg c8a3046555
CURLMOPT_TIMERFUNCTION.3: call it expire time, not interval
Since we say it is a non-repating timer
2021-12-02 12:05:48 +01:00
Florian Van Heghe 8443f975c0
mbedTLS: add support for CURLOPT_CAINFO_BLOB
Closes #8071
2021-11-30 16:19:46 +01:00
Daniel Stenberg 230bb3e278
docs: consistent manpage SYNOPSIS
Make all libcurl related options use .nf (no fill) for the SYNOPSIS
section - for consistent look. roffit then renders that section using
<pre> (monospace font) in html for the website.

Extended manpage-syntax (test 1173) with a basic check for it.

Closes #8062
2021-11-26 16:51:23 +01:00
Daniel Stenberg 76d6e719d9
docs: address proselint nits
- avoid exclamation marks
- use consistent number of spaces after periods: one
- avoid clichés
- avoid using 'very'

Closes #8060
2021-11-26 14:27:07 +01:00
Daniel Stenberg 4183b8fe9a
urlapi: provide more detailed return codes
Previously, the return code CURLUE_MALFORMED_INPUT was used for almost
30 different URL format violations. This made it hard for users to
understand why a particular URL was not acceptable. Since the API cannot
point out a specific position within the URL for the problem, this now
instead introduces a number of additional and more fine-grained error
codes to allow the API to return more exactly in what "part" or section
of the URL a problem was detected.

Also bug-fixes curl_url_get() with CURLUPART_ZONEID, which previously
returned CURLUE_OK even if no zoneid existed.

Test cases in 1560 have been adjusted and extended. Tests 1538 and 1559
have been updated.

Updated libcurl-errors.3 and curl_url_strerror() accordingly.

Closes #8049
2021-11-25 08:36:04 +01:00
Daniel Stenberg a5f5687368
urlapi: make Curl_is_absolute_url always use MAX_SCHEME_LEN
Instad of having all callers pass in the maximum length, always use
it. The passed in length is instead used only as the length of the
target buffer for to storing the scheme name in, if used.

Added the scheme max length restriction to the curl_url_set.3 man page.

Follow-up to 45bcb2eaa7

Closes #8047
2021-11-25 08:33:48 +01:00
Patrick Monnerat b20b364764
mime: use percent-escaping for multipart form field and file names
Until now, form field and file names where escaped using the
backslash-escaping algorithm defined for multipart mails. This commit
replaces this with the percent-escaping method for URLs.

As this may introduce incompatibilities with server-side applications, a
new libcurl option CURLOPT_MIME_OPTIONS with bitmask
CURLMIMEOPT_FORMESCAPE is introduced to revert to legacy use of
backslash-escaping. This is controlled by new cli tool option
--form-escape.

New tests and documentation are provided for this feature.

Reported by: Ryan Sleevi
Fixes #7789
Closes #7805
2021-11-15 10:40:03 +01:00
Daniel Stenberg 541adbe2d8
curl_share_setopt.3: refer to CURLSHOPT_USERDATA(3) properly 2021-11-12 15:27:04 +01:00
Daniel Stenberg ec1d4e6466
curl_share_setopt.3: split out options into their own manpages
CURLSHOPT_LOCKFUNC.3
CURLSHOPT_SHARE.3
CURLSHOPT_UNLOCKFUNC.3
CURLSHOPT_UNSHARE.3
CURLSHOPT_USERDATA.3

Closes #7998
2021-11-12 15:14:40 +01:00
Daniel Stenberg 11a46d6d66
curl_easy_cleanup.3: remove from multi handle first
Easy handles that are used by the multi interface should be removed from
the multi handle before they are cleaned up.

Reported-by: Stephen M. Coakley
Ref: #7982
Closes #7983
2021-11-10 15:01:36 +01:00
Daniel Stenberg f2665f4e75
docs: NAME fixes in easy option man pages
Closes #7975
2021-11-08 23:10:49 +01:00
Daniel Stenberg 5c1e1d9aa4
curl_easy_perform.3: add a para about recv and send data
Reported-by: Godwin Stewart
Fixes #7973
Closes #7974
2021-11-08 16:13:42 +01:00
Daniel Stenberg ef7c76ad82
libcurl-easy.3: language polish 2021-11-08 14:43:13 +01:00
Daniel Stenberg a28464ae77
docs: reduce/avoid English contractions
You're => You are
Hasn't => Has not
Doesn't => Does not
Don't => Do not
You'll => You will
etc

Closes #7930
2021-11-07 23:16:27 +01:00
Daniel Stenberg 38ecb56df5
man pages: fix backslash-n in examples
... to be proper backslash-backslash-n sequences to render nicely in man
and on website.

Follow-up to 24155569d8
Reported-by: Sergey Markelov

Fixes https://github.com/curl/curl-www/issues/163
Closes #7962
2021-11-05 08:28:29 +01:00
Daniel Stenberg c6a66ccb5f
CURLOPT_ALTSVC_CTRL.3: mention conn reuse is preferred
Ref: https://github.com/curl/curl/discussions/7954

Closes #7957
2021-11-04 13:53:13 +01:00
Daniel Stenberg 92efb3db7e
docs: reduce use of "very"
"Very" should be avoided in most texts. If intensifiers are needed, try
find better words instead.

Closes #7936
2021-11-01 16:13:12 +01:00
Daniel Stenberg 407392b424
CURLOPT_[PROXY]_SSL_CIPHER_LIST.3: bold instead of quote
Bold the example ciphers instead of using single quotes, which then also
avoids the problem of how to use single quotes when first in a line.

Also rephrased the pages a little.

Reported-by: Sergio Durigan Junior
Ref: #7928
Closes #7934
2021-11-01 15:41:10 +01:00
Jonathan Cardoso Machado dd77ccd87c
CURLOPT_HSTSWRITEFUNCTION.3: using CURLOPT_HSTS_CTRL is required
Closes #7923
2021-10-29 17:27:43 +02:00
Daniel Stenberg 3c05186dc6
opt-manpages: use 'Added in' instead of 'Since'
Closes #7913
2021-10-27 13:56:13 +02:00
Kerem Kat c40914dbdb
docs: fix typo in CURLOPT_TRAILERFUNCTION example
Closes #7910
2021-10-26 23:22:56 +02:00
Daniel Stenberg 16a6b02df2
docs: consistent use of "Added in"
Make them all say "Added in [version]" without using 'curl' or 'libcurl'
in that phrase.
2021-10-25 12:57:11 +02:00
Daniel Stenberg 24155569d8
man pages: require all to use the same section header order
This is the same order we already enforce among the options' man pages:
consistency is good. Add lots of previously missing examples.

Adjust the manpage-syntax script for this purpose, used in test 1173.

Closes #7904
2021-10-25 12:57:01 +02:00
Daniel Stenberg 412570d7c4
docs: provide "RETURN VALUE" section for more func manpages
Three were missing, one used a non-standard name for the header.

Closes #7902
2021-10-25 10:19:38 +02:00
Jay Satiro aa429d49b3 curl_multi_socket_action.3: add a "RETURN VALUE" section
.. because it may not be immediately clear to the user what
curl_multi_socket_action returns.

Ref: https://curl.se/mail/lib-2021-10/0035.html

Closes https://github.com/curl/curl/pull/7901
2021-10-25 03:25:40 -04:00
Daniel Stenberg 1732502cb0
hyper: does not support disabling CURLOPT_HTTP_TRANSFER_DECODING
Simply because hyper doesn't have this ability. Mentioned in docs now.

Skip test 326 then

Closes #7889
2021-10-22 12:54:08 +02:00
Daniel Stenberg 2c8a81407f
manpage: adjust the asterisk in some SYNOPSIS sections
Closes #7884
2021-10-20 23:21:53 +02:00
Daniel Stenberg 47c4f7b255
curl_multi_perform.3: polish wording
- simplify the example by using curl_multi_poll

 - mention curl_multi_add_handle in the text

 - cut out the description of pre-7.20.0 return code behavior - that version
   is now more than eleven years old and is basically no longer out there

 - adjust the "typical usage" to mention curl_multi_poll

Closes #7883
2021-10-20 12:36:17 +02:00
Daniel Stenberg 9fa1ce4e13
curl_easy_perform.3: minor wording tweak 2021-10-20 08:41:06 +02:00
Daniel Stenberg 9a8564a920
urlapi: URL decode percent-encoded host names
The host name is stored decoded and can be encoded when used to extract
the full URL. By default when extracting the URL, the host name will not
be URL encoded to work as similar as possible as before. When not URL
encoding the host name, the '%' character will however still be encoded.

Getting the URL with the CURLU_URLENCODE flag set will percent encode
the host name part.

As a bonus, setting the host name part with curl_url_set() no longer
accepts a name that contains space, CR or LF.

Test 1560 has been extended to verify percent encodings.

Reported-by: Noam Moshe
Reported-by: Sharon Brizinov
Reported-by: Raul Onitza-Klugman
Reported-by: Kirill Efimov
Fixes #7830
Closes #7834
2021-10-11 17:04:14 +02:00
Daniel Stenberg 33882a066e
CURLOPT_HTTPHEADER.3: add descripion for specific headers
Settting Host: or Transfer-Encoding: chunked actually have special
meanings to libcurl. This change tries to document them

Closes #7829
2021-10-08 15:15:30 +02:00
Jeffrey Tolar 5f563495f1
CURLOPT_MAXLIFETIME_CONN: maximum allowed lifetime for conn reuse
... and close connections that are too old instead of reusing them.

By default, this behavior is disabled.

Bug: https://curl.se/mail/lib-2021-09/0058.html
Closes #7751
2021-10-06 14:38:59 +02:00
Max Dymond a517378de5
CURLOPT_PREREQFUNCTION: add new callback
Triggered before a request is made but after a connection is set up

Changes:

- callback: Update docs and callback for pre-request callback
- Add documentation for CURLOPT_PREREQDATA and CURLOPT_PREREQFUNCTION,
- Add redirect test and callback failure test
- Note that the function may be called multiple times on a redirection
- Disable new 2086 test due to Windows weirdness

Closes #7477
2021-09-27 17:16:43 +02:00
i-ky 3363eeb262
urlapi: add curl_url_strerror()
Add curl_url_strerror() to convert CURLUcode into readable string and
facilitate easier troubleshooting in programs using URL API.
Extend CURLUcode with CURLU_LAST for iteration in unit tests.
Update man pages with a mention of new function.
Update example code and tests with new functionality where it fits.

Closes #7605
2021-09-27 08:28:46 +02:00
Mats Lindestam d1e7d9197b
libssh2: add SHA256 fingerprint support
Added support for SHA256 fingerprint in command line curl and in
libcurl.

Closes #7646
2021-09-26 23:20:53 +02:00
a1346054 7cf5e8e70e
misc: fix typos in docs and comments
No user facing output from curl/libcurl is changed by this, just
comments.

Closes #7747
2021-09-23 12:57:55 +02:00
Daniel Stenberg da2598f823
hsts: CURLSTS_FAIL from hsts read callback should fail transfer
... and have CURLE_ABORTED_BY_CALLBACK returned.

Extended test 1915 to verify.

Reported-by: Jonathan Cardoso
Fixes #7726
Closes #7729
2021-09-16 12:36:12 +02:00
Daniel Stenberg 1fbd822b64
opts docs: unify phrasing in NAME header
- avoid writing "set ..." or "enable/disable ..." or "specify ..."
  *All* options for curl_easy_setopt() are about setting or enabling
  things and most of the existing options didn't use that way of
  description.

- start with lowercase letter, unless abbreviation. For consistency.

- Some additional touch-ups

Closes #7688
2021-09-09 09:55:24 +02:00
Daniel Stenberg 3c40840ca7
docs: remove experimental mentions from HSTS and MQTT
Reported-by: Jonathan Cardoso
Bug: https://github.com/curl/curl/pull/6700#issuecomment-913792863
Closes #7681
2021-09-07 08:21:40 +02:00
Daniel Stenberg 7d1bd8a301
CURLOPT_UNIX_SOCKET_PATH.3: remove nginx reference, add see also
Closes #7656
2021-09-04 11:27:51 +02:00
Daniel Stenberg 12a2ed970f
opt-docs: verify man page sections + order
In every libcurl option man page there are now 8 mandatory sections that
must use the right name in the correct order and test 1173 verifies
this. Only 14 man pages needed adjustments.

The sections and the order is as follows:

 - NAME
 - SYNOPSIS
 - DESCRIPTION
 - PROTOCOLS
 - EXAMPLE
 - AVAILABILITY
 - RETURN VALUE
 - SEE ALSO

Reviewed-by: Daniel Gustafsson
Closes #7656
2021-09-04 11:27:46 +02:00
Daniel Stenberg 1731a77989
opt-docs: make sure all man pages have examples
Extended manpage-syntax.pl (run by test 1173) to check that every man
page for a libcurl option has an EXAMPLE section that is more than two
lines. Then fixed all errors it found and added examples.

Reviewed-by: Daniel Gustafsson
Closes #7656
2021-09-04 11:27:04 +02:00
Daniel Stenberg 1a042be270
curl_easy_setopt: tweak the string copy wording
Reported-by: Yaobin Wen
Fixes #7632
Closes #7634
2021-08-26 09:18:42 +02:00
Daniel Stenberg 46d4373ea7
setopt: enable CURLOPT_IGNORE_CONTENT_LENGTH for hyper
Since this option is also used for FTP, it needs to work to set for
applications even if hyper doesn't support it for HTTP. Verified by test
1137.

Updated docs to specify that the option doesn't work for HTTP when using
the hyper backend.

Closes #7614
2021-08-23 11:23:17 +02:00
Daniel Stenberg b9183e6e72
libcurl-errors.3: clarify two CURLUcode errors
CURLUE_BAD_HANDLE and CURLUE_BAD_PARTPOINTER should be for "bad" or
wrong pointers in a generic sense, not just for NULL pointers.

Reviewed-by: Jay Satiro

Ref: #7605
Closes #7611
2021-08-23 09:01:34 +02:00
Jay Satiro d5a27064a0 symbols-in-versions: fix CURLSSLBACKEND_QSOSSL last used version
... and also change the 'Removed' column name to 'Last' since that
column is for the last version to contain the symbol.

Closes https://github.com/curl/curl/pull/7609
2021-08-23 02:59:38 -04:00
Jay Satiro 9cb395dcc9 mksymbolsmanpage.pl: Fix showing symbol's last used version
Prior to this change the symbol's deprecated version was erroneously
shown as its last used version.

Bug: https://github.com/curl/curl/commit/4e53b94#commitcomment-55239509
Reported-by: i-ky@users.noreply.github.com
2021-08-22 01:12:26 -04:00
Daniel Stenberg 342f92763e
mksymbolsmanpage.pl: match symbols case insenitively
Follow-up to 4e53b9430c which made this bug show.

Reported-by: i-ky
Bug: 4e53b9430c (commitcomment-55239253)
Closes #7607
2021-08-21 23:40:11 +02:00
Daniel Stenberg 4e53b9430c
man pages: remove trailing whitespaces
Extended test 1173 (via the manpage-syntax.pl script) to detect and warn
for them.

Ref: #7602
Reported-by: a1346054 on github
Closes #7604
2021-08-21 16:44:03 +02:00
Sergey Markelov 1828f6ae2e
sectransp: support CURLINFO_CERTINFO
Fixes #4130
Closes #7372
2021-08-17 08:40:44 +02:00
Emil Engler 116856b9d5
curl_url_get.3: clarify about path and query
The current man-page lacks some details regarding the obtained path and
query.

Closes #7563
2021-08-13 17:38:23 +02:00
Aleksandr Krotov beb1b1cb03
bearssl: support CURLOPT_CAINFO_BLOB
Closes #7468
2021-07-28 23:04:53 +02:00
Daniel Stenberg 21e090369e
CURLOPT_DOH_URL.3: CURLOPT_OPENSOCKETFUNCTION is not inherited
Reported-by: Daniel Woelfel
Fixes #7441
Closes #7509
2021-07-28 17:34:22 +02:00
Josh Soref 4d145346ae docs: fix grammar
Fixes https://github.com/curl/curl/issues/7444
Fixes https://github.com/curl/curl/issues/7451
Fixes https://github.com/curl/curl/issues/7465
Closes https://github.com/curl/curl/pull/7495
2021-07-27 13:44:30 -04:00
Daniel Stenberg 76bed59ec3
CURLOPT_SSL_CTX_*.3: tidy up the example
Use the proper code style. Don't store return codes that aren't read.
Copy the same example into CURLOPT_SSL_CTX_FUNCTION.3 as well.

Closes #7500
2021-07-26 22:11:17 +02:00
Jay Satiro 9a6f974881 docs: change max-filesize caveat again
- Add protocols field to max-filesize.d.

- Revert wording on unknown file size caveat and do not discuss specific
  protocols in that section.

Partial revert of ecf0225. All max-filesize options now have the list of
protocols and it's clearer just to have that list without discussing
specific protocols in the caveat.

Reported-by: Josh Soref

Ref: https://github.com/curl/curl/issues/7453#issuecomment-884128762
2021-07-23 02:56:52 -04:00
Oleg Pudeyev 1b8638b36c
CURLMOPT_TIMERFUNCTION.3: remove misplaced "time"
Closes #7470
2021-07-21 23:41:34 +02:00
Jay Satiro ecf0225461 docs: mention max-filesize options also apply to MQTT transfers
Also make it clearer that the caveat 'if the file size is unknown it
the option will have no effect' may apply to protocols other than FTP
and HTTP.

Reported-by: Josh Soref

Fixes https://github.com/curl/curl/issues/7453
2021-07-21 01:03:06 -04:00
Nyholm 8749ce651f docs: correct spelling errors and a broken link
Update grammar and spelling in docs and source code comments.

Closes: #7427
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2021-07-18 21:14:36 +02:00
Josh Soref de1004eb0f
cleanup: spell DoH with a lowercase o
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

Closes #7413
2021-07-16 23:53:13 +02:00
Daniel Gustafsson 21ef78b556 docs: fix inconsistencies in EGDSOCKET documentation
Only the OpenSSL backend actually use the EGDSOCKET, and also use
TLS consistently rather than mixing SSL and TLS. While there, also
fix a minor spelling nit.

Closes: #7391
Reviewed-by: Jay Satiro <raysatiro@yahoo.com>
2021-07-14 23:47:37 +02:00