summaryrefslogtreecommitdiff
path: root/src/tool_getparam.c
Commit message (Collapse)AuthorAgeFilesLines
* code style: use spaces around plusesDaniel Stenberg2017-09-111-5/+5
|
* code style: use spaces around equals signsDaniel Stenberg2017-09-111-4/+4
|
* mime: use in curl cli tool instead of form API.Patrick Monnerat2017-09-021-3/+3
| | | | | | Extended -F option syntax to support multipart mail messages. -F keyword headers= added to include custom headers in parts. Documentation upgraded.
* ssh: add the ability to enable compression (for SCP/SFTP)Viktor Szakats2017-08-171-0/+4
| | | | | | | | | | | | | | | | | | 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
* strtoofft: reduce integer overflow risks globallyDaniel Stenberg2017-08-141-2/+9
| | | | | | | ... make sure we bail out on overflows. Reported-by: Brian Carpenter Closes #1758
* curl: detect and bail out early on parameter integer overflowsDaniel Stenberg2017-08-071-3/+4
| | | | | | | | | Make the number parser aware of the maximum limit curl accepts for a value and return an error immediately if larger, instead of running an integer overflow later. Fixes #1730 Closes #1736
* getparameter: avoid returning uninitialized 'usedarg'Daniel Stenberg2017-08-051-1/+1
| | | | Fixes #1728
* tool_getparam: fix potentially uninitialized errJay Satiro2017-07-091-1/+2
|
* curl --socks5-{basic,gssapi}: control socks5 authKamil Dudka2017-06-281-0/+18
| | | | Closes https://github.com/curl/curl/pull/1454
* tool_getparam: fix memory leak on test 1147 OOM (torture tests)Jay Satiro2017-06-261-1/+3
| | | | | Bug: https://github.com/curl/curl/pull/1486#issuecomment-310926872 Reported-by: Dan Fandrich
* --request-target: instead of --strip-path-slashDaniel Stenberg2017-06-211-3/+3
| | | | | | | | | | | | | | ... and CURLOPT_REQUEST_TARGET instead of CURLOPT_STRIP_PATH_SLASH. This option instead provides the full "alternative" target to use in the request, instead of extracting the path from the URL. Test 1298 and 1299 updated accordingly. Idea-by: Evert Pot Suggestion: https://daniel.haxx.se/blog/2017/06/19/options-with-curl/comment-page-1/#comment-18373 Closes #1593
* http: add --strip-path-slash and CURLOPT_STRIP_PATH_SLASHDaniel Stenberg2017-06-191-1/+6
| | | | | | | | | | | ... to enable sending "OPTIONS *" which wasn't possible previously. This option currently only works for HTTP. Added test cases 1298 + 1299 to verify Fixes #1280 Closes #1462
* curl: prevent binary output spewed to terminalDaniel Stenberg2017-06-161-1/+1
| | | | | | | | | ... unless "--output -" is used. Binary detection is done by simply checking for a binary zero in early data. Added test 1425 1426 to verify. Closes #1512
* curl: allow --header and --proxy-header read from fileDaniel Stenberg2017-06-151-6/+36
| | | | | | | | So many headers can be provided as @filename. Suggested-by: Timothe Litt Closes #1486
* tool: fix remaining -Wcast-qual warningsMarcel Raad2017-05-091-5/+5
| | | | Avoid casting away low-level const.
* curl: remove tool_writeenv.[ch]Daniel Stenberg2017-05-061-8/+0
| | | | | | | | | ... and USE_ENVIRONMENT and --environment. It was once added for RISC OS support and its platform specific behavior has been annoying ever since. Added in commit c3c8bbd3b2688da8e, mostly unchanged since then. Most probably not actually used for years. Closes #1463
* curl: fix warning "comma at end of enumerator list"Daniel Stenberg2017-05-041-1/+1
|
* curl: non-boolean command line args reject --no- prefixesDaniel Stenberg2017-05-021-219/+225
| | | | | | | | ... and instead properly respond with an error message to the user instead of silently ignoring. Fixes #1453 Closes #1458
* tool: Fix missing prototype warnings for CURL_DOES_CONVERSIONSJay Satiro2017-05-011-0/+1
| | | | | | | - Include tool_convert.h where needed. Bug: https://github.com/curl/curl/issues/1460 Reported-by: Gisle Vanem
* Improve code readbilitySylvestre Ledru2017-03-131-25/+22
| | | | | | ... by removing the else branch after a return, break or continue. Closes #1310
* url: add option CURLOPT_SUPPRESS_CONNECT_HEADERSDesmond O. Chang2017-03-121-0/+4
| | | | | | | | | | | | | | - Add new option CURLOPT_SUPPRESS_CONNECT_HEADERS to allow suppressing proxy CONNECT response headers from the user callback functions CURLOPT_HEADERFUNCTION and CURLOPT_WRITEFUNCTION. - Add new tool option --suppress-connect-headers to expose CURLOPT_SUPPRESS_CONNECT_HEADERS and allow suppressing proxy CONNECT response headers from --dump-header and --include. Assisted-by: Jay Satiro Assisted-by: CarloCannas@users.noreply.github.com Closes https://github.com/curl/curl/pull/783
* vtls: add options to specify range of enabled TLS versionsJozef Kralik2017-03-081-0/+6
| | | | | | | This commit introduces the CURL_SSLVERSION_MAX_* constants as well as the --tls-max option of the curl tool. Closes https://github.com/curl/curl/pull/1166
* curl: fix typo in time condition warning messageNick Draffen2017-02-141-1/+1
| | | | | | | The warning message had a typo. The argument long form is --time-cond not --timecond Closes #1263
* unix_socket: add support for abstract unix domain socketIsaac Boukris2017-01-131-0/+6
| | | | | | | | | | | | | | | | | | | | | In addition to unix domain sockets, Linux also supports an abstract namespace which is independent of the filesystem. In order to support it, add new CURLOPT_ABSTRACT_UNIX_SOCKET option which uses the same storage as CURLOPT_UNIX_SOCKET_PATH internally, along with a flag to specify abstract socket. On non-supporting platforms, the abstract address will be interpreted as an empty string and fail gracefully. Also add new --abstract-unix-socket tool parameter. Signed-off-by: Isaac Boukris <iboukris@gmail.com> Reported-by: Chungtsun Li (typeless) Reviewed-by: Daniel Stenberg Reviewed-by: Peter Wu Closes #1197 Fixes #1061
* tool_getparam.c: make comments use the up-to-date option namesDaniel Stenberg2016-12-171-2/+2
|
* preproxy: renamed what was added as SOCKS_PROXYDaniel Stenberg2016-12-161-3/+11
| | | | | | | CURLOPT_SOCKS_PROXY -> CURLOPT_PRE_PROXY Added the corresponding --preroxy command line option. Sets a SOCKS proxy to connect to _before_ connecting to a HTTP(S) proxy.
* curl: normal socks proxies still use CURLOPT_PROXYDaniel Stenberg2016-12-161-8/+8
| | | | | | | ... the newly introduced CURLOPT_SOCKS_PROXY is special and should be asked for specially. (Needs new code.) Unified proxy type to a single variable in the config struct.
* checksrc: warn for assignments within if() expressionsDaniel Stenberg2016-12-141-3/+11
| | | | | ... they're already frowned upon in our source code style guide, this now enforces the rule harder.
* checksrc: stricter no-space-before-paren enforcementDaniel Stenberg2016-12-131-1/+1
| | | | In order to make the code style more uniform everywhere
* curl: remove --proxy-ssl* optionsDaniel Stenberg2016-11-281-12/+0
| | | | | There's mostly likely no need to allow setting SSLv2/3 version for HTTPS proxy. Those protocols are insecure by design and deprecated.
* proxy: Support HTTPS proxy and SOCKS+HTTP(s)Alex Rousskov2016-11-241-10/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * HTTPS proxies: An HTTPS proxy receives all transactions over an SSL/TLS connection. Once a secure connection with the proxy is established, the user agent uses the proxy as usual, including sending CONNECT requests to instruct the proxy to establish a [usually secure] TCP tunnel with an origin server. HTTPS proxies protect nearly all aspects of user-proxy communications as opposed to HTTP proxies that receive all requests (including CONNECT requests) in vulnerable clear text. With HTTPS proxies, it is possible to have two concurrent _nested_ SSL/TLS sessions: the "outer" one between the user agent and the proxy and the "inner" one between the user agent and the origin server (through the proxy). This change adds supports for such nested sessions as well. A secure connection with a proxy requires its own set of the usual SSL options (their actual descriptions differ and need polishing, see TODO): --proxy-cacert FILE CA certificate to verify peer against --proxy-capath DIR CA directory to verify peer against --proxy-cert CERT[:PASSWD] Client certificate file and password --proxy-cert-type TYPE Certificate file type (DER/PEM/ENG) --proxy-ciphers LIST SSL ciphers to use --proxy-crlfile FILE Get a CRL list in PEM format from the file --proxy-insecure Allow connections to proxies with bad certs --proxy-key KEY Private key file name --proxy-key-type TYPE Private key file type (DER/PEM/ENG) --proxy-pass PASS Pass phrase for the private key --proxy-ssl-allow-beast Allow security flaw to improve interop --proxy-sslv2 Use SSLv2 --proxy-sslv3 Use SSLv3 --proxy-tlsv1 Use TLSv1 --proxy-tlsuser USER TLS username --proxy-tlspassword STRING TLS password --proxy-tlsauthtype STRING TLS authentication type (default SRP) All --proxy-foo options are independent from their --foo counterparts, except --proxy-crlfile which defaults to --crlfile and --proxy-capath which defaults to --capath. Curl now also supports %{proxy_ssl_verify_result} --write-out variable, similar to the existing %{ssl_verify_result} variable. Supported backends: OpenSSL, GnuTLS, and NSS. * A SOCKS proxy + HTTP/HTTPS proxy combination: If both --socks* and --proxy options are given, Curl first connects to the SOCKS proxy and then connects (through SOCKS) to the HTTP or HTTPS proxy. TODO: Update documentation for the new APIs and --proxy-* options. Look for "Added in 7.XXX" marks.
* curl: add --fail-earlyDaniel Stenberg2016-11-141-2/+9
| | | | | | | Exit with an error on the first transfer error instead of continuing to do the rest of the URLs. Discussion: https://curl.haxx.se/mail/archive-2016-11/0038.html
* curl: Add --retry-connrefusedDaniel Hwang2016-11-111-0/+4
| | | | | | to consider ECONNREFUSED as a transient error. Closes #1064
* curl: introduce the --tlsv1.3 option to force TLS 1.3Kamil Dudka2016-11-071-0/+5
| | | | | | Fully implemented with the NSS backend only for now. Reviewed-by: Ray Satiro
* strcase: make the tool use curl_str[n]equal insteadDaniel Stenberg2016-10-311-4/+4
| | | | | | | | As they are after all part of the public API. Saves space and reduces complexity. Remove the strcase defines from the curlx_ family. Suggested-by: Dan Fandrich Idea: https://curl.haxx.se/mail/lib-2016-10/0136.html
* strcasecompare: all case insensitive string compares ignore locale nowDaniel Stenberg2016-10-311-3/+3
| | | | | We had some confusions on when each function was used. We should not act differently on different locales anyway.
* strcasecompare: is the new name for strequal()Daniel Stenberg2016-10-311-8/+8
| | | | | | | ... to make it less likely that we forget that the function actually does case insentive compares. Also replaced several invokes of the function with a plain strcmp when case sensitivity is not an issue (like comparing with "-").
* curl: allow "pkcs11:" prefix for client certificatesDavid Woodhouse2016-08-171-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RFC7512 provides a standard method to reference certificates in PKCS#11 tokens, by means of a URI starting 'pkcs11:'. We're working on fixing various applications so that whenever they would have been able to use certificates from a file, users can simply insert a PKCS#11 URI instead and expect it to work. This expectation is now a part of the Fedora packaging guidelines, for example. This doesn't work with cURL because of the way that the colon is used to separate the certificate argument from the passphrase. So instead of curl -E 'pkcs11:manufacturer=piv_II;id=%01' … I instead need to invoke cURL with the colon escaped, like this: curl -E 'pkcs11\:manufacturer=piv_II;id=%01' … This is suboptimal because we want *consistency* — the URI should be usable in place of a filename anywhere, without having strange differences for different applications. This patch therefore disables the processing in parse_cert_parameter() when the string starts with 'pkcs11:'. It means you can't pass a passphrase with an unescaped PKCS#11 URI, but there's no need to do so because RFC7512 allows a PIN to be given as a 'pin-value' attribute in the URI itself. Also, if users are already using RFC7512 URIs with the colon escaped as in the above example — even providing a passphrase for cURL to handling instead of using a pin-value attribute, that will continue to work because their string will start 'pkcs11\:' and won't match the check. What *does* break with this patch is the extremely unlikely case that a user has a file which is in the local directory and literally named just "pkcs11", and they have a passphrase on it. If that ever happened, the user would need to refer to it as './pkcs11:<passphrase>' instead.
* curl: remove "--socks" as "--socks5" turned 8Daniel Stenberg2016-04-291-3/+0
| | | | | | In commit 2e42b0a2524 (Jan 2008) we made the option "--socks" deprecated and it has not been documented since. The more explicit socks options (like --socks4 or --socks5) should be used.
* curl: remove --http-requestDaniel Stenberg2016-04-291-2/+0
| | | | | It was mentioned as deprecated already in commit ae1912cb0d4 from 1999. It has not been documented in this millennium.
* curl: use --telnet-option as documentedDaniel Stenberg2016-04-291-2/+1
| | | | | | The code said "telnet-options" but no documentation ever said so. It worked fine since the code is fine with a unique match of the first part.
* getparam: remove support for --ftpportDaniel Stenberg2016-04-291-2/+0
| | | | | It has been deprecated and undocumented since commit ad5ead8bed7 (Dec 2003). --ftp-port is the proper long option name.
* aliases: remove trailing space from capath stringDaniel Stenberg2016-04-291-1/+1
|
* cmdline parse: only single letter options have single-letter stringsDaniel Stenberg2016-04-291-9/+8
| | | | | ... moved around options so that parsing the code to find all single-letter options easier.
* tool: add --tcp-fastopen optionAlessandro Ghedini2016-04-181-0/+5
|
* news: CURLOPT_CONNECT_TO and --connect-toMichael Kaufmann2016-04-171-0/+6
| | | | | Makes curl connect to the given host+port instead of the host+port found in the URL.
* CURLOPT_SOCKS5_GSSAPI_SERVICE: Merged with CURLOPT_PROXY_SERVICE_NAMESteve Holme2016-04-091-5/+4
| | | | | | | | | As these two options provide identical functionality, the former for SOCK5 proxies and the latter for HTTP proxies, merged the two options together. As such CURLOPT_SOCKS5_GSSAPI_SERVICE is marked as deprecated as of 7.49.0.
* code: style updatesDaniel Stenberg2016-04-031-3/+3
|
* http2: support "prior knowledge", no upgrade from HTTP/1.1Diego Bes2016-03-311-0/+5
| | | | | | | | | | | | | Supports HTTP/2 over clear TCP - Optimize switching to HTTP/2 by removing calls to init and setup before switching. Switching will eventually call setup and setup calls init. - Supports new version to “force” the use of HTTP/2 over clean TCP - Add common line parameter “--http2-prior-knowledge” to the Curl command line tool.
* TFTP: add option to suppress TFTP option requests (Part 2)Jay Satiro2016-02-231-0/+4
| | | | | | | | | | - Add tests. - Add an example to CURLOPT_TFTP_NO_OPTIONS.3. - Add --tftp-no-options to expose CURLOPT_TFTP_NO_OPTIONS. Bug: https://github.com/curl/curl/issues/481