Commit Graph

1418 Commits

Author SHA1 Message Date
Patrick Monnerat 11bf1796cd HTTP: implement Brotli content encoding
This uses the brotli external library (https://github.com/google/brotli).
Brotli becomes a feature: additional curl_version_info() bit and
structure fields are provided for it and CURLVERSION_NOW bumped.

Tests 314 and 315 check Brotli content unencoding with correct and
erroneous data.

Some tests are updated to accomodate with the now configuration dependent
parameters of the Accept-Encoding header.
2017-11-05 15:28:16 +01:00
Florin f20cbac970
auth: Added test cases for RFC7616
Updated docs to include support for RFC7616

Signed-off-by: Florin <petriuc.florin@gmail.com>

Closes #1934
2017-10-28 16:33:09 +02:00
Alessandro Ghedini 7408570bf0 libcurl-tutorial.3: fix typo
closes #2008
2017-10-24 13:27:41 +02:00
Alessandro Ghedini f6535791fa curl_mime_filedata.3: fix typos 2017-10-23 23:23:23 +01:00
Daniel Stenberg 172ce9cc19
setopt: avoid integer overflows when setting millsecond values
... that are multiplied by 1000 when stored.

For 32 bit long systems, the max value accepted (2147483 seconds) is >
596 hours which is unlikely to ever be set by a legitimate application -
and previously it didn't work either, it just caused undefined behavior.

Also updated the man pages for these timeout options to mention the
return code.

Closes #1938
2017-10-16 09:23:19 +02:00
Daniel Stenberg f8e593887e
CURLOPT_XFERINFODATA.3: fix duplicate see also 2017-10-09 16:24:36 +02:00
Daniel Stenberg d895a83a3b
CURLOPT_NOPROGRESS.3: also refer to xferinfofunction 2017-10-09 16:24:19 +02:00
Patrick Monnerat 14d6e207d3 docs: clarify form/mime usage of non-regular data files. 2017-10-08 16:15:23 +01:00
Felix Kaiser 2592241d63
docs: fix typo in curl_mime_data_cb man page
Closes #1946
2017-10-04 23:56:22 +02:00
Patrick Monnerat ff6774ea6a libcurl-tutorial: add casts in example to avoid compilation warnings. 2017-10-03 11:03:46 +01:00
Patrick Monnerat 753a5da906 libcurl-tutorial: fix two typos. 2017-10-02 00:12:55 +01:00
Patrick Monnerat 525251398f libcurl-tutorial: describe MIME API and deprecate form API.
Include a guide to form/mime API conversion.
2017-10-01 18:31:52 +01:00
Michael Kaufmann c66d94d6da docs: link CURLOPT_CONNECTTIMEOUT and CURLOPT_CONNECTTIMEOUT_MS
Closes #1922
2017-09-28 21:32:20 +02:00
Michael Kaufmann 46d63bbbe8 docs: clarify the use of environment variables for proxy
Closes #1921
2017-09-28 21:29:39 +02:00
Jay Satiro 3a1c7cb3ca symbols-in-versions: fix CURLSSLSET_NO_BACKENDS entry
- Use spaces instead of tabs as the delimiter.

Follow up to 7c52b12 which added the entry. The entry had used tabs but
the symbol-scan parser doesn't recognize tabs and would fail the symbol.
2017-09-23 03:19:47 -04:00
Daniel Stenberg 7c52b12dd4
symbols-in-versions: add CURLSSLSET_NO_BACKENDS
...fixup from b8e0fe19ec
2017-09-22 16:22:57 +02:00
Daniel Stenberg b8e0fe19ec
vtls: provide curl_global_sslset() even in non-SSL builds
... it just returns error:

Bug: 1328f69d53 (commitcomment-24470367)
Reported-by: Marcel Raad

Closes #1906
2017-09-22 12:09:13 +02:00
Patrick Monnerat ee56fdb691 form/mime: field names are not allowed to contain zero-valued bytes.
Also suppress length argument of curl_mime_name() (names are always
zero-terminated).
2017-09-22 01:08:29 +01:00
Daniel Stenberg 50b208e23e
docs: clarify the CURLOPT_INTERLEAVE* options behavior 2017-09-15 15:47:56 +02:00
Jay Satiro 64bb7ae6ae mbedtls: enable CA path processing
CA path processing was implemented when mbedtls.c was added to libcurl
in fe7590f, but it was never enabled.

Bug: https://github.com/curl/curl/issues/1877
Reported-by: SBKarr@users.noreply.github.com
2017-09-10 03:22:05 -04:00
Patrick Monnerat 63ef436ea1 mime: implement encoders.
curl_mime_encoder() is operational and documented.
curl tool -F option is extended with ";encoder=".
curl tool --libcurl option generates calls to curl_mime_encoder().
New encoder tests 648 & 649.
Test 1404 extended with an encoder specification.
2017-09-05 17:55:51 +01:00
Daniel Stenberg 8b902ef0af docs/curl_mime_*.3: use correct variable types in examples 2017-09-05 17:33:16 +01:00
Viktor Szakats 25fc694a41 examples/mime: minor example code fixes 2017-09-05 10:05:27 +00:00
Daniel Stenberg eae21db920
docs/curl_mime_*.3: added examples 2017-09-05 11:15:02 +02:00
Viktor Szakats 841a09ea19 mime: use CURL_ZERO_TERMINATED in examples
and some minor whitespace fixes
2017-09-04 13:58:10 +00:00
Daniel Stenberg 2e4074c953
docs: curl_mime_*.3 man page formatting edits 2017-09-04 09:20:24 +02:00
Patrick Monnerat efd9301426 mime: use size_t instead of ssize_t in public API interface.
To support telling a string is nul-terminated, symbol CURL_ZERO_TERMINATED
has been introduced.

Documentation updated accordingly.

symbols in versions updated. Added form API symbols deprecation info.
2017-09-03 16:10:55 +01:00
Patrick Monnerat 1a3f4c1991 mime: remove support "-" stdin pseudo-file name in curl_mime_filedata().
This feature is badly supported in Windows: as a replacement, a caller has
to use curl_mime_data_cb() with fread, fseek and possibly fclose
callbacks to process opened files.

The cli tool and documentation are updated accordingly.

The feature is however kept internally for form API compatibility, with
the known caveats it always had.

As a side effect, stdin size is not determined by the cli tool even if
possible and this results in a chunked transfer encoding. Test 173 is
updated accordingly.
2017-09-03 14:45:43 +01:00
Patrick Monnerat ce0881edee mime: new MIME API.
Available in HTTP, SMTP and IMAP.
Deprecates the FORM API.
See CURLOPT_MIMEPOST.
Lib code and associated documentation.
2017-09-02 17:47:10 +01:00
Daniel Stenberg c290b8fb23
curl_global_sslset: select backend by name case insensitively
Closes #1849
2017-09-01 11:51:32 +02:00
Daniel Stenberg f7512d7bec
curl_global_sslset.3: show the struct and enum too
... so that users can actually write code based on the man page alone,
not having to read the header file.
2017-08-31 10:13:49 +02:00
Daniel Stenberg 860443bee4
curl_global_sslset.3: clarify
it is a one time *set*, not necessarily a one time use... it can be
called again if the first call failed or just listed the alternatives.

clarify that the available backends are the ones this build supports

plus add some formatting

Reported-by: Rich Gray
Bug: https://curl.haxx.se/mail/lib-2017-08/0119.html
2017-08-30 09:57:05 +02:00
Daniel Stenberg edcb1ef60f
curl_global_init.3: mention curl_global_sslset(3) 2017-08-28 23:58:42 +02:00
Johannes Schindelin 9d96a5f0b5
version: add the CURL_VERSION_MULTI_SSL feature flag
This new feature flag reports When cURL was built with multiple SSL
backends.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-08-28 22:56:49 +02:00
Johannes Schindelin 0fb4125554
Add a man page for curl_global_sslset()
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-08-28 14:56:59 +02:00
Johannes Schindelin 1328f69d53
vtls: introduce curl_global_sslset()
Let's add a compile time safe API to select an SSL backend. This
function needs to be called *before* curl_global_init(), and can be
called only once.

Side note: we do not explicitly test that it is called before
curl_global_init(), but we do verify that it is not called multiple times
(even implicitly).

If SSL is used before the function was called, it will use whatever the
CURL_SSL_BACKEND environment variable says (or default to the first
available SSL backend), and if a subsequent call to
curl_global_sslset() disagrees with the previous choice, it will fail
with CURLSSLSET_TOO_LATE.

The function also accepts an "avail" parameter to point to a (read-only)
NULL-terminated list of available backends. This comes in real handy if
an application wants to let the user choose between whatever SSL backends
the currently available libcurl has to offer: simply call

	curl_global_sslset(-1, NULL, &avail);

which will return CURLSSLSET_UNKNOWN_BACKEND and populate the avail
variable to point to the relevant information to present to the user.

Just like with the HTTP/2 push functions, we have to add the function
declaration of curl_global_sslset() function to the header file
*multi.h* because VMS and OS/400 require a stable order of functions
declared in include/curl/*.h (where the header files are sorted
alphabetically). This looks a bit funny, but it cannot be helped.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-08-28 14:56:59 +02:00
Daniel Stenberg 4a7673c8ca
CURLOPT_USERPWD.3: see also CURLOPT_PROXYUSERPWD 2017-08-24 10:09:28 +02:00
Daniel Stenberg 582f2a1308
CURLOPT_SSH_COMPRESSION.3: enable with 1L
(leaves other values reserved for the future)
2017-08-17 09:54:07 +02:00
Viktor Szakats b7b4dc0d49 ssh: add the ability to enable compression (for SCP/SFTP)
The required low-level logic was already available as part of
`libssh2` (via `LIBSSH2_FLAG_COMPRESS` `libssh2_session_flag()`[1]
option.)

This patch adds the new `libcurl` option `CURLOPT_SSH_COMPRESSION`
(boolean) and the new `curl` command-line option `--compressed-ssh`
to request this `libssh2` feature. To have compression enabled, it
is required that the SSH server supports a (zlib) compatible
compression method and that `libssh2` was built with `zlib` support
enabled.

[1] https://www.libssh2.org/libssh2_session_flag.html

Ref: https://github.com/curl/curl/issues/1732
Closes https://github.com/curl/curl/pull/1735
2017-08-17 03:32:00 -04:00
Alessandro Ghedini a6fdf11771
docs: fix typo funtion -> function
Closes #1770
2017-08-12 14:56:37 +02:00
Alessandro Ghedini 34f24fef4a docs: fix grammar in CURL_SSLVERSION_MAX_DEFAULT description 2017-08-12 13:36:39 +01:00
Alessandro Ghedini 274f9cac96 docs: fix typo stuct -> struct 2017-08-12 13:33:10 +01:00
Daniel Stenberg a7bbbb7c36
make install: add 8 missing man pages to the installation 2017-08-09 11:31:10 +02:00
Viktor Szakats 13ef623a81
docs/comments: Update to secure URL versions
Closes #1741
2017-08-08 21:41:07 +02:00
Daniel Stenberg 70934885d0 CURLOPT_NETRC.3: fix typo in 7e48aa3861
Reported-by: Viktor Szakats
2017-08-02 15:29:27 +02:00
Daniel Stenberg 7e48aa3861 CURLOPT_NETRC.3: mention the file name on windows
... and CURLOPT_NETRC_FILE(3).
2017-08-02 14:34:26 +02:00
Daniel Stenberg bbc9c6d144 CURLOPT_POSTFIELDS.3: explain the 100-continue magic better 2017-07-07 12:43:17 +02:00
Daniel Stenberg a126ca8481 curl_easy_escape.3: mention the (lack of) encoding
Fixes #1612
Reported-by: Jeroen Ooms
2017-07-07 10:47:46 +02:00
Daniel Stenberg ef2a9f22cc curl_strequal.3: fix typo in SYNOPSIS
Reported-by: Jesse Chisholm

Fixes #1623
2017-06-29 01:16:56 +02:00
Kamil Dudka 8924f58c37 CURLOPT_SOCKS5_AUTH: allowed methods for SOCKS5 proxy auth
If libcurl was built with GSS-API support, it unconditionally advertised
GSS-API authentication while connecting to a SOCKS5 proxy.  This caused
problems in environments with improperly configured Kerberos: a stock
libcurl failed to connect, despite libcurl built without GSS-API
connected fine using username and password.

This commit introduces the CURLOPT_SOCKS5_AUTH option to control the
allowed methods for SOCKS5 authentication at run time.

Note that a new option was preferred over reusing CURLOPT_PROXYAUTH
for compatibility reasons because the set of authentication methods
allowed by default was different for HTTP and SOCKS5 proxies.

Bug: https://curl.haxx.se/mail/lib-2017-01/0005.html
Closes https://github.com/curl/curl/pull/1454
2017-06-28 08:02:58 +02:00