Compare commits

..

22 Commits

Author SHA1 Message Date
Patrick Monnerat
ed24d41cb1 gskit: protect inetsocketpair() against foreign connection.
Avoid blocking read.
Drain SSL over SSL output upon close.
2015-12-23 15:43:25 +01:00
Patrick Monnerat
cc9b053d84 gskit: Implement SSL over SSL
This is done via a TCP socket pair monitored at each negotiate/send/receive
attempt for explicit pipelining.
See gskit.c comments for more information.
2015-12-22 15:58:28 +01:00
Kamil Dudka
3e7a1ff9a6 nss: fix crash when closing HTTPS conn over HTTPS proxy
Truncated valgrind output capturing the crash follows:

Invalid read of size 8
   at 0x628B4A0: PR_Close (priometh.c:104)
   by 0x43C088: nss_close (nss.c:1356)
   by 0x43C17F: Curl_nss_close (nss.c:1377)
   by 0x438F42: Curl_ssl_close (vtls.c:618)
   by 0x45460B: Curl_disconnect (url.c:3000)
   by 0x42EACA: close_all_connections (multi.c:1887)
   by 0x42EB37: curl_multi_cleanup (multi.c:1907)
   by 0x44B4CA: Curl_close (url.c:427)
   by 0x4282C2: curl_easy_cleanup (easy.c:859)
   by 0x41341C: main_free (tool_main.c:206)
   by 0x4134F4: main (tool_main.c:260)
 Address 0x99afa10 is 0 bytes inside a block of size 48 free'd
   at 0x4C29D6A: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x62A2C33: pt_Close (ptio.c:1277)
   by 0x43BACD: nspr_io_close (nss.c:1141)
   by 0x54D6E25: ssl_DefClose (ssldef.c:203)
   by 0x43BACD: nspr_io_close (nss.c:1141)
   by 0x54D6E25: ssl_DefClose (ssldef.c:203)
   by 0x43C088: nss_close (nss.c:1356)
   by 0x43C173: Curl_nss_close (nss.c:1376)
   by 0x438F42: Curl_ssl_close (vtls.c:618)
   by 0x45460B: Curl_disconnect (url.c:3000)
   by 0x42EACA: close_all_connections (multi.c:1887)
   by 0x42EB37: curl_multi_cleanup (multi.c:1907)
 Block was alloc'd at
   at 0x4C28C50: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x6289F71: _PR_Getfd (prfdcach.c:103)
   by 0x62A4816: pt_SetMethods.isra.13 (ptio.c:3303)
   by 0x62A56E5: PR_ImportTCPSocket (ptio.c:4577)
   by 0x43D4D0: nss_setup_connect (nss.c:1733)
   by 0x43DDCA: nss_connect_common (nss.c:1929)
   by 0x43DF1E: Curl_nss_connect_nonblocking (nss.c:1985)
   by 0x4386CE: Curl_ssl_connect_nonblocking (vtls.c:364)
   by 0x47F02C: https_proxy_connect (http_proxy.c:58)
   by 0x47F086: Curl_proxy_connect (http_proxy.c:74)
   by 0x445891: Curl_http_connect (http.c:1348)
   by 0x42D613: multi_runsingle (multi.c:1233)
2015-12-16 00:32:13 +01:00
Patrick Monnerat
e21bd4ecb5 os400: add new https proxy options 2015-12-15 14:56:54 +01:00
Patrick Monnerat
4bb13975a8 gskit: adapt to new ssl proxy parameters 2015-12-15 14:30:25 +01:00
Daniel Stenberg
4e28002898 Merge branch 'master' into HTTPS-proxy 2015-11-19 23:29:04 +01:00
Daniel Stenberg
ec6d8a38ae curl_gssapi: remove 'const' to fix compiler warnings
initialization discards 'const' qualifier from pointer target type
2015-11-17 23:06:05 +01:00
Alex Rousskov
127a7b0257 gnutls: finished support for HTTPS proxies. 2015-11-17 23:02:06 +01:00
Alex Rousskov
043c5f5c33 axtls: Fixed build
axTLS does not support HTTPS proxies yet
(ssl_connect_init_proxy returns CURLE_NOT_BUILT_IN).
2015-11-17 23:02:01 +01:00
Alex Rousskov
171de1bef8 cyassl: Fixed build
CyaSSL does not support HTTPS proxies yet
(ssl_connect_init_proxy returns CURLE_NOT_BUILT_IN).
2015-11-17 23:01:52 +01:00
Alex Rousskov
f956ebf252 PolarSSL: Fixed build with backend
PolarSSL does not support HTTPS proxies yet
(ssl_connect_init_proxy returns CURLE_NOT_BUILT_IN).
2015-11-17 23:01:34 +01:00
Alex Rousskov
68a7d38aa0 NSS: Full backend support for HTTPS proxies
Also adjusts SSL_IS_PROXY() to work correctly without requiring
sockindex.
2015-11-17 23:01:23 +01:00
Daniel Stenberg
cd2644fe2c gtls: initial work to support HTTPS proxy 2015-07-01 08:46:43 +02:00
Jay Satiro
1c5997ae9d multi: Move http2 push function declarations to header end
This change necessary for binary compatibility.

Prior to this change test 1135 failed due to the order of functions.
2015-07-01 08:46:43 +02:00
Daniel Stenberg
f9087b7499 vtls: moved the new SSL_* access macros to generic header 2015-07-01 08:46:43 +02:00
Daniel Stenberg
7df237b0b1 openssl: remove unused arguments
... that popped up when SSL_IS_PROXY() was modified.
2015-07-01 08:46:39 +02:00
Daniel Stenberg
211b265ffd openssl: fixup the proxy/primary access macros
IS_PROXY_SSL() no longer depend on connect state

IS_PROXY_SSL renamed to SSL_IS_PROXY

SSL_OPTION renamed to SSL_SET_OPTION

SSL_OPTION_PRIM renamed to SSL_CONN_CONFIG
2015-07-01 00:16:40 +02:00
Daniel Stenberg
316054e8cd gtls: access 'CApath' through connectdata
and fix the error message
2015-07-01 00:04:26 +02:00
Daniel Stenberg
f7e2cd278a Merge branch 'master' into HTTPS-proxy 2015-06-30 23:06:15 +02:00
Daniel Stenberg
b505df4b68 gnutls: adapted to the internally moved SSL struct 2015-06-30 23:05:48 +02:00
Daniel Stenberg
e58bd8e41a Merge branch 'master' into HTTPS-proxy 2015-06-30 00:32:37 +02:00
Alex Rousskov
3d90ec5448 proxy: Support HTTPS proxy and SOCKS+HTTP(s)
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.

The secure connection with the proxy requires its own set of the usual
SSL/TLS-related options (their descriptions need polishing):

  --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 given file
  --proxy-insecure           Allow connections to SSL sites without 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 defaults to --crlfile and --proxy-capath defaults to --capath.

Curl now also supports %{proxy_ssl_verify_result} --write-out variable,
similar to the existing %{ssl_verify_result} variable.

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.
2015-06-24 23:59:18 +02:00
235 changed files with 2866 additions and 3129 deletions

View File

@@ -1,10 +0,0 @@
;;; Directory Local Variables
;;; See Info node `(emacs) Directory Variables' for more information.
((nil . ((indent-tabs-mode . nil)
(show-trailing-whitespace . t)))
(c-mode . ((c-basic-offset . 2)
))
(c++-mode . ((c-basic-offset . 2)
))
)

1
.gitignore vendored
View File

@@ -49,4 +49,3 @@ missing
mkinstalldirs mkinstalldirs
tags tags
test-driver test-driver
scripts/_curl

View File

@@ -1,6 +1,6 @@
COPYRIGHT AND PERMISSION NOTICE COPYRIGHT AND PERMISSION NOTICE
Copyright (c) 1996 - 2016, Daniel Stenberg, <daniel@haxx.se>. Copyright (c) 1996 - 2015, Daniel Stenberg, <daniel@haxx.se>.
All rights reserved. All rights reserved.

View File

@@ -140,7 +140,7 @@ CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP) $(VC7_LIBVCPROJ) $(VC7_SRCVCPROJ) \
bin_SCRIPTS = curl-config bin_SCRIPTS = curl-config
SUBDIRS = lib src include scripts SUBDIRS = lib src include
DIST_SUBDIRS = $(SUBDIRS) tests packages docs DIST_SUBDIRS = $(SUBDIRS) tests packages docs
pkgconfigdir = $(libdir)/pkgconfig pkgconfigdir = $(libdir)/pkgconfig
@@ -160,10 +160,10 @@ dist-hook:
done) done)
html: html:
cd docs && make html cd docs; make html
pdf: pdf:
cd docs && make pdf cd docs; make pdf
check: test examples check-docs check: test examples check-docs

View File

@@ -1,78 +1,73 @@
Curl and libcurl 7.47.0 Curl and libcurl 7.46.0
Public curl releases: 151 Public curl releases: 150
Command line options: 179 Command line options: 177
curl_easy_setopt() options: 221 curl_easy_setopt() options: 221
Public functions in libcurl: 61 Public functions in libcurl: 61
Contributors: 1340 Contributors: 1322
This release includes the following changes: This release includes the following changes:
o version: Add flag CURL_VERSION_PSL for libpsl o configure: build silently by default
o http: added CURL_HTTP_VERSION_2TLS to do HTTP/2 for HTTPS only [8] o cookies: Add support for Publix Suffix List with libpsl
o curl: use 2TLS by default o vtls: added support for mbedTLS [7]
o curl --expect100-timeout: added [10] o Added CURLOPT_STREAM_DEPENDS [8]
o Add .dir-locals and set c-basic-offset to 2 (for emacs) [16] o Added CURLOPT_STREAM_DEPENDS_E [9]
o Added CURLOPT_STREAM_WEIGHT [10]
o Added CURLFORM_CONTENTLEN [14]
o oauth2: Added support for OAUTHBEARER SASL mechanism to IMAP, POP3 and SNMP
This release includes the following bugfixes: This release includes the following bugfixes:
o curl: avoid local drive traversal when saving file on Windows [33] o des: Fix header conditional for Curl_des_set_odd_parity
o NTLM: do not resuse proxy connections without diff proxy credentials [34] o ntlm: get rid of unconditional use of long long [1]
o tests: Disable the OAUTHBEARER tests when using a non-default port number [1] o CURLOPT_CERTINFO.3: fix reference to CURLINFO_CERTINFO
o curl: remove keepalive #ifdef checks done on libcurl's behalf o docs: CURLINFO_LASTSOCKET => CURLINFO_ACTIVESOCKET [2]
o formdata: Check if length is too large for memory [2] o http2: Fix http2_recv to return -1 if recv returned -1
o lwip: Fix compatibility issues with later versions [3] o curl_global_init_mem: set function pointers before doing init
o openssl: BoringSSL doesn't have CONF_modules_free o ntlm: error out without 64bit support as the code needs it [1]
o config-win32: Fix warning HAVE_WINSOCK2_H undefined o openssl: Fix set up of pkcs12 certificate verification chain
o build: fix compilation error with CURL_DISABLE_VERBOSE_STRINGS [4] o acinclude: remove PKGCONFIG override [3]
o http2: Fix hanging paused stream [5] o test1531: case the size to fix the test on non-largefile builds
o scripts/Makefile: fix GNUism and survive no perl [6] o fread_func: move callback pointer from set to state struct [4]
o openssl: adapt to 1.1.0+ name changes o test1601: fix compilation with --enable-debug and --disable-crypto-auth
o openssl: adapt to openssl >= 1.1.0 X509 opaque structs [7] o http2: Don't pass unitialized name+len pairs to nghttp2_submit_request [5]
o HTTP2.md: spell fix and remove TODO now implemented o curlbuild.h: Fix non-configure compiling to mips and sh4 targets
o setstropt: const-correctness [9] o tool: Generate easysrc with last cache linked-list [6]
o cyassl: fix compiler warning on type conversion o cmake: Fix for add_subdirectory(curl) use-case
o gskit: Fix host subject altname verification [11] o vtls: fix compiler warning for TLS backends without sha256
o http2: Support trailer fields [12] o build: fix for MSDOS/djgpp
o wolfssl: handle builds without SSLv3 support o checksrc: add crude // detection
o cyassl: deal with lack of *get_peer_certificate [13] o http2: on_frame_recv: trust the conn/data input
o sockfilt: do not wait on unreliable file or pipe handle o ftp: allow CURLOPT_IGNORE_CONTENT_LENGTH to ignore size [11]
o make: build zsh script even in an out-of-tree build o polarssl/mbedtls: fix name space pollution
o test 1326: fix getting stuck on Windows o build: Fix mingw ssl gdi32 order [12]
o test 87: fix file check on Windows o build: Fix support for PKG_CONFIG
o configure: allow static builds on mingw [14] o MacOSX-Framework: sdk regex fix for sdk 10.10 and later
o configure: detect IPv6 support on Windows [15] o socks: Fix incorrect port numbers in failed connect messages
o ConnectionExists: with *PIPEWAIT, wait for connections [17] o curl.1: -E: s/private certificate/client certificate
o Makefile.inc: s/curl_SOURCES/CURL_FILES [18] o curl.h: s/HTTPPOST_/CURL_HTTPOST_ [13]
o test 16: fixed for Windows o curl_formadd: support >2GB files on windows [14]
o test 252-255: use datacheck mode text for ASCII-mode LISTings o http redirects: %-encode bytes outside of ascii range [15]
o tftpd server: add Windows support by writing files in binary mode o rawstr: Speed up Curl_raw_toupper by 40%
o ftplistparser: fix handling of file LISTings using Windows EOL o curl_ntlm_core: fix 2 curl_off_t constant overflows.
o tests first.c: fix calculation of sleep timeout on Windows o getinfo: CURLINFO_ACTIVESOCKET: fix bad socket value
o tests (several): use datacheck mode text for ASCII-mode LISTings o tftp tests: verify sent options too
o CURLOPT_RANGE.3: for HTTP servers, range support is optional o imap: Don't call imap_atom() when no mailbox specified in LIST command
o test 1515: add MSYS support by passing a relative path o imap: Fixed double quote in LIST command when mailbox contains spaces
o curl_global_init.3: Add Windows-specific info for init via DLL [19] o imap: Don't check for continuation when executing a CUSTOMREQUEST [16]
o http2: Fix client write for trailers on stream close [20] o acinclude: Remove check for 16-bit curl_off_t
o mbedtls: Fix ALPN support o BoringSSL: Work with stricter BIO_get_mem_data() [17]
o connection reuse: IDN host names fixed [21] o cmake: Add missing feature macros in config header [18]
o http2: Fix PUSH_PROMISE headers being treated as trailers [22] o sasl_sspi: fixed unicode build for digest authentication [19]
o http2: handle the received SETTINGS frame [23] o sasl_sspi: fix identity memory leak in digest authentication
o http2: Ensure that http2_handle_stream_close is called [24] o unit1602: Fixed failure in torture test
o mbedtls: implement CURLOPT_PINNEDPUBLICKEY o unit1603: Added unit tests for hash functions
o runtests: Add mbedTLS to the SSL backends o vtls/openssl: remove unused traces of yassl ifdefs
o IDN host names: Remove the port number before converting to ACE [25] o openssl: remove #ifdefs for < 0.9.7 support
o zsh.pl: fail if no curl is found o typecheck-gcc.h: add some missing options
o scripts: fix zsh completion generation o curl: mark two more options strings for --libcurl output
o scripts: don't generate and install zsh completion when cross-compiling [26] o openssl: Free modules on cleanup [20]
o lib: Prefix URLs with lower-case protocol names/schemes [27]
o ConnectionExists: only do pipelining/multiplexing when asked [28]
o configure: assume IPv6 works when cross-compiled [29]
o openssl: for 1.1.0+ they now provide a SSLeay() macro of their own
o openssl: improved error detection/reporting
o ssh: CURLOPT_SSH_PUBLIC_KEYFILE now treats "" as NULL again [30]
o mbedtls: Fix pinned key return value on fail [31]
o maketgz: generate date stamp with LC_TIME=C [32]
This release includes the following known bugs: This release includes the following known bugs:
@@ -81,48 +76,35 @@ This release includes the following known bugs:
This release would not have looked like this without help, code, reports and This release would not have looked like this without help, code, reports and
advice from friends like these: advice from friends like these:
Alessandro Ghedini, Anders Bakken, Christian Stewart, Dan Fandrich, Anders Bakken, Dan Fandrich, Daniel Hwang, Daniel Stenberg, Dmitry S. Baikov,
Daniel Schauenberg, Daniel Stenberg, Francisco Moraes, Gisle Vanem, Douglas Creager, Erik Johansson, Gisle Vanem, Javier G. Sogo, John Levon,
Isaac Boukris, Johannes Schindelin, John Kohl, Kamil Dudka, Marc Hoersken, Jonas Minnberg, Justin Ehlert, Kamil Dudka, Kang Lin, Kurt Fankhauser,
Michael Kaufmann, Mohammad AlSaleh, Patrick Monnerat, Ray Satiro, Steve Holme, Lauri Kasanen, Marcel Raad, Patrick Monnerat, Rainer Jung, Ray Satiro,
Tatsuhiro Tsujikawa, Thomas Glanzmann, Thomas Klausner, Richard Hosking, Sebastian Pohlschmidt, Stefan Bühler, Steve Holme,
(21 contributors) Svyatoslav Mishyn, Tatsuhiro Tsujikawa, Tim Rühsen, xiangbin li,
(28 contributors)
Thanks! (and sorry if I forgot to mention someone) Thanks! (and sorry if I forgot to mention someone)
References to bug reports and discussions on issues: References to bug reports and discussions on issues:
[1] = http://curl.haxx.se/mail/lib-2015-12/0003.html [1] = http://curl.haxx.se/bug/?i=478
[2] = https://github.com/bagder/curl/issues/425#issuecomment-154518679 [2] = http://curl.haxx.se/bug/?i=479
[3] = http://curl.haxx.se/mail/lib-2015-12/0023.html [3] = http://curl.haxx.se/mail/lib-2015-10/0035.html
[4] = http://curl.haxx.se/bug/?i=558 [4] = http://curl.haxx.se/bug/?i=346
[5] = http://curl.haxx.se/mail/lib-2015-11/0103.html [5] = http://curl.haxx.se/bug/?i=493
[6] = http://curl.haxx.se/bug/?i=555 [6] = http://curl.haxx.se/bug/?i=452
[7] = http://curl.haxx.se/bug/?i=491 [7] = http://curl.haxx.se/bug/?i=496
[8] = http://curl.haxx.se/libcurl/c/CURLOPT_HTTP_VERSION.html [8] = http://curl.haxx.se/libcurl/c/CURLOPT_STREAM_DEPENDS.html
[9] = http://curl.haxx.se/bug/?i=565 [9] = http://curl.haxx.se/libcurl/c/CURLOPT_STREAM_DEPENDS_E.html
[10] = http://curl.haxx.se/docs/manpage.html#--expect100-timeout [10] = http://curl.haxx.se/libcurl/c/CURLOPT_STREAM_WEIGHT.html
[11] = http://curl.haxx.se/mail/lib-2015-12/0062.html [11] = http://curl.haxx.se/bug/?i=480
[12] = http://curl.haxx.se/bug/?i=564 [12] = https://github.com/bagder/curl/pull/501
[13] = http://curl.haxx.se/bug/?i=565 [13] = http://curl.haxx.se/bug/?i=506
[14] = https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-curl [14] = http://curl.haxx.se/bug/?i=425
[15] = https://github.com/Alexpux/MINGW-packages/commit/9253d0bf58a1486e91f7efb5316e7fdb48fa4007 [15] = http://curl.haxx.se/bug/?i=473
[16] = http://curl.haxx.se/bug/?i=574 [16] = http://curl.haxx.se/bug/?i=486
[17] = http://curl.haxx.se/bug/?i=575 [17] = http://curl.haxx.se/bug/?i=524
[18] = http://curl.haxx.se/bug/?i=577 [18] = http://curl.haxx.se/bug/?i=523
[19] = http://curl.haxx.se/bug/?i=586 [19] = http://curl.haxx.se/bug/?i=525
[20] = http://curl.haxx.se/bug/?i=564 [20] = http://curl.haxx.se/bug/?i=526
[21] = http://curl.haxx.se/bug/?i=592
[22] = http://curl.haxx.se/bug/?i=564
[23] = http://curl.haxx.se/mail/lib-2016-01/0031.html
[24] = http://curl.haxx.se/bug/?i=564
[25] = http://curl.haxx.se/bug/?i=596
[26] = http://curl.haxx.se/bug/?i=582
[27] = http://curl.haxx.se/bug/?i=597
[28] = http://curl.haxx.se/bug/?i=584
[29] = http://curl.haxx.se/bug/?i=594
[30] = http://curl.haxx.se/mail/lib-2016-01/0072.html
[31] = http://curl.haxx.se/bug/?i=601
[32] = http://curl.haxx.se/mail/lib-2016-01/0123.html
[33] = http://curl.haxx.se/docs/adv_20160127B.html
[34] = http://curl.haxx.se/docs/adv_20160127A.html

View File

@@ -5,7 +5,7 @@
# | (__| |_| | _ <| |___ # | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____| # \___|\___/|_| \_\_____|
# #
# Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. # Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
# #
# This software is licensed as described in the file COPYING, which # This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms # you should have received as part of this distribution. The terms
@@ -1083,11 +1083,7 @@ AC_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
AC_TRY_RUN([ /* is AF_INET6 available? */ AC_TRY_RUN([ /* is AF_INET6 available? */
#include <sys/types.h> #include <sys/types.h>
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#else
#include <sys/socket.h> #include <sys/socket.h>
#endif
#include <stdlib.h> /* for exit() */ #include <stdlib.h> /* for exit() */
main() main()
{ {
@@ -1101,8 +1097,8 @@ main()
ipv6=yes, ipv6=yes,
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
ipv6=no, ipv6=no,
AC_MSG_RESULT(yes) AC_MSG_RESULT(no)
ipv6=yes ipv6=no
)) ))
if test "$ipv6" = "yes"; then if test "$ipv6" = "yes"; then
@@ -1114,12 +1110,7 @@ if test "$ipv6" = yes; then
AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member]) AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member])
AC_TRY_COMPILE([ AC_TRY_COMPILE([
#include <sys/types.h> #include <sys/types.h>
#ifdef HAVE_WINSOCK2_H #include <netinet/in.h>] ,
#include <winsock2.h>
#include <ws2tcpip.h>
#else
#include <netinet/in.h>
#endif] ,
struct sockaddr_in6 s; s.sin6_scope_id = 0; , have_sin6_scope_id=yes) struct sockaddr_in6 s; s.sin6_scope_id = 0; , have_sin6_scope_id=yes)
if test "$have_sin6_scope_id" = yes; then if test "$have_sin6_scope_id" = yes; then
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
@@ -2175,11 +2166,11 @@ if test "$curl_ssl_msg" = "$init_ssl_msg"; then
]]) ]])
],[ ],[
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)
AC_DEFINE(USE_CYASSL, 1, [if CyaSSL/WolfSSL is enabled]) AC_DEFINE(USE_CYASSL, 1, [if CyaSSL is enabled])
AC_SUBST(USE_CYASSL, [1]) AC_SUBST(USE_CYASSL, [1])
CYASSL_ENABLED=1 CYASSL_ENABLED=1
USE_CYASSL="yes" USE_CYASSL="yes"
curl_ssl_msg="enabled (WolfSSL)" curl_ssl_msg="enabled (CyaSSL)"
], ],
[ [
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
@@ -2191,7 +2182,7 @@ if test "$curl_ssl_msg" = "$init_ssl_msg"; then
fi fi
if test "x$USE_CYASSL" = "xyes"; then if test "x$USE_CYASSL" = "xyes"; then
AC_MSG_NOTICE([detected $cyassllibname]) AC_MSG_NOTICE([detected CyaSSL])
dnl cyassl/ctaocrypt/types.h needs SIZEOF_LONG_LONG defined! dnl cyassl/ctaocrypt/types.h needs SIZEOF_LONG_LONG defined!
AC_CHECK_SIZEOF(long long) AC_CHECK_SIZEOF(long long)
@@ -2204,16 +2195,6 @@ if test "$curl_ssl_msg" = "$init_ssl_msg"; then
LIBS="-l$cyassllibname -lm $LIBS" LIBS="-l$cyassllibname -lm $LIBS"
if test "x$cyassllibname" = "xwolfssl"; then
dnl Recent WolfSSL versions build without SSLv3 by default
dnl WolfSSL needs configure --enable-opensslextra to have *get_peer*
AC_CHECK_FUNCS(wolfSSLv3_client_method \
wolfSSL_get_peer_certificate)
else
dnl Cyassl needs configure --enable-opensslextra to have *get_peer*
AC_CHECK_FUNCS(CyaSSL_get_peer_certificate)
fi
if test -n "$cyassllib"; then if test -n "$cyassllib"; then
dnl when shared libs were found in a path that the run-time dnl when shared libs were found in a path that the run-time
dnl linker doesn't search through, we need to add it to dnl linker doesn't search through, we need to add it to
@@ -3049,31 +3030,6 @@ if test X"$want_h2" != Xno; then
fi fi
dnl **********************************************************************
dnl Check for zsh completion path
dnl **********************************************************************
OPT_ZSH_FPATH=default
AC_ARG_WITH(zsh-functions-dir,
AC_HELP_STRING([--with-zsh-functions-dir=PATH],[Install zsh completions to PATH])
AC_HELP_STRING([--without-zsh-functions-dir],[Do not install zsh completions]),
[OPT_ZSH_FPATH=$withval])
case "$OPT_ZSH_FPATH" in
no)
dnl --without-zsh-functions-dir option used
;;
default|yes)
dnl --with-zsh-functions-dir option used without path
ZSH_FUNCTIONS_DIR="$datarootdir/zsh/site-functions"
AC_SUBST(ZSH_FUNCTIONS_DIR)
;;
*)
dnl --with-zsh-functions-dir option used with path
ZSH_FUNCTIONS_DIR="$withval"
AC_SUBST(ZSH_FUNCTIONS_DIR)
;;
esac
dnl ********************************************************************** dnl **********************************************************************
dnl Back to "normal" configuring dnl Back to "normal" configuring
dnl ********************************************************************** dnl **********************************************************************
@@ -3841,7 +3797,6 @@ AC_CONFIG_FILES([Makefile \
include/curl/Makefile \ include/curl/Makefile \
src/Makefile \ src/Makefile \
lib/Makefile \ lib/Makefile \
scripts/Makefile \
lib/libcurl.vers \ lib/libcurl.vers \
tests/Makefile \ tests/Makefile \
tests/certs/Makefile \ tests/certs/Makefile \

View File

@@ -225,9 +225,7 @@ FAQ
implement it for you, that is not a very friendly attitude. We spend a implement it for you, that is not a very friendly attitude. We spend a
considerable time already on maintaining and developing curl. In order to considerable time already on maintaining and developing curl. In order to
get more out of us, you should consider trading in some of your time and get more out of us, you should consider trading in some of your time and
efforts in return. Simply go to the GitHub repo which resides at efforts in return.
https://github.com/bagder/curl, fork the project, and create pull requests
with your proposed changes.
If you write the code, chances are bigger that it will get into curl faster. If you write the code, chances are bigger that it will get into curl faster.
@@ -253,10 +251,9 @@ FAQ
We still get help from companies. Haxx provides web site, bandwidth, mailing We still get help from companies. Haxx provides web site, bandwidth, mailing
lists etc, sourceforge.net hosts project services we take advantage from, lists etc, sourceforge.net hosts project services we take advantage from,
like the bug tracker, and GitHub hosts the primary git repository at like the bug tracker and github hosts the primary git repository. Also
https://github.com/bagder/curl. Also again, some companies have sponsored again, some companies have sponsored certain parts of the development in the
certain parts of the development in the past and I hope some will continue to past and I hope some will continue to do so in the future.
do so in the future.
If you want to support our project, consider a donation or a banner-program If you want to support our project, consider a donation or a banner-program
or even better: by helping us coding, documenting, testing etc. or even better: by helping us coding, documenting, testing etc.
@@ -355,15 +352,13 @@ FAQ
cryptography. When doing so, the Export Control Classification Number (ECCN) cryptography. When doing so, the Export Control Classification Number (ECCN)
is used to identify the level of export control etc. is used to identify the level of export control etc.
Apache Software Foundation gives a good explanation of ECCNs at ASF gives a good explanation at https://www.apache.org/dev/crypto.html
https://www.apache.org/dev/crypto.html
We believe curl's number might be ECCN 5D002, another possibility is We believe curl's number might be ECCN 5D002, another possibility is
5D992. It seems necessary to write them (the authority that administers ECCN 5D992. It seems necessary to write them, asking to confirm.
numbers), asking to confirm.
Comprehensible explanations of the meaning of such numbers and how to obtain Comprehensible explanations of the meaning of such numbers and how to
them (resp.) are here obtain them (resp.) are here
http://www.bis.doc.gov/licensing/exportingbasics.htm http://www.bis.doc.gov/licensing/exportingbasics.htm
http://www.bis.doc.gov/licensing/do_i_needaneccn.html http://www.bis.doc.gov/licensing/do_i_needaneccn.html
@@ -1092,7 +1087,7 @@ FAQ
In such cases, the TCP/IP stack is responsible for detecting when the In such cases, the TCP/IP stack is responsible for detecting when the
network connection is irrevocably lost. Since with some protocols it is network connection is irrevocably lost. Since with some protocols it is
perfectly legal for the client to wait indefinitely for data, the stack may perfectly legal for the client wait indefinitely for data, the stack may
never report a problem, and even when it does, it can take up to 20 minutes never report a problem, and even when it does, it can take up to 20 minutes
for it to detect an issue. The curl option --keepalive-time enables for it to detect an issue. The curl option --keepalive-time enables
keep-alive support in the TCP/IP stack which makes it periodically probe the keep-alive support in the TCP/IP stack which makes it periodically probe the

View File

@@ -100,5 +100,8 @@ automatically. [Spec](https://tools.ietf.org/html/draft-ietf-httpbis-alt-svc-05)
TODO TODO
---- ----
- Implement "prior-knowledge" HTTP/2 connections over clear text so that - Provide API to set priorities / dependencies of individual streams
- Implement "prior-knowledge" HTTP/2 connecitons over clear text so that
curl can connect with HTTP/2 at once without 1.1+Upgrade. curl can connect with HTTP/2 at once without 1.1+Upgrade.

View File

@@ -45,10 +45,10 @@ MAN2HTML= roffit < $< >$@
SUFFIXES = .1 .html .pdf SUFFIXES = .1 .html .pdf
html: $(HTMLPAGES) html: $(HTMLPAGES)
cd libcurl && make html cd libcurl; make html
pdf: $(PDFPAGES) pdf: $(PDFPAGES)
cd libcurl && make pdf cd libcurl; make pdf
.1.html: .1.html:
$(MAN2HTML) $(MAN2HTML)

View File

@@ -23,6 +23,13 @@ HTTP/2
As it would avoid the roundtrip-heavy Upgrade: procedures when you _know_ As it would avoid the roundtrip-heavy Upgrade: procedures when you _know_
it speaks HTTP/2. it speaks HTTP/2.
- provide option to allow curl to default to HTTP/2 only when using HTTPS
We could switch on HTTP/2 by-default for HTTPS quite easily and it
shouldn't hurt anyone, while HTTP/2 for HTTP by default could introduce
lots of Upgrade: roundtrips that users won't like. So a separated option
alternative makes sense.
SRV records SRV records
----------- -----------

View File

@@ -207,7 +207,6 @@ Christian Krause
Christian Kurz Christian Kurz
Christian Robottom Reis Christian Robottom Reis
Christian Schmitz Christian Schmitz
Christian Stewart
Christian Vogt Christian Vogt
Christian Weisgerber Christian Weisgerber
Christophe Demory Christophe Demory
@@ -262,9 +261,7 @@ Daniel Kahn Gillmor
Daniel Lee Hwang Daniel Lee Hwang
Daniel Melani Daniel Melani
Daniel Mentz Daniel Mentz
Daniel Schauenberg
Daniel Seither Daniel Seither
Daniel Shahaf
Daniel Steinberg Daniel Steinberg
Daniel Stenberg Daniel Stenberg
Daniel Theron Daniel Theron
@@ -278,7 +275,6 @@ Dave May
Dave Reisner Dave Reisner
Dave Thompson Dave Thompson
Dave Vasilevsky Dave Vasilevsky
Davey Shafik
David Bau David Bau
David Binderman David Binderman
David Blaikie David Blaikie
@@ -332,14 +328,12 @@ Dmitry Falko
Dmitry Kurochkin Dmitry Kurochkin
Dmitry Popov Dmitry Popov
Dmitry Rechkin Dmitry Rechkin
Dmitry S. Baikov
Dolbneff A.V Dolbneff A.V
Domenico Andreoli Domenico Andreoli
Dominick Meglio Dominick Meglio
Dominique Leuenberger Dominique Leuenberger
Doug Kaufman Doug Kaufman
Doug Porter Doug Porter
Douglas Creager
Douglas E. Wegscheid Douglas E. Wegscheid
Douglas Kilpatrick Douglas Kilpatrick
Douglas R. Horner Douglas R. Horner
@@ -404,11 +398,9 @@ Feist Josselin
Felix Yan Felix Yan
Felix von Leitner Felix von Leitner
Feng Tu Feng Tu
Flavio Medeiros
Florian Schoppmann Florian Schoppmann
Florian Weimer Florian Weimer
Forrest Cahoon Forrest Cahoon
Francisco Moraes
Frank Gevaerts Frank Gevaerts
Frank Hempel Frank Hempel
Frank Keeney Frank Keeney
@@ -557,7 +549,6 @@ Jason Liu
Jason McDonald Jason McDonald
Jason S. Priebe Jason S. Priebe
Javier Barroso Javier Barroso
Javier G. Sogo
Jay Austin Jay Austin
Jayesh A Shah Jayesh A Shah
Jaz Fresh Jaz Fresh
@@ -613,7 +604,6 @@ Johan Nilsson
Johan van Selst Johan van Selst
Johannes Bauer Johannes Bauer
Johannes Ernst Johannes Ernst
Johannes Schindelin
John Bradshaw John Bradshaw
John Coffey John Coffey
John Crow John Crow
@@ -624,9 +614,7 @@ John Gardiner Myers
John Janssen John Janssen
John Joseph Bachir John Joseph Bachir
John Kelly John Kelly
John Kohl
John Lask John Lask
John Levon
John Lightsey John Lightsey
John Marino John Marino
John Marshall John Marshall
@@ -645,7 +633,6 @@ Jon Torrey
Jon Travis Jon Travis
Jon Turner Jon Turner
Jonas Forsman Jonas Forsman
Jonas Minnberg
Jonas Schnelli Jonas Schnelli
Jonatan Lander Jonatan Lander
Jonatan Vela Jonatan Vela
@@ -674,7 +661,6 @@ Julien Nabet
Julien Royer Julien Royer
Jun-ichiro itojun Hagino Jun-ichiro itojun Hagino
Jurij Smakov Jurij Smakov
Justin Ehlert
Justin Fletcher Justin Fletcher
Justin Karneges Justin Karneges
Justin Maggard Justin Maggard
@@ -686,7 +672,6 @@ Kai Sommerfeld
Kai-Uwe Rommel Kai-Uwe Rommel
Kalle Vahlman Kalle Vahlman
Kamil Dudka Kamil Dudka
Kang Lin
Kang-Jin Lee Kang-Jin Lee
Karl Moerder Karl Moerder
Karol Pietrzak Karol Pietrzak
@@ -718,7 +703,6 @@ Krishnendu Majumdar
Krister Johansen Krister Johansen
Kristian Gunstone Kristian Gunstone
Kristian Köhntopp Kristian Köhntopp
Kurt Fankhauser
Kyle J. McKay Kyle J. McKay
Kyle L. Huff Kyle L. Huff
Kyle Sallee Kyle Sallee
@@ -735,7 +719,6 @@ Lars Nilsson
Lars Torben Wilson Lars Torben Wilson
Lau Hang Kin Lau Hang Kin
Laurent Rabret Laurent Rabret
Lauri Kasanen
Legoff Vincent Legoff Vincent
Lehel Bernadt Lehel Bernadt
Leif W Leif W
@@ -764,7 +747,6 @@ Lucas Adamski
Lucas Pardue Lucas Pardue
Ludek Finstrle Ludek Finstrle
Ludovico Cavedon Ludovico Cavedon
Lukas Ruzicka
Lukasz Czekierda Lukasz Czekierda
Luke Amery Luke Amery
Luke Call Luke Call
@@ -873,7 +855,6 @@ Michal Marek
Michał Fita Michał Fita
Michał Górny Michał Górny
Michał Kowalczyk Michał Kowalczyk
Michał Piechowski
Michel Promonet Michel Promonet
Michele Bini Michele Bini
Miguel Angel Miguel Angel
@@ -932,7 +913,6 @@ Nis Jorgensen
Nobuhiro Ban Nobuhiro Ban
Nodak Sodak Nodak Sodak
Norbert Frese Norbert Frese
Norbert Kett
Norbert Novotny Norbert Novotny
Ofer Ofer
Ola Mork Ola Mork
@@ -1069,7 +1049,6 @@ Richard Bramante
Richard Clayton Richard Clayton
Richard Cooper Richard Cooper
Richard Gorton Richard Gorton
Richard Hosking
Richard Michael Richard Michael
Richard Moore Richard Moore
Richard Prescott Richard Prescott
@@ -1143,7 +1122,6 @@ Scott Cantor
Scott Davis Scott Davis
Scott McCreary Scott McCreary
Sean Boudreau Sean Boudreau
Sebastian Pohlschmidt
Sebastian Rasmussen Sebastian Rasmussen
Senthil Raja Velu Senthil Raja Velu
Sergei Nikulov Sergei Nikulov
@@ -1217,7 +1195,6 @@ Tatsuhiro Tsujikawa
Temprimus Temprimus
Terri Oda Terri Oda
Thomas Braun Thomas Braun
Thomas Glanzmann
Thomas J. Moore Thomas J. Moore
Thomas Klausner Thomas Klausner
Thomas L. Shinnick Thomas L. Shinnick
@@ -1236,7 +1213,7 @@ Tim Costello
Tim Harder Tim Harder
Tim Heckman Tim Heckman
Tim Newsome Tim Newsome
Tim Rühsen Tim Ruehsen
Tim Sneddon Tim Sneddon
Tim Stack Tim Stack
Tim Starling Tim Starling
@@ -1325,7 +1302,6 @@ Wojciech Zwiefka
Wouter Van Rooy Wouter Van Rooy
Wu Yongzheng Wu Yongzheng
Xavier Bouchoux Xavier Bouchoux
Xiangbin Li
Yaakov Selkowitz Yaakov Selkowitz
Yamada Yasuharu Yamada Yasuharu
Yang Tse Yang Tse

View File

@@ -51,4 +51,3 @@ s/Viktor Szakats/Viktor Szakáts/
s/Jonathan Cardoso/Jonathan Cardoso Machado/ s/Jonathan Cardoso/Jonathan Cardoso Machado/
s/Linus Nielsen/Linus Nielsen Feltzing/ s/Linus Nielsen/Linus Nielsen Feltzing/
s/Todd Ouska$/Todd A Ouska/ s/Todd Ouska$/Todd A Ouska/
s/Tim Ruehsen/Tim Rühsen/

112
docs/TODO
View File

@@ -27,17 +27,11 @@
1.9 Cache negative name resolves 1.9 Cache negative name resolves
1.10 Support IDNA2008 1.10 Support IDNA2008
1.11 minimize dependencies with dynamicly loaded modules 1.11 minimize dependencies with dynamicly loaded modules
1.12 have form functions use CURL handle argument
1.13 Add CURLOPT_MAIL_CLIENT option
1.14 Typesafe curl_easy_setopt()
1.15 TCP Fast Open
1.16 Try to URL encode given URL
2. libcurl - multi interface 2. libcurl - multi interface
2.1 More non-blocking 2.1 More non-blocking
2.2 Better support for same name resolves 2.2 Fix HTTP Pipelining for PUT
2.3 Non-blocking curl_multi_remove_handle() 2.3 Better support for same name resolves
2.4 Split connect and authentication process
3. Documentation 3. Documentation
3.1 Update date and version in man pages 3.1 Update date and version in man pages
@@ -84,7 +78,6 @@
11.1 File listing support 11.1 File listing support
11.2 Honor file timestamps 11.2 Honor file timestamps
11.3 Use NTLMv2 11.3 Use NTLMv2
11.4 Create remote directories
12. New protocols 12. New protocols
12.1 RSYNC 12.1 RSYNC
@@ -148,6 +141,8 @@
21.6 remove CURLOPT_DNS_USE_GLOBAL_CACHE 21.6 remove CURLOPT_DNS_USE_GLOBAL_CACHE
21.7 remove progress meter from libcurl 21.7 remove progress meter from libcurl
21.8 remove 'curl_httppost' from public 21.8 remove 'curl_httppost' from public
21.9 have form functions use CURL handle argument
21.10 Add CURLOPT_MAIL_CLIENT option
============================================================================== ==============================================================================
@@ -241,59 +236,6 @@
app/invoke/used protocols would be necessary to load. See app/invoke/used protocols would be necessary to load. See
https://github.com/bagder/curl/issues/349 https://github.com/bagder/curl/issues/349
1.12 have form functions use CURL handle argument
curl_formadd() and curl_formget() both currently have no CURL handle
argument, but both can use a callback that is set in the easy handle, and
thus curl_formget() with callback cannot function without first having
curl_easy_perform() (or similar) called - which is hard to grasp and a design
mistake.
The curl_formadd() design can probably also be reconsidered to make it easier
to use and less error-prone. Probably easiest by splitting it into several
function calls.
1.13 Add CURLOPT_MAIL_CLIENT option
Rather than use the URL to specify the mail client string to present in the
HELO and EHLO commands, libcurl should support a new CURLOPT specifically for
specifying this data as the URL is non-standard and to be honest a bit of a
hack ;-)
Please see the following thread for more information:
http://curl.haxx.se/mail/lib-2012-05/0178.html
1.14 Typesafe curl_easy_setopt()
One of the most common problems in libcurl using applications is the lack of
type checks for curl_easy_setopt() which happens because it accepts varargs
and thus can take any type.
One possible solution to this is to introduce a few different versions of the
setopt version for the different kinds of data you can set.
curl_easy_set_num() - sets a long value
curl_easy_set_large() - sets a curl_off_t value
curl_easy_set_ptr() - sets a pointer
curl_easy_set_cb() - sets a callback PLUS its callback data
1.15 TCP Fast Open
RFC 7413 defines how to include data already in the TCP SYN handshake to
reduce latency.
1.16 Try to URL encode given URL
Given a URL that for example contains spaces, libcurl could have an option
that would try somewhat harder than it does now and convert spaces to %20 and
perhaps URL encoded byte values over 128 etc (basically do what the redirect
following code already does).
https://github.com/bagder/curl/issues/514
2. libcurl - multi interface 2. libcurl - multi interface
2.1 More non-blocking 2.1 More non-blocking
@@ -310,7 +252,13 @@
- The "DONE" operation (post transfer protocol-specific actions) for the - The "DONE" operation (post transfer protocol-specific actions) for the
protocols SFTP, SMTP, FTP. Fixing Curl_done() for this is a worthy task. protocols SFTP, SMTP, FTP. Fixing Curl_done() for this is a worthy task.
2.2 Better support for same name resolves 2.2 Fix HTTP Pipelining for PUT
HTTP Pipelining can be a way to greatly enhance performance for multiple
serial requests and currently libcurl only supports that for HEAD and GET
requests but it should also be possible for PUT.
2.3 Better support for same name resolves
If a name resolve has been initiated for name NN and a second easy handle If a name resolve has been initiated for name NN and a second easy handle
wants to resolve that name as well, make it wait for the first resolve to end wants to resolve that name as well, make it wait for the first resolve to end
@@ -318,20 +266,6 @@
especially needed when adding many simultaneous handles using the same host especially needed when adding many simultaneous handles using the same host
name when the DNS resolver can get flooded. name when the DNS resolver can get flooded.
2.3 Non-blocking curl_multi_remove_handle()
The multi interface has a few API calls that assume a blocking behavior, like
add_handle() and remove_handle() which limits what we can do internally. The
multi API need to be moved even more into a single function that "drives"
everything in a non-blocking manner and signals when something is done. A
remove or add would then only ask for the action to get started and then
multi_perform() etc still be called until the add/remove is completed.
2.4 Split connect and authentication process
The multi interface treats the authentication process as part of the connect
phase. As such any failures during authentication won't trigger the relevant
QUIT or LOGOFF for protocols such as IMAP, POP3 and SMTP.
3. Documentation 3. Documentation
@@ -526,11 +460,6 @@ The timestamp of the transferred file should reflect that of the original file.
Currently the SMB authentication uses NTLMv1. Currently the SMB authentication uses NTLMv1.
11.4 Create remote directories
Support for creating remote directories when uploading a file to a directory
that doesn't exist on the server, just like --ftp-create-dirs.
12. New protocols 12. New protocols
12.1 RSYNC 12.1 RSYNC
@@ -886,3 +815,22 @@ that doesn't exist on the server, just like --ftp-create-dirs.
Changing them to return a private handle will benefit the implementation and Changing them to return a private handle will benefit the implementation and
allow us much greater freedoms while still maintaining a solid API and ABI. allow us much greater freedoms while still maintaining a solid API and ABI.
21.9 have form functions use CURL handle argument
curl_formadd() and curl_formget() both currently have no CURL handle
argument, but both can use a callback that is set in the easy handle, and
thus curl_formget() with callback cannot function without first having
curl_easy_perform() (or similar) called - which is hard to grasp and a design
mistake.
21.10 Add CURLOPT_MAIL_CLIENT option
Rather than use the URL to specify the mail client string to present in the
HELO and EHLO commands, libcurl should support a new CURLOPT specifically for
specifying this data as the URL is non-standard and to be honest a bit of a
hack ;-)
Please see the following thread for more information:
http://curl.haxx.se/mail/lib-2012-05/0178.html

View File

@@ -523,13 +523,6 @@ after having run curl.
(SSL) Specify the path name to the Entropy Gathering Daemon socket. The socket (SSL) Specify the path name to the Entropy Gathering Daemon socket. The socket
is used to seed the random engine for SSL connections. See also the is used to seed the random engine for SSL connections. See also the
\fI--random-file\fP option. \fI--random-file\fP option.
.IP "--expect100-timeout <seconds>"
(HTTP) Maximum time in seconds that you allow curl to wait for a 100-continue
response when curl emits an Expects: 100-continue header in its request. By
default curl will wait one second. This option accepts decimal values! When
curl stops waiting, it will continue as if the response has been received.
(Added in 7.47.0)
.IP "--cert-type <type>" .IP "--cert-type <type>"
(SSL) Tells curl what certificate type the provided certificate is in. PEM, (SSL) Tells curl what certificate type the provided certificate is in. PEM,
DER and ENG are recognized types. If not specified, PEM is assumed. DER and ENG are recognized types. If not specified, PEM is assumed.

View File

@@ -73,7 +73,3 @@ smtp-vrfy
url2file url2file
usercertinmem usercertinmem
xmlstream xmlstream
http2-download
http2-serverpush
http2-upload
imap-lsub

View File

@@ -5,7 +5,7 @@
# | (__| |_| | _ <| |___ # | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____| # \___|\___/|_| \_\_____|
# #
# Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. # Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
# #
# This software is licensed as described in the file COPYING, which # This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms # you should have received as part of this distribution. The terms
@@ -32,7 +32,7 @@ check_PROGRAMS = 10-at-a-time anyauthput cookie_interface debug fileupload \
imap-list imap-lsub imap-fetch imap-store imap-append imap-examine \ imap-list imap-lsub imap-fetch imap-store imap-append imap-examine \
imap-search imap-create imap-delete imap-copy imap-noop imap-ssl \ imap-search imap-create imap-delete imap-copy imap-noop imap-ssl \
imap-tls imap-multi url2file sftpget ftpsget postinmemory http2-download \ imap-tls imap-multi url2file sftpget ftpsget postinmemory http2-download \
http2-upload http2-serverpush getredirect http2-upload http2-serverpush
# These examples require external dependencies that may not be commonly # These examples require external dependencies that may not be commonly
# available on POSIX systems, so don't bother attempting to compile them here. # available on POSIX systems, so don't bother attempting to compile them here.

View File

@@ -32,7 +32,51 @@ actually torture our web site with your tests! Thanks.
EXAMPLES EXAMPLES
Each example source code file is designed to be and work stand-alone and anyauthput.c - HTTP PUT using "any" authentication method
rather self-explanatory. The examples may at times lack the level of error cacertinmem.c - Use a built-in PEM certificate to retrieve a https page
checks you need in a real world, but that is then only for the sake of cookie_interface.c - shows usage of simple cookie interface
readability: to make the code smaller and easier to follow. curlgtk.c - download using a GTK progress bar
curlx.c - getting file info from the remote cert data
debug.c - showing how to use the debug callback
fileupload.c - uploading to a file:// URL
fopen.c - fopen() layer that supports opening URLs and files
ftpget.c - simple getting a file from FTP
ftpgetresp.c - get the response strings from the FTP server
ftpupload.c - upload a file to an FTP server
ftpuploadresume.c - resume an upload to an FTP server
getinfo.c - get the Content-Type from the recent transfer
getinmemory.c - download a file to memory only
ghiper.c - curl_multi_socket() using code with glib-2
hiperfifo.c - downloads all URLs written to the fifo, using
curl_multi_socket() and libevent
htmltidy.c - download a document and use libtidy to parse the HTML
htmltitle.cc - download a HTML file and extract the <title> tag from a HTML
page using libxml
http-post.c - HTTP POST
httpput.c - HTTP PUT a local file
https.c - simple HTTPS transfer
imap.c - simple IMAP transfer
multi-app.c - a multi-interface app
multi-debugcallback.c - a multi-interface app using the debug callback
multi-double.c - a multi-interface app doing two simultaneous transfers
multi-post.c - a multi-interface app doing a multipart formpost
multi-single.c - a multi-interface app getting a single file
multi-uv.c - a multi-interface app using libuv
multithread.c - an example using multi-treading transferring multiple files
opensslthreadlock.c - show how to do locking when using OpenSSL multi-threaded
persistant.c - request two URLs with a persistent connection
pop3s.c - POP3S transfer
pop3slist.c - POP3S LIST
post-callback.c - send a HTTP POST using a callback
postit2.c - send a HTTP multipart formpost
sampleconv.c - showing how a program on a non-ASCII platform would invoke
callbacks to do its own codeset conversions instead of using
the built-in iconv functions in libcurl
sepheaders.c - download headers to a separate file
simple.c - the most simple download a URL source
simplepost.c - HTTP POST
simplessl.c - HTTPS example with certificates many options set
synctime.c - Sync local time by extracting date from remote HTTP servers
url2file.c - download a document and store it in a file
xmlstream.c - Stream-parse a document using the streaming Expat parser
10-at-a-time.c - Download many files simultaneously, 10 at a time.

View File

@@ -1,70 +0,0 @@
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at http://curl.haxx.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
***************************************************************************/
/* <DESC>
* Show how to extract Location: header and URL to redirect to.
* </DESC>
*/
#include <stdio.h>
#include <curl/curl.h>
int main(void)
{
CURL *curl;
CURLcode res;
char *location;
long response_code;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
/* example.com is redirected, figure out the redirection! */
/* Perform the request, res will get the return code */
res = curl_easy_perform(curl);
/* Check for errors */
if(res != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n",
curl_easy_strerror(res));
else {
res = curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code);
if((res == CURLE_OK) &&
((code / 100) != 3)) {
/* a redirect implies a 3xx response code */
fprintf(stderr, "Not a redirect.\n");
}
else {
res = curl_easy_getinfo(curl, CURLINFO_REDIRECT_URL, &location);
if((res == CURLE_OK) && location) {
/* This is the new absolute URL that you could redirect to, even if
* the Location: response header may have been a relative URL. */
printf("Redirected to: %s\n", location);
}
}
}
/* always cleanup */
curl_easy_cleanup(curl);
}
return 0;
}

View File

@@ -25,7 +25,6 @@
*/ */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
/* somewhat unix-specific */ /* somewhat unix-specific */
#include <sys/time.h> #include <sys/time.h>

View File

@@ -25,7 +25,6 @@
*/ */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
/* somewhat unix-specific */ /* somewhat unix-specific */
#include <sys/time.h> #include <sys/time.h>

View File

@@ -25,7 +25,6 @@
*/ */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/stat.h> #include <sys/stat.h>

View File

@@ -19,12 +19,10 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC> /* <DESC>
* IMAP example showing how to send e-mails * Simple IMAP APPEND use
* </DESC> * </DESC>
*/ */
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,12 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* IMAP example showing how to copy an e-mail from one folder to another
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,12 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* IMAP example showing how to create a new folder
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,12 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* IMAP example showing how to delete a folder
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,12 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* IMAP example showing how to obtain information about a folder
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,12 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* IMAP example showing how to retreieve e-mails
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,12 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* IMAP example to list the folders within a mailbox
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,12 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* IMAP example to list the subscribed folders
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,14 +19,7 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* IMAP example using the multi interface
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include <curl/curl.h> #include <curl/curl.h>
/* This is a simple example showing how to fetch mail using libcurl's IMAP /* This is a simple example showing how to fetch mail using libcurl's IMAP

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,12 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* IMAP example showing how to perform a noop
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,12 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* IMAP example showing how to search for new e-mails
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,12 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* IMAP example using SSL
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,12 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* IMAP example showing how to modify the properties of an e-mail
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,12 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* IMAP example using TLS
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,11 +19,7 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC> /* This is an example application source code using the multi interface. */
* A basic application source code using the multi interface doing two
* transfers in parallel.
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,12 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* POP3 example showing how to delete e-mails
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,12 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* POP3 example to list the contents of a mailbox
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,14 +19,7 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* POP3 example using the multi interface
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include <curl/curl.h> #include <curl/curl.h>
/* This is a simple example showing how to retrieve mail using libcurl's POP3 /* This is a simple example showing how to retrieve mail using libcurl's POP3

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,12 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* POP3 example showing how to perform a noop
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,12 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* POP3 example showing how to retrieve e-mails
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,12 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* POP3 example using SSL
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,12 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* POP3 example showing how to obtain message statistics
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,12 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* POP3 example using TLS
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,12 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* POP3 example showing how to retreive only the headers of an e-mail
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,12 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* POP3 example to list the contents of a mailbox by unique ID
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,10 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* Make a HTTP POST with data from memory and receive response in memory.
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,10 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* HTTP Multipart formpost with file upload and two additional parts.
* </DESC>
*/
/* Example code that uploads a file name 'foo' to a remote script that accepts /* Example code that uploads a file name 'foo' to a remote script that accepts
* "HTML form based" (as described in RFC1738) uploads using HTTP POST. * "HTML form based" (as described in RFC1738) uploads using HTTP POST.
* *

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,11 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* Use the progress callbacks, old and/or new one depending on available
* libcurl version.
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,11 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* Use CURLOPT_RESOLVE to feed custom IP addresses for given host name + port
* number combinations.
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -27,10 +27,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
*/ */
/* <DESC>
* A basic RTSP transfer
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,13 +19,10 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* This is a simple example showing how a program on a non-ASCII platform
* would invoke callbacks to do its own codeset conversions instead of
* using the built-in iconv functions in libcurl.
* </DESC>
*/
/* /*
This is a simple example showing how a program on a non-ASCII platform
would invoke callbacks to do its own codeset conversions instead of
using the built-in iconv functions in libcurl.
The IBM-1047 EBCDIC codeset is used for this example but the code The IBM-1047 EBCDIC codeset is used for this example but the code
would be similar for other non-ASCII codesets. would be similar for other non-ASCII codesets.

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,10 +19,7 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC> /* An example of curl_easy_send() and curl_easy_recv() usage. */
* An example of curl_easy_send() and curl_easy_recv() usage.
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@@ -69,14 +66,6 @@ int main(void)
size_t iolen; size_t iolen;
curl_off_t nread; curl_off_t nread;
/* A general note of caution here: if you're using curl_easy_recv() or
curl_easy_send() to implement HTTP or _any_ other protocol libcurl
supports "natively", you're doing it wrong and you should stop.
This example uses HTTP only to show how to use this API, it does not
suggest that writing an application doing this is sensible.
*/
curl = curl_easy_init(); curl = curl_easy_init();
if(curl) { if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,10 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* Simple HTTP GET that stores the headers in a separate file
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,10 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* Uses the CURLINFO_TLS_SESSION data.
* </DESC>
*/
/* Note that this example currently requires cURL to be linked against /* Note that this example currently requires cURL to be linked against
GnuTLS (and this program must also be linked against -lgnutls). */ GnuTLS (and this program must also be linked against -lgnutls). */

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,10 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* Gets a file using an SFTP URL.
* </DESC>
*/
#include <stdio.h> #include <stdio.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,10 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* Very simple HTTP GET
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,10 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* Very simple HTTP POST
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,10 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* Shows HTTPS usage with client certs and optional ssl engine use.
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,12 +19,9 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC> /* This is a multi threaded application that uses a progress bar to show
* A multi threaded application that uses a progress bar to show
* status. It uses Gtk+ to make a smooth pulse. * status. It uses Gtk+ to make a smooth pulse.
* </DESC> *
*/
/*
* Written by Jud Bishop after studying the other examples provided with * Written by Jud Bishop after studying the other examples provided with
* libcurl. * libcurl.
* *

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,17 +19,11 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* SMTP example showing how to expand an e-mail mailing list
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <curl/curl.h> #include <curl/curl.h>
/* This is a simple example showing how to expand an e-mail mailing list. /* This is a simple example showing how to expand an email mailing list.
* *
* Notes: * Notes:
* *

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,12 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* SMTP example showing how to send e-mails
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,12 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* SMTP example using the multi interface
* </DESC>
*/
#include <string.h> #include <string.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,12 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* SMTP example using SSL
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,12 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* SMTP example using TLS
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,17 +19,11 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* SMTP example showing how to verify an e-mail address
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <curl/curl.h> #include <curl/curl.h>
/* This is a simple example showing how to verify an e-mail address from an /* This is a simple example showing how to verify an email address from an
* SMTP server. * SMTP server.
* *
* Notes: * Notes:

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,10 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* Set your system time from a remote HTTP server's Date: header.
* </DESC>
*/
/* This example code only builds as-is on Windows. /* This example code only builds as-is on Windows.
* *
* While Unix/Linux user, you do not need this software. * While Unix/Linux user, you do not need this software.

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,11 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* Show the required mutex callback setups for GnuTLS and OpenSSL when using
* libcurl multi-threaded.
* </DESC>
*/
/* A multi-threaded example that uses pthreads and fetches 4 remote files at /* A multi-threaded example that uses pthreads and fetches 4 remote files at
* once over HTTPS. The lock callbacks and stuff assume OpenSSL or GnuTLS * once over HTTPS. The lock callbacks and stuff assume OpenSSL or GnuTLS
* (libgcrypt) so far. * (libgcrypt) so far.

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,10 +19,6 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
* Download a given URL into a local file named page.out.
* </DESC>
*/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 2013 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,13 +19,10 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC>
/* Example using an in memory PEM user certificate and RSA key to retrieve an /* Example using an in memory PEM user certificate and RSA key to retrieve an
* https page. * https page.
* </DESC> * Written by Ishan SinghLevett, based on Theo Borm's cacertinmem.c.
*/ * Note that to maintain simplicity this example does not use a CA certificate
/* Written by Ishan SinghLevett, based on Theo Borm's cacertinmem.c.
* Note that to maintain simplicity this example does not use a CA certificate
* for peer verification. However, some form of peer verification * for peer verification. However, some form of peer verification
* must be used in real circumstances when a secure connection is required. * must be used in real circumstances when a secure connection is required.
*/ */

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -19,11 +19,8 @@
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* <DESC> /* Stream-parse a document using the streaming Expat parser.
* Stream-parse a document using the streaming Expat parser. * Written by David Strauss
* </DESC>
*/
/* Written by David Strauss
* *
* Expat => http://www.libexpat.org/ * Expat => http://www.libexpat.org/
* *

View File

@@ -99,13 +99,13 @@ libcurl-symbols.3: $(srcdir)/symbols-in-versions $(srcdir)/mksymbolsmanpage.pl
perl $(srcdir)/mksymbolsmanpage.pl < $(srcdir)/symbols-in-versions > $@ perl $(srcdir)/mksymbolsmanpage.pl < $(srcdir)/symbols-in-versions > $@
html: $(HTMLPAGES) html: $(HTMLPAGES)
cd opts && make html cd opts; make html
.3.html: .3.html:
$(MAN2HTML) $(MAN2HTML)
pdf: $(PDFPAGES) pdf: $(PDFPAGES)
cd opts && make pdf cd opts; make pdf
.3.pdf: .3.pdf:
@(foo=`echo $@ | sed -e 's/\.[0-9]$$//g'`; \ @(foo=`echo $@ | sed -e 's/\.[0-9]$$//g'`; \

View File

@@ -50,10 +50,6 @@ This doesn't just mean no other thread that is using libcurl. Because
similarly thread unsafe, it could conflict with any other thread that uses similarly thread unsafe, it could conflict with any other thread that uses
these other libraries. these other libraries.
If you are initializing libcurl from a Windows DLL you should not initialize it
from DllMain or a static initializer because Windows holds the loader lock
during that time and it could cause a deadlock.
See the description in \fBlibcurl(3)\fP of global environment requirements for See the description in \fBlibcurl(3)\fP of global environment requirements for
details of how to use this function. details of how to use this function.

View File

@@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___ .\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____| .\" * \___|\___/|_| \_\_____|
.\" * .\" *
.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. .\" * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" * .\" *
.\" * This software is licensed as described in the file COPYING, which .\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms .\" * you should have received as part of this distribution. The terms
@@ -27,8 +27,7 @@ curl_multi_socket_action \- reads/writes available data given an action
#include <curl/curl.h> #include <curl/curl.h>
CURLMcode curl_multi_socket_action(CURLM * multi_handle, CURLMcode curl_multi_socket_action(CURLM * multi_handle,
curl_socket_t sockfd, curl_socket_t sockfd, int ev_bitmask,
int ev_bitmask,
int *running_handles); int *running_handles);
.fi .fi
.SH DESCRIPTION .SH DESCRIPTION

View File

@@ -76,9 +76,9 @@ typedef struct {
.fi .fi
\fIage\fP describes what the age of this struct is. The number depends on how \fIage\fP describes what the age of this struct is. The number depends on how
new the libcurl you're using is. You are however guaranteed to get a struct new the libcurl you're using is. You are however guaranteed to get a struct that you
that you have a matching struct for in the header, as you tell libcurl your have a matching struct for in the header, as you tell libcurl your "age" with
"age" with the input argument. the input argument.
\fIversion\fP is just an ascii string for the libcurl version. \fIversion\fP is just an ascii string for the libcurl version.
@@ -149,10 +149,6 @@ libcurl was built with support for HTTP2.
.IP CURL_VERSION_UNIX_SOCKETS .IP CURL_VERSION_UNIX_SOCKETS
libcurl was built with support for Unix domain sockets. libcurl was built with support for Unix domain sockets.
(Added in 7.40.0) (Added in 7.40.0)
.IP CURL_VERSION_PSL
libcurl was built with support for Mozilla's Public Suffix List. This makes
libcurl ignore cookies with a domain that's on the list.
(Added in 7.47.0)
.RE .RE
\fIssl_version\fP is an ASCII string for the OpenSSL version used. If libcurl \fIssl_version\fP is an ASCII string for the OpenSSL version used. If libcurl
has no SSL support, this is NULL. has no SSL support, this is NULL.

View File

@@ -194,9 +194,6 @@ object as the program starts up and the destructor as it terminates. As the
author of this libcurl-using module, you can make the constructor call author of this libcurl-using module, you can make the constructor call
\fIcurl_global_init(3)\fP and the destructor call \fIcurl_global_cleanup(3)\fP \fIcurl_global_init(3)\fP and the destructor call \fIcurl_global_cleanup(3)\fP
and satisfy libcurl's requirements without your user having to think about it. and satisfy libcurl's requirements without your user having to think about it.
(Caveat: If you are initializing libcurl from a Windows DLL you should not
initialize it from DllMain or a static initializer because Windows holds the
loader lock during that time and it could cause a deadlock.)
\fIcurl_global_init(3)\fP has an argument that tells what particular parts of \fIcurl_global_init(3)\fP has an argument that tells what particular parts of
the global constant environment to set up. In order to successfully use any the global constant environment to set up. In order to successfully use any

View File

@@ -38,19 +38,7 @@ Support for SMTP responses added in 7.25.0.
.SH PROTOCOLS .SH PROTOCOLS
HTTP, FTP and SMTP HTTP, FTP and SMTP
.SH EXAMPLE .SH EXAMPLE
.nf TODO
CURL *curl = curl_easy_init();
if(curl) {
CURLcode res;
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
res = curl_easy_perform(curl);
if(res == CURLE_OK) {
long response_code;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code);
}
curl_easy_cleanup(curl);
}
.fi
.SH AVAILABILITY .SH AVAILABILITY
Added in 7.10.8. CURLINFO_HTTP_CODE was added in 7.4.1. Added in 7.10.8. CURLINFO_HTTP_CODE was added in 7.4.1.
.SH RETURN VALUE .SH RETURN VALUE

View File

@@ -85,7 +85,7 @@ static size_t header_callback(char *buffer, size_t size,
size_t nitems, void *userdata) size_t nitems, void *userdata)
{ {
/* received header is nitems * size long in 'buffer' NOT ZERO TERMINATED */ /* received header is nitems * size long in 'buffer' NOT ZERO TERMINATED */
/* 'userdata' is set with CURLOPT_HEADERDATA */ /* 'userdata' is set with CURLOPT_WRITEDATA */
return nitems * size; return nitems * size;
} }

View File

@@ -45,15 +45,8 @@ Enforce HTTP 1.0 requests.
.IP CURL_HTTP_VERSION_1_1 .IP CURL_HTTP_VERSION_1_1
Enforce HTTP 1.1 requests. Enforce HTTP 1.1 requests.
.IP CURL_HTTP_VERSION_2_0 .IP CURL_HTTP_VERSION_2_0
Attempt HTTP 2 requests. libcurl will fall back to HTTP 1.1 if HTTP 2 can't be Attempt HTTP 2 requests. libcurl will fall back to HTTP 1.x if HTTP 2 can't be
negotiated with the server. (Added in 7.33.0) negotiated with the server. (Added in 7.33.0)
The alias \fICURL_HTTP_VERSION_2\fI was added in 7.43.0 to better reflect the
actual protocol name.
.IP CURL_HTTP_VERSION_2TLS
Attempt HTTP 2 over TLS (HTTPS) only. libcurl will fall back to HTTP 1.1 if
HTTP 2 can't be negotiated with the HTTPS server. For clear text HTTP servers,
libcurl will use 1.1. (Added in 7.47.0)
.SH DEFAULT .SH DEFAULT
CURL_HTTP_VERSION_NONE CURL_HTTP_VERSION_NONE
.SH PROTOCOLS .SH PROTOCOLS

View File

@@ -91,9 +91,8 @@ footer:
.fi .fi
.SH AVAILABILITY .SH AVAILABILITY
Added in 7.39.0 for OpenSSL, GnuTLS and GSKit. Added in 7.43.0 for Added in 7.39.0 for OpenSSL, GnuTLS and GSKit. Added in 7.43.0 for
NSS and wolfSSL/CyaSSL. Added for mbedtls in 7.47.0, sha256 support NSS and wolfSSL/CyaSSL. sha256 support added in 7.44.0 for OpenSSL,
added in 7.44.0 for OpenSSL, GnuTLS, NSS and wolfSSL/CyaSSL. Other GnuTLS, NSS and wolfSSL/CyaSSL. Other SSL backends not supported.
SSL backends not supported.
.SH RETURN VALUE .SH RETURN VALUE
Returns CURLE_OK if TLS enabled, CURLE_UNKNOWN_OPTION if not, or Returns CURLE_OK if TLS enabled, CURLE_UNKNOWN_OPTION if not, or
CURLE_OUT_OF_MEMORY if there was insufficient heap space. CURLE_OUT_OF_MEMORY if there was insufficient heap space.

View File

@@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___ .\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____| .\" * \___|\___/|_| \_\_____|
.\" * .\" *
.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. .\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" * .\" *
.\" * This software is licensed as described in the file COPYING, which .\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms .\" * you should have received as part of this distribution. The terms
@@ -35,13 +35,9 @@ out and X and Y are byte indexes.
HTTP transfers also support several intervals, separated with commas as in HTTP transfers also support several intervals, separated with commas as in
\fI"X-Y,N-M"\fP. Using this kind of multiple intervals will cause the HTTP \fI"X-Y,N-M"\fP. Using this kind of multiple intervals will cause the HTTP
server to send the response document in pieces (using standard MIME separation server to send the response document in pieces (using standard MIME separation
techniques). Unfortunately, the HTTP standard (RFC 7233 section 3.1) allows techniques). For RTSP, the formatting of a range should follow RFC2326 Section
servers to ignore range requests so even when you set \fICURLOPT_RANGE\fP for 12.29. For RTSP, byte ranges are \fBnot\fP permitted. Instead, ranges should
a request, you may end up getting the full response sent back. be given in npt, utc, or smpte formats.
For RTSP, the formatting of a range should follow RFC2326 Section 12.29. For
RTSP, byte ranges are \fBnot\fP permitted. Instead, ranges should be given in
npt, utc, or smpte formats.
Pass a NULL to this option to disable the use of ranges. Pass a NULL to this option to disable the use of ranges.
.SH DEFAULT .SH DEFAULT

View File

@@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___ .\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____| .\" * \___|\___/|_| \_\_____|
.\" * .\" *
.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. .\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" * .\" *
.\" * This software is licensed as described in the file COPYING, which .\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms .\" * you should have received as part of this distribution. The terms
@@ -44,14 +44,15 @@ ADDRESS can of course be either IPv4 or IPv6 style addressing.
This option effectively pre-populates the DNS cache with entries for the This option effectively pre-populates the DNS cache with entries for the
host+port pair so redirects and everything that operations against the host+port pair so redirects and everything that operations against the
HOST+PORT will instead use your provided ADDRESS. Addresses set with HOST+PORT will instead use your provided ADDRESS. Addresses to set with
\fICURL_RESOLVE\fP will not time-out from the DNS cache like ordinary entries. \fICURL_RESOLVE\fP will not time-out from the DNS cache like ordinary
entries.
Remove names from the DNS cache again, to stop providing these fake resolves, You can remove names from the DNS cache again, to stop providing these fake
by including a string in the linked list that uses the format resolves, by including a string in the linked list that uses the format
\&"-HOST:PORT". The host name must be prefixed with a dash, and the host name \&"-HOST:PORT". The host name must be prefixed with a dash, and the host name
and port number must exactly match what was already added previously. (Added and port number must exactly match what was already added previously. (Added in
in 7.42.0) 7.42.0)
.SH DEFAULT .SH DEFAULT
NULL NULL
.SH PROTOCOLS .SH PROTOCOLS

View File

@@ -35,11 +35,11 @@ libcurl defaults to \fB$HOME/.ssh/id_dsa.pub\fP if the HOME environment
variable is set, and just "id_dsa.pub" in the current directory if HOME is not variable is set, and just "id_dsa.pub" in the current directory if HOME is not
set. set.
If NULL (or an empty string) is passed, libcurl will pass no public key to If an empty string is passed, libcurl will pass no public key to libssh2 which
libssh2, which then tries to compute it from the private key. This is known then tries to compute it from the private key, this is known to work when
to work with libssh2 1.4.0+ linked against OpenSSL. libssh2 1.4.0+ is linked against OpenSSL.
.SH DEFAULT .SH DEFAULT
NULL As explained above
.SH PROTOCOLS .SH PROTOCOLS
SFTP and SCP SFTP and SCP
.SH EXAMPLE .SH EXAMPLE

View File

@@ -237,6 +237,7 @@ CURLINFO_PRIMARY_IP 7.19.0
CURLINFO_PRIMARY_PORT 7.21.0 CURLINFO_PRIMARY_PORT 7.21.0
CURLINFO_PRIVATE 7.10.3 CURLINFO_PRIVATE 7.10.3
CURLINFO_PROXYAUTH_AVAIL 7.10.8 CURLINFO_PROXYAUTH_AVAIL 7.10.8
CURLINFO_PROXY_SSL_VERIFYRESULT 7.44.0
CURLINFO_REDIRECT_COUNT 7.9.7 CURLINFO_REDIRECT_COUNT 7.9.7
CURLINFO_REDIRECT_TIME 7.9.7 CURLINFO_REDIRECT_TIME 7.9.7
CURLINFO_REDIRECT_URL 7.18.2 CURLINFO_REDIRECT_URL 7.18.2
@@ -462,7 +463,23 @@ CURLOPT_PROXYPORT 7.1
CURLOPT_PROXYTYPE 7.10 CURLOPT_PROXYTYPE 7.10
CURLOPT_PROXYUSERNAME 7.19.1 CURLOPT_PROXYUSERNAME 7.19.1
CURLOPT_PROXYUSERPWD 7.1 CURLOPT_PROXYUSERPWD 7.1
CURLOPT_PROXY_CAINFO 7.44.0
CURLOPT_PROXY_CAPATH 7.44.0
CURLOPT_PROXY_CRLFILE 7.44.0
CURLOPT_PROXY_KEYPASSWD 7.44.0
CURLOPT_PROXY_SERVICE_NAME 7.43.0 CURLOPT_PROXY_SERVICE_NAME 7.43.0
CURLOPT_PROXY_SSLCERT 7.44.0
CURLOPT_PROXY_SSLCERTTYPE 7.44.0
CURLOPT_PROXY_SSLKEY 7.44.0
CURLOPT_PROXY_SSLKEYTYPE 7.44.0
CURLOPT_PROXY_SSLVERSION 7.44.0
CURLOPT_PROXY_SSL_CIPHER_LIST 7.44.0
CURLOPT_PROXY_SSL_OPTIONS 7.44.0
CURLOPT_PROXY_SSL_VERIFYHOST 7.44.0
CURLOPT_PROXY_SSL_VERIFYPEER 7.44.0
CURLOPT_PROXY_TLSAUTH_PASSWORD 7.44.0
CURLOPT_PROXY_TLSAUTH_TYPE 7.44.0
CURLOPT_PROXY_TLSAUTH_USERNAME 7.44.0
CURLOPT_PROXY_TRANSFER_MODE 7.18.0 CURLOPT_PROXY_TRANSFER_MODE 7.18.0
CURLOPT_PUT 7.1 CURLOPT_PUT 7.1
CURLOPT_QUOTE 7.1 CURLOPT_QUOTE 7.1
@@ -492,6 +509,8 @@ CURLOPT_SOCKOPTDATA 7.16.0
CURLOPT_SOCKOPTFUNCTION 7.16.0 CURLOPT_SOCKOPTFUNCTION 7.16.0
CURLOPT_SOCKS5_GSSAPI_NEC 7.19.4 CURLOPT_SOCKS5_GSSAPI_NEC 7.19.4
CURLOPT_SOCKS5_GSSAPI_SERVICE 7.19.4 CURLOPT_SOCKS5_GSSAPI_SERVICE 7.19.4
CURLOPT_SOCKS_PROXY 7.44.0
CURLOPT_SOCKS_PROXYTYPE 7.44.0
CURLOPT_SOURCE_HOST 7.12.1 - 7.15.5 CURLOPT_SOURCE_HOST 7.12.1 - 7.15.5
CURLOPT_SOURCE_PATH 7.12.1 - 7.15.5 CURLOPT_SOURCE_PATH 7.12.1 - 7.15.5
CURLOPT_SOURCE_PORT 7.12.1 - 7.15.5 CURLOPT_SOURCE_PORT 7.12.1 - 7.15.5
@@ -603,6 +622,7 @@ CURLPROTO_TELNET 7.19.4
CURLPROTO_TFTP 7.19.4 CURLPROTO_TFTP 7.19.4
CURLPROXY_HTTP 7.10 CURLPROXY_HTTP 7.10
CURLPROXY_HTTP_1_0 7.19.4 CURLPROXY_HTTP_1_0 7.19.4
CURLPROXY_HTTPS 7.44.0
CURLPROXY_SOCKS4 7.10 CURLPROXY_SOCKS4 7.10
CURLPROXY_SOCKS4A 7.18.0 CURLPROXY_SOCKS4A 7.18.0
CURLPROXY_SOCKS5 7.10 CURLPROXY_SOCKS5 7.10
@@ -692,7 +712,6 @@ CURL_HTTP_VERSION_1_0 7.9.1
CURL_HTTP_VERSION_1_1 7.9.1 CURL_HTTP_VERSION_1_1 7.9.1
CURL_HTTP_VERSION_2 7.43.0 CURL_HTTP_VERSION_2 7.43.0
CURL_HTTP_VERSION_2_0 7.33.0 CURL_HTTP_VERSION_2_0 7.33.0
CURL_HTTP_VERSION_2TLS 7.47.0
CURL_HTTP_VERSION_NONE 7.9.1 CURL_HTTP_VERSION_NONE 7.9.1
CURL_IPRESOLVE_V4 7.10.8 CURL_IPRESOLVE_V4 7.10.8
CURL_IPRESOLVE_V6 7.10.8 CURL_IPRESOLVE_V6 7.10.8
@@ -780,7 +799,6 @@ CURL_VERSION_LARGEFILE 7.11.1
CURL_VERSION_LIBZ 7.10 CURL_VERSION_LIBZ 7.10
CURL_VERSION_NTLM 7.10.6 CURL_VERSION_NTLM 7.10.6
CURL_VERSION_NTLM_WB 7.22.0 CURL_VERSION_NTLM_WB 7.22.0
CURL_VERSION_PSL 7.47.0
CURL_VERSION_SPNEGO 7.10.8 CURL_VERSION_SPNEGO 7.10.8
CURL_VERSION_SSL 7.10 CURL_VERSION_SSL 7.10
CURL_VERSION_SSPI 7.13.2 CURL_VERSION_SSPI 7.13.2

View File

@@ -56,8 +56,7 @@
#include <time.h> #include <time.h>
#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__) #if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__)
#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || \ #if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || defined(__LWIP_OPT_H__))
defined(__LWIP_OPT_H__) || defined(LWIP_HDR_OPT_H))
/* The check above prevents the winsock2 inclusion if winsock.h already was /* The check above prevents the winsock2 inclusion if winsock.h already was
included, since they can't co-exist without problems */ included, since they can't co-exist without problems */
#include <winsock2.h> #include <winsock2.h>
@@ -113,7 +112,7 @@ typedef void CURL;
#ifndef curl_socket_typedef #ifndef curl_socket_typedef
/* socket typedef */ /* socket typedef */
#if defined(WIN32) && !defined(__LWIP_OPT_H__) && !defined(LWIP_HDR_OPT_H) #if defined(WIN32) && !defined(__LWIP_OPT_H__)
typedef SOCKET curl_socket_t; typedef SOCKET curl_socket_t;
#define CURL_SOCKET_BAD INVALID_SOCKET #define CURL_SOCKET_BAD INVALID_SOCKET
#else #else
@@ -623,6 +622,7 @@ typedef enum {
CONNECT HTTP/1.1 */ CONNECT HTTP/1.1 */
CURLPROXY_HTTP_1_0 = 1, /* added in 7.19.4, force to use CONNECT CURLPROXY_HTTP_1_0 = 1, /* added in 7.19.4, force to use CONNECT
HTTP/1.0 */ HTTP/1.0 */
CURLPROXY_HTTPS = 2, /* added in TBD */
CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already
in 7.10 */ in 7.10 */
CURLPROXY_SOCKS5 = 5, /* added in 7.10 */ CURLPROXY_SOCKS5 = 5, /* added in 7.10 */
@@ -1189,7 +1189,8 @@ typedef enum {
CINIT(SHARE, OBJECTPOINT, 100), CINIT(SHARE, OBJECTPOINT, 100),
/* indicates type of proxy. accepted values are CURLPROXY_HTTP (default), /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default),
CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5. */ CURLPROXY_HTTPS, CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and
CURLPROXY_SOCKS5. */
CINIT(PROXYTYPE, LONG, 101), CINIT(PROXYTYPE, LONG, 101),
/* Set the Accept-Encoding string. Use this to tell a server you would like /* Set the Accept-Encoding string. Use this to tell a server you would like
@@ -1673,6 +1674,70 @@ typedef enum {
/* Set E-xclusive stream dependency on another CURL handle */ /* Set E-xclusive stream dependency on another CURL handle */
CINIT(STREAM_DEPENDS_E, OBJECTPOINT, 241), CINIT(STREAM_DEPENDS_E, OBJECTPOINT, 241),
/* The CApath or CAfile used to validate the proxy certificate
this option is used only if PROXY_SSL_VERIFYPEER is true */
CINIT(PROXY_CAINFO, STRINGPOINT, 242),
/* The CApath directory used to validate the proxy certificate
this option is used only if PROXY_SSL_VERIFYPEER is true */
CINIT(PROXY_CAPATH, STRINGPOINT, 243),
/* Set if we should verify the proxy in ssl handshake,
set 1 to verify. */
CINIT(PROXY_SSL_VERIFYPEER, LONG, 244),
/* Set if we should verify the Common name from the proxy certificate in ssl
* handshake, set 1 to check existence, 2 to ensure that it matches
* the provided hostname. */
CINIT(PROXY_SSL_VERIFYHOST, LONG, 245),
/* What version to specifically try to use for proxy.
See CURL_SSLVERSION defines below. */
CINIT(PROXY_SSLVERSION, LONG, 246),
/* Set a username for authenticated TLS for proxy */
CINIT(PROXY_TLSAUTH_USERNAME, STRINGPOINT, 247),
/* Set a password for authenticated TLS for proxy */
CINIT(PROXY_TLSAUTH_PASSWORD, STRINGPOINT, 248),
/* Set authentication type for authenticated TLS for proxy */
CINIT(PROXY_TLSAUTH_TYPE, STRINGPOINT, 249),
/* name of the file keeping your private SSL-certificate for proxy */
CINIT(PROXY_SSLCERT, STRINGPOINT, 250),
/* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") for
proxy */
CINIT(PROXY_SSLCERTTYPE, STRINGPOINT, 251),
/* name of the file keeping your private SSL-key for proxy */
CINIT(PROXY_SSLKEY, STRINGPOINT, 252),
/* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") for
proxy */
CINIT(PROXY_SSLKEYTYPE, STRINGPOINT, 253),
/* password for the SSL private key for proxy */
CINIT(PROXY_KEYPASSWD, STRINGPOINT, 254),
/* Specify which SSL ciphers to use for proxy */
CINIT(PROXY_SSL_CIPHER_LIST, STRINGPOINT, 255),
/* CRL file for proxy */
CINIT(PROXY_CRLFILE, STRINGPOINT, 256),
/* Enable/disable specific SSL features with a bitmask for proxy, see
CURLSSLOPT_* */
CINIT(PROXY_SSL_OPTIONS, LONG, 257),
/* Name of socks proxy to use. */
CINIT(SOCKS_PROXY, STRINGPOINT, 258),
/* indicates type of proxy. accepted values are CURLPROXY_SOCKS4,
CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5. */
CINIT(SOCKS_PROXYTYPE, LONG, 259),
CURLOPT_LASTENTRY /* the last unused */ CURLOPT_LASTENTRY /* the last unused */
} CURLoption; } CURLoption;
@@ -1722,8 +1787,7 @@ enum {
for us! */ for us! */
CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */ CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */
CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */ CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */
CURL_HTTP_VERSION_2_0, /* please use HTTP 2 in the request */ CURL_HTTP_VERSION_2_0, /* please use HTTP 2.0 in the request */
CURL_HTTP_VERSION_2TLS, /* use version 2 for HTTPS, version 1.1 for HTTP */
CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */ CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */
}; };
@@ -2169,9 +2233,10 @@ typedef enum {
CURLINFO_LOCAL_PORT = CURLINFO_LONG + 42, CURLINFO_LOCAL_PORT = CURLINFO_LONG + 42,
CURLINFO_TLS_SESSION = CURLINFO_SLIST + 43, CURLINFO_TLS_SESSION = CURLINFO_SLIST + 43,
CURLINFO_ACTIVESOCKET = CURLINFO_SOCKET + 44, CURLINFO_ACTIVESOCKET = CURLINFO_SOCKET + 44,
CURLINFO_PROXY_SSL_VERIFYRESULT = CURLINFO_LONG + 45,
/* Fill in new entries below here! */ /* Fill in new entries below here! */
CURLINFO_LASTONE = 44 CURLINFO_LASTONE = 45
} CURLINFO; } CURLINFO;
/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as /* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
@@ -2331,8 +2396,6 @@ typedef struct {
#define CURL_VERSION_GSSAPI (1<<17) /* Built against a GSS-API library */ #define CURL_VERSION_GSSAPI (1<<17) /* Built against a GSS-API library */
#define CURL_VERSION_KERBEROS5 (1<<18) /* Kerberos V5 auth is supported */ #define CURL_VERSION_KERBEROS5 (1<<18) /* Kerberos V5 auth is supported */
#define CURL_VERSION_UNIX_SOCKETS (1<<19) /* Unix domain sockets support */ #define CURL_VERSION_UNIX_SOCKETS (1<<19) /* Unix domain sockets support */
#define CURL_VERSION_PSL (1<<20) /* Mozilla's Public Suffix List, used
for cookie domain verification */
/* /*
* NAME curl_version_info() * NAME curl_version_info()

View File

@@ -30,12 +30,12 @@
/* This is the version number of the libcurl package from which this header /* This is the version number of the libcurl package from which this header
file origins: */ file origins: */
#define LIBCURL_VERSION "7.47.0-DEV" #define LIBCURL_VERSION "7.46.0-DEV"
/* The numeric version number is also available "in parts" by using these /* The numeric version number is also available "in parts" by using these
defines: */ defines: */
#define LIBCURL_VERSION_MAJOR 7 #define LIBCURL_VERSION_MAJOR 7
#define LIBCURL_VERSION_MINOR 47 #define LIBCURL_VERSION_MINOR 46
#define LIBCURL_VERSION_PATCH 0 #define LIBCURL_VERSION_PATCH 0
/* This is the numeric version of the libcurl version number, meant for easier /* This is the numeric version of the libcurl version number, meant for easier
@@ -57,7 +57,7 @@
CURL_VERSION_BITS() macro since curl's own configure script greps for it CURL_VERSION_BITS() macro since curl's own configure script greps for it
and needs it to contain the full number. and needs it to contain the full number.
*/ */
#define LIBCURL_VERSION_NUM 0x072F00 #define LIBCURL_VERSION_NUM 0x072E00
/* /*
* This is the date and time when the full source package was created. The * This is the date and time when the full source package was created. The

View File

@@ -416,7 +416,6 @@ CURLcode Curl_resolver_wait_resolv(struct connectdata *conn,
if(result) if(result)
/* close the connection, since we can't return failure here without /* close the connection, since we can't return failure here without
cleaning up this connection properly. cleaning up this connection properly.
TODO: remove this action from here, it is not a name resolver decision.
*/ */
connclose(conn, "c-ares resolve failed"); connclose(conn, "c-ares resolve failed");

View File

@@ -627,8 +627,7 @@ Vista
/* Define if struct sockaddr_in6 has the sin6_scope_id member. */ /* Define if struct sockaddr_in6 has the sin6_scope_id member. */
#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
#if defined(HAVE_WINSOCK2_H) && defined(_WIN32_WINNT) && \ #if HAVE_WINSOCK2_H && defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0600)
(_WIN32_WINNT >= 0x0600)
#define HAVE_STRUCT_POLLFD 1 #define HAVE_STRUCT_POLLFD 1
#endif #endif

View File

@@ -133,7 +133,9 @@ void Curl_conncache_destroy(struct conncache *connc)
static char *hashkey(struct connectdata *conn) static char *hashkey(struct connectdata *conn)
{ {
return aprintf("%s:%d", return aprintf("%s:%d",
conn->bits.proxy?conn->proxy.name:conn->host.name, conn->bits.socksproxy ? conn->socks_proxy.host.name :
conn->bits.httpproxy ? conn->http_proxy.host.name :
conn->host.name,
conn->localport); conn->localport);
} }

View File

@@ -850,7 +850,8 @@ CURLcode Curl_is_connected(struct connectdata *conn,
} }
failf(data, "Failed to connect to %s port %ld: %s", failf(data, "Failed to connect to %s port %ld: %s",
conn->bits.proxy?conn->proxy.name:conn->host.name, conn->bits.socksproxy ? conn->socks_proxy.host.name :
conn->bits.httpproxy ? conn->http_proxy.host.name : conn->host.name,
conn->port, Curl_strerror(conn, error)); conn->port, Curl_strerror(conn, error));
} }

View File

@@ -521,11 +521,7 @@ void
curl_dofreeaddrinfo(struct addrinfo *freethis, curl_dofreeaddrinfo(struct addrinfo *freethis,
int line, const char *source) int line, const char *source)
{ {
#ifdef USE_LWIPSOCK
lwip_freeaddrinfo(freethis);
#else
(freeaddrinfo)(freethis); (freeaddrinfo)(freethis);
#endif
curl_memlog("ADDR %s:%d freeaddrinfo(%p)\n", curl_memlog("ADDR %s:%d freeaddrinfo(%p)\n",
source, line, (void *)freethis); source, line, (void *)freethis);
} }
@@ -548,11 +544,7 @@ curl_dogetaddrinfo(const char *hostname,
struct addrinfo **result, struct addrinfo **result,
int line, const char *source) int line, const char *source)
{ {
#ifdef USE_LWIPSOCK
int res=lwip_getaddrinfo(hostname, service, hints, result);
#else
int res=(getaddrinfo)(hostname, service, hints, result); int res=(getaddrinfo)(hostname, service, hints, result);
#endif
if(0 == res) if(0 == res)
/* success */ /* success */
curl_memlog("ADDR %s:%d getaddrinfo() = %p\n", curl_memlog("ADDR %s:%d getaddrinfo() = %p\n",

View File

@@ -83,8 +83,7 @@ Curl_addrinfo *Curl_str2addr(char *dotted, int port);
Curl_addrinfo *Curl_unix2addr(const char *path); Curl_addrinfo *Curl_unix2addr(const char *path);
#endif #endif
#if defined(CURLDEBUG) && defined(HAVE_GETADDRINFO) && \ #if defined(CURLDEBUG) && defined(HAVE_FREEADDRINFO)
defined(HAVE_FREEADDRINFO)
void void
curl_dofreeaddrinfo(struct addrinfo *freethis, curl_dofreeaddrinfo(struct addrinfo *freethis,
int line, const char *source); int line, const char *source);

View File

@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -39,7 +39,7 @@
* *
* File lib/strdup.c is an exception, given that it provides a strdup * File lib/strdup.c is an exception, given that it provides a strdup
* clone implementation while using malloc. Extra care needed inside * clone implementation while using malloc. Extra care needed inside
* this one. TODO: revisit this paragraph and related code. * this one.
* *
* The need for curl_memory.h inclusion is due to libcurl's feature * The need for curl_memory.h inclusion is due to libcurl's feature
* of allowing library user to provide memory replacement functions, * of allowing library user to provide memory replacement functions,

View File

@@ -137,8 +137,8 @@ CURLcode Curl_output_ntlm(struct connectdata *conn, bool proxy)
if(proxy) { if(proxy) {
allocuserpwd = &conn->allocptr.proxyuserpwd; allocuserpwd = &conn->allocptr.proxyuserpwd;
userp = conn->proxyuser; userp = conn->http_proxy.user;
passwdp = conn->proxypasswd; passwdp = conn->http_proxy.passwd;
ntlm = &conn->proxyntlm; ntlm = &conn->proxyntlm;
authp = &conn->data->state.authproxy; authp = &conn->data->state.authproxy;
} }

View File

@@ -350,7 +350,7 @@ CURLcode Curl_output_ntlm_wb(struct connectdata *conn,
if(proxy) { if(proxy) {
allocuserpwd = &conn->allocptr.proxyuserpwd; allocuserpwd = &conn->allocptr.proxyuserpwd;
userp = conn->proxyuser; userp = conn->http_proxy.user;
ntlm = &conn->proxyntlm; ntlm = &conn->proxyntlm;
authp = &conn->data->state.authproxy; authp = &conn->data->state.authproxy;
} }

View File

@@ -481,10 +481,9 @@
/* /*
* msvc 6.0 requires PSDK in order to have INET6_ADDRSTRLEN * msvc 6.0 requires PSDK in order to have INET6_ADDRSTRLEN
* defined in ws2tcpip.h as well as to provide IPv6 support. * defined in ws2tcpip.h as well as to provide IPv6 support.
* Does not apply if lwIP is used.
*/ */
#if defined(_MSC_VER) && !defined(__POCC__) && !defined(USE_LWIPSOCK) #if defined(_MSC_VER) && !defined(__POCC__)
# if !defined(HAVE_WS2TCPIP_H) || \ # if !defined(HAVE_WS2TCPIP_H) || \
((_MSC_VER < 1300) && !defined(INET6_ADDRSTRLEN)) ((_MSC_VER < 1300) && !defined(INET6_ADDRSTRLEN))
# undef HAVE_GETADDRINFO_THREADSAFE # undef HAVE_GETADDRINFO_THREADSAFE
@@ -528,7 +527,6 @@
# define CURLRES_ARES # define CURLRES_ARES
/* now undef the stock libc functions just to avoid them being used */ /* now undef the stock libc functions just to avoid them being used */
# undef HAVE_GETADDRINFO # undef HAVE_GETADDRINFO
# undef HAVE_FREEADDRINFO
# undef HAVE_GETHOSTBYNAME # undef HAVE_GETHOSTBYNAME
#elif defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32) #elif defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32)
# define CURLRES_ASYNCH # define CURLRES_ASYNCH
@@ -676,7 +674,7 @@ int netware_init(void);
* Ensure that Winsock and lwIP TCP/IP stacks are not mixed. * Ensure that Winsock and lwIP TCP/IP stacks are not mixed.
*/ */
#if defined(__LWIP_OPT_H__) || defined(LWIP_HDR_OPT_H) #if defined(__LWIP_OPT_H__)
# if defined(SOCKET) || \ # if defined(SOCKET) || \
defined(USE_WINSOCK) || \ defined(USE_WINSOCK) || \
defined(HAVE_WINSOCK_H) || \ defined(HAVE_WINSOCK_H) || \

View File

@@ -646,7 +646,7 @@ static CURLcode wait_or_timeout(struct Curl_multi *multi, struct events *ev)
return CURLE_RECV_ERROR; return CURLE_RECV_ERROR;
if(mcode) if(mcode)
return CURLE_URL_MALFORMAT; /* TODO: return a proper error! */ return CURLE_URL_MALFORMAT;
/* we don't really care about the "msgs_in_queue" value returned in the /* we don't really care about the "msgs_in_queue" value returned in the
second argument */ second argument */

View File

@@ -830,26 +830,19 @@ static CURLcode AddFormData(struct FormData **formp,
return CURLE_OUT_OF_MEMORY; return CURLE_OUT_OF_MEMORY;
newform->next = NULL; newform->next = NULL;
if(length < 0 || (size && *size < 0))
return CURLE_BAD_FUNCTION_ARGUMENT;
if(type <= FORM_CONTENT) { if(type <= FORM_CONTENT) {
/* we make it easier for plain strings: */ /* we make it easier for plain strings: */
if(!length) if(!length)
length = strlen((char *)line); length = strlen((char *)line);
#if (SIZEOF_SIZE_T < CURL_SIZEOF_CURL_OFF_T)
else if(length >= (curl_off_t)(size_t)-1)
return CURLE_BAD_FUNCTION_ARGUMENT;
#endif
newform->line = malloc((size_t)length+1); newform->line = malloc(length+1);
if(!newform->line) { if(!newform->line) {
free(newform); free(newform);
return CURLE_OUT_OF_MEMORY; return CURLE_OUT_OF_MEMORY;
} }
memcpy(newform->line, line, (size_t)length); memcpy(newform->line, line, length);
newform->length = (size_t)length; newform->length = length;
newform->line[(size_t)length]=0; /* zero terminate for easier debugging */ newform->line[length]=0; /* zero terminate for easier debugging */
} }
else else
/* For callbacks and files we don't have any actual data so we just keep a /* For callbacks and files we don't have any actual data so we just keep a

130
lib/ftp.c
View File

@@ -491,7 +491,7 @@ static CURLcode InitiateTransfer(struct connectdata *conn)
struct FTP *ftp = data->req.protop; struct FTP *ftp = data->req.protop;
CURLcode result = CURLE_OK; CURLcode result = CURLE_OK;
if(conn->ssl[SECONDARYSOCKET].use) { if(conn->bits.ftp_use_data_ssl) {
/* since we only have a plaintext TCP connection here, we must now /* since we only have a plaintext TCP connection here, we must now
* do the TLS stuff */ * do the TLS stuff */
infof(data, "Doing the SSL/TLS handshake on the data stream\n"); infof(data, "Doing the SSL/TLS handshake on the data stream\n");
@@ -732,7 +732,7 @@ CURLcode Curl_GetFTPResponse(ssize_t *nreadp, /* return number of bytes read */
* wait for more data anyway. * wait for more data anyway.
*/ */
} }
else { else if(!Curl_ssl_data_pending(conn, FIRSTSOCKET)) {
switch (Curl_socket_ready(sockfd, CURL_SOCKET_BAD, interval_ms)) { switch (Curl_socket_ready(sockfd, CURL_SOCKET_BAD, interval_ms)) {
case -1: /* select() error, stop reading */ case -1: /* select() error, stop reading */
failf(data, "FTP response aborted due to select/poll error: %d", failf(data, "FTP response aborted due to select/poll error: %d",
@@ -1842,84 +1842,6 @@ static CURLcode ftp_epsv_disable(struct connectdata *conn)
return result; return result;
} }
/*
* Perform the necessary magic that needs to be done once the TCP connection
* to the proxy has completed.
*/
static CURLcode proxy_magic(struct connectdata *conn,
char *newhost, unsigned short newport,
bool *magicdone)
{
CURLcode result = CURLE_OK;
struct SessionHandle *data = conn->data;
#if defined(CURL_DISABLE_PROXY)
(void) newhost;
(void) newport;
#endif
*magicdone = FALSE;
switch(conn->proxytype) {
case CURLPROXY_SOCKS5:
case CURLPROXY_SOCKS5_HOSTNAME:
result = Curl_SOCKS5(conn->proxyuser, conn->proxypasswd, newhost,
newport, SECONDARYSOCKET, conn);
*magicdone = TRUE;
break;
case CURLPROXY_SOCKS4:
result = Curl_SOCKS4(conn->proxyuser, newhost, newport,
SECONDARYSOCKET, conn, FALSE);
*magicdone = TRUE;
break;
case CURLPROXY_SOCKS4A:
result = Curl_SOCKS4(conn->proxyuser, newhost, newport,
SECONDARYSOCKET, conn, TRUE);
*magicdone = TRUE;
break;
case CURLPROXY_HTTP:
case CURLPROXY_HTTP_1_0:
/* do nothing here. handled later. */
break;
default:
failf(data, "unknown proxytype option given");
result = CURLE_COULDNT_CONNECT;
break;
}
if(conn->bits.tunnel_proxy && conn->bits.httpproxy) {
/* BLOCKING */
/* We want "seamless" FTP operations through HTTP proxy tunnel */
/* Curl_proxyCONNECT is based on a pointer to a struct HTTP at the
* member conn->proto.http; we want FTP through HTTP and we have to
* change the member temporarily for connecting to the HTTP proxy. After
* Curl_proxyCONNECT we have to set back the member to the original
* struct FTP pointer
*/
struct HTTP http_proxy;
struct FTP *ftp_save = data->req.protop;
memset(&http_proxy, 0, sizeof(http_proxy));
data->req.protop = &http_proxy;
result = Curl_proxyCONNECT(conn, SECONDARYSOCKET, newhost, newport, TRUE);
data->req.protop = ftp_save;
if(result)
return result;
if(conn->tunnel_state[SECONDARYSOCKET] != TUNNEL_COMPLETE) {
/* the CONNECT procedure is not complete, the tunnel is not yet up */
state(conn, FTP_STOP); /* this phase is completed */
return result;
}
else
*magicdone = TRUE;
}
return result;
}
static char *control_address(struct connectdata *conn) static char *control_address(struct connectdata *conn)
{ {
@@ -1927,11 +1849,7 @@ static char *control_address(struct connectdata *conn)
If a proxy tunnel is used, returns the original host name instead, because If a proxy tunnel is used, returns the original host name instead, because
the effective control connection address is the proxy address, the effective control connection address is the proxy address,
not the ftp host. */ not the ftp host. */
if(conn->bits.tunnel_proxy || if(conn->bits.tunnel_proxy || conn->bits.socksproxy)
conn->proxytype == CURLPROXY_SOCKS5 ||
conn->proxytype == CURLPROXY_SOCKS5_HOSTNAME ||
conn->proxytype == CURLPROXY_SOCKS4 ||
conn->proxytype == CURLPROXY_SOCKS4A)
return conn->host.name; return conn->host.name;
return conn->ip_addr_str; return conn->ip_addr_str;
@@ -2055,7 +1973,9 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
* here. We don't want to rely on a former host lookup that might've * here. We don't want to rely on a former host lookup that might've
* expired now, instead we remake the lookup here and now! * expired now, instead we remake the lookup here and now!
*/ */
rc = Curl_resolv(conn, conn->proxy.name, (int)conn->port, &addr); const char * const host_name = conn->bits.socksproxy ?
conn->socks_proxy.host.name : conn->http_proxy.host.name;
rc = Curl_resolv(conn, host_name, (int)conn->port, &addr);
if(rc == CURLRESOLV_PENDING) if(rc == CURLRESOLV_PENDING)
/* BLOCKING, ignores the return code but 'addr' will be NULL in /* BLOCKING, ignores the return code but 'addr' will be NULL in
case of failure */ case of failure */
@@ -2065,8 +1985,7 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
(unsigned short)conn->port; /* we connect to the proxy's port */ (unsigned short)conn->port; /* we connect to the proxy's port */
if(!addr) { if(!addr) {
failf(data, "Can't resolve proxy host %s:%hu", failf(data, "Can't resolve proxy host %s:%hu", host_name, connectport);
conn->proxy.name, connectport);
return CURLE_FTP_CANT_GET_HOST; return CURLE_FTP_CANT_GET_HOST;
} }
} }
@@ -2107,6 +2026,10 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
/* this just dumps information about this second connection */ /* this just dumps information about this second connection */
ftp_pasv_verbose(conn, addr->addr, ftpc->newhost, connectport); ftp_pasv_verbose(conn, addr->addr, ftpc->newhost, connectport);
Curl_safefree(conn->secondaryhostname);
conn->secondaryhostname = strdup(ftpc->newhost);
conn->secondary_port = ftpc->newport;
Curl_resolv_unlock(data, addr); /* we're done using this address */ Curl_resolv_unlock(data, addr); /* we're done using this address */
conn->bits.do_more = TRUE; conn->bits.do_more = TRUE;
state(conn, FTP_STOP); /* this phase is completed */ state(conn, FTP_STOP); /* this phase is completed */
@@ -2755,7 +2678,10 @@ static CURLcode ftp_statemach_act(struct connectdata *conn)
} }
#endif #endif
if(data->set.use_ssl && !conn->ssl[FIRSTSOCKET].use) { if(data->set.use_ssl &&
(!conn->ssl[FIRSTSOCKET].use ||
(conn->bits.proxy_ssl_connected[FIRSTSOCKET] &&
!conn->proxy_ssl[FIRSTSOCKET].use))) {
/* We don't have a SSL/TLS connection yet, but FTPS is /* We don't have a SSL/TLS connection yet, but FTPS is
requested. Try a FTPS connection now */ requested. Try a FTPS connection now */
@@ -2800,7 +2726,7 @@ static CURLcode ftp_statemach_act(struct connectdata *conn)
/* Curl_ssl_connect is BLOCKING */ /* Curl_ssl_connect is BLOCKING */
result = Curl_ssl_connect(conn, FIRSTSOCKET); result = Curl_ssl_connect(conn, FIRSTSOCKET);
if(!result) { if(!result) {
conn->ssl[SECONDARYSOCKET].use = FALSE; /* clear-text data */ conn->bits.ftp_use_data_ssl = FALSE; /* clear-text data */
result = ftp_state_user(conn); result = ftp_state_user(conn);
} }
} }
@@ -2842,7 +2768,7 @@ static CURLcode ftp_statemach_act(struct connectdata *conn)
case FTP_PROT: case FTP_PROT:
if(ftpcode/100 == 2) if(ftpcode/100 == 2)
/* We have enabled SSL for the data connection! */ /* We have enabled SSL for the data connection! */
conn->ssl[SECONDARYSOCKET].use = conn->bits.ftp_use_data_ssl =
(data->set.use_ssl != CURLUSESSL_CONTROL) ? TRUE : FALSE; (data->set.use_ssl != CURLUSESSL_CONTROL) ? TRUE : FALSE;
/* FTP servers typically responds with 500 if they decide to reject /* FTP servers typically responds with 500 if they decide to reject
our 'P' request */ our 'P' request */
@@ -3659,7 +3585,7 @@ static CURLcode ftp_do_more(struct connectdata *conn, int *completep)
if(!conn->bits.tcpconnect[SECONDARYSOCKET]) { if(!conn->bits.tcpconnect[SECONDARYSOCKET]) {
if(conn->tunnel_state[SECONDARYSOCKET] == TUNNEL_CONNECT) { if(conn->tunnel_state[SECONDARYSOCKET] == TUNNEL_CONNECT) {
/* As we're in TUNNEL_CONNECT state now, we know the proxy name and port /* As we're in TUNNEL_CONNECT state now, we know the proxy name and port
aren't used so we blank their arguments. TODO: make this nicer */ aren't used so we blank their arguments. */
result = Curl_proxyCONNECT(conn, SECONDARYSOCKET, NULL, 0, FALSE); result = Curl_proxyCONNECT(conn, SECONDARYSOCKET, NULL, 0, FALSE);
return result; return result;
@@ -3670,10 +3596,6 @@ static CURLcode ftp_do_more(struct connectdata *conn, int *completep)
/* Ready to do more? */ /* Ready to do more? */
if(connected) { if(connected) {
DEBUGF(infof(data, "DO-MORE connected phase starts\n")); DEBUGF(infof(data, "DO-MORE connected phase starts\n"));
if(conn->bits.proxy) {
infof(data, "Connection to proxy confirmed\n");
result = proxy_magic(conn, ftpc->newhost, ftpc->newport, &connected);
}
} }
else { else {
if(result && (ftpc->count1 == 0)) { if(result && (ftpc->count1 == 0)) {
@@ -3685,6 +3607,18 @@ static CURLcode ftp_do_more(struct connectdata *conn, int *completep)
} }
} }
result = Curl_proxy_connect(conn, SECONDARYSOCKET);
if(result)
return result;
if(CONNECT_SECONDARYSOCKET_PROXY_SSL())
return result;
if(conn->bits.tunnel_proxy && conn->bits.httpproxy &&
conn->tunnel_state[SECONDARYSOCKET] != TUNNEL_COMPLETE)
return result;
if(ftpc->state) { if(ftpc->state) {
/* already in a state so skip the intial commands. /* already in a state so skip the intial commands.
They are only done to kickstart the do_more state */ They are only done to kickstart the do_more state */
@@ -4252,8 +4186,8 @@ CURLcode ftp_parse_url_path(struct connectdata *conn)
const char *cur_pos; const char *cur_pos;
const char *filename = NULL; const char *filename = NULL;
cur_pos = path_to_use; /* current position in path. point at the begin cur_pos = path_to_use; /* current position in path. point at the begin of
of next path component */ next path component */
ftpc->ctl_valid = FALSE; ftpc->ctl_valid = FALSE;
ftpc->cwdfail = FALSE; ftpc->cwdfail = FALSE;

View File

@@ -728,6 +728,7 @@ size_t Curl_ftp_parselist(char *buffer, size_t size, size_t nmemb,
case PL_UNIX_FILENAME_NAME: case PL_UNIX_FILENAME_NAME:
parser->item_length++; parser->item_length++;
if(c == '\r') { if(c == '\r') {
parser->item_length--;
parser->state.UNIX.sub.filename = PL_UNIX_FILENAME_WINDOWSEOL; parser->state.UNIX.sub.filename = PL_UNIX_FILENAME_WINDOWSEOL;
} }
else if(c == '\n') { else if(c == '\n') {
@@ -743,7 +744,7 @@ size_t Curl_ftp_parselist(char *buffer, size_t size, size_t nmemb,
break; break;
case PL_UNIX_FILENAME_WINDOWSEOL: case PL_UNIX_FILENAME_WINDOWSEOL:
if(c == '\n') { if(c == '\n') {
finfo->b_data[parser->item_offset + parser->item_length - 1] = 0; finfo->b_data[parser->item_offset + parser->item_length] = 0;
parser->offsets.filename = parser->item_offset; parser->offsets.filename = parser->item_offset;
parser->state.UNIX.main = PL_UNIX_FILETYPE; parser->state.UNIX.main = PL_UNIX_FILETYPE;
result = ftp_pl_insert_finfo(conn, finfo); result = ftp_pl_insert_finfo(conn, finfo);
@@ -834,8 +835,9 @@ size_t Curl_ftp_parselist(char *buffer, size_t size, size_t nmemb,
} }
break; break;
case PL_UNIX_SYMLINK_TARGET: case PL_UNIX_SYMLINK_TARGET:
parser->item_length++; parser->item_length ++;
if(c == '\r') { if(c == '\r') {
parser->item_length --;
parser->state.UNIX.sub.symlink = PL_UNIX_SYMLINK_WINDOWSEOL; parser->state.UNIX.sub.symlink = PL_UNIX_SYMLINK_WINDOWSEOL;
} }
else if(c == '\n') { else if(c == '\n') {

Some files were not shown because too many files have changed in this diff Show More