Compare commits

..

No commits in common. "main" and "curl-7_47_0" have entirely different histories.

1195 changed files with 3815 additions and 5928 deletions

View File

@ -1,9 +0,0 @@
### I did this
### I expected the following
### curl/libcurl version
[curl -V output perhaps?]
### operating system

View File

@ -1,4 +1,4 @@
See https://curl.haxx.se/changes.html for the edited and human readable online See http://curl.haxx.se/changes.html for the edited and human readable online
version of what has changed over the years in different curl releases. version of what has changed over the years in different curl releases.
Generate a CHANGES file like the one present in evey release like this: Generate a CHANGES file like the one present in evey release like this:

450
CHANGES.0

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,7 @@
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is

View File

@ -9,7 +9,7 @@
# #
# 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
# are also available at https://curl.haxx.se/docs/copyright.html. # are also available at http://curl.haxx.se/docs/copyright.html.
# #
# You may opt to use, copy, modify, merge, publish, distribute and/or sell # 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 # copies of the Software, and permit persons to whom the Software is
@ -64,7 +64,7 @@ message(STATUS "curl version=[${CURL_VERSION}]")
# SET(PACKAGE_NAME "curl") # SET(PACKAGE_NAME "curl")
# SET(PACKAGE_VERSION "-") # SET(PACKAGE_VERSION "-")
# SET(PACKAGE_STRING "curl-") # SET(PACKAGE_STRING "curl-")
# SET(PACKAGE_BUGREPORT "a suitable curl mailing list => https://curl.haxx.se/mail/") # SET(PACKAGE_BUGREPORT "a suitable curl mailing list => http://curl.haxx.se/mail/")
set(OPERATING_SYSTEM "${CMAKE_SYSTEM_NAME}") set(OPERATING_SYSTEM "${CMAKE_SYSTEM_NAME}")
set(OS "\"${CMAKE_SYSTEM_NAME}\"") set(OS "\"${CMAKE_SYSTEM_NAME}\"")
@ -122,6 +122,11 @@ endif()
option(CURL_HIDDEN_SYMBOLS "Set to ON to hide libcurl internal symbols (=hide all symbols that aren't officially external)." ON) option(CURL_HIDDEN_SYMBOLS "Set to ON to hide libcurl internal symbols (=hide all symbols that aren't officially external)." ON)
mark_as_advanced(CURL_HIDDEN_SYMBOLS) mark_as_advanced(CURL_HIDDEN_SYMBOLS)
IF(WIN32)
OPTION(CURL_WINDOWS_SSPI "Use windows libraries to allow NTLM authentication without openssl" ON)
MARK_AS_ADVANCED(CURL_WINDOWS_SSPI)
ENDIF()
option(HTTP_ONLY "disables all protocols except HTTP (This overrides all CURL_DISABLE_* options)" OFF) option(HTTP_ONLY "disables all protocols except HTTP (This overrides all CURL_DISABLE_* options)" OFF)
mark_as_advanced(HTTP_ONLY) mark_as_advanced(HTTP_ONLY)
option(CURL_DISABLE_FTP "disables FTP" OFF) option(CURL_DISABLE_FTP "disables FTP" OFF)
@ -248,7 +253,6 @@ include (CheckLibraryExists)
include (CheckSymbolExists) include (CheckSymbolExists)
include (CheckTypeSize) include (CheckTypeSize)
include (CheckCSourceCompiles) include (CheckCSourceCompiles)
include (CMakeDependentOption)
# On windows preload settings # On windows preload settings
if(WIN32) if(WIN32)
@ -286,22 +290,14 @@ endif(NOT NOT_NEED_LIBNSL)
check_function_exists(gethostname HAVE_GETHOSTNAME) check_function_exists(gethostname HAVE_GETHOSTNAME)
set(OPENSSL_DEFAULT ON)
if(WIN32) if(WIN32)
set(OPENSSL_DEFAULT OFF)
check_library_exists_concat("ws2_32" getch HAVE_LIBWS2_32) check_library_exists_concat("ws2_32" getch HAVE_LIBWS2_32)
check_library_exists_concat("winmm" getch HAVE_LIBWINMM) check_library_exists_concat("winmm" getch HAVE_LIBWINMM)
endif() endif()
option(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" ${OPENSSL_DEFAULT}) option(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" ON)
mark_as_advanced(CMAKE_USE_OPENSSL) mark_as_advanced(CMAKE_USE_OPENSSL)
if(WIN32)
CMAKE_DEPENDENT_OPTION(CURL_WINDOWS_SSPI "Use windows libraries to allow NTLM authentication without openssl" ON
"NOT CMAKE_USE_OPENSSL" OFF)
mark_as_advanced(CURL_WINDOWS_SSPI)
endif()
set(USE_OPENSSL OFF) set(USE_OPENSSL OFF)
set(HAVE_LIBCRYPTO OFF) set(HAVE_LIBCRYPTO OFF)
set(HAVE_LIBSSL OFF) set(HAVE_LIBSSL OFF)
@ -324,8 +320,6 @@ if(CMAKE_USE_OPENSSL)
check_include_file("openssl/ssl.h" HAVE_OPENSSL_SSL_H) check_include_file("openssl/ssl.h" HAVE_OPENSSL_SSL_H)
check_include_file("openssl/x509.h" HAVE_OPENSSL_X509_H) check_include_file("openssl/x509.h" HAVE_OPENSSL_X509_H)
check_include_file("openssl/rand.h" HAVE_OPENSSL_RAND_H) check_include_file("openssl/rand.h" HAVE_OPENSSL_RAND_H)
elseif(WIN32)
set(CURL_WINDOWS_SSPI ON)
endif() endif()
endif() endif()
@ -1061,8 +1055,7 @@ endfunction()
# Clear list and try to detect available features # Clear list and try to detect available features
set(_items) set(_items)
_add_if("WinSSL" SSL_ENABLED AND USE_WINDOWS_SSPI) _add_if("SSL" SSL_ENABLED)
_add_if("OpenSSL" SSL_ENABLED AND USE_OPENSSL)
_add_if("IPv6" ENABLE_IPV6) _add_if("IPv6" ENABLE_IPV6)
_add_if("unix-sockets" USE_UNIX_SOCKETS) _add_if("unix-sockets" USE_UNIX_SOCKETS)
_add_if("libz" HAVE_LIBZ) _add_if("libz" HAVE_LIBZ)

View File

@ -6,9 +6,9 @@ Join the community
1. Click 'watch' on the github repo 1. Click 'watch' on the github repo
2. Subscribe to the suitable [mailing lists](https://curl.haxx.se/mail/) 2. Subscribe to the suitable [mailing lists](http://curl.haxx.se/mail/)
Read [CONTRIBUTE](../docs/CONTRIBUTE) Read [docs/CONTRIBUTE](docs/CONTRIBUTE)
--------------------------------------- ---------------------------------------
Send your suggestions using one of these methods: Send your suggestions using one of these methods:
@ -16,8 +16,10 @@ Send your suggestions using one of these methods:
1. in a mail to the mailing list 1. in a mail to the mailing list
2. as a [pull request](https://github.com/curl/curl/pulls) 2. as a pull request on github
3. as an issue on github
3. as an [issue](https://github.com/curl/curl/issues)
/ The cURL team! / The cURL team!

View File

@ -1,7 +1,6 @@
COPYRIGHT AND PERMISSION NOTICE COPYRIGHT AND PERMISSION NOTICE
Copyright (c) 1996 - 2016, Daniel Stenberg, <daniel@haxx.se>, and many Copyright (c) 1996 - 2016, Daniel Stenberg, <daniel@haxx.se>.
contributors, see the THANKS file.
All rights reserved. All rights reserved.

View File

@ -5,11 +5,11 @@
# | (__| |_| | _ <| |___ # | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____| # \___|\___/|_| \_\_____|
# #
# 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
# are also available at https://curl.haxx.se/docs/copyright.html. # are also available at http://curl.haxx.se/docs/copyright.html.
# #
# You may opt to use, copy, modify, merge, publish, distribute and/or sell # 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 # copies of the Software, and permit persons to whom the Software is
@ -113,24 +113,16 @@ VC_DIST = projects/README \
projects/Windows/VC9/src/curl.sln \ projects/Windows/VC9/src/curl.sln \
projects/Windows/VC10/curl-all.sln \ projects/Windows/VC10/curl-all.sln \
projects/Windows/VC10/lib/libcurl.sln \ projects/Windows/VC10/lib/libcurl.sln \
projects/Windows/VC10/lib/libcurl.vcxproj.filters \
projects/Windows/VC10/src/curl.sln \ projects/Windows/VC10/src/curl.sln \
projects/Windows/VC10/src/curl.vcxproj.filters \
projects/Windows/VC11/curl-all.sln \ projects/Windows/VC11/curl-all.sln \
projects/Windows/VC11/lib/libcurl.sln \ projects/Windows/VC11/lib/libcurl.sln \
projects/Windows/VC11/lib/libcurl.vcxproj.filters \
projects/Windows/VC11/src/curl.sln \ projects/Windows/VC11/src/curl.sln \
projects/Windows/VC11/src/curl.vcxproj.filters \
projects/Windows/VC12/curl-all.sln \ projects/Windows/VC12/curl-all.sln \
projects/Windows/VC12/lib/libcurl.sln \ projects/Windows/VC12/lib/libcurl.sln \
projects/Windows/VC12/lib/libcurl.vcxproj.filters \
projects/Windows/VC12/src/curl.sln \ projects/Windows/VC12/src/curl.sln \
projects/Windows/VC12/src/curl.vcxproj.filters \
projects/Windows/VC14/curl-all.sln \ projects/Windows/VC14/curl-all.sln \
projects/Windows/VC14/lib/libcurl.sln \ projects/Windows/VC14/lib/libcurl.sln \
projects/Windows/VC14/lib/libcurl.vcxproj.filters \ projects/Windows/VC14/src/curl.sln
projects/Windows/VC14/src/curl.sln \
projects/Windows/VC14/src/curl.vcxproj.filters
WINBUILD_DIST = winbuild/BUILD.WINDOWS.txt winbuild/gen_resp_file.bat \ WINBUILD_DIST = winbuild/BUILD.WINDOWS.txt winbuild/gen_resp_file.bat \
winbuild/MakefileBuild.vc winbuild/Makefile.vc \ winbuild/MakefileBuild.vc winbuild/Makefile.vc \
@ -138,8 +130,7 @@ WINBUILD_DIST = winbuild/BUILD.WINDOWS.txt winbuild/gen_resp_file.bat \
EXTRA_DIST = CHANGES COPYING maketgz Makefile.dist curl-config.in \ EXTRA_DIST = CHANGES COPYING maketgz Makefile.dist curl-config.in \
RELEASE-NOTES buildconf libcurl.pc.in MacOSX-Framework scripts/zsh.pl \ RELEASE-NOTES buildconf libcurl.pc.in MacOSX-Framework scripts/zsh.pl \
$(CMAKE_DIST) $(VC_DIST) $(WINBUILD_DIST) lib/libcurl.vers.in \ $(CMAKE_DIST) $(VC_DIST) $(WINBUILD_DIST) lib/libcurl.vers.in
buildconf.bat
CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP) $(VC7_LIBVCPROJ) $(VC7_SRCVCPROJ) \ CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP) $(VC7_LIBVCPROJ) $(VC7_SRCVCPROJ) \
$(VC71_LIBVCPROJ) $(VC71_SRCVCPROJ) $(VC8_LIBVCPROJ) $(VC8_SRCVCPROJ) \ $(VC71_LIBVCPROJ) $(VC71_SRCVCPROJ) $(VC8_LIBVCPROJ) $(VC8_SRCVCPROJ) \

View File

@ -9,7 +9,7 @@
# #
# 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
# are also available at https://curl.haxx.se/docs/copyright.html. # are also available at http://curl.haxx.se/docs/copyright.html.
# #
# You may opt to use, copy, modify, merge, publish, distribute and/or sell # 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 # copies of the Software, and permit persons to whom the Software is

6
README
View File

@ -24,7 +24,7 @@ README
CONTACT CONTACT
If you have problems, questions, ideas or suggestions, please contact us If you have problems, questions, ideas or suggestions, please contact us
by posting to a suitable mailing list. See https://curl.haxx.se/mail/ by posting to a suitable mailing list. See http://curl.haxx.se/mail/
All contributors to the project are listed in the THANKS document. All contributors to the project are listed in the THANKS document.
@ -32,13 +32,13 @@ WEB SITE
Visit the curl web site for the latest news and downloads: Visit the curl web site for the latest news and downloads:
https://curl.haxx.se/ http://curl.haxx.se/
GIT GIT
To download the very latest source off the GIT server do this: To download the very latest source off the GIT server do this:
git clone https://github.com/curl/curl.git git clone https://github.com/bagder/curl.git
(you'll get a directory named curl created, filled with the source code) (you'll get a directory named curl created, filled with the source code)

View File

@ -1,45 +0,0 @@
Curl is a command line tool for transferring data specified with URL
syntax. Find out how to use curl by reading [the curl.1 man
page](https://curl.haxx.se/docs/manpage.html) or [the MANUAL
document](https://curl.haxx.se/docs/manual.html). Find out how to install Curl
by reading [the INSTALL document](https://curl.haxx.se/docs/install.html).
libcurl is the library curl is using to do its job. It is readily available to
be used by your software. Read [the libcurl.3 man
page](https://curl.haxx.se/libcurl/c/libcurl.html) to learn how!
You find answers to the most frequent questions we get in [the FAQ
document](https://curl.haxx.se/docs/faq.html).
Study [the COPYING file](https://curl.haxx.se/docs/copyright.html) for
distribution terms and similar. If you distribute curl binaries or other
binaries that involve libcurl, you might enjoy [the LICENSE-MIXING
document](https://curl.haxx.se/legal/licmix.html).
## CONTACT
If you have problems, questions, ideas or suggestions, please contact us by
posting to a suitable [mailing list](https://curl.haxx.se/mail/).
All contributors to the project are listed in [the THANKS
document](https://curl.haxx.se/docs/thanks.html).
## WEB SITE
Visit the [curl web site](https://curl.haxx.se/) for the latest news and
downloads.
## GIT
To download the very latest source off the GIT server do this:
git clone https://github.com/curl/curl.git
(you'll get a directory named curl created, filled with the source code)
## NOTICE
Curl contains pieces of source code that is Copyright (c) 1998, 1999 Kungliga
Tekniska Högskolan. This notice is included here to comply with the
distribution terms.

View File

@ -1,159 +1,128 @@
Curl and libcurl 7.48.0 Curl and libcurl 7.47.0
Public curl releases: 153 Public curl releases: 151
Command line options: 179 Command line options: 179
curl_easy_setopt() options: 221 curl_easy_setopt() options: 221
Public functions in libcurl: 61 Public functions in libcurl: 61
Contributors: 1364 Contributors: 1340
This release includes the following changes: This release includes the following changes:
o configure: --with-ca-fallback: use built-in TLS CA fallback [2] o version: Add flag CURL_VERSION_PSL for libpsl
o TFTP: add --tftp-no-options to expose CURLOPT_TFTP_NO_OPTIONS [22] o http: added CURL_HTTP_VERSION_2TLS to do HTTP/2 for HTTPS only [8]
o getinfo: CURLINFO_TLS_SSL_PTR supersedes CURLINFO_TLS_SESSION [25] o curl: use 2TLS by default
o added CODE_STYLE.md [47] o curl --expect100-timeout: added [10]
o Add .dir-locals and set c-basic-offset to 2 (for emacs) [16]
This release includes the following bugfixes: This release includes the following bugfixes:
o Proxy-Connection: stop sending this header by default [1] o curl: avoid local drive traversal when saving file on Windows [33]
o os400: sync ILE/RPG definitions with latest public header files o NTLM: do not resuse proxy connections without diff proxy credentials [34]
o cookies: allow spaces in cookie names, cut of trailing spaces [3] o tests: Disable the OAUTHBEARER tests when using a non-default port number [1]
o tool_urlglob: Allow reserved dos device names (Windows) [4] o curl: remove keepalive #ifdef checks done on libcurl's behalf
o openssl: remove most BoringSSL #ifdefs [5] o formdata: Check if length is too large for memory [2]
o tool_doswin: Support for literal path prefix \\?\ o lwip: Fix compatibility issues with later versions [3]
o mbedtls: fix ALPN usage segfault [6] o openssl: BoringSSL doesn't have CONF_modules_free
o mbedtls: fix memory leak when destroying SSL connection data [7] o config-win32: Fix warning HAVE_WINSOCK2_H undefined
o nss: do not count enabled cipher-suites o build: fix compilation error with CURL_DISABLE_VERBOSE_STRINGS [4]
o examples/cookie_interface.c: add cleanup call o http2: Fix hanging paused stream [5]
o examples: adhere to curl code style o scripts/Makefile: fix GNUism and survive no perl [6]
o curlx_tvdiff: handle 32bit time_t overflows [8] o openssl: adapt to 1.1.0+ name changes
o dist: ship buildconf.bat too o openssl: adapt to openssl >= 1.1.0 X509 opaque structs [7]
o curl.1: --disable-{eprt,epsv} are ignored for IPv6 hosts [9] o HTTP2.md: spell fix and remove TODO now implemented
o generate.bat: Fix comment bug by removing old comments [10] o setstropt: const-correctness [9]
o test1604: Add to Makefile.inc so it gets run o cyassl: fix compiler warning on type conversion
o gtls: fix for builds lacking encrypted key file support [11] o gskit: Fix host subject altname verification [11]
o SCP: use libssh2_scp_recv2 to support > 2GB files on windows [12] o http2: Support trailer fields [12]
o CURLOPT_CONNECTTIMEOUT_MS.3: Fix example to use milliseconds option [13] o wolfssl: handle builds without SSLv3 support
o cookie: do not refuse cookies to localhost [14] o cyassl: deal with lack of *get_peer_certificate [13]
o openssl: avoid direct PKEY access with OpenSSL 1.1.0 [15] o sockfilt: do not wait on unreliable file or pipe handle
o http: Don't break the header into chunks if HTTP/2 [16] o make: build zsh script even in an out-of-tree build
o http2: don't decompress gzip decoding automatically [17] o test 1326: fix getting stuck on Windows
o curlx.c: i2s_ASN1_IA5STRING() clashes with an openssl function o test 87: fix file check on Windows
o curl.1: add a missing dash o configure: allow static builds on mingw [14]
o curl.1: HTTP headers for --cookie must be Set-Cookie style [18] o configure: detect IPv6 support on Windows [15]
o CURLOPT_COOKIEFILE.3: HTTP headers must be Set-Cookie style [18] o ConnectionExists: with *PIPEWAIT, wait for connections [17]
o curl_sasl: Fix memory leak in digest parser [19] o Makefile.inc: s/curl_SOURCES/CURL_FILES [18]
o src/Makefile.m32: add CURL_{LD,C}FLAGS_EXTRAS support [20] o test 16: fixed for Windows
o CURLOPT_DEBUGFUNCTION.3: Fix example o test 252-255: use datacheck mode text for ASCII-mode LISTings
o runtests: Fixed usage of %PWD on MinGW64 [21] o tftpd server: add Windows support by writing files in binary mode
o tests/sshserver.pl: use RSA instead of DSA for host auth [23] o ftplistparser: fix handling of file LISTings using Windows EOL
o multi_remove_handle: keep the timeout list until after disconnect [24] o tests first.c: fix calculation of sleep timeout on Windows
o Curl_read: check for activated HTTP/1 pipelining, not only requested o tests (several): use datacheck mode text for ASCII-mode LISTings
o configure: warn on invalid ca bundle or path [26] o CURLOPT_RANGE.3: for HTTP servers, range support is optional
o file: try reading from files with no size [27] o test 1515: add MSYS support by passing a relative path
o getinfo: Add support for mbedTLS TLS session info o curl_global_init.3: Add Windows-specific info for init via DLL [19]
o formpost: fix memory leaks in AddFormData error branches [28] o http2: Fix client write for trailers on stream close [20]
o makefile.m32: allow to pass .dll/.exe-specific LDFLAGS [29] o mbedtls: Fix ALPN support
o url: if Curl_done is premature then pipeline not in use [30] o connection reuse: IDN host names fixed [21]
o cookie: remove redundant check [31] o http2: Fix PUSH_PROMISE headers being treated as trailers [22]
o cookie: Don't expire session cookies in remove_expired [32] o http2: handle the received SETTINGS frame [23]
o makefile.m32: fix to allow -ssh2-winssl combination [33] o http2: Ensure that http2_handle_stream_close is called [24]
o checksrc.bat: Fixed cannot find perl if installed but not in path o mbedtls: implement CURLOPT_PINNEDPUBLICKEY
o build-openssl.bat: Fixed cannot find perl if installed but not in path o runtests: Add mbedTLS to the SSL backends
o mbedtls: fix user-specified SSL protocol version o IDN host names: Remove the port number before converting to ACE [25]
o makefile.m32: add missing libs for static -winssl-ssh2 builds [34] o zsh.pl: fail if no curl is found
o test46: change cookie expiry date [35] o scripts: fix zsh completion generation
o pipeline: Sanity check pipeline pointer before accessing it [36] o scripts: don't generate and install zsh completion when cross-compiling [26]
o openssl: use the correct OpenSSL/BoringSSL/LibreSSL in messages o lib: Prefix URLs with lower-case protocol names/schemes [27]
o ftp_done: clear tunnel_state when secondary socket closes [37] o ConnectionExists: only do pipelining/multiplexing when asked [28]
o opt-docs: fix heading macros [38] o configure: assume IPv6 works when cross-compiled [29]
o imap/pop3/smtp: Fixed connections upgraded with TLS are not reused [39] o openssl: for 1.1.0+ they now provide a SSLeay() macro of their own
o curl_multi_wait: never return -1 in 'numfds' [40] o openssl: improved error detection/reporting
o url.c: fix clang warning: no newline at end of file o ssh: CURLOPT_SSH_PUBLIC_KEYFILE now treats "" as NULL again [30]
o krb5: improved type handling to avoid clang compiler warnings o mbedtls: Fix pinned key return value on fail [31]
o cookies: first n/v pair in Set-Cookie: is the cookie, then parameters [41] o maketgz: generate date stamp with LC_TIME=C [32]
o multi: avoid blocking during CURLM_STATE_WAITPROXYCONNECT [42]
o multi hash: ensure modulo performed on curl_socket_t [43]
o curl: glob_range: no need to check unsigned variable for negative
o easy: add check to malloc() when running event-based
o CURLOPT_SSLENGINE.3: Only for OpenSSL built with engine support [44]
o version: thread safety
o openssl: verbose: show matching SAN pattern
o openssl: adapt to OpenSSL 1.1.0 API breakage in ERR_remove_thread_state()
o formdata.c: Fixed compilation warning
o configure: use cpp -P when needed [45]
o imap.c: Fixed compilation warning with /Wall enabled
o config-w32.h: Fixed compilation warning when /Wall enabled
o ftp/imap/pop3/smtp: Fixed compilation warning when /Wall enabled
o build: Added missing Visual Studio filter files for VC10 onwards
o easy: Remove poll failure check in easy_transfer
o mbedtls: fix compiler warning
o build-wolfssl: Update VS properties for wolfSSL v3.9.0
o Fixed various compilation warnings when verbose strings disabled
This release includes the following known bugs: This release includes the following known bugs:
o see docs/KNOWN_BUGS (https://curl.haxx.se/docs/knownbugs.html) o see docs/KNOWN_BUGS (http://curl.haxx.se/docs/knownbugs.html)
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:
Anders Bakken, Brad Fitzpatrick, Clint Clayton, Dan Fandrich, Alessandro Ghedini, Anders Bakken, Christian Stewart, Dan Fandrich,
Daniel Stenberg, David Benjamin, David Byron, Emil Lerner, Eric S. Raymond, Daniel Schauenberg, Daniel Stenberg, Francisco Moraes, Gisle Vanem,
Gisle Vanem, Jaime Fullaondo, Jeffrey Walton, Jesse Tan, Justin Ehlert, Isaac Boukris, Johannes Schindelin, John Kohl, Kamil Dudka, Marc Hoersken,
Kamil Dudka, Kazuho Oku, Ludwig Nussel, Maksim Kuzevanov, Michael König, Michael Kaufmann, Mohammad AlSaleh, Patrick Monnerat, Ray Satiro, Steve Holme,
Oliver Graute, Patrick Monnerat, Rafael Antonio, Ray Satiro, Seth Mos, Tatsuhiro Tsujikawa, Thomas Glanzmann, Thomas Klausner,
Shine Fan, Steve Holme, Tatsuhiro Tsujikawa, Timotej Lazar, Tim Rühsen, (21 contributors)
Viktor Szakáts,
(30 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] = https://curl.haxx.se/bug/?i=633 [1] = http://curl.haxx.se/mail/lib-2015-12/0003.html
[2] = https://curl.haxx.se/bug/?i=569 [2] = https://github.com/bagder/curl/issues/425#issuecomment-154518679
[3] = https://curl.haxx.se/bug/?i=639 [3] = http://curl.haxx.se/mail/lib-2015-12/0023.html
[4] = https://github.com/curl/curl/commit/4520534#commitcomment-15954863 [4] = http://curl.haxx.se/bug/?i=558
[5] = https://curl.haxx.se/bug/?i=640 [5] = http://curl.haxx.se/mail/lib-2015-11/0103.html
[6] = https://curl.haxx.se/bug/?i=642 [6] = http://curl.haxx.se/bug/?i=555
[7] = https://curl.haxx.se/bug/?i=626 [7] = http://curl.haxx.se/bug/?i=491
[8] = https://curl.haxx.se/bug/?i=646 [8] = http://curl.haxx.se/libcurl/c/CURLOPT_HTTP_VERSION.html
[9] = https://bugzilla.redhat.com/1305970 [9] = http://curl.haxx.se/bug/?i=565
[10] = https://curl.haxx.se/bug/?i=649 [10] = http://curl.haxx.se/docs/manpage.html#--expect100-timeout
[11] = https://curl.haxx.se/bug/?i=651 [11] = http://curl.haxx.se/mail/lib-2015-12/0062.html
[12] = https://curl.haxx.se/bug/?i=451 [12] = http://curl.haxx.se/bug/?i=564
[13] = https://curl.haxx.se/bug/?i=653 [13] = http://curl.haxx.se/bug/?i=565
[14] = https://curl.haxx.se/bug/?i=658 [14] = https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-curl
[15] = https://curl.haxx.se/bug/?i=650 [15] = https://github.com/Alexpux/MINGW-packages/commit/9253d0bf58a1486e91f7efb5316e7fdb48fa4007
[16] = https://curl.haxx.se/bug/?i=659 [16] = http://curl.haxx.se/bug/?i=574
[17] = https://curl.haxx.se/bug/?i=661 [17] = http://curl.haxx.se/bug/?i=575
[18] = https://curl.haxx.se/bug/?i=666 [18] = http://curl.haxx.se/bug/?i=577
[19] = https://curl.haxx.se/bug/?i=667 [19] = http://curl.haxx.se/bug/?i=586
[20] = https://curl.haxx.se/bug/?i=670 [20] = http://curl.haxx.se/bug/?i=564
[21] = https://curl.haxx.se/bug/?i=672 [21] = http://curl.haxx.se/bug/?i=592
[22] = https://curl.haxx.se/bug/?i=481 [22] = http://curl.haxx.se/bug/?i=564
[23] = https://curl.haxx.se/bug/?i=676 [23] = http://curl.haxx.se/mail/lib-2016-01/0031.html
[24] = https://curl.haxx.se/mail/lib-2016-02/0097.html [24] = http://curl.haxx.se/bug/?i=564
[25] = https://curl.haxx.se/libcurl/c/CURLINFO_TLS_SSL_PTR.html [25] = http://curl.haxx.se/bug/?i=596
[26] = https://curl.haxx.se/bug/?i=404 [26] = http://curl.haxx.se/bug/?i=582
[27] = https://curl.haxx.se/bug/?i=681 [27] = http://curl.haxx.se/bug/?i=597
[28] = https://curl.haxx.se/bug/?i=688 [28] = http://curl.haxx.se/bug/?i=584
[29] = https://curl.haxx.se/bug/?i=689 [29] = http://curl.haxx.se/bug/?i=594
[30] = https://curl.haxx.se/bug/?i=690 [30] = http://curl.haxx.se/mail/lib-2016-01/0072.html
[31] = https://curl.haxx.se/bug/?i=695 [31] = http://curl.haxx.se/bug/?i=601
[32] = https://curl.haxx.se/bug/?i=697 [32] = http://curl.haxx.se/mail/lib-2016-01/0123.html
[33] = https://curl.haxx.se/bug/?i=692 [33] = http://curl.haxx.se/docs/adv_20160127B.html
[34] = https://curl.haxx.se/bug/?i=693 [34] = http://curl.haxx.se/docs/adv_20160127A.html
[35] = https://curl.haxx.se/bug/?i=697
[36] = https://curl.haxx.se/bug/?i=704
[37] = https://curl.haxx.se/bug/?i=701
[38] = https://curl.haxx.se/bug/?i=705
[39] = https://curl.haxx.se/bug/?i=422
[40] = https://curl.haxx.se/bug/?i=707
[41] = https://curl.haxx.se/bug/?i=709
[42] = https://curl.haxx.se/bug/?i=703
[43] = https://curl.haxx.se/bug/?i=712
[44] = https://curl.haxx.se/mail/lib-2016-03/0150.html
[45] = https://curl.haxx.se/bug/?i=719
[47] = https://curl.haxx.se/dev/code-style.html

View File

@ -9,7 +9,7 @@
# #
# 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
# are also available at https://curl.haxx.se/docs/copyright.html. # are also available at http://curl.haxx.se/docs/copyright.html.
# #
# You may opt to use, copy, modify, merge, publish, distribute and/or sell # 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 # copies of the Software, and permit persons to whom the Software is
@ -20,6 +20,7 @@
# #
#*************************************************************************** #***************************************************************************
dnl CURL_CHECK_DEF (SYMBOL, [INCLUDES], [SILENT]) dnl CURL_CHECK_DEF (SYMBOL, [INCLUDES], [SILENT])
dnl ------------------------------------------------- dnl -------------------------------------------------
dnl Use the C preprocessor to find out if the given object-style symbol dnl Use the C preprocessor to find out if the given object-style symbol
@ -30,10 +31,6 @@ dnl result in a set of double-quoted strings the returned expansion will
dnl actually be a single double-quoted string concatenating all them. dnl actually be a single double-quoted string concatenating all them.
AC_DEFUN([CURL_CHECK_DEF], [ AC_DEFUN([CURL_CHECK_DEF], [
AC_REQUIRE([CURL_CPP_P])dnl
OLDCPPFLAGS=$CPPFLAGS
# CPPPFLAGS comes from CURL_CPP_P
CPPFLAGS="$CPPPFLAGS"
AS_VAR_PUSHDEF([ac_HaveDef], [curl_cv_have_def_$1])dnl AS_VAR_PUSHDEF([ac_HaveDef], [curl_cv_have_def_$1])dnl
AS_VAR_PUSHDEF([ac_Def], [curl_cv_def_$1])dnl AS_VAR_PUSHDEF([ac_Def], [curl_cv_def_$1])dnl
if test -z "$SED"; then if test -z "$SED"; then
@ -70,7 +67,6 @@ CURL_DEF_TOKEN $1
fi fi
AS_VAR_POPDEF([ac_Def])dnl AS_VAR_POPDEF([ac_Def])dnl
AS_VAR_POPDEF([ac_HaveDef])dnl AS_VAR_POPDEF([ac_HaveDef])dnl
CPPFLAGS=$OLDCPPFLAGS
]) ])
@ -2574,8 +2570,7 @@ AC_DEFUN([CURL_CHECK_CA_BUNDLE], [
AC_MSG_CHECKING([default CA cert bundle/path]) AC_MSG_CHECKING([default CA cert bundle/path])
AC_ARG_WITH(ca-bundle, AC_ARG_WITH(ca-bundle,
AC_HELP_STRING([--with-ca-bundle=FILE], AC_HELP_STRING([--with-ca-bundle=FILE], [File name to use as CA bundle])
[Path to a file containing CA certificates (example: /etc/ca-bundle.crt)])
AC_HELP_STRING([--without-ca-bundle], [Don't use a default CA bundle]), AC_HELP_STRING([--without-ca-bundle], [Don't use a default CA bundle]),
[ [
want_ca="$withval" want_ca="$withval"
@ -2585,11 +2580,7 @@ AC_HELP_STRING([--without-ca-bundle], [Don't use a default CA bundle]),
], ],
[ want_ca="unset" ]) [ want_ca="unset" ])
AC_ARG_WITH(ca-path, AC_ARG_WITH(ca-path,
AC_HELP_STRING([--with-ca-path=DIRECTORY], AC_HELP_STRING([--with-ca-path=DIRECTORY], [Directory to use as CA path])
[Path to a directory containing CA certificates stored individually, with \
their filenames in a hash format. This option can be used with OpenSSL, \
GnuTLS and PolarSSL backends. Refer to OpenSSL c_rehash for details. \
(example: /etc/certificates)])
AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]), AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]),
[ [
want_capath="$withval" want_capath="$withval"
@ -2599,10 +2590,6 @@ AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]),
], ],
[ want_capath="unset"]) [ want_capath="unset"])
ca_warning=" (warning: certs not found)"
capath_warning=" (warning: certs not found)"
check_capath=""
if test "x$want_ca" != "xno" -a "x$want_ca" != "xunset" -a \ if test "x$want_ca" != "xno" -a "x$want_ca" != "xunset" -a \
"x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then "x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then
dnl both given dnl both given
@ -2651,7 +2638,12 @@ AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]),
fi fi
if test "x$want_capath" = "xunset" -a "x$ca" = "xno" -a \ if test "x$want_capath" = "xunset" -a "x$ca" = "xno" -a \
"x$OPENSSL_ENABLED" = "x1"; then "x$OPENSSL_ENABLED" = "x1"; then
check_capath="/etc/ssl/certs/" for a in /etc/ssl/certs/; do
if test -d "$a" && ls "$a"/[[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]].0 >/dev/null 2>/dev/null; then
capath="$a"
break
fi
done
fi fi
else else
dnl no option given and cross-compiling dnl no option given and cross-compiling
@ -2659,30 +2651,6 @@ AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]),
fi fi
fi fi
if test "x$ca" = "xno" || test -f "$ca"; then
ca_warning=""
fi
if test "x$capath" != "xno"; then
check_capath="$capath"
fi
if test ! -z "$check_capath"; then
for a in "$check_capath"; do
if test -d "$a" && ls "$a"/[[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]].0 >/dev/null 2>/dev/null; then
if test "x$capath" = "xno"; then
capath="$a"
fi
capath_warning=""
break
fi
done
fi
if test "x$capath" = "xno"; then
capath_warning=""
fi
if test "x$ca" != "xno"; then if test "x$ca" != "xno"; then
CURL_CA_BUNDLE='"'$ca'"' CURL_CA_BUNDLE='"'$ca'"'
AC_DEFINE_UNQUOTED(CURL_CA_BUNDLE, "$ca", [Location of default ca bundle]) AC_DEFINE_UNQUOTED(CURL_CA_BUNDLE, "$ca", [Location of default ca bundle])
@ -2697,24 +2665,6 @@ AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]),
if test "x$ca" = "xno" && test "x$capath" = "xno"; then if test "x$ca" = "xno" && test "x$capath" = "xno"; then
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
fi fi
AC_MSG_CHECKING([whether to use builtin CA store of SSL library])
AC_ARG_WITH(ca-fallback,
AC_HELP_STRING([--with-ca-fallback], [Use the built in CA store of the SSL library])
AC_HELP_STRING([--without-ca-fallback], [Don't use the built in CA store of the SSL library]),
[
if test "x$with_ca_fallback" != "xyes" -a "x$with_ca_fallback" != "xno"; then
AC_MSG_ERROR([--with-ca-fallback only allows yes or no as parameter])
fi
],
[ with_ca_fallback="no"])
AC_MSG_RESULT([$with_ca_fallback])
if test "x$with_ca_fallback" = "xyes"; then
if test "x$OPENSSL_ENABLED" != "x1" -a "x$GNUTLS_ENABLED" != "x1"; then
AC_MSG_ERROR([--with-ca-fallback only works with OpenSSL or GnuTLS])
fi
AC_DEFINE_UNQUOTED(CURL_CA_FALLBACK, 1, [define "1" to use built in CA store of SSL library ])
fi
]) ])
@ -3151,48 +3101,3 @@ use vars qw(
1; 1;
_EOF _EOF
]) ])
dnl CURL_CPP_P
dnl
dnl Check if $cpp -P should be used for extract define values due to gcc 5
dnl splitting up strings and defines between line outputs. gcc by default
dnl (without -P) will show TEST EINVAL TEST as
dnl
dnl # 13 "conftest.c"
dnl TEST
dnl # 13 "conftest.c" 3 4
dnl 22
dnl # 13 "conftest.c"
dnl TEST
AC_DEFUN([CURL_CPP_P], [
AC_MSG_CHECKING([if cpp -P is needed])
AC_EGREP_CPP([TEST.*TEST], [
#include <errno.h>
TEST EINVAL TEST
], [cpp=no], [cpp=yes])
AC_MSG_RESULT([$cpp])
dnl we need cpp -P so check if it works then
if test "x$cpp" = "xyes"; then
AC_MSG_CHECKING([if cpp -P works])
OLDCPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -P"
AC_EGREP_CPP([TEST.*TEST], [
#include <errno.h>
TEST EINVAL TEST
], [cpp_p=yes], [cpp_p=no])
AC_MSG_RESULT([$cpp_p])
if test "x$cpp_p" = "xno"; then
AC_MSG_WARN([failed to figure out cpp -P alternative])
# without -P
CPPPFLAGS=$OLDCPPFLAGS
else
# with -P
CPPPFLAGS=$CPPFLAGS
fi
dnl restore CPPFLAGS
CPPFLAGS=$OLDCPPFLAGS
fi
])

View File

@ -1,35 +1,19 @@
version: 7.47.0.{build} version: 7.45.0.{build}
environment: environment:
matrix: matrix:
- PRJ_GEN: "Visual Studio 11 2012 Win64" - PRJ_GEN: "Visual Studio 11 2012 Win64"
BDIR: msvc2012 BDIR: msvc2012
PRJ_CFG: Release PRJ_CFG: Release
OPENSSL: OFF
- PRJ_GEN: "Visual Studio 12 2013 Win64" - PRJ_GEN: "Visual Studio 12 2013 Win64"
BDIR: msvc2013 BDIR: msvc2013
PRJ_CFG: Release PRJ_CFG: Release
OPENSSL: OFF
- PRJ_GEN: "Visual Studio 14 2015 Win64" - PRJ_GEN: "Visual Studio 14 2015 Win64"
BDIR: msvc2015 BDIR: msvc2015
PRJ_CFG: Release PRJ_CFG: Release
OPENSSL: OFF
- PRJ_GEN: "Visual Studio 11 2012 Win64"
BDIR: msvc2012
PRJ_CFG: Release
OPENSSL: ON
- PRJ_GEN: "Visual Studio 12 2013 Win64"
BDIR: msvc2013
PRJ_CFG: Release
OPENSSL: ON
- PRJ_GEN: "Visual Studio 14 2015 Win64"
BDIR: msvc2015
PRJ_CFG: Release
OPENSSL: ON
build_script: build_script:
- mkdir build.%BDIR% - mkdir build.%BDIR%
- cd build.%BDIR% - cd build.%BDIR%
- cmake .. -G"%PRJ_GEN%" -DCMAKE_USE_OPENSSL=%OPENSSL% - cmake .. -G"%PRJ_GEN%"
- cmake --build . --config %PRJ_CFG% --clean-first - cmake --build . --config %PRJ_CFG% --clean-first

View File

@ -10,7 +10,7 @@
# #
# 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
# are also available at https://curl.haxx.se/docs/copyright.html. # are also available at http://curl.haxx.se/docs/copyright.html.
# #
# You may opt to use, copy, modify, merge, publish, distribute and/or sell # 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 # copies of the Software, and permit persons to whom the Software is

View File

@ -6,11 +6,11 @@ rem * / __| | | | |_) | |
rem * | (__| |_| | _ <| |___ rem * | (__| |_| | _ <| |___
rem * \___|\___/|_| \_\_____| rem * \___|\___/|_| \_\_____|
rem * rem *
rem * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. rem * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
rem * rem *
rem * This software is licensed as described in the file COPYING, which rem * This software is licensed as described in the file COPYING, which
rem * you should have received as part of this distribution. The terms rem * you should have received as part of this distribution. The terms
rem * are also available at https://curl.haxx.se/docs/copyright.html. rem * are also available at http://curl.haxx.se/docs/copyright.html.
rem * rem *
rem * You may opt to use, copy, modify, merge, publish, distribute and/or sell rem * You may opt to use, copy, modify, merge, publish, distribute and/or sell
rem * copies of the Software, and permit persons to whom the Software is rem * copies of the Software, and permit persons to whom the Software is
@ -26,6 +26,8 @@ rem
rem This batch file must be used to set up a git tree to build on systems where rem This batch file must be used to set up a git tree to build on systems where
rem there is no autotools support (i.e. DOS and Windows). rem there is no autotools support (i.e. DOS and Windows).
rem rem
rem This file is not included or required for curl's release archives or daily
rem snapshot archives.
:begin :begin
rem Set our variables rem Set our variables

View File

@ -9,7 +9,7 @@
# #
# 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
# are also available at https://curl.haxx.se/docs/copyright.html. # are also available at http://curl.haxx.se/docs/copyright.html.
# #
# You may opt to use, copy, modify, merge, publish, distribute and/or sell # 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 # copies of the Software, and permit persons to whom the Software is
@ -24,14 +24,14 @@ dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57) AC_PREREQ(2.57)
dnl We don't know the version number "statically" so we use a dash here dnl We don't know the version number "statically" so we use a dash here
AC_INIT([curl], [-], [a suitable curl mailing list: https://curl.haxx.se/mail/]) AC_INIT([curl], [-], [a suitable curl mailing list: http://curl.haxx.se/mail/])
XC_OVR_ZZ50 XC_OVR_ZZ50
XC_OVR_ZZ60 XC_OVR_ZZ60
CURL_OVERRIDE_AUTOCONF CURL_OVERRIDE_AUTOCONF
dnl configure script copyright dnl configure script copyright
AC_COPYRIGHT([Copyright (c) 1998 - 2016 Daniel Stenberg, <daniel@haxx.se> AC_COPYRIGHT([Copyright (c) 1998 - 2014 Daniel Stenberg, <daniel@haxx.se>
This configure script may be copied, distributed and modified under the This configure script may be copied, distributed and modified under the
terms of the curl license; see COPYING for more details]) terms of the curl license; see COPYING for more details])
@ -1631,6 +1631,8 @@ if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
dnl Older versions of Cyassl (some time before 2.9.4) don't have dnl Older versions of Cyassl (some time before 2.9.4) don't have
dnl SSL_get_shutdown (but this check won't actually detect it there dnl SSL_get_shutdown (but this check won't actually detect it there
dnl as it's a macro that needs the header files be included) dnl as it's a macro that needs the header files be included)
dnl BoringSSL didn't have DES_set_odd_parity for a while but now it is
dnl back again.
AC_CHECK_FUNCS( RAND_status \ AC_CHECK_FUNCS( RAND_status \
RAND_screen \ RAND_screen \
@ -1638,7 +1640,8 @@ if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
ENGINE_cleanup \ ENGINE_cleanup \
CRYPTO_cleanup_all_ex_data \ CRYPTO_cleanup_all_ex_data \
SSL_get_shutdown \ SSL_get_shutdown \
SSLv2_client_method ) SSLv2_client_method \
DES_set_odd_parity )
AC_MSG_CHECKING([for BoringSSL]) AC_MSG_CHECKING([for BoringSSL])
AC_COMPILE_IFELSE([ AC_COMPILE_IFELSE([
@ -1653,7 +1656,6 @@ if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_BORINGSSL, 1, AC_DEFINE_UNQUOTED(HAVE_BORINGSSL, 1,
[Define to 1 if using BoringSSL.]) [Define to 1 if using BoringSSL.])
curl_ssl_msg="enabled (BoringSSL)"
],[ ],[
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
]) ])
@ -3891,9 +3893,8 @@ AC_MSG_NOTICE([Configured to build curl/libcurl:
--libcurl option: ${curl_libcurl_msg} --libcurl option: ${curl_libcurl_msg}
Verbose errors: ${curl_verbose_msg} Verbose errors: ${curl_verbose_msg}
SSPI support: ${curl_sspi_msg} SSPI support: ${curl_sspi_msg}
ca cert bundle: ${ca}${ca_warning} ca cert bundle: ${ca}
ca cert path: ${capath}${capath_warning} ca cert path: ${capath}
ca fallback: ${with_ca_fallback}
LDAP support: ${curl_ldap_msg} LDAP support: ${curl_ldap_msg}
LDAPS support: ${curl_ldaps_msg} LDAPS support: ${curl_ldaps_msg}
RTSP support: ${curl_rtsp_msg} RTSP support: ${curl_rtsp_msg}

View File

@ -10,7 +10,7 @@
# #
# 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
# are also available at https://curl.haxx.se/docs/copyright.html. # are also available at http://curl.haxx.se/docs/copyright.html.
# #
# You may opt to use, copy, modify, merge, publish, distribute and/or sell # 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 # copies of the Software, and permit persons to whom the Software is

View File

@ -27,7 +27,7 @@ Basic
C C
libcurl is a C library in itself! libcurl is a C library in itself!
https://curl.haxx.se/libcurl/ http://curl.haxx.se/libcurl/
C++ C++
@ -184,7 +184,7 @@ Rexx
RPG RPG
Support for ILE/RPG on OS/400 is included in source distribution Support for ILE/RPG on OS/400 is included in source distribution
https://curl.haxx.se/libcurl/ http://curl.haxx.se/libcurl/
See packages/OS400/README.OS400 and packages/OS400/curl.inc.in See packages/OS400/README.OS400 and packages/OS400/curl.inc.in
Ruby Ruby

View File

@ -35,12 +35,12 @@ BUGS
have a go at a solution. You can optionally also post your bug/problem at have a go at a solution. You can optionally also post your bug/problem at
curl's bug tracking system over at curl's bug tracking system over at
https://github.com/curl/curl/issues https://github.com/bagder/curl/issues
Please read the rest of this document below first before doing that! Please read the rest of this document below first before doing that!
If you feel you need to ask around first, find a suitable mailing list and If you feel you need to ask around first, find a suitable mailing list and
post there. The lists are available on https://curl.haxx.se/mail/ post there. The lists are available on http://curl.haxx.se/mail/
1.3 What to report 1.3 What to report

View File

@ -1,185 +0,0 @@
# cURL C code style
Source code that has a common style is easier to read than code that uses
different styles in different places. It helps making the code feel like one
single code base. Easy-to-read is a very important property of code and helps
making it easier to review when new things are added and it helps debugging
code when developers are trying to figure out why things go wrong. A unified
style is more important than individual contributors having their own personal
tastes satisfied.
Our C code has a few style rules. Most of them are verified and upheld by the
lib/checksrc.pl script. Invoked with `make checksrc` or even by default by the
build system when built after `./configure --enable-debug` has been used.
It is normally not a problem for anyone to follow the guidelines, as you just
need to copy the style already used in the source code and there are no
particularly unusual rules in our set of rules.
We also work hard on writing code that are warning-free on all the major
platforms and in general on as many platforms as possible. Code that obviously
will cause warnings will not be accepted as-is.
## Naming
Try using a non-confusing naming scheme for your new functions and variable
names. It doesn't necessarily have to mean that you should use the same as in
other places of the code, just that the names should be logical,
understandable and be named according to what they're used for. File-local
functions should be made static. We like lower case names.
See the INTERNALS document on how we name non-exported library-global symbols.
## Indenting
We use only spaces for indentation, never TABs. We use two spaces for each new
open brace.
if(something_is_true) {
while(second_statement == fine) {
moo();
}
}
## Comments
Since we write C89 code, `//` comments are not allowed. They weren't
introduced in the C standard until C99. We use only `/*` and `*/` comments:
/* this is a comment */
## Long lines
Source code in curl may never be wider than 80 columns and there are two
reasons for maintaining this even in the modern era of very large and high
resolution screens:
1. Narrower columns are easier to read than very wide ones. There's a reason
newspapers have used columns for decades or centuries.
2. Narrower columns allow developers to easier show multiple pieces of code
next to each other in different windows. I often have two or three source
code windows next to each other on the same screen - as well as multiple
terminal and debugging windows.
## Braces
In if/while/do/for expressions, we write the open brace on the same line as
the keyword and we then set the closing brace on the same indentation level as
the initial keyword. Like this:
if(age < 40) {
/* clearly a youngster */
}
When we write functions however, the opening brace should be in the first
column of the first line:
int main(int argc, char **argv)
{
return 1;
}
## 'else' on the following line
When adding an `else` clause to a conditional expression using braces, we add
it on a new line after the closing brace. Like this:
if(age < 40) {
/* clearly a youngster */
}
else {
/* probably grumpy */
}
## No space before parentheses
When writing expressions using if/while/do/for, there shall be no space
between the keyword and the open parenthesis. Like this:
while(1) {
/* loop forever */
}
## Use boolean conditions
Rather than test a conditional value such as a bool against TRUE or FALSE, a
pointer against NULL or != NULL and an int against zero or not zero in
if/while conditions we prefer:
result = do_something();
if(!result) {
/* something went wrong */
return result;
}
## No assignments in conditions
To increase readability and reduce complexity of conditionals, we avoid
assigning variables within if/while conditions. We frown upon this style:
if((ptr = malloc(100)) == NULL)
return NULL;
and instead we encourage the above version to be spelled out more clearly:
ptr = malloc(100);
if(!ptr)
return NULL;
## New block on a new line
We never write multiple statements on the same source line, even for very
short if() conditions.
if(a)
return TRUE;
else if(b)
return FALSE;
and NEVER:
if(a) return TRUE;
else if(b) return FALSE;
## Space around operators
Please use spaces on both sides of operators in C expressions. Postfix `(),
[], ->, ., ++, --` and Unary `+, - !, ~, &` operators excluded they should
have no space.
Examples:
bla = func();
who = name[0];
age += 1;
true = !false;
size += -2 + 3 * (a + b);
ptr->member = a++;
struct.field = b--;
ptr = &address;
contents = *pointer;
complement = ~bits;
## Platform dependent code
Use `#ifdef HAVE_FEATURE` to do conditional code. We avoid checking for
particular operating systems or hardware in the #ifdef lines. The HAVE_FEATURE
shall be generated by the configure script for unix-like systems and they are
hard-coded in the config-[system].h files for the others.
We also encourage use of macros/functions that possibly are empty or defined
to constants when libcurl is built without that feature, to make the code
seamless. Like this style where the `magic()` function works differently
depending on a build-time conditional:
#ifdef HAVE_MAGIC
void magic(int a)
{
return a + 2;
}
#else
#define magic(x) 1
#endif
int content = magic(3);

View File

@ -15,13 +15,18 @@
1.2 License 1.2 License
1.3 What To Read 1.3 What To Read
2. Write a good patch 2. cURL Coding Standards
2.1 Follow code style 2.1 Naming
2.2 Non-clobbering All Over 2.2 Indenting
2.3 Write Separate Patches 2.3 Commenting
2.4 Patch Against Recent Sources 2.4 Line Lengths
2.5 Document 2.5 General Style
2.6 Test Cases 2.6 Non-clobbering All Over
2.7 Platform Dependent Code
2.8 Write Separate Patches
2.9 Patch Against Recent Sources
2.10 Document
2.11 Test Cases
3. Pushing Out Your Changes 3. Pushing Out Your Changes
3.1 Write Access to git Repository 3.1 Write Access to git Repository
@ -37,13 +42,13 @@
1.1 Join the Community 1.1 Join the Community
Skip over to https://curl.haxx.se/mail/ and join the appropriate mailing Skip over to http://curl.haxx.se/mail/ and join the appropriate mailing
list(s). Read up on details before you post questions. Read this file before list(s). Read up on details before you post questions. Read this file before
you start sending patches! We prefer patches and discussions being held on you start sending patches! We prefer patches and discussions being held on
the mailing list(s), not sent to individuals. the mailing list(s), not sent to individuals.
Before posting to one of the curl mailing lists, please read up on the mailing Before posting to one of the curl mailing lists, please read up on the mailing
list etiquette: https://curl.haxx.se/mail/etiquette.html list etiquette: http://curl.haxx.se/mail/etiquette.html
We also hang out on IRC in #curl on irc.freenode.net We also hang out on IRC in #curl on irc.freenode.net
@ -82,15 +87,48 @@
list is gonna give you a lot of insights on what's going on right now. Asking list is gonna give you a lot of insights on what's going on right now. Asking
there is a good idea too. there is a good idea too.
2. Write a good patch 2. cURL Coding Standards
2.1 Follow code style 2.1 Naming
When writing C code, follow the CODE_STYLE already established in the Try using a non-confusing naming scheme for your new functions and variable
project. Consistent style makes code easier to read and mistakes less likely names. It doesn't necessarily have to mean that you should use the same as in
to happen. other places of the code, just that the names should be logical,
understandable and be named according to what they're used for. File-local
functions should be made static. We like lower case names.
2.2 Non-clobbering All Over See the INTERNALS document on how we name non-exported library-global
symbols.
2.2 Indenting
Use the same indenting levels and bracing method as all the other code
already does. It makes the source code easier to follow if all of it is
written using the same style. We don't ask you to like it, we just ask you to
follow the tradition! ;-) This mainly means: 2-level indents, using spaces
only (no tabs) and having the opening brace ({) on the same line as the if()
or while().
Also note that we use if() and while() with no space before the parenthesis.
2.3 Commenting
Comment your source code extensively using C comments (/* comment */), DO NOT
use C++ comments (// this style). Commented code is quality code and enables
future modifications much more. Uncommented code risk having to be completely
replaced when someone wants to extend things, since other persons' source
code can get quite hard to read.
2.4 Line Lengths
We write source lines shorter than 80 columns.
2.5 General Style
Keep your functions small. If they're small you avoid a lot of mistakes and
you don't accidentally mix up variables etc.
2.6 Non-clobbering All Over
When you write new functionality or fix bugs, it is important that you don't When you write new functionality or fix bugs, it is important that you don't
fiddle all over the source files and functions. Remember that it is likely fiddle all over the source files and functions. Remember that it is likely
@ -99,7 +137,14 @@
functionality, try writing it in a new source file. If you fix bugs, try to functionality, try writing it in a new source file. If you fix bugs, try to
fix one bug at a time and send them as separate patches. fix one bug at a time and send them as separate patches.
2.3 Write Separate Patches 2.7 Platform Dependent Code
Use #ifdef HAVE_FEATURE to do conditional code. We avoid checking for
particular operating systems or hardware in the #ifdef lines. The
HAVE_FEATURE shall be generated by the configure script for unix-like systems
and they are hard-coded in the config-[system].h files for the others.
2.8 Write Separate Patches
It is annoying when you get a huge patch from someone that is said to fix 511 It is annoying when you get a huge patch from someone that is said to fix 511
odd problems, but discussions and opinions don't agree with 510 of them - or odd problems, but discussions and opinions don't agree with 510 of them - or
@ -113,14 +158,14 @@
Also, separate patches enable bisecting much better when we track problems in Also, separate patches enable bisecting much better when we track problems in
the future. the future.
2.4 Patch Against Recent Sources 2.9 Patch Against Recent Sources
Please try to get the latest available sources to make your patches Please try to get the latest available sources to make your patches
against. It makes the life of the developers so much easier. The very best is against. It makes the life of the developers so much easier. The very best is
if you get the most up-to-date sources from the git repository, but the if you get the most up-to-date sources from the git repository, but the
latest release archive is quite OK as well! latest release archive is quite OK as well!
2.5 Document 2.10 Document
Writing docs is dead boring and one of the big problems with many open source Writing docs is dead boring and one of the big problems with many open source
projects. Someone's gotta do it. It makes it a lot easier if you submit a projects. Someone's gotta do it. It makes it a lot easier if you submit a
@ -131,7 +176,7 @@
ASCII files. All HTML files on the web site and in the release archives are ASCII files. All HTML files on the web site and in the release archives are
generated from the nroff/ASCII versions. generated from the nroff/ASCII versions.
2.6 Test Cases 2.11 Test Cases
Since the introduction of the test suite, we can quickly verify that the main Since the introduction of the test suite, we can quickly verify that the main
features are working as they're supposed to. To maintain this situation and features are working as they're supposed to. To maintain this situation and
@ -158,7 +203,7 @@
You need to first checkout the repository: You need to first checkout the repository:
git clone https://github.com/curl/curl.git git clone https://github.com/bagder/curl.git
You then proceed and edit all the files you like and you commit them to your You then proceed and edit all the files you like and you commit them to your
local repository: local repository:

View File

@ -30,7 +30,6 @@ FAQ
2.2 Does curl work/build with other SSL libraries? 2.2 Does curl work/build with other SSL libraries?
2.3 Where can I find a copy of LIBEAY32.DLL? 2.3 Where can I find a copy of LIBEAY32.DLL?
2.4 Does curl support SOCKS (RFC 1928) ? 2.4 Does curl support SOCKS (RFC 1928) ?
2.5 Install libcurl for both 32bit and 64bit?
3. Usage Problems 3. Usage Problems
3.1 curl: (1) SSL is disabled, https: not supported 3.1 curl: (1) SSL is disabled, https: not supported
@ -227,7 +226,7 @@ FAQ
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. Simply go to the GitHub repo which resides at
https://github.com/curl/curl, fork the project, and create pull requests https://github.com/bagder/curl, fork the project, and create pull requests
with your proposed changes. 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.
@ -255,7 +254,7 @@ 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 at
https://github.com/curl/curl. Also again, some companies have sponsored https://github.com/bagder/curl. Also again, some companies have sponsored
certain parts of the development in the past and I hope some will continue to certain parts of the development in the past and I hope some will continue to
do so in the future. do so in the future.
@ -282,7 +281,7 @@ FAQ
Please do not mail any single individual unless you really need to. Keep Please do not mail any single individual unless you really need to. Keep
curl-related questions on a suitable mailing list. All available mailing curl-related questions on a suitable mailing list. All available mailing
lists are listed in the MANUAL document and online at lists are listed in the MANUAL document and online at
https://curl.haxx.se/mail/ http://curl.haxx.se/mail/
Keeping curl-related questions and discussions on mailing lists allows Keeping curl-related questions and discussions on mailing lists allows
others to join in and help, to share their ideas, contribute their others to join in and help, to share their ideas, contribute their
@ -303,7 +302,7 @@ FAQ
your curl-related problems. your curl-related problems.
We list available alternatives on the curl web site: We list available alternatives on the curl web site:
https://curl.haxx.se/support.html http://curl.haxx.se/support.html
1.10 How many are using curl? 1.10 How many are using curl?
@ -320,7 +319,7 @@ FAQ
In May 2012 Daniel did a counting game and came up with a number that may In May 2012 Daniel did a counting game and came up with a number that may
be completely wrong or somewhat accurate. Over 500 million! be completely wrong or somewhat accurate. Over 500 million!
See https://daniel.haxx.se/blog/2012/05/16/300m-users/ See http://daniel.haxx.se/blog/2012/05/16/300m-users/
1.11 Why don't you update ca-bundle.crt 1.11 Why don't you update ca-bundle.crt
@ -342,7 +341,7 @@ FAQ
If you want the most recent collection of ca certs that Mozilla Firefox If you want the most recent collection of ca certs that Mozilla Firefox
uses, we recommend that you extract the collection yourself from Mozilla uses, we recommend that you extract the collection yourself from Mozilla
Firefox (by running 'make ca-bundle), or by using our online service setup Firefox (by running 'make ca-bundle), or by using our online service setup
for this purpose: https://curl.haxx.se/docs/caextract.html for this purpose: http://curl.haxx.se/docs/caextract.html
1.12 I have a problem who can I chat with? 1.12 I have a problem who can I chat with?
@ -450,7 +449,7 @@ FAQ
GnuTLS, yassl, NSS, PolarSSL, axTLS, Secure Transport (native iOS/OS X), GnuTLS, yassl, NSS, PolarSSL, axTLS, Secure Transport (native iOS/OS X),
WinSSL (native Windows) or GSKit (native IBM i). They all have their pros WinSSL (native Windows) or GSKit (native IBM i). They all have their pros
and cons, and we try to maintain a comparison of them here: and cons, and we try to maintain a comparison of them here:
https://curl.haxx.se/docs/ssl-compared.html http://curl.haxx.se/docs/ssl-compared.html
2.3 Where can I find a copy of LIBEAY32.DLL? 2.3 Where can I find a copy of LIBEAY32.DLL?
@ -465,32 +464,6 @@ FAQ
Yes, SOCKS 4 and 5 are supported. Yes, SOCKS 4 and 5 are supported.
2.5 Install libcurl for both 32bit and 64bit?
In curl's configure procedure one of the regular include files get created
with platform specific information. The file 'curl/curlbuild.h' in the
installed libcurl file tree is therefore somewhat tied to that particular
platform.
To allow applications to get built for either 32bit or 64bit you need to
install libcurl headers for both setups and unfortunately curl doesn't do
this automatically.
A commonly used procedure is this:
$ ./configure [32bit platform]
$ mv curl/curlbuild.h curl/curlbuild-32bit.h
$ ./configure [64bit platform]
$ mv curl/curlbuild.h curl/curlbuild-64bit.h
Then you make a toplevel curl/curlbuild.h replacement that only does this:
#ifdef IS_32BIT
#include "curlbuild-32bit.h"
else
#include "curlbuild-64bit.h"
#endif
3. Usage problems 3. Usage problems
@ -588,7 +561,7 @@ FAQ
Find out more about which languages that support curl directly, and how to Find out more about which languages that support curl directly, and how to
install and use them, in the libcurl section of the curl web site: install and use them, in the libcurl section of the curl web site:
https://curl.haxx.se/libcurl/ http://curl.haxx.se/libcurl/
All the various bindings to libcurl are made by other projects and people, All the various bindings to libcurl are made by other projects and people,
outside of the cURL project. The cURL project itself only produces libcurl outside of the cURL project. The cURL project itself only produces libcurl
@ -721,7 +694,7 @@ FAQ
certificate. Server certificate verification is enabled by default in curl certificate. Server certificate verification is enabled by default in curl
and libcurl and is often the reason for problems as explained in FAQ entry and libcurl and is often the reason for problems as explained in FAQ entry
4.12 and the SSLCERTS document 4.12 and the SSLCERTS document
(https://curl.haxx.se/docs/sslcerts.html). Server certificates that are (http://curl.haxx.se/docs/sslcerts.html). Server certificates that are
"self-signed" or otherwise signed by a CA that you do not have a CA cert "self-signed" or otherwise signed by a CA that you do not have a CA cert
for, cannot be verified. If the verification during a connect fails, you are for, cannot be verified. If the verification during a connect fails, you are
refused access. You then need to explicitly disable the verification to refused access. You then need to explicitly disable the verification to
@ -1012,7 +985,7 @@ FAQ
this check. this check.
Details are also in the SSLCERTS file in the release archives, found online Details are also in the SSLCERTS file in the release archives, found online
here: https://curl.haxx.se/docs/sslcerts.html here: http://curl.haxx.se/docs/sslcerts.html
4.13 Why is curl -R on Windows one hour off? 4.13 Why is curl -R on Windows one hour off?
@ -1429,7 +1402,7 @@ FAQ
to do "LIST -a" or similar to see them. to do "LIST -a" or similar to see them.
The application thus needs to parse the LIST output. One such existing The application thus needs to parse the LIST output. One such existing
list parser is available at https://cr.yp.to/ftpparse.html Versions of list parser is available at http://cr.yp.to/ftpparse.html Versions of
libcurl since 7.21.0 also provide the ability to specify a wildcard to libcurl since 7.21.0 also provide the ability to specify a wildcard to
download multiple files from one FTP directory. download multiple files from one FTP directory.
@ -1548,7 +1521,7 @@ FAQ
notice" somewhere. Most probably like in the documentation or in the section notice" somewhere. Most probably like in the documentation or in the section
where other third party dependencies already are mentioned and acknowledged. where other third party dependencies already are mentioned and acknowledged.
As can be seen here: https://curl.haxx.se/docs/companies.html and elsewhere, As can be seen here: http://curl.haxx.se/docs/companies.html and elsewhere,
more and more companies are discovering the power of libcurl and take more and more companies are discovering the power of libcurl and take
advantage of it even in commercial environments. advantage of it even in commercial environments.

View File

@ -65,7 +65,7 @@ OpenSSL took over where SSLeay was abandoned.
May, first Debian package. May, first Debian package.
August, LDAP:// and FILE:// support added. The curl web site gets 1300 visits August, LDAP:// and FILE:// support added. The curl web site gets 1300 visits
weekly. Moved site to curl.haxx.nu. weekly.
Released curl 6.0 in September. 15000 lines of code. Released curl 6.0 in September. 15000 lines of code.
@ -81,8 +81,6 @@ the easy interface and turned out to be the beginning of actually getting
other software and programs to get based on and powered by libcurl. Almost other software and programs to get based on and powered by libcurl. Almost
20000 lines of code. 20000 lines of code.
June 2000: the curl site moves to "curl.haxx.se"
August, the curl web site gets 4000 visits weekly. August, the curl web site gets 4000 visits weekly.
The PHP guys adopted libcurl already the same month, when the first ever third The PHP guys adopted libcurl already the same month, when the first ever third

View File

@ -1,4 +1,4 @@
Updated: July 3, 2012 (https://curl.haxx.se/docs/http-cookies.html) Updated: July 3, 2012 (http://curl.haxx.se/docs/http-cookies.html)
_ _ ____ _ _ _ ____ _
___| | | | _ \| | ___| | | | _ \| |
/ __| | | | |_) | | / __| | | | |_) | |
@ -34,7 +34,7 @@ HTTP Cookies
servers with the Cookie: header. servers with the Cookie: header.
For a very long time, the only spec explaining how to use cookies was the For a very long time, the only spec explaining how to use cookies was the
original Netscape spec from 1994: https://curl.haxx.se/rfc/cookie_spec.html original Netscape spec from 1994: http://curl.haxx.se/rfc/cookie_spec.html
In 2011, RFC6265 (https://www.ietf.org/rfc/rfc6265.txt) was finally published In 2011, RFC6265 (https://www.ietf.org/rfc/rfc6265.txt) was finally published
and details how cookies work within HTTP. and details how cookies work within HTTP.

View File

@ -2,7 +2,7 @@ HTTP/2 with curl
================ ================
[HTTP/2 Spec](https://www.rfc-editor.org/rfc/rfc7540.txt) [HTTP/2 Spec](https://www.rfc-editor.org/rfc/rfc7540.txt)
[http2 explained](https://daniel.haxx.se/http2/) [http2 explained](http://daniel.haxx.se/http2/)
Build prerequisites Build prerequisites
------------------- -------------------
@ -36,17 +36,12 @@ Over an https:// URL
If `CURLOPT_HTTP_VERSION` is set to `CURL_HTTP_VERSION_2_0`, libcurl will use If `CURLOPT_HTTP_VERSION` is set to `CURL_HTTP_VERSION_2_0`, libcurl will use
ALPN (or NPN) to negotiate which protocol to continue with. Possibly introduce ALPN (or NPN) to negotiate which protocol to continue with. Possibly introduce
an option that will cause libcurl to fail if not possible to use HTTP/2. an option that will cause libcurl to fail if not possible to use HTTP/2.
Consider options to explicitly disable ALPN and/or NPN.
`CURL_HTTP_VERSION_2TLS` was added in 7.47.0 as a way to ask libcurl to prefer
HTTP/2 for HTTPS but stick to 1.1 by default for plain old HTTP connections.
ALPN is the TLS extension that HTTP/2 is expected to use. The NPN extension is ALPN is the TLS extension that HTTP/2 is expected to use. The NPN extension is
for a similar purpose, was made prior to ALPN and is used for SPDY so early for a similar purpose, was made prior to ALPN and is used for SPDY so early
HTTP/2 servers are implemented using NPN before ALPN support is widespread. HTTP/2 servers are implemented using NPN before ALPN support is widespread.
`CURLOPT_SSL_ENABLE_ALPN` and `CURLOPT_SSL_ENABLE_NPN` are offered to allow
applications to explicitly disable ALPN or NPN.
SSL libs SSL libs
-------- --------
@ -89,9 +84,7 @@ in HTTP 1.1 style. This allows applications to work unmodified.
curl tool curl tool
--------- ---------
curl offers the `--http2` command line option to enable use of HTTP/2. curl offers the `--http2` command line option to enable use of HTTP/2
Since 7.47.0, the curl tool enables HTTP/2 by default for HTTPS connections.
HTTP Alternative Services HTTP Alternative Services
------------------------- -------------------------
@ -102,7 +95,7 @@ same origin server that you get the response from. A browser or long-living
client can use that hint to create a new connection asynchronously. For client can use that hint to create a new connection asynchronously. For
libcurl, we may introduce a way to bring such clues to the applicaton and/or libcurl, we may introduce a way to bring such clues to the applicaton and/or
let a subsequent request use the alternate route let a subsequent request use the alternate route
automatically. [Spec](https://tools.ietf.org/html/draft-ietf-httpbis-alt-svc-14) automatically. [Spec](https://tools.ietf.org/html/draft-ietf-httpbis-alt-svc-05)
TODO TODO
---- ----

View File

@ -706,7 +706,7 @@ NetWare
Builds automatically created 8 times a day from current git are here: Builds automatically created 8 times a day from current git are here:
http://www.gknw.net/mirror/curl/autobuilds/ http://www.gknw.net/mirror/curl/autobuilds/
the status of these builds can be viewed at the autobuild table: the status of these builds can be viewed at the autobuild table:
https://curl.haxx.se/dev/builds.html http://curl.haxx.se/dev/builds.html
eCos eCos
==== ====

View File

@ -248,7 +248,7 @@ SSL Files
openssl-0.9.7e-win32-bin.zip for the minimalist package of the openssl-0.9.7e openssl-0.9.7e-win32-bin.zip for the minimalist package of the openssl-0.9.7e
binaries ported to MS Windows 95/98/NT/XP using the MingW32/GCC-3.1 binaries ported to MS Windows 95/98/NT/XP using the MingW32/GCC-3.1
development environment. The file may be downloaded at development environment. The file may be downloaded at
https://curl.haxx.se/download/. http://curl.haxx.se/download/.
2- Open the above zip file. You will find two files - SDL.dll, 2- Open the above zip file. You will find two files - SDL.dll,
SDL_mixer.dll. Install them in the directory C:\WINDOWS\SYSTEM32 for Win 9x SDL_mixer.dll. Install them in the directory C:\WINDOWS\SYSTEM32 for Win 9x

View File

@ -1079,17 +1079,17 @@ for older and later versions as things don't change drastically that often.
the share API. the share API.
[1]: https://curl.haxx.se/libcurl/c/curl_easy_setopt.html [1]: http://curl.haxx.se/libcurl/c/curl_easy_setopt.html
[2]: https://curl.haxx.se/libcurl/c/curl_easy_init.html [2]: http://curl.haxx.se/libcurl/c/curl_easy_init.html
[3]: http://c-ares.haxx.se/ [3]: http://c-ares.haxx.se/
[4]: https://tools.ietf.org/html/rfc7230 "RFC 7230" [4]: https://tools.ietf.org/html/rfc7230 "RFC 7230"
[5]: https://curl.haxx.se/libcurl/c/CURLOPT_ACCEPT_ENCODING.html [5]: http://curl.haxx.se/libcurl/c/CURLOPT_ACCEPT_ENCODING.html
[6]: https://curl.haxx.se/docs/manpage.html#--compressed [6]: http://curl.haxx.se/docs/manpage.html#--compressed
[7]: https://curl.haxx.se/libcurl/c/curl_multi_socket_action.html [7]: http://curl.haxx.se/libcurl/c/curl_multi_socket_action.html
[8]: https://curl.haxx.se/libcurl/c/curl_multi_timeout.html [8]: http://curl.haxx.se/libcurl/c/curl_multi_timeout.html
[9]: https://curl.haxx.se/libcurl/c/curl_multi_setopt.html [9]: http://curl.haxx.se/libcurl/c/curl_multi_setopt.html
[10]: https://curl.haxx.se/libcurl/c/CURLMOPT_TIMERFUNCTION.html [10]: http://curl.haxx.se/libcurl/c/CURLMOPT_TIMERFUNCTION.html
[11]: https://curl.haxx.se/libcurl/c/curl_multi_perform.html [11]: http://curl.haxx.se/libcurl/c/curl_multi_perform.html
[12]: https://curl.haxx.se/libcurl/c/curl_multi_fdset.html [12]: http://curl.haxx.se/libcurl/c/curl_multi_fdset.html
[13]: https://curl.haxx.se/libcurl/c/curl_multi_add_handle.html [13]: http://curl.haxx.se/libcurl/c/curl_multi_add_handle.html
[14]: https://curl.haxx.se/libcurl/c/curl_multi_info_read.html [14]: http://curl.haxx.se/libcurl/c/curl_multi_info_read.html

View File

@ -3,35 +3,17 @@ join in and help us correct one or more of these! Also be sure to check the
changelog of the current development status, as one or more of these problems changelog of the current development status, as one or more of these problems
may have been fixed since this was written! may have been fixed since this was written!
93. It is not possible to pass a 64-bit value using CURLFORM_CONTENTLEN with
CURLFORM_ARRAY, when compiled on 32-bit platforms that support 64-bit
integers. This is because the underlying structure 'curl_forms' uses a dual
purpose char* for storing these values in via casting. For more information
see the now closed related issue:
https://github.com/curl/curl/issues/608
92. curl tool 7.47.1 in Windows will not --output to literal paths \\?\ or to
reserved dos device names unless the device prefix \\.\ is used. To send
output to a device that has a reserved dos device name you can use the
Windows device prefix (eg: --output \\.\NUL). You can also use the
redirection operator to send output to a literal path or a reserved device
name (eg: > NUL).
The next release of curl will support --output in Windows to literal paths
and to reserved device names without the device prefix.
https://github.com/curl/curl/commit/c3aac48
https://github.com/curl/curl/commit/4fc80f3
91. "curl_easy_perform hangs with imap and PolarSSL" 91. "curl_easy_perform hangs with imap and PolarSSL"
https://github.com/curl/curl/issues/334 https://github.com/bagder/curl/issues/334
90. IMAP "SEARCH ALL" truncates output on large boxes. "A quick search of the 90. IMAP "SEARCH ALL" truncates output on large boxes. "A quick search of the
code reveals that pingpong.c contains some truncation code, at line 408, code reveals that pingpong.c contains some truncation code, at line 408,
when it deems the server response to be too large truncating it to 40 when it deems the server response to be too large truncating it to 40
characters" characters"
https://curl.haxx.se/bug/view.cgi?id=1366 http://curl.haxx.se/bug/view.cgi?id=1366
89. Disabling HTTP Pipelining when there are ongoing transfers can lead to 89. Disabling HTTP Pipelining when there are ongoing transfers can lead to
heap corruption and crash. https://curl.haxx.se/bug/view.cgi?id=1411 heap corruption and crash. http://curl.haxx.se/bug/view.cgi?id=1411
88. libcurl doesn't support CURLINFO_FILETIME for SFTP transfers and thus 88. libcurl doesn't support CURLINFO_FILETIME for SFTP transfers and thus
curl's -R option also doesn't work then. curl's -R option also doesn't work then.
@ -42,7 +24,7 @@ may have been fixed since this was written!
mention that decoding also means that we need to check for nastiness that is mention that decoding also means that we need to check for nastiness that is
attempted, like "../" sequences and the like. Probably everything to the left attempted, like "../" sequences and the like. Probably everything to the left
of any embedded slashes should be cut off. of any embedded slashes should be cut off.
https://curl.haxx.se/bug/view.cgi?id=1294 http://curl.haxx.se/bug/view.cgi?id=1294
86. The disconnect commands (LOGOUT and QUIT) may not be sent by IMAP, POP3 86. The disconnect commands (LOGOUT and QUIT) may not be sent by IMAP, POP3
and SMTP if a failure occurs during the authentication phase of a and SMTP if a failure occurs during the authentication phase of a
@ -53,8 +35,8 @@ may have been fixed since this was written!
CURLINFO_STARTTRANSFER_TIME is wrong. While using POST CURLINFO_STARTTRANSFER_TIME is wrong. While using POST
CURLINFO_STARTTRANSFER_TIME minus CURLINFO_PRETRANSFER_TIME is near to zero CURLINFO_STARTTRANSFER_TIME minus CURLINFO_PRETRANSFER_TIME is near to zero
every time. every time.
https://github.com/curl/curl/issues/218 https://github.com/bagder/curl/issues/218
https://curl.haxx.se/bug/view.cgi?id=1213 http://curl.haxx.se/bug/view.cgi?id=1213
84. CURLINFO_SSL_VERIFYRESULT is only implemented for the OpenSSL and NSS 84. CURLINFO_SSL_VERIFYRESULT is only implemented for the OpenSSL and NSS
backends, so relying on this information in a generic app is flaky. backends, so relying on this information in a generic app is flaky.
@ -62,48 +44,48 @@ may have been fixed since this was written!
82. When building with the Windows Borland compiler, it fails because the 82. When building with the Windows Borland compiler, it fails because the
"tlib" tool doesn't support hyphens (minus signs) in file names and we have "tlib" tool doesn't support hyphens (minus signs) in file names and we have
such in the build. such in the build.
https://curl.haxx.se/bug/view.cgi?id=1222 http://curl.haxx.se/bug/view.cgi?id=1222
81. When using -J (with -O), automatically resumed downloading together with 81. When using -J (with -O), automatically resumed downloading together with
"-C -" fails. Without -J the same command line works! This happens because "-C -" fails. Without -J the same command line works! This happens because
the resume logic is worked out before the target file name (and thus its the resume logic is worked out before the target file name (and thus its
pre-transfer size) has been figured out! pre-transfer size) has been figured out!
https://curl.haxx.se/bug/view.cgi?id=1169 http://curl.haxx.se/bug/view.cgi?id=1169
80. Curl doesn't recognize certificates in DER format in keychain, but it 80. Curl doesn't recognize certificates in DER format in keychain, but it
works with PEM. works with PEM.
https://curl.haxx.se/bug/view.cgi?id=1065 http://curl.haxx.se/bug/view.cgi?id=1065
79. SMTP. When sending data to multiple recipients, curl will abort and return 79. SMTP. When sending data to multiple recipients, curl will abort and return
failure if one of the recipients indicate failure (on the "RCPT TO" failure if one of the recipients indicate failure (on the "RCPT TO"
command). Ordinary mail programs would proceed and still send to the ones command). Ordinary mail programs would proceed and still send to the ones
that can receive data. This is subject for change in the future. that can receive data. This is subject for change in the future.
https://curl.haxx.se/bug/view.cgi?id=1116 http://curl.haxx.se/bug/view.cgi?id=1116
75. NTLM authentication involving unicode user name or password only works 75. NTLM authentication involving unicode user name or password only works
properly if built with UNICODE defined together with the WinSSL/schannel properly if built with UNICODE defined together with the WinSSL/schannel
backend. The original problem was mentioned in: backend. The original problem was mentioned in:
https://curl.haxx.se/mail/lib-2009-10/0024.html http://curl.haxx.se/mail/lib-2009-10/0024.html
https://curl.haxx.se/bug/view.cgi?id=896 http://curl.haxx.se/bug/view.cgi?id=896
The WinSSL/schannel version verified to work as mentioned in The WinSSL/schannel version verified to work as mentioned in
https://curl.haxx.se/mail/lib-2012-07/0073.html http://curl.haxx.se/mail/lib-2012-07/0073.html
73. if a connection is made to a FTP server but the server then just never 73. if a connection is made to a FTP server but the server then just never
sends the 220 response or otherwise is dead slow, libcurl will not sends the 220 response or otherwise is dead slow, libcurl will not
acknowledge the connection timeout during that phase but only the "real" acknowledge the connection timeout during that phase but only the "real"
timeout - which may surprise users as it is probably considered to be the timeout - which may surprise users as it is probably considered to be the
connect phase to most people. Brought up (and is being misunderstood) in: connect phase to most people. Brought up (and is being misunderstood) in:
https://curl.haxx.se/bug/view.cgi?id=856 http://curl.haxx.se/bug/view.cgi?id=856
72. "Pausing pipeline problems." 72. "Pausing pipeline problems."
https://curl.haxx.se/mail/lib-2009-07/0214.html http://curl.haxx.se/mail/lib-2009-07/0214.html
70. Problem re-using easy handle after call to curl_multi_remove_handle 70. Problem re-using easy handle after call to curl_multi_remove_handle
https://curl.haxx.se/mail/lib-2009-07/0249.html http://curl.haxx.se/mail/lib-2009-07/0249.html
68. "More questions about ares behavior". 68. "More questions about ares behavior".
https://curl.haxx.se/mail/lib-2009-08/0012.html http://curl.haxx.se/mail/lib-2009-08/0012.html
67. When creating multipart formposts. The file name part can be encoded with 67. When creating multipart formposts. The file name part can be encoded with
something beyond ascii but currently libcurl will only pass in the verbatim something beyond ascii but currently libcurl will only pass in the verbatim
@ -112,7 +94,7 @@ may have been fixed since this was written!
https://tools.ietf.org/html/draft-reschke-rfc2231-in-http-02 https://tools.ietf.org/html/draft-reschke-rfc2231-in-http-02
66. When using telnet, the time limitation options don't work. 66. When using telnet, the time limitation options don't work.
https://curl.haxx.se/bug/view.cgi?id=846 http://curl.haxx.se/bug/view.cgi?id=846
65. When doing FTP over a socks proxy or CONNECT through HTTP proxy and the 65. When doing FTP over a socks proxy or CONNECT through HTTP proxy and the
multi interface is used, libcurl will fail if the (passive) TCP connection multi interface is used, libcurl will fail if the (passive) TCP connection
@ -123,27 +105,27 @@ may have been fixed since this was written!
63. When CURLOPT_CONNECT_ONLY is used, the handle cannot reliably be re-used 63. When CURLOPT_CONNECT_ONLY is used, the handle cannot reliably be re-used
for any further requests or transfers. The work-around is then to close that for any further requests or transfers. The work-around is then to close that
handle with curl_easy_cleanup() and create a new. Some more details: handle with curl_easy_cleanup() and create a new. Some more details:
https://curl.haxx.se/mail/lib-2009-04/0300.html http://curl.haxx.se/mail/lib-2009-04/0300.html
61. If an upload using Expect: 100-continue receives an HTTP 417 response, 61. If an upload using Expect: 100-continue receives an HTTP 417 response,
it ought to be automatically resent without the Expect:. A workaround is it ought to be automatically resent without the Expect:. A workaround is
for the client application to redo the transfer after disabling Expect:. for the client application to redo the transfer after disabling Expect:.
https://curl.haxx.se/mail/archive-2008-02/0043.html http://curl.haxx.se/mail/archive-2008-02/0043.html
60. libcurl closes the connection if an HTTP 401 reply is received while it 60. libcurl closes the connection if an HTTP 401 reply is received while it
is waiting for the the 100-continue response. is waiting for the the 100-continue response.
https://curl.haxx.se/mail/lib-2008-08/0462.html http://curl.haxx.se/mail/lib-2008-08/0462.html
58. It seems sensible to be able to use CURLOPT_NOBODY and 58. It seems sensible to be able to use CURLOPT_NOBODY and
CURLOPT_FAILONERROR with FTP to detect if a file exists or not, but it is CURLOPT_FAILONERROR with FTP to detect if a file exists or not, but it is
not working: https://curl.haxx.se/mail/lib-2008-07/0295.html not working: http://curl.haxx.se/mail/lib-2008-07/0295.html
56. When libcurl sends CURLOPT_POSTQUOTE commands when connected to a SFTP 56. When libcurl sends CURLOPT_POSTQUOTE commands when connected to a SFTP
server using the multi interface, the commands are not being sent correctly server using the multi interface, the commands are not being sent correctly
and instead the connection is "cancelled" (the operation is considered done) and instead the connection is "cancelled" (the operation is considered done)
prematurely. There is a half-baked (busy-looping) patch provided in the bug prematurely. There is a half-baked (busy-looping) patch provided in the bug
report but it cannot be accepted as-is. See report but it cannot be accepted as-is. See
https://curl.haxx.se/bug/view.cgi?id=748 http://curl.haxx.se/bug/view.cgi?id=748
55. libcurl fails to build with MIT Kerberos for Windows (KfW) due to KfW's 55. libcurl fails to build with MIT Kerberos for Windows (KfW) due to KfW's
library header files exporting symbols/macros that should be kept private library header files exporting symbols/macros that should be kept private
@ -152,13 +134,13 @@ may have been fixed since this was written!
52. Gautam Kachroo's issue that identifies a problem with the multi interface 52. Gautam Kachroo's issue that identifies a problem with the multi interface
where a connection can be re-used without actually being properly where a connection can be re-used without actually being properly
SSL-negotiated: SSL-negotiated:
https://curl.haxx.se/mail/lib-2008-01/0277.html http://curl.haxx.se/mail/lib-2008-01/0277.html
49. If using --retry and the transfer timeouts (possibly due to using -m or 49. If using --retry and the transfer timeouts (possibly due to using -m or
-y/-Y) the next attempt doesn't resume the transfer properly from what was -y/-Y) the next attempt doesn't resume the transfer properly from what was
downloaded in the previous attempt but will truncate and restart at the downloaded in the previous attempt but will truncate and restart at the
original position where it was at before the previous failed attempt. See original position where it was at before the previous failed attempt. See
https://curl.haxx.se/mail/lib-2008-01/0080.html and Mandriva bug report http://curl.haxx.se/mail/lib-2008-01/0080.html and Mandriva bug report
https://qa.mandriva.com/show_bug.cgi?id=22565 https://qa.mandriva.com/show_bug.cgi?id=22565
48. If a CONNECT response-headers are larger than BUFSIZE (16KB) when the 48. If a CONNECT response-headers are larger than BUFSIZE (16KB) when the
@ -167,25 +149,25 @@ may have been fixed since this was written!
protocol code. This should be very rare. protocol code. This should be very rare.
43. There seems to be a problem when connecting to the Microsoft telnet server. 43. There seems to be a problem when connecting to the Microsoft telnet server.
https://curl.haxx.se/bug/view.cgi?id=649 http://curl.haxx.se/bug/view.cgi?id=649
41. When doing an operation over FTP that requires the ACCT command (but not 41. When doing an operation over FTP that requires the ACCT command (but not
when logging in), the operation will fail since libcurl doesn't detect this when logging in), the operation will fail since libcurl doesn't detect this
and thus fails to issue the correct command: and thus fails to issue the correct command:
https://curl.haxx.se/bug/view.cgi?id=635 http://curl.haxx.se/bug/view.cgi?id=635
39. Steffen Rumler's Race Condition in Curl_proxyCONNECT: 39. Steffen Rumler's Race Condition in Curl_proxyCONNECT:
https://curl.haxx.se/mail/lib-2007-01/0045.html http://curl.haxx.se/mail/lib-2007-01/0045.html
38. Kumar Swamy Bhatt's problem in ftp/ssl "LIST" operation: 38. Kumar Swamy Bhatt's problem in ftp/ssl "LIST" operation:
https://curl.haxx.se/mail/lib-2007-01/0103.html http://curl.haxx.se/mail/lib-2007-01/0103.html
35. Both SOCKS5 and SOCKS4 proxy connections are done blocking, which is very 35. Both SOCKS5 and SOCKS4 proxy connections are done blocking, which is very
bad when used with the multi interface. bad when used with the multi interface.
34. The SOCKS4 connection codes don't properly acknowledge (connect) timeouts. 34. The SOCKS4 connection codes don't properly acknowledge (connect) timeouts.
Also see #12. According to bug #1556528, even the SOCKS5 connect code does Also see #12. According to bug #1556528, even the SOCKS5 connect code does
not do it right: https://curl.haxx.se/bug/view.cgi?id=604 not do it right: http://curl.haxx.se/bug/view.cgi?id=604
31. "curl-config --libs" will include details set in LDFLAGS when configure is 31. "curl-config --libs" will include details set in LDFLAGS when configure is
run that might be needed only for building libcurl. Further, curl-config run that might be needed only for building libcurl. Further, curl-config
@ -193,7 +175,7 @@ may have been fixed since this was written!
26. NTLM authentication using SSPI (on Windows) when (lib)curl is running in 26. NTLM authentication using SSPI (on Windows) when (lib)curl is running in
"system context" will make it use wrong(?) user name - at least when compared "system context" will make it use wrong(?) user name - at least when compared
to what winhttp does. See https://curl.haxx.se/bug/view.cgi?id=535 to what winhttp does. See http://curl.haxx.se/bug/view.cgi?id=535
23. SOCKS-related problems: 23. SOCKS-related problems:
B) libcurl doesn't support FTPS over a SOCKS proxy. B) libcurl doesn't support FTPS over a SOCKS proxy.
@ -239,8 +221,8 @@ may have been fixed since this was written!
10. To get HTTP Negotiate (SPNEGO) authentication to work fine, you need to 10. To get HTTP Negotiate (SPNEGO) authentication to work fine, you need to
provide a (fake) user name (this concerns both curl and the lib) because the provide a (fake) user name (this concerns both curl and the lib) because the
code wrongly only considers authentication if there's a user name provided. code wrongly only considers authentication if there's a user name provided.
https://curl.haxx.se/bug/view.cgi?id=440 How? http://curl.haxx.se/bug/view.cgi?id=440 How?
https://curl.haxx.se/mail/lib-2004-08/0182.html http://curl.haxx.se/mail/lib-2004-08/0182.html
8. Doing resumed upload over HTTP does not work with '-C -', because curl 8. Doing resumed upload over HTTP does not work with '-C -', because curl
doesn't do a HEAD first to get the initial size. This needs to be done doesn't do a HEAD first to get the initial size. This needs to be done
@ -256,4 +238,4 @@ may have been fixed since this was written!
5. libcurl doesn't treat the content-length of compressed data properly, as 5. libcurl doesn't treat the content-length of compressed data properly, as
it seems HTTP servers send the *uncompressed* length in that header and it seems HTTP servers send the *uncompressed* length in that header and
libcurl thinks of it as the *compressed* length. Some explanations are here: libcurl thinks of it as the *compressed* length. Some explanations are here:
https://curl.haxx.se/mail/lib-2003-06/0146.html http://curl.haxx.se/mail/lib-2003-06/0146.html

View File

@ -18,7 +18,7 @@ accompany your license with an exception[2]. This particular problem was
addressed when the Modified BSD license was created, which does not have the addressed when the Modified BSD license was created, which does not have the
announcement clause that collides with GPL. announcement clause that collides with GPL.
libcurl https://curl.haxx.se/docs/copyright.html libcurl http://curl.haxx.se/docs/copyright.html
Uses an MIT (or Modified BSD)-style license that is as liberal as Uses an MIT (or Modified BSD)-style license that is as liberal as
possible. possible.
@ -73,7 +73,7 @@ libressl http://www.libressl.org/
(May be used for SSL/TLS support) As an OpenSSL fork, it has the same (May be used for SSL/TLS support) As an OpenSSL fork, it has the same
license as that. license as that.
c-ares https://daniel.haxx.se/projects/c-ares/license.html c-ares http://daniel.haxx.se/projects/c-ares/license.html
(Used for asynchronous name resolves) Uses an MIT license that is very (Used for asynchronous name resolves) Uses an MIT license that is very
liberal and imposes no restrictions on any other library or part you liberal and imposes no restrictions on any other library or part you

View File

@ -33,7 +33,7 @@ MAIL ETIQUETTE
1.1 Mailing Lists 1.1 Mailing Lists
The mailing lists we have are all listed and described at The mailing lists we have are all listed and described at
https://curl.haxx.se/mail/ http://curl.haxx.se/mail/
Each mailing list is targeted to a specific set of users and subjects, Each mailing list is targeted to a specific set of users and subjects,
please use the one or the ones that suit you the most. please use the one or the ones that suit you the most.

View File

@ -3,7 +3,7 @@ LATEST VERSION
You always find news about what's going on as well as the latest versions You always find news about what's going on as well as the latest versions
from the curl web pages, located at: from the curl web pages, located at:
https://curl.haxx.se http://curl.haxx.se
SIMPLE USAGE SIMPLE USAGE
@ -824,7 +824,7 @@ LDAP
Working with LDAP URLs": Working with LDAP URLs":
http://developer.netscape.com/docs/manuals/dirsdk/csdk30/url.htm http://developer.netscape.com/docs/manuals/dirsdk/csdk30/url.htm
RFC 2255, "The LDAP URL Format" https://curl.haxx.se/rfc/rfc2255.txt RFC 2255, "The LDAP URL Format" http://curl.haxx.se/rfc/rfc2255.txt
To show you an example, this is how I can get all people from my local LDAP To show you an example, this is how I can get all people from my local LDAP
server that has a certain sub-domain in their email address: server that has a certain sub-domain in their email address:
@ -1011,7 +1011,7 @@ MAILING LISTS
For your convenience, we have several open mailing lists to discuss curl, For your convenience, we have several open mailing lists to discuss curl,
its development and things relevant to this. Get all info at its development and things relevant to this. Get all info at
https://curl.haxx.se/mail/. Some of the lists available are: http://curl.haxx.se/mail/. Some of the lists available are:
curl-users curl-users

View File

@ -5,11 +5,11 @@
# | (__| |_| | _ <| |___ # | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____| # \___|\___/|_| \_\_____|
# #
# 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
# are also available at https://curl.haxx.se/docs/copyright.html. # are also available at http://curl.haxx.se/docs/copyright.html.
# #
# You may opt to use, copy, modify, merge, publish, distribute and/or sell # 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 # copies of the Software, and permit persons to whom the Software is
@ -38,7 +38,7 @@ EXTRA_DIST = MANUAL BUGS CONTRIBUTE FAQ FEATURES INTERNALS SSLCERTS \
KNOWN_BUGS BINDINGS $(man_MANS) $(HTMLPAGES) HISTORY INSTALL \ KNOWN_BUGS BINDINGS $(man_MANS) $(HTMLPAGES) HISTORY INSTALL \
$(PDFPAGES) LICENSE-MIXING README.netware INSTALL.devcpp \ $(PDFPAGES) LICENSE-MIXING README.netware INSTALL.devcpp \
MAIL-ETIQUETTE HTTP-COOKIES SECURITY RELEASE-PROCEDURE SSL-PROBLEMS \ MAIL-ETIQUETTE HTTP-COOKIES SECURITY RELEASE-PROCEDURE SSL-PROBLEMS \
HTTP2.md ROADMAP.md CODE_OF_CONDUCT.md CODE_STYLE.md HTTP2.md ROADMAP.md CODE_OF_CONDUCT.md
MAN2HTML= roffit < $< >$@ MAN2HTML= roffit < $< >$@

View File

@ -24,6 +24,8 @@ in the source code repo
- upload the 8 resulting files to the primary download directory - upload the 8 resulting files to the primary download directory
- upload the 4 tarballs to github for the HTTPS download
in the curl-www repo in the curl-www repo
-------------------- --------------------

View File

@ -36,7 +36,7 @@ This document lists documents and standards used by curl.
RFC 2109 - HTTP State Management Mechanism (cookie stuff) RFC 2109 - HTTP State Management Mechanism (cookie stuff)
- Also, read Netscape's specification at - Also, read Netscape's specification at
https://curl.haxx.se/rfc/cookie_spec.html http://curl.haxx.se/rfc/cookie_spec.html
RFC 2183 - The Content-Disposition Header Field RFC 2183 - The Content-Disposition Header Field

View File

@ -23,19 +23,6 @@ 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.
HTTP cookies
------------
Two cookie drafts have been adopted by the httpwg in IETF and we should
support them as the popular browsers will as well:
[Deprecate modification of 'secure' cookies from non-secure
origins](https://tools.ietf.org/html/draft-ietf-httpbis-cookie-alone-00)
[Cookie Prefixes](https://tools.ietf.org/html/draft-ietf-httpbis-cookie-prefixes-00)
[Firefox bug report about secure cookies](https://bugzilla.mozilla.org/show_bug.cgi?id=976073)
SRV records SRV records
----------- -----------
@ -44,9 +31,7 @@ How to find services for specific domains/hosts.
HTTPS to proxy HTTPS to proxy
-------------- --------------
To avoid network traffic to/from the proxy getting snooped on. There's a git To avoid network traffic to/from the proxy getting snooped on.
branch in the public git repository for this that we need to make sure works
for all TLS backends and then merge!
curl_formadd() curl_formadd()
-------------- --------------

View File

@ -14,7 +14,7 @@ Publishing Information
---------------------- ----------------------
All known and public curl or libcurl related vulnerabilities are listed on All known and public curl or libcurl related vulnerabilities are listed on
[the curl web site security page](https://curl.haxx.se/docs/security.html). [the curl web site security page](http://curl.haxx.se/docs/security.html).
Security vulnerabilities should not be entered in the project's public bug Security vulnerabilities should not be entered in the project's public bug
tracker unless the necessary configuration is in place to limit access to the tracker unless the necessary configuration is in place to limit access to the

View File

@ -84,4 +84,4 @@ Disabling certificate revocation checks
References: References:
https://curl.haxx.se/docs/ssl-compared.html http://curl.haxx.se/docs/ssl-compared.html

View File

@ -20,8 +20,8 @@ support.
It is about trust It is about trust
----------------- -----------------
This system is about trust. In your local CA certificate store you have certs This system is about trust. In your local CA cert bundle you have certs from
from *trusted* Certificate Authorities that you then can use to verify that the *trusted* Certificate Authorities that you then can use to verify that the
server certificates you see are valid. They're signed by one of the CAs you server certificates you see are valid. They're signed by one of the CAs you
trust. trust.
@ -35,16 +35,16 @@ Certificate Verification
------------------------ ------------------------
libcurl performs peer SSL certificate verification by default. This is done libcurl performs peer SSL certificate verification by default. This is done
by using a CA certificate store that the SSL library can use to make sure the by using CA cert bundle that the SSL library can use to make sure the peer's
peer's server certificate is valid. server certificate is valid.
If you communicate with HTTPS, FTPS or other TLS-using servers using If you communicate with HTTPS, FTPS or other TLS-using servers using
certificates that are signed by CAs present in the store, you can be sure certificates that are signed by CAs present in the bundle, you can be sure
that the remote server really is the one it claims to be. that the remote server really is the one it claims to be.
If the remote server uses a self-signed certificate, if you don't install a CA If the remote server uses a self-signed certificate, if you don't install a CA
cert store, if the server uses a certificate signed by a CA that isn't cert bundle, if the server uses a certificate signed by a CA that isn't
included in the store you use or if the remote host is an impostor included in the bundle you use or if the remote host is an impostor
impersonating your favorite site, and you want to transfer files from this impersonating your favorite site, and you want to transfer files from this
server, do one of the following: server, do one of the following:
@ -59,22 +59,12 @@ server, do one of the following:
With the curl command line tool: --cacert [file] With the curl command line tool: --cacert [file]
3. Add the CA cert for your server to the existing default CA certificate 3. Add the CA cert for your server to the existing default CA cert bundle.
store. The default CA certificate store can changed at compile time with the The default path of the CA bundle used can be changed by running configure
following configure options: with the --with-ca-bundle option pointing out the path of your choice.
--with-ca-bundle=FILE: use the specified file as CA certificate store. CA To do this, you need to get the CA cert for your server in PEM format and
certificates need to be concatenated in PEM format into this file. then append that to your CA cert bundle.
--with-ca-path=PATH: use the specified path as CA certificate store. CA
certificates need to be stored as individual PEM files in this directory.
You may need to run c_rehash after adding files there.
If neither of the two options is specified, configure will try to auto-detect
a setting. It's also possible to explicitly not hardcode any default store
but rely on the built in default the crypto library may provide instead.
You can achieve that by passing both --without-ca-bundle and
--without-ca-path to the configure script.
If you use Internet Explorer, this is one way to get extract the CA cert If you use Internet Explorer, this is one way to get extract the CA cert
for a particular server: for a particular server:
@ -86,7 +76,7 @@ server, do one of the following:
- Convert it from crt to PEM using the openssl tool: - Convert it from crt to PEM using the openssl tool:
openssl x509 -inform DES -in yourdownloaded.crt \ openssl x509 -inform DES -in yourdownloaded.crt \
-out outcert.pem -text -out outcert.pem -text
- Add the 'outcert.pem' to the CA certificate store or use it stand-alone - Append the 'outcert.pem' to the CA cert bundle or use it stand-alone
as described below. as described below.
If you use the 'openssl' tool, this is one way to get extract the CA cert If you use the 'openssl' tool, this is one way to get extract the CA cert
@ -99,9 +89,9 @@ server, do one of the following:
- If you want to see the data in the certificate, you can do: "openssl - If you want to see the data in the certificate, you can do: "openssl
x509 -inform PEM -in certfile -text -out certdata" where certfile is x509 -inform PEM -in certfile -text -out certdata" where certfile is
the cert you extracted from logfile. Look in certdata. the cert you extracted from logfile. Look in certdata.
- If you want to trust the certificate, you can add it to your CA - If you want to trust the certificate, you can append it to your
certificate store or use it stand-alone as described. Just remember that cert bundle or use it stand-alone as described. Just remember that the
the security is no better than the way you obtained the certificate. security is no better than the way you obtained the certificate.
4. If you're using the curl command line tool, you can specify your own CA 4. If you're using the curl command line tool, you can specify your own CA
cert path by setting the environment variable `CURL_CA_BUNDLE` to the path cert path by setting the environment variable `CURL_CA_BUNDLE` to the path
@ -119,13 +109,13 @@ server, do one of the following:
5. Get a better/different/newer CA cert bundle! One option is to extract the 5. Get a better/different/newer CA cert bundle! One option is to extract the
one a recent Firefox browser uses by running 'make ca-bundle' in the curl one a recent Firefox browser uses by running 'make ca-bundle' in the curl
build tree root, or possibly download a version that was generated this build tree root, or possibly download a version that was generated this
way for you: [CA Extract](https://curl.haxx.se/docs/caextract.html) way for you: [CA Extract](http://curl.haxx.se/docs/caextract.html)
Neglecting to use one of the above methods when dealing with a server using a Neglecting to use one of the above methods when dealing with a server using a
certificate that isn't signed by one of the certificates in the installed CA certificate that isn't signed by one of the certificates in the installed CA
certificate store, will cause SSL to report an error ("certificate verify cert bundle, will cause SSL to report an error ("certificate verify failed")
failed") during the handshake and SSL will then refuse further communication during the handshake and SSL will then refuse further communication with that
with that server. server.
Certificate Verification with NSS Certificate Verification with NSS
--------------------------------- ---------------------------------
@ -133,8 +123,8 @@ Certificate Verification with NSS
If libcurl was built with NSS support, then depending on the OS distribution, If libcurl was built with NSS support, then depending on the OS distribution,
it is probably required to take some additional steps to use the system-wide it is probably required to take some additional steps to use the system-wide
CA cert db. RedHat ships with an additional module, libnsspem.so, which CA cert db. RedHat ships with an additional module, libnsspem.so, which
enables NSS to read the OpenSSL PEM CA bundle. On openSUSE you can install enables NSS to read the OpenSSL PEM CA bundle. This library is missing in
p11-kit-nss-trust which makes NSS use the system wide CA certificate store. NSS OpenSuSE, and without it, NSS can only work with its own internal formats. NSS
also has a new [database format](https://wiki.mozilla.org/NSS_Shared_DB). also has a new [database format](https://wiki.mozilla.org/NSS_Shared_DB).
Starting with version 7.19.7, libcurl automatically adds the 'sql:' prefix to Starting with version 7.19.7, libcurl automatically adds the 'sql:' prefix to

View File

@ -135,7 +135,6 @@ Benjamin Kircher
Benoit Neil Benoit Neil
Benoit Sigoure Benoit Sigoure
Bernard Leak Bernard Leak
Bernard Spil
Bernhard Reutner-Fischer Bernhard Reutner-Fischer
Bert Huijben Bert Huijben
Bertrand Demiddelaer Bertrand Demiddelaer
@ -155,7 +154,6 @@ Bob Richmond
Bob Schader Bob Schader
Bogdan Nicula Bogdan Nicula
Brad Burdick Brad Burdick
Brad Fitzpatrick
Brad Harder Brad Harder
Brad Hards Brad Hards
Brad King Brad King
@ -223,7 +221,6 @@ Claes Jakobsson
Clarence Gardner Clarence Gardner
Clemens Gruber Clemens Gruber
Clifford Wolf Clifford Wolf
Clint Clayton
Cody Jones Cody Jones
Cody Mack Cody Mack
Colby Ranger Colby Ranger
@ -283,7 +280,6 @@ Dave Thompson
Dave Vasilevsky Dave Vasilevsky
Davey Shafik Davey Shafik
David Bau David Bau
David Benjamin
David Binderman David Binderman
David Blaikie David Blaikie
David Byron David Byron
@ -460,7 +456,6 @@ Glen A Johnson Jr.
Glen Nakamura Glen Nakamura
Glen Scott Glen Scott
Glenn Sheridan Glenn Sheridan
Google Inc.
Gordon Marler Gordon Marler
Gorilla Maguila Gorilla Maguila
Grant Erickson Grant Erickson
@ -535,7 +530,6 @@ Jacob Meuser
Jacob Moshenko Jacob Moshenko
Jactry Zeng Jactry Zeng
Jad Chamcham Jad Chamcham
Jaime Fullaondo
Jakub Zakrzewski Jakub Zakrzewski
James Bursa James Bursa
James Cheng James Cheng
@ -583,7 +577,6 @@ Jeff Lawson
Jeff Phillips Jeff Phillips
Jeff Pohlmeyer Jeff Pohlmeyer
Jeff Weber Jeff Weber
Jeffrey Walton
Jens Rantil Jens Rantil
Jeremy Friesner Jeremy Friesner
Jeremy Huddleston Jeremy Huddleston
@ -598,7 +591,6 @@ Jerry Wu
Jes Badwal Jes Badwal
Jesper Jensen Jesper Jensen
Jesse Noller Jesse Noller
Jesse Tan
Jie He Jie He
Jim Drash Jim Drash
Jim Freeman Jim Freeman
@ -700,7 +692,6 @@ Karl Moerder
Karol Pietrzak Karol Pietrzak
Kaspar Brand Kaspar Brand
Katie Wang Katie Wang
Kazuho Oku
Kees Cook Kees Cook
Keith MacDonald Keith MacDonald
Keith McGuigan Keith McGuigan
@ -773,7 +764,6 @@ Lucas Adamski
Lucas Pardue Lucas Pardue
Ludek Finstrle Ludek Finstrle
Ludovico Cavedon Ludovico Cavedon
Ludwig Nussel
Lukas Ruzicka Lukas Ruzicka
Lukasz Czekierda Lukasz Czekierda
Luke Amery Luke Amery
@ -785,7 +775,6 @@ Maciej Karpiuk
Maciej Puzio Maciej Puzio
Maciej W. Rozycki Maciej W. Rozycki
Maks Naumov Maks Naumov
Maksim Kuzevanov
Maksim Stsepanenka Maksim Stsepanenka
Mamoru Tasaka Mamoru Tasaka
Mandy Wu Mandy Wu
@ -872,7 +861,6 @@ Michael Jahn
Michael Jerris Michael Jerris
Michael Kalinin Michael Kalinin
Michael Kaufmann Michael Kaufmann
Michael König
Michael Mealling Michael Mealling
Michael Mueller Michael Mueller
Michael Osipov Michael Osipov
@ -946,13 +934,11 @@ Nodak Sodak
Norbert Frese Norbert Frese
Norbert Kett Norbert Kett
Norbert Novotny Norbert Novotny
Octavio Schroeder
Ofer Ofer
Ola Mork Ola Mork
Olaf Flebbe Olaf Flebbe
Olaf Stüben Olaf Stüben
Oliver Gondža Oliver Gondža
Oliver Graute
Oliver Kuckertz Oliver Kuckertz
Oliver Schindler Oliver Schindler
Olivier Berger Olivier Berger
@ -1045,7 +1031,6 @@ Quanah Gibson-Mount
Quinn Slack Quinn Slack
Radu Simionescu Radu Simionescu
Rafa Muyo Rafa Muyo
Rafael Antonio
Rafael Sagula Rafael Sagula
Rafayel Mkrtchyan Rafayel Mkrtchyan
Rafaël Carré Rafaël Carré
@ -1165,14 +1150,12 @@ Sergei Nikulov
Sergey Tatarincev Sergey Tatarincev
Sergio Ballestrero Sergio Ballestrero
Seshubabu Pasam Seshubabu Pasam
Seth Mos
Sh Diao Sh Diao
Shao Shuchao Shao Shuchao
Sharad Gupta Sharad Gupta
Shard Shard
Shawn Landden Shawn Landden
Shawn Poulson Shawn Poulson
Shine Fan
Shmulik Regev Shmulik Regev
Siddhartha Prakash Jain Siddhartha Prakash Jain
Sidney San Martin Sidney San Martin
@ -1258,7 +1241,6 @@ Tim Sneddon
Tim Stack Tim Stack
Tim Starling Tim Starling
Timo Sirainen Timo Sirainen
Timotej Lazar
Tinus van den Berg Tinus van den Berg
Tobias Markus Tobias Markus
Tobias Rundström Tobias Rundström

View File

@ -52,4 +52,3 @@ 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/ s/Tim Ruehsen/Tim Rühsen/
s/Michael Koenig/Michael König/

View File

@ -112,7 +112,7 @@
16.1 Other authentication mechanisms 16.1 Other authentication mechanisms
16.2 Add QOP support to GSSAPI authentication 16.2 Add QOP support to GSSAPI authentication
17. Command line tool 17. Client
17.1 sync 17.1 sync
17.2 glob posts 17.2 glob posts
17.3 prevent file overwriting 17.3 prevent file overwriting
@ -123,8 +123,6 @@
17.8 offer color-coded HTTP header output 17.8 offer color-coded HTTP header output
17.9 Choose the name of file in braces for complex URLs 17.9 Choose the name of file in braces for complex URLs
17.10 improve how curl works in a windows console window 17.10 improve how curl works in a windows console window
17.11 -w output to stderr
17.12 keep running, read instructions from pipe/socket
18. Build 18. Build
18.1 roffit 18.1 roffit
@ -135,7 +133,6 @@
19.3 more protocols supported 19.3 more protocols supported
19.4 more platforms supported 19.4 more platforms supported
19.5 Add support for concurrent connections 19.5 Add support for concurrent connections
19.6 Use the RFC6265 test suite
20. Next SONAME bump 20. Next SONAME bump
20.1 http-style HEAD output for FTP 20.1 http-style HEAD output for FTP
@ -175,7 +172,7 @@
signal handler back into the library with a sigsetjmp, which effectively signal handler back into the library with a sigsetjmp, which effectively
causes libcurl to continue running within the signal handler. This is causes libcurl to continue running within the signal handler. This is
non-portable and could cause problems on some platforms. A discussion on the non-portable and could cause problems on some platforms. A discussion on the
problem is available at https://curl.haxx.se/mail/lib-2008-09/0197.html problem is available at http://curl.haxx.se/mail/lib-2008-09/0197.html
Also, alarm() provides timeout resolution only to the nearest second. alarm Also, alarm() provides timeout resolution only to the nearest second. alarm
ought to be replaced by setitimer on systems that support it. ought to be replaced by setitimer on systems that support it.
@ -242,7 +239,7 @@
would be the ones that link to 3rd party libs. That would allow us to avoid would be the ones that link to 3rd party libs. That would allow us to avoid
having to load ALL dependencies since only the necessary ones for this having to load ALL dependencies since only the necessary ones for this
app/invoke/used protocols would be necessary to load. See app/invoke/used protocols would be necessary to load. See
https://github.com/curl/curl/issues/349 https://github.com/bagder/curl/issues/349
1.12 have form functions use CURL handle argument 1.12 have form functions use CURL handle argument
@ -264,7 +261,7 @@
hack ;-) hack ;-)
Please see the following thread for more information: Please see the following thread for more information:
https://curl.haxx.se/mail/lib-2012-05/0178.html http://curl.haxx.se/mail/lib-2012-05/0178.html
1.14 Typesafe curl_easy_setopt() 1.14 Typesafe curl_easy_setopt()
@ -295,7 +292,7 @@
perhaps URL encoded byte values over 128 etc (basically do what the redirect perhaps URL encoded byte values over 128 etc (basically do what the redirect
following code already does). following code already does).
https://github.com/curl/curl/issues/514 https://github.com/bagder/curl/issues/514
2. libcurl - multi interface 2. libcurl - multi interface
@ -358,7 +355,7 @@
When trying to connect passively to a server which only supports active When trying to connect passively to a server which only supports active
connections, libcurl returns CURLE_FTP_WEIRD_PASV_REPLY and closes the connections, libcurl returns CURLE_FTP_WEIRD_PASV_REPLY and closes the
connection. There could be a way to fallback to an active connection (and connection. There could be a way to fallback to an active connection (and
vice versa). https://curl.haxx.se/bug/feature.cgi?id=1754793 vice versa). http://curl.haxx.se/bug/feature.cgi?id=1754793
4.3 Earlier bad letter detection 4.3 Earlier bad letter detection
@ -395,13 +392,13 @@ This is not detailed in any FTP specification.
5.1 Better persistency for HTTP 1.0 5.1 Better persistency for HTTP 1.0
"Better" support for persistent connections over HTTP 1.0 "Better" support for persistent connections over HTTP 1.0
https://curl.haxx.se/bug/feature.cgi?id=1089001 http://curl.haxx.se/bug/feature.cgi?id=1089001
5.2 support FF3 sqlite cookie files 5.2 support FF3 sqlite cookie files
Firefox 3 is changing from its former format to a a sqlite database instead. Firefox 3 is changing from its former format to a a sqlite database instead.
We should consider how (lib)curl can/should support this. We should consider how (lib)curl can/should support this.
https://curl.haxx.se/bug/feature.cgi?id=1871388 http://curl.haxx.se/bug/feature.cgi?id=1871388
5.3 Rearrange request header order 5.3 Rearrange request header order
@ -437,7 +434,7 @@ This is not detailed in any FTP specification.
5.6 Refuse "downgrade" redirects 5.6 Refuse "downgrade" redirects
See https://github.com/curl/curl/issues/226 See https://github.com/bagder/curl/issues/226
Consider a way to tell curl to refuse to "downgrade" protocol with a redirect Consider a way to tell curl to refuse to "downgrade" protocol with a redirect
and/or possibly a bit that refuses redirect to change protocol completely. and/or possibly a bit that refuses redirect to change protocol completely.
@ -546,7 +543,7 @@ that doesn't exist on the server, just like --ftp-create-dirs.
13.1 Disable specific versions 13.1 Disable specific versions
Provide an option that allows for disabling specific SSL versions, such as Provide an option that allows for disabling specific SSL versions, such as
SSLv2 https://curl.haxx.se/bug/feature.cgi?id=1767276 SSLv2 http://curl.haxx.se/bug/feature.cgi?id=1767276
13.2 Provide mutex locking API 13.2 Provide mutex locking API
@ -557,7 +554,7 @@ that doesn't exist on the server, just like --ftp-create-dirs.
13.3 Evaluate SSL patches 13.3 Evaluate SSL patches
Evaluate/apply Gertjan van Wingerde's SSL patches: Evaluate/apply Gertjan van Wingerde's SSL patches:
https://curl.haxx.se/mail/lib-2004-03/0087.html http://curl.haxx.se/mail/lib-2004-03/0087.html
13.4 Cache OpenSSL contexts 13.4 Cache OpenSSL contexts
@ -595,9 +592,9 @@ that doesn't exist on the server, just like --ftp-create-dirs.
https://www.rfc-editor.org/rfc/rfc6698.txt https://www.rfc-editor.org/rfc/rfc6698.txt
An initial patch was posted by Suresh Krishnaswamy on March 7th 2013 An initial patch was posted by Suresh Krishnaswamy on March 7th 2013
(https://curl.haxx.se/mail/lib-2013-03/0075.html) but it was a too simple (http://curl.haxx.se/mail/lib-2013-03/0075.html) but it was a too simple
approach. See Daniel's comments: approach. See Daniel's comments:
https://curl.haxx.se/mail/lib-2013-03/0103.html . libunbound may be the http://curl.haxx.se/mail/lib-2013-03/0103.html . libunbound may be the
correct library to base this development on. correct library to base this development on.
14. GnuTLS 14. GnuTLS
@ -660,7 +657,7 @@ that doesn't exist on the server, just like --ftp-create-dirs.
with integrity protection) and auth-conf (Authentication with integrity and with integrity protection) and auth-conf (Authentication with integrity and
privacy protection). privacy protection).
17. Command line tool 17. Client
17.1 sync 17.1 sync
@ -689,7 +686,7 @@ that doesn't exist on the server, just like --ftp-create-dirs.
The client could be told to use maximum N simultaneous parallel transfers and The client could be told to use maximum N simultaneous parallel transfers and
then just make sure that happens. It should of course not make more than one then just make sure that happens. It should of course not make more than one
connection to the same remote host. This would require the client to use the connection to the same remote host. This would require the client to use the
multi interface. https://curl.haxx.se/bug/feature.cgi?id=1558595 multi interface. http://curl.haxx.se/bug/feature.cgi?id=1558595
17.5 provide formpost headers 17.5 provide formpost headers
@ -732,29 +729,14 @@ that doesn't exist on the server, just like --ftp-create-dirs.
{partURL1:name1,partURL2:name2,partURL3:name3} where the name following the {partURL1:name1,partURL2:name2,partURL3:name3} where the name following the
colon is the output name. colon is the output name.
See https://github.com/curl/curl/issues/221 See https://github.com/bagder/curl/issues/221
17.10 improve how curl works in a windows console window 17.10 improve how curl works in a windows console window
If you pull the scrollbar when transferring with curl in a Windows console If you pull the scrollbar when transferring with curl in a Windows console
window, the transfer is interrupted and can get disconnected. This can window, the transfer is interrupted and can get disconnected. This can
probably be improved. See https://github.com/curl/curl/issues/322 probably be improved. See https://github.com/bagder/curl/issues/322
17.11 -w output to stderr
-w is quite useful, but not to those of us who use curl without -o or -O
(such as for scripting through a higher level language). It would be nice to
have an option that is exactly like -w but sends it to stderr
instead. Proposed name: --write-stderr. See
https://github.com/curl/curl/issues/613
17.12 keep running, read instructions from pipe/socket
Provide an option that makes curl not exit after the last URL (or even work
without a given URL), and then make it read instructions passed on a pipe or
over a socket to make further instructions so that a second subsequent curl
invoke can talk to the still running instance and ask for transfers to get
done, and thus maintain its connection pool, DNS cache and more.
18. Build 18. Build
@ -800,16 +782,6 @@ that doesn't exist on the server, just like --ftp-create-dirs.
and thus the wait for connections loop is never entered to receive the second and thus the wait for connections loop is never entered to receive the second
connection. connection.
19.6 Use the RFC6265 test suite
A test suite made for HTTP cookies (RFC 6265) by Adam Barth is available at
https://github.com/abarth/http-state/tree/master/tests
It'd be really awesome if someone would write a script/setup that would run
curl with that test suite and detect deviances. Ideally, that would even be
incorporated into our regular test suite.
20. Next SONAME bump 20. Next SONAME bump
20.1 http-style HEAD output for FTP 20.1 http-style HEAD output for FTP

View File

@ -136,7 +136,7 @@ The Art Of Scripting HTTP Requests Using Curl
The Uniform Resource Locator format is how you specify the address of a The Uniform Resource Locator format is how you specify the address of a
particular resource on the Internet. You know these, you've seen URLs like particular resource on the Internet. You know these, you've seen URLs like
https://curl.haxx.se or https://yourbank.com a million times. RFC 3986 is the http://curl.haxx.se or https://yourbank.com a million times. RFC 3986 is the
canonical spec. And yeah, the formal name is not URL, it is URI. canonical spec. And yeah, the formal name is not URL, it is URI.
2.2 Host 2.2 Host
@ -203,7 +203,7 @@ The Art Of Scripting HTTP Requests Using Curl
issues a GET request to the server and receives the document it asked for. issues a GET request to the server and receives the document it asked for.
If you issue the command line If you issue the command line
curl https://curl.haxx.se curl http://curl.haxx.se
you get a web page returned in your terminal window. The entire HTML document you get a web page returned in your terminal window. The entire HTML document
that that URL holds. that that URL holds.
@ -628,7 +628,7 @@ The Art Of Scripting HTTP Requests Using Curl
More about server certificate verification and ca cert bundles can be read More about server certificate verification and ca cert bundles can be read
in the SSLCERTS document, available online here: in the SSLCERTS document, available online here:
https://curl.haxx.se/docs/sslcerts.html http://curl.haxx.se/docs/sslcerts.html
At times you may end up with your own CA cert store and then you can tell At times you may end up with your own CA cert store and then you can tell
curl to use that to verify the server's certificate: curl to use that to verify the server's certificate:
@ -755,4 +755,4 @@ The Art Of Scripting HTTP Requests Using Curl
14.2 Sites 14.2 Sites
https://curl.haxx.se is the home of the cURL project http://curl.haxx.se is the home of the cURL project

View File

@ -9,7 +9,7 @@
.\" * .\" *
.\" * 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
.\" * are also available at https://curl.haxx.se/docs/copyright.html. .\" * are also available at http://curl.haxx.se/docs/copyright.html.
.\" * .\" *
.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell .\" * 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 .\" * copies of the Software, and permit persons to whom the Software is

View File

@ -5,11 +5,11 @@
.\" * | (__| |_| | _ <| |___ .\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____| .\" * \___|\___/|_| \_\_____|
.\" * .\" *
.\" * 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
.\" * are also available at https://curl.haxx.se/docs/copyright.html. .\" * are also available at http://curl.haxx.se/docs/copyright.html.
.\" * .\" *
.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell .\" * 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 .\" * copies of the Software, and permit persons to whom the Software is
@ -216,8 +216,8 @@ read previously stored cookie lines from, which should be used in this session
if they match. Using this method also activates the cookie engine which will if they match. Using this method also activates the cookie engine which will
make curl record incoming cookies too, which may be handy if you're using this make curl record incoming cookies too, which may be handy if you're using this
in combination with the \fI-L, --location\fP option. The file format of the in combination with the \fI-L, --location\fP option. The file format of the
file to read cookies from should be plain HTTP headers (Set-Cookie style) or file to read cookies from should be plain HTTP headers or the Netscape/Mozilla
the Netscape/Mozilla cookie file format. cookie file format.
The file specified with \fI-b, --cookie\fP is only used as input. No cookies The file specified with \fI-b, --cookie\fP is only used as input. No cookies
will be written to the file. To store cookies, use the \fI-c, --cookie-jar\fP will be written to the file. To store cookies, use the \fI-c, --cookie-jar\fP
@ -430,9 +430,6 @@ the traditional PORT command.
\fB--eprt\fP can be used to explicitly enable EPRT again and \fB--no-eprt\fP \fB--eprt\fP can be used to explicitly enable EPRT again and \fB--no-eprt\fP
is an alias for \fB--disable-eprt\fP. is an alias for \fB--disable-eprt\fP.
If the server is an IPv6 host, this option will have no effect as EPRT is
necessary then.
Disabling EPRT only changes the active behavior. If you want to switch to Disabling EPRT only changes the active behavior. If you want to switch to
passive mode you need to not use \fI-P, --ftp-port\fP or force it with passive mode you need to not use \fI-P, --ftp-port\fP or force it with
\fI--ftp-pasv\fP. \fI--ftp-pasv\fP.
@ -444,9 +441,6 @@ but with this option, it will not try using EPSV.
\fB--epsv\fP can be used to explicitly enable EPSV again and \fB--no-epsv\fP \fB--epsv\fP can be used to explicitly enable EPSV again and \fB--no-epsv\fP
is an alias for \fB--disable-epsv\fP. is an alias for \fB--disable-epsv\fP.
If the server is an IPv6 host, this option will have no effect as EPSV is
necessary then.
Disabling EPSV only changes the passive behavior. If you want to switch to Disabling EPSV only changes the passive behavior. If you want to switch to
active mode you need to use \fI-P, --ftp-port\fP. active mode you need to use \fI-P, --ftp-port\fP.
.IP "--dns-interface <interface>" .IP "--dns-interface <interface>"
@ -834,17 +828,8 @@ cookies when they're closed down.
server-specified Content-Disposition filename instead of extracting a filename server-specified Content-Disposition filename instead of extracting a filename
from the URL. from the URL.
If the server specifies a file name and a file with that name already exists
in the current working directory it will not be overwritten and an error will
occur. If the server doesn't specify a file name then this option has no
effect.
There's no attempt to decode %-sequences (yet) in the provided file name, so There's no attempt to decode %-sequences (yet) in the provided file name, so
this option may provide you with rather unexpected file names. this option may provide you with rather unexpected file names.
\fBWARNING\fP: Exercise judicious use of this option, especially on Windows. A
rogue server could send you the name of a DLL or other file that could possibly
be loaded automatically by Windows or some third party software.
.IP "-k, --insecure" .IP "-k, --insecure"
(SSL) This option explicitly allows curl to perform "insecure" SSL connections (SSL) This option explicitly allows curl to perform "insecure" SSL connections
and transfers. All SSL connections are attempted to be made secure by using and transfers. All SSL connections are attempted to be made secure by using
@ -852,7 +837,7 @@ the CA certificate bundle installed by default. This makes all connections
considered "insecure" fail unless \fI-k, --insecure\fP is used. considered "insecure" fail unless \fI-k, --insecure\fP is used.
See this online resource for further details: See this online resource for further details:
\fBhttps://curl.haxx.se/docs/sslcerts.html\fP \fBhttp://curl.haxx.se/docs/sslcerts.html\fP
.IP "-K, --config <config file>" .IP "-K, --config <config file>"
Specify which config file to read curl arguments from. The config file is a Specify which config file to read curl arguments from. The config file is a
text file in which command line arguments can be written which then will be text file in which command line arguments can be written which then will be
@ -879,7 +864,7 @@ Note that to be able to specify a URL in the config file, you need to specify
it using the \fI--url\fP option, and not by simply writing the URL on its own it using the \fI--url\fP option, and not by simply writing the URL on its own
line. So, it could look similar to this: line. So, it could look similar to this:
url = "https://curl.haxx.se/docs/" url = "http://curl.haxx.se/docs/"
When curl is invoked, it always (unless \fI-q\fP is used) checks for a default When curl is invoked, it always (unless \fI-q\fP is used) checks for a default
config file and uses it if found. The default config file is checked for in config file and uses it if found. The default config file is checked for in
@ -977,7 +962,7 @@ re-send the following request using the same unmodified method.
You can tell curl to not change the non-GET request method to GET after a 30x You can tell curl to not change the non-GET request method to GET after a 30x
response by using the dedicated options for that: \fI--post301\fP, response by using the dedicated options for that: \fI--post301\fP,
\fI--post302\fP and \fI--post303\fP. \fI--post302\fP and \fI-post303\fP.
.IP "--libcurl <file>" .IP "--libcurl <file>"
Append this option to any ordinary curl command line, and you will get a Append this option to any ordinary curl command line, and you will get a
libcurl-using C source code written to the file that does the equivalent libcurl-using C source code written to the file that does the equivalent
@ -1205,15 +1190,12 @@ output to be done to stdout.
Write output to a local file named like the remote file we get. (Only the file Write output to a local file named like the remote file we get. (Only the file
part of the remote file is used, the path is cut off.) part of the remote file is used, the path is cut off.)
The file will be saved in the current working directory. If you want the file The remote file name to use for saving is extracted from the given URL,
saved in a different directory, make sure you change the current working nothing else.
directory before invoking curl with this option.
The remote file name to use for saving is extracted from the given URL, nothing Consequentially, the file will be saved in the current working directory. If
else, and if it already exists it will be overwritten. If you want the server you want the file saved in a different directory, make sure you change current
to be able to choose the file name refer to \fI-J, --remote-header-name\fP working directory before you invoke curl with the \fB-O, --remote-name\fP flag!
which can be used in addition to this option. If the server chooses a file name
and that name already exists it will not be overwritten.
There is no URL decoding done on the file name. If it has %20 or other URL There is no URL decoding done on the file name. If it has %20 or other URL
encoded parts of the name, they will end up as-is as file name. encoded parts of the name, they will end up as-is as file name.
@ -1730,14 +1712,6 @@ default 512 bytes will be used.
If this option is used several times, the last one will be used. If this option is used several times, the last one will be used.
(Added in 7.20.0) (Added in 7.20.0)
.IP "--tftp-no-options"
(TFTP) Tells curl not to send TFTP options requests.
This option improves interop with some legacy servers that do not acknowledge
or properly implement TFTP options. When this option is used
\fI--tftp-blksize\fP is ignored.
(Added in 7.48.0)
.IP "--tlsauthtype <authtype>" .IP "--tlsauthtype <authtype>"
Set TLS authentication type. Currently, the only supported option is "SRP", Set TLS authentication type. Currently, the only supported option is "SRP",
for TLS-SRP (RFC 5054). If \fI--tlsuser\fP and \fI--tlspassword\fP are for TLS-SRP (RFC 5054). If \fI--tlsuser\fP and \fI--tlspassword\fP are
@ -2361,7 +2335,7 @@ are meant to never change.
Daniel Stenberg is the main author, but the whole list of contributors is Daniel Stenberg is the main author, but the whole list of contributors is
found in the separate THANKS file. found in the separate THANKS file.
.SH WWW .SH WWW
https://curl.haxx.se http://curl.haxx.se
.SH FTP .SH FTP
ftp://ftp.sunet.se/pub/www/utilities/curl/ ftp://ftp.sunet.se/pub/www/utilities/curl/
.SH "SEE ALSO" .SH "SEE ALSO"

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is
@ -155,10 +155,9 @@ int main(void)
#ifdef WIN32 #ifdef WIN32
Sleep(L); Sleep(L);
#else #else
sleep((unsigned int)L / 1000); sleep(L / 1000);
#endif #endif
} } else {
else {
T.tv_sec = L/1000; T.tv_sec = L/1000;
T.tv_usec = (L%1000)*1000; T.tv_usec = (L%1000)*1000;

View File

@ -5,11 +5,11 @@
# | (__| |_| | _ <| |___ # | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____| # \___|\___/|_| \_\_____|
# #
# 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
# are also available at https://curl.haxx.se/docs/copyright.html. # are also available at http://curl.haxx.se/docs/copyright.html.
# #
# You may opt to use, copy, modify, merge, publish, distribute and/or sell # 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 # copies of the Software, and permit persons to whom the Software is
@ -61,6 +61,3 @@ endif
include Makefile.inc include Makefile.inc
all: $(check_PROGRAMS) all: $(check_PROGRAMS)
checksrc:
@@PERL@ $(top_srcdir)/lib/checksrc.pl -D$(top_srcdir)/docs/examples *.c

View File

@ -9,7 +9,7 @@
# #
# 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
# are also available at https://curl.haxx.se/docs/copyright.html. # are also available at http://curl.haxx.se/docs/copyright.html.
# #
# You may opt to use, copy, modify, merge, publish, distribute and/or sell # 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 # copies of the Software, and permit persons to whom the Software is

View File

@ -9,7 +9,7 @@
# #
# 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
# are also available at https://curl.haxx.se/docs/copyright.html. # are also available at http://curl.haxx.se/docs/copyright.html.
# #
# You may opt to use, copy, modify, merge, publish, distribute and/or sell # 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 # copies of the Software, and permit persons to whom the Software is

View File

@ -9,7 +9,7 @@
# #
# 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
# are also available at https://curl.haxx.se/docs/copyright.html. # are also available at http://curl.haxx.se/docs/copyright.html.
# #
# You may opt to use, copy, modify, merge, publish, distribute and/or sell # 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 # copies of the Software, and permit persons to whom the Software is

View File

@ -2,7 +2,7 @@
# pass files as argument(s) # pass files as argument(s)
my $docroot="https://curl.haxx.se/libcurl/c"; my $docroot="http://curl.haxx.se/libcurl/c";
for $f (@ARGV) { for $f (@ARGV) {
open(NEW, ">$f.new"); open(NEW, ">$f.new");

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is
@ -78,8 +78,7 @@
/* ioctl callback function */ /* ioctl callback function */
static curlioerr my_ioctl(CURL *handle, curliocmd cmd, void *userp) static curlioerr my_ioctl(CURL *handle, curliocmd cmd, void *userp)
{ {
int *fdp = (int *)userp; intptr_t fd = (intptr_t)userp;
int fd = *fdp;
(void)handle; /* not used in here */ (void)handle; /* not used in here */
@ -101,11 +100,10 @@ static curlioerr my_ioctl(CURL *handle, curliocmd cmd, void *userp)
/* read callback function, fread() look alike */ /* read callback function, fread() look alike */
static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream) static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream)
{ {
ssize_t retcode; size_t retcode;
curl_off_t nread; curl_off_t nread;
int *fdp = (int *)stream; intptr_t fd = (intptr_t)stream;
int fd = *fdp;
retcode = read(fd, ptr, size * nmemb); retcode = read(fd, ptr, size * nmemb);
@ -121,7 +119,7 @@ int main(int argc, char **argv)
{ {
CURL *curl; CURL *curl;
CURLcode res; CURLcode res;
int hd; intptr_t hd ;
struct stat file_info; struct stat file_info;
char *file; char *file;
@ -147,13 +145,13 @@ int main(int argc, char **argv)
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback); curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
/* which file to upload */ /* which file to upload */
curl_easy_setopt(curl, CURLOPT_READDATA, (void*)&hd); curl_easy_setopt(curl, CURLOPT_READDATA, (void*)hd);
/* set the ioctl function */ /* set the ioctl function */
curl_easy_setopt(curl, CURLOPT_IOCTLFUNCTION, my_ioctl); curl_easy_setopt(curl, CURLOPT_IOCTLFUNCTION, my_ioctl);
/* pass the file descriptor to the ioctl callback as well */ /* pass the file descriptor to the ioctl callback as well */
curl_easy_setopt(curl, CURLOPT_IOCTLDATA, (void*)&hd); curl_easy_setopt(curl, CURLOPT_IOCTLDATA, (void*)hd);
/* enable "uploading" (which means PUT when doing HTTP) */ /* enable "uploading" (which means PUT when doing HTTP) */
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L) ; curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L) ;

View File

@ -9,7 +9,7 @@
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is
@ -48,7 +48,6 @@
#include <curl/curl.h> #include <curl/curl.h>
#include <boost/asio.hpp> #include <boost/asio.hpp>
#include <boost/bind.hpp> #include <boost/bind.hpp>
#include <iostream>
#define MSG_OUT stdout /* Send info to stdout, change to stderr if you want */ #define MSG_OUT stdout /* Send info to stdout, change to stderr if you want */
@ -379,9 +378,9 @@ static curl_socket_t opensocket(void *clientp, curlsocktype purpose,
} }
/* CURLOPT_CLOSESOCKETFUNCTION */ /* CURLOPT_CLOSESOCKETFUNCTION */
static int close_socket(void *clientp, curl_socket_t item) static int closesocket(void *clientp, curl_socket_t item)
{ {
fprintf(MSG_OUT, "\nclose_socket : %d", item); fprintf(MSG_OUT, "\nclosesocket : %d", item);
std::map<curl_socket_t, boost::asio::ip::tcp::socket *>::iterator it = socket_map.find(item); std::map<curl_socket_t, boost::asio::ip::tcp::socket *>::iterator it = socket_map.find(item);
@ -428,7 +427,7 @@ static void new_conn(char *url, GlobalInfo *g)
curl_easy_setopt(conn->easy, CURLOPT_OPENSOCKETFUNCTION, opensocket); curl_easy_setopt(conn->easy, CURLOPT_OPENSOCKETFUNCTION, opensocket);
/* call this function to close a socket */ /* call this function to close a socket */
curl_easy_setopt(conn->easy, CURLOPT_CLOSESOCKETFUNCTION, close_socket); curl_easy_setopt(conn->easy, CURLOPT_CLOSESOCKETFUNCTION, closesocket);
fprintf(MSG_OUT, fprintf(MSG_OUT,
"\nAdding easy %p to multi %p (%s)", conn->easy, g->multi, url); "\nAdding easy %p to multi %p (%s)", conn->easy, g->multi, url);
@ -442,6 +441,7 @@ static void new_conn(char *url, GlobalInfo *g)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
GlobalInfo g; GlobalInfo g;
CURLMcode rc;
(void)argc; (void)argc;
(void)argv; (void)argv;

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is

View File

@ -9,7 +9,7 @@
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is
@ -77,58 +77,43 @@ int main(int argc, char *argv[])
"\rUsage: %s [-m=1|2|5|10|20|50|100] [-t] [-x] [url]\n", "\rUsage: %s [-m=1|2|5|10|20|50|100] [-t] [-x] [url]\n",
appname); appname);
exit(1); exit(1);
} } else if (strncasecmp(*argv, "-V", 2) == 0) {
else if(strncasecmp(*argv, "-V", 2) == 0) {
fprintf(stderr, "\r%s %s - %s\n", fprintf(stderr, "\r%s %s - %s\n",
appname, CHKSPEED_VERSION, curl_version()); appname, CHKSPEED_VERSION, curl_version());
exit(1); exit(1);
} } else if (strncasecmp(*argv, "-A", 2) == 0) {
else if(strncasecmp(*argv, "-A", 2) == 0) {
prtall = 1; prtall = 1;
} } else if (strncasecmp(*argv, "-X", 2) == 0) {
else if(strncasecmp(*argv, "-X", 2) == 0) {
prtsep = 1; prtsep = 1;
} } else if (strncasecmp(*argv, "-T", 2) == 0) {
else if(strncasecmp(*argv, "-T", 2) == 0) {
prttime = 1; prttime = 1;
} } else if (strncasecmp(*argv, "-M=", 3) == 0) {
else if(strncasecmp(*argv, "-M=", 3) == 0) {
long m = strtol((*argv)+3, NULL, 10); long m = strtol((*argv)+3, NULL, 10);
switch(m) { switch(m) {
case 1: case 1: url = URL_1M;
url = URL_1M;
break; break;
case 2: case 2: url = URL_2M;
url = URL_2M;
break; break;
case 5: case 5: url = URL_5M;
url = URL_5M;
break; break;
case 10: case 10: url = URL_10M;
url = URL_10M;
break; break;
case 20: case 20: url = URL_20M;
url = URL_20M;
break; break;
case 50: case 50: url = URL_50M;
url = URL_50M;
break; break;
case 100: case 100: url = URL_100M;
url = URL_100M;
break; break;
default: default: fprintf(stderr, "\r%s: invalid parameter %s\n",
fprintf(stderr, "\r%s: invalid parameter %s\n",
appname, *argv + 3); appname, *argv + 3);
exit(1); exit(1);
} }
} } else {
else {
fprintf(stderr, "\r%s: invalid or unknown option %s\n", fprintf(stderr, "\r%s: invalid or unknown option %s\n",
appname, *argv); appname, *argv);
exit(1); exit(1);
} }
} } else {
else {
url = *argv; url = *argv;
} }
} }
@ -193,8 +178,8 @@ int main(int argc, char *argv[])
if((CURLE_OK == res) && (val>0)) if((CURLE_OK == res) && (val>0))
printf("Connect time: %0.3f sec.\n", val); printf("Connect time: %0.3f sec.\n", val);
} }
}
else { } else {
fprintf(stderr, "Error while fetching '%s' : %s\n", fprintf(stderr, "Error while fetching '%s' : %s\n",
url, curl_easy_strerror(res)); url, curl_easy_strerror(res));
} }

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is
@ -43,8 +43,7 @@ print_cookies(CURL *curl)
printf("Cookies, curl knows:\n"); printf("Cookies, curl knows:\n");
res = curl_easy_getinfo(curl, CURLINFO_COOKIELIST, &cookies); res = curl_easy_getinfo(curl, CURLINFO_COOKIELIST, &cookies);
if (res != CURLE_OK) { if (res != CURLE_OK) {
fprintf(stderr, "Curl curl_easy_getinfo failed: %s\n", fprintf(stderr, "Curl curl_easy_getinfo failed: %s\n", curl_easy_strerror(res));
curl_easy_strerror(res));
exit(1); exit(1);
} }
nc = cookies, i = 1; nc = cookies, i = 1;
@ -72,7 +71,7 @@ main(void)
curl_easy_setopt(curl, CURLOPT_URL, "http://www.example.com/"); curl_easy_setopt(curl, CURLOPT_URL, "http://www.example.com/");
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, ""); /* start cookie engine */ curl_easy_setopt(curl, CURLOPT_COOKIEFILE, ""); /* just to start the cookie engine */
res = curl_easy_perform(curl); res = curl_easy_perform(curl);
if (res != CURLE_OK) { if (res != CURLE_OK) {
fprintf(stderr, "Curl perform failed: %s\n", curl_easy_strerror(res)); fprintf(stderr, "Curl perform failed: %s\n", curl_easy_strerror(res));
@ -93,13 +92,10 @@ main(void)
#endif #endif
/* Netscape format cookie */ /* Netscape format cookie */
snprintf(nline, sizeof(nline), "%s\t%s\t%s\t%s\t%lu\t%s\t%s", snprintf(nline, sizeof(nline), "%s\t%s\t%s\t%s\t%lu\t%s\t%s",
".google.com", "TRUE", "/", "FALSE", ".google.com", "TRUE", "/", "FALSE", (unsigned long)time(NULL) + 31337UL, "PREF", "hello google, i like you very much!");
(unsigned long)time(NULL) + 31337UL,
"PREF", "hello google, i like you very much!");
res = curl_easy_setopt(curl, CURLOPT_COOKIELIST, nline); res = curl_easy_setopt(curl, CURLOPT_COOKIELIST, nline);
if (res != CURLE_OK) { if (res != CURLE_OK) {
fprintf(stderr, "Curl curl_easy_setopt failed: %s\n", fprintf(stderr, "Curl curl_easy_setopt failed: %s\n", curl_easy_strerror(res));
curl_easy_strerror(res));
return 1; return 1;
} }
@ -114,8 +110,7 @@ main(void)
"expires=Sun, 17-Jan-2038 19:14:07 GMT; path=/; domain=.google.com"); "expires=Sun, 17-Jan-2038 19:14:07 GMT; path=/; domain=.google.com");
res = curl_easy_setopt(curl, CURLOPT_COOKIELIST, nline); res = curl_easy_setopt(curl, CURLOPT_COOKIELIST, nline);
if (res != CURLE_OK) { if (res != CURLE_OK) {
fprintf(stderr, "Curl curl_easy_setopt failed: %s\n", fprintf(stderr, "Curl curl_easy_setopt failed: %s\n", curl_easy_strerror(res));
curl_easy_strerror(res));
return 1; return 1;
} }
@ -126,8 +121,6 @@ main(void)
fprintf(stderr, "Curl perform failed: %s\n", curl_easy_strerror(res)); fprintf(stderr, "Curl perform failed: %s\n", curl_easy_strerror(res));
return 1; return 1;
} }
curl_easy_cleanup(curl);
} }
else { else {
fprintf(stderr, "Curl init failed!\n"); fprintf(stderr, "Curl init failed!\n");

View File

@ -50,9 +50,9 @@ void *my_thread(void *ptr)
gchar *url = ptr; gchar *url = ptr;
curl = curl_easy_init(); curl = curl_easy_init();
if(curl) { if(curl)
const char *filename = "test.curl"; {
outfile = fopen(filename, "wb"); outfile = fopen("test.curl", "w");
curl_easy_setopt(curl, CURLOPT_URL, url); curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, outfile); curl_easy_setopt(curl, CURLOPT_WRITEDATA, outfile);

View File

@ -36,7 +36,7 @@
* "This product includes software developed by the Openevidence Project * "This product includes software developed by the Openevidence Project
* for use in the OpenEvidence Toolkit. (http://www.openevidence.org/)" * for use in the OpenEvidence Toolkit. (http://www.openevidence.org/)"
* This product includes software developed by the OpenSSL Project * This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (https://www.openssl.org/)" * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
* This product includes cryptographic software written by Eric Young * This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim * (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com)." * Hudson (tjh@cryptsoft.com)."
@ -55,7 +55,7 @@
* "This product includes software developed by the OpenEvidence Project * "This product includes software developed by the OpenEvidence Project
* for use in the OpenEvidence Toolkit (http://www.openevidence.org/) * for use in the OpenEvidence Toolkit (http://www.openevidence.org/)
* This product includes software developed by the OpenSSL Project * This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (https://www.openssl.org/)" * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
* This product includes cryptographic software written by Eric Young * This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim * (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com)." * Hudson (tjh@cryptsoft.com)."
@ -75,7 +75,7 @@
* ==================================================================== * ====================================================================
* *
* This product includes software developed by the OpenSSL Project * This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (https://www.openssl.org/) * for use in the OpenSSL Toolkit (http://www.openssl.org/)
* This product includes cryptographic software written by Eric Young * This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim * (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com). * Hudson (tjh@cryptsoft.com).
@ -101,18 +101,13 @@
static const char *curlx_usage[]={ static const char *curlx_usage[]={
"usage: curlx args\n", "usage: curlx args\n",
" -p12 arg - tia file ", " -p12 arg - tia file ",
" -envpass arg - environement variable which content the tia private" " -envpass arg - environement variable which content the tia private key password",
" key password",
" -out arg - output file (response)- default stdout", " -out arg - output file (response)- default stdout",
" -in arg - input file (request)- default stdin", " -in arg - input file (request)- default stdin",
" -connect arg - URL of the server for the connection ex:" " -connect arg - URL of the server for the connection ex: www.openevidence.org",
" www.openevidence.org", " -mimetype arg - MIME type for data in ex : application/timestamp-query or application/dvcs -default application/timestamp-query",
" -mimetype arg - MIME type for data in ex : application/timestamp-query" " -acceptmime arg - MIME type acceptable for the response ex : application/timestamp-response or application/dvcs -default none",
" or application/dvcs -default application/timestamp-query", " -accesstype arg - an Object identifier in an AIA/SIA method, e.g. AD_DVCS or ad_timestamping",
" -acceptmime arg - MIME type acceptable for the response ex : "
"application/timestamp-response or application/dvcs -default none",
" -accesstype arg - an Object identifier in an AIA/SIA method, e.g."
" AD_DVCS or ad_timestamping",
NULL NULL
}; };
@ -148,7 +143,7 @@ typedef struct sslctxparm_st {
/* some helper function. */ /* some helper function. */
static char *ia5string(ASN1_IA5STRING *ia5) static char *i2s_ASN1_IA5STRING( ASN1_IA5STRING *ia5)
{ {
char *tmp; char *tmp;
if(!ia5 || !ia5->length) if(!ia5 || !ia5->length)
@ -160,9 +155,9 @@ static char *ia5string(ASN1_IA5STRING *ia5)
} }
/* A conveniance routine to get an access URI. */ /* A conveniance routine to get an access URI. */
static unsigned char *my_get_ext(X509 *cert, const int type,
int extensiontype) static unsigned char *my_get_ext(X509 * cert, const int type, int extensiontype) {
{
int i; int i;
STACK_OF(ACCESS_DESCRIPTION) * accessinfo ; STACK_OF(ACCESS_DESCRIPTION) * accessinfo ;
accessinfo = X509_get_ext_d2i(cert, extensiontype, NULL, NULL) ; accessinfo = X509_get_ext_d2i(cert, extensiontype, NULL, NULL) ;
@ -173,7 +168,7 @@ static unsigned char *my_get_ext(X509 *cert, const int type,
ACCESS_DESCRIPTION * ad = sk_ACCESS_DESCRIPTION_value(accessinfo, i); ACCESS_DESCRIPTION * ad = sk_ACCESS_DESCRIPTION_value(accessinfo, i);
if (OBJ_obj2nid(ad->method) == type) { if (OBJ_obj2nid(ad->method) == type) {
if (ad->location->type == GEN_URI) { if (ad->location->type == GEN_URI) {
return ia5string(ad->location->d.ia5); return i2s_ASN1_IA5STRING(ad->location->d.ia5);
} }
return NULL; return NULL;
} }
@ -216,48 +211,46 @@ static int ssl_app_verify_callback(X509_STORE_CTX *ctx, void *arg)
} }
if (p->verbose > 2) if (p->verbose > 2)
BIO_printf(p->errorbio,"leaving ssl_app_verify_callback with %d\n", ok); BIO_printf(p->errorbio,"leaving ssl_app_verify_callback with %d\n", ok);
return(ok);
return ok;
} }
/* The SSL initialisation callback. The callback sets: /* This is an example of an curl SSL initialisation call back. The callback sets:
- a private key and certificate - a private key and certificate
- a trusted ca certificate - a trusted ca certificate
- a preferred cipherlist - a preferred cipherlist
- an application verification callback (the function above) - an application verification callback (the function above)
*/ */
static CURLcode sslctxfun(CURL * curl, void * sslctx, void * parm) static CURLcode sslctxfun(CURL * curl, void * sslctx, void * parm) {
{
sslctxparm * p = (sslctxparm *) parm; sslctxparm * p = (sslctxparm *) parm;
SSL_CTX * ctx = (SSL_CTX *) sslctx ; SSL_CTX * ctx = (SSL_CTX *) sslctx ;
if (!SSL_CTX_use_certificate(ctx,p->usercert)) { if (!SSL_CTX_use_certificate(ctx,p->usercert)) {
BIO_printf(p->errorbio, "SSL_CTX_use_certificate problem\n"); BIO_printf(p->errorbio, "SSL_CTX_use_certificate problem\n"); goto err;
goto err;
} }
if (!SSL_CTX_use_PrivateKey(ctx,p->pkey)) { if (!SSL_CTX_use_PrivateKey(ctx,p->pkey)) {
BIO_printf(p->errorbio, "SSL_CTX_use_PrivateKey\n"); BIO_printf(p->errorbio, "SSL_CTX_use_PrivateKey\n"); goto err;
goto err;
} }
if (!SSL_CTX_check_private_key(ctx)) { if (!SSL_CTX_check_private_key(ctx)) {
BIO_printf(p->errorbio, "SSL_CTX_check_private_key\n"); BIO_printf(p->errorbio, "SSL_CTX_check_private_key\n"); goto err;
goto err;
} }
SSL_CTX_set_quiet_shutdown(ctx,1); SSL_CTX_set_quiet_shutdown(ctx,1);
SSL_CTX_set_cipher_list(ctx,"RC4-MD5"); SSL_CTX_set_cipher_list(ctx,"RC4-MD5");
SSL_CTX_set_mode(ctx, SSL_MODE_AUTO_RETRY); SSL_CTX_set_mode(ctx, SSL_MODE_AUTO_RETRY);
X509_STORE_add_cert(SSL_CTX_get_cert_store(ctx), X509_STORE_add_cert(SSL_CTX_get_cert_store(ctx), sk_X509_value(p->ca, sk_X509_num(p->ca)-1));
sk_X509_value(p->ca, sk_X509_num(p->ca)-1));
SSL_CTX_set_verify_depth(ctx,2); SSL_CTX_set_verify_depth(ctx,2);
SSL_CTX_set_verify(ctx,SSL_VERIFY_PEER,ZERO_NULL); SSL_CTX_set_verify(ctx,SSL_VERIFY_PEER,ZERO_NULL);
SSL_CTX_set_cert_verify_callback(ctx, ssl_app_verify_callback, parm); SSL_CTX_set_cert_verify_callback(ctx, ssl_app_verify_callback, parm);
return CURLE_OK ; return CURLE_OK ;
err: err:
ERR_print_errors(p->errorbio); ERR_print_errors(p->errorbio);
@ -265,8 +258,8 @@ static CURLcode sslctxfun(CURL * curl, void * sslctx, void * parm)
} }
int main(int argc, char **argv) int main(int argc, char **argv) {
{
BIO* in=NULL; BIO* in=NULL;
BIO* out=NULL; BIO* out=NULL;
@ -303,74 +296,48 @@ int main(int argc, char **argv)
OpenSSL_add_all_digests(); OpenSSL_add_all_digests();
ERR_load_crypto_strings(); ERR_load_crypto_strings();
while (*args && *args[0] == '-') { while (*args && *args[0] == '-') {
if (!strcmp (*args, "-in")) { if (!strcmp (*args, "-in")) {
if (args[1]) { if (args[1]) {
infile=*(++args); infile=*(++args);
} } else badarg=1;
else } else if (!strcmp (*args, "-out")) {
badarg=1;
}
else if(!strcmp (*args, "-out")) {
if (args[1]) { if (args[1]) {
outfile=*(++args); outfile=*(++args);
} } else badarg=1;
else } else if (!strcmp (*args, "-p12")) {
badarg=1;
}
else if(!strcmp (*args, "-p12")) {
if (args[1]) { if (args[1]) {
p.p12file = *(++args); p.p12file = *(++args);
} } else badarg=1;
else } else if (strcmp(*args,"-envpass") == 0) {
badarg=1;
}
else if(strcmp(*args, "-envpass") == 0) {
if (args[1]) { if (args[1]) {
p.pst = getenv(*(++args)); p.pst = getenv(*(++args));
} } else badarg=1;
else } else if (strcmp(*args,"-connect") == 0) {
badarg=1;
}
else if(strcmp(*args, "-connect") == 0) {
if (args[1]) { if (args[1]) {
hostporturl = *(++args); hostporturl = *(++args);
} } else badarg=1;
else } else if (strcmp(*args,"-mimetype") == 0) {
badarg=1;
}
else if(strcmp(*args, "-mimetype") == 0) {
if (args[1]) { if (args[1]) {
mimetype = *(++args); mimetype = *(++args);
} } else badarg=1;
else } else if (strcmp(*args,"-acceptmime") == 0) {
badarg=1;
}
else if(strcmp(*args, "-acceptmime") == 0) {
if (args[1]) { if (args[1]) {
mimetypeaccept = *(++args); mimetypeaccept = *(++args);
} } else badarg=1;
else } else if (strcmp(*args,"-accesstype") == 0) {
badarg=1;
}
else if(strcmp(*args, "-accesstype") == 0) {
if (args[1]) { if (args[1]) {
if((p.accesstype = OBJ_obj2nid(OBJ_txt2obj(*++args, 0))) == 0) if ((p.accesstype = OBJ_obj2nid(OBJ_txt2obj(*++args,0))) == 0) badarg=1;
badarg=1; } else badarg=1;
} } else if (strcmp(*args,"-verbose") == 0) {
else
badarg=1;
}
else if(strcmp(*args, "-verbose") == 0) {
p.verbose++; p.verbose++;
} } else badarg=1;
else
badarg=1;
args++; args++;
} }
if(mimetype==NULL || mimetypeaccept == NULL) if (mimetype==NULL || mimetypeaccept == NULL) badarg = 1;
badarg = 1;
if (badarg) { if (badarg) {
for (pp=curlx_usage; (*pp != NULL); pp++) for (pp=curlx_usage; (*pp != NULL); pp++)
@ -379,13 +346,14 @@ int main(int argc, char **argv)
goto err; goto err;
} }
/* set input */ /* set input */
if ((in=BIO_new(BIO_s_file())) == NULL) { if ((in=BIO_new(BIO_s_file())) == NULL) {
BIO_printf(p.errorbio, "Error setting input bio\n"); BIO_printf(p.errorbio, "Error setting input bio\n");
goto err; goto err;
} } else if (infile == NULL)
else if(infile == NULL)
BIO_set_fp(in,stdin,BIO_NOCLOSE|BIO_FP_TEXT); BIO_set_fp(in,stdin,BIO_NOCLOSE|BIO_FP_TEXT);
else if (BIO_read_filename(in,infile) <= 0) { else if (BIO_read_filename(in,infile) <= 0) {
BIO_printf(p.errorbio, "Error opening input file %s\n", infile); BIO_printf(p.errorbio, "Error opening input file %s\n", infile);
@ -398,8 +366,7 @@ int main(int argc, char **argv)
if ((out=BIO_new(BIO_s_file())) == NULL) { if ((out=BIO_new(BIO_s_file())) == NULL) {
BIO_printf(p.errorbio, "Error setting output bio.\n"); BIO_printf(p.errorbio, "Error setting output bio.\n");
goto err; goto err;
} } else if (outfile == NULL)
else if(outfile == NULL)
BIO_set_fp(out,stdout,BIO_NOCLOSE|BIO_FP_TEXT); BIO_set_fp(out,stdout,BIO_NOCLOSE|BIO_FP_TEXT);
else if (BIO_write_filename(out,outfile) <= 0) { else if (BIO_write_filename(out,outfile) <= 0) {
BIO_printf(p.errorbio, "Error opening output file %s\n", outfile); BIO_printf(p.errorbio, "Error opening output file %s\n", outfile);
@ -415,24 +382,22 @@ int main(int argc, char **argv)
goto err; goto err;
} }
if (!(p12bio = BIO_new_file(p.p12file , "rb"))) { if (!(p12bio = BIO_new_file(p.p12file , "rb"))) {
BIO_printf(p.errorbio, "Error opening P12 file %s\n", p.p12file); BIO_printf(p.errorbio, "Error opening P12 file %s\n", p.p12file); goto err;
goto err;
} }
if (!(p.p12 = d2i_PKCS12_bio (p12bio, NULL))) { if (!(p.p12 = d2i_PKCS12_bio (p12bio, NULL))) {
BIO_printf(p.errorbio, "Cannot decode P12 structure %s\n", p.p12file); BIO_printf(p.errorbio, "Cannot decode P12 structure %s\n", p.p12file); goto err;
goto err;
} }
p.ca= NULL; p.ca= NULL;
if (!(PKCS12_parse (p.p12, p.pst, &(p.pkey), &(p.usercert), &(p.ca) ) )) { if (!(PKCS12_parse (p.p12, p.pst, &(p.pkey), &(p.usercert), &(p.ca) ) )) {
BIO_printf(p.errorbio, "Invalid P12 structure in %s\n", p.p12file); BIO_printf(p.errorbio,"Invalid P12 structure in %s\n", p.p12file); goto err;
goto err;
} }
if (sk_X509_num(p.ca) <= 0) { if (sk_X509_num(p.ca) <= 0) {
BIO_printf(p.errorbio, "No trustworthy CA given.%s\n", p.p12file); BIO_printf(p.errorbio,"No trustworthy CA given.%s\n", p.p12file); goto err;
goto err;
} }
if (p.verbose > 1) if (p.verbose > 1)
@ -441,12 +406,10 @@ int main(int argc, char **argv)
/* determine URL to go */ /* determine URL to go */
if (hostporturl) { if (hostporturl) {
size_t len = strlen(hostporturl) + 9; serverurl = malloc(9+strlen(hostporturl));
serverurl = malloc(len); sprintf(serverurl,"https://%s",hostporturl);
snprintf(serverurl, len, "https://%s", hostporturl);
} }
else if(p.accesstype != 0) { /* see whether we can find an AIA or SIA for a else if (p.accesstype != 0) { /* see whether we can find an AIA or SIA for a given access type */
given access type */
if (!(serverurl = my_get_ext(p.usercert,p.accesstype,NID_info_access))) { if (!(serverurl = my_get_ext(p.usercert,p.accesstype,NID_info_access))) {
int j=0; int j=0;
BIO_printf(p.errorbio,"no service URL in user cert " BIO_printf(p.errorbio,"no service URL in user cert "
@ -482,7 +445,7 @@ int main(int argc, char **argv)
/* pass our list of custom made headers */ /* pass our list of custom made headers */
contenttype = malloc(15+strlen(mimetype)); contenttype = malloc(15+strlen(mimetype));
snprintf(contenttype, 15+strlen(mimetype), "Content-type: %s", mimetype); sprintf(contenttype,"Content-type: %s",mimetype);
headers = curl_slist_append(headers,contenttype); headers = curl_slist_append(headers,contenttype);
curl_easy_setopt(p.curl, CURLOPT_HTTPHEADER, headers); curl_easy_setopt(p.curl, CURLOPT_HTTPHEADER, headers);
@ -498,8 +461,7 @@ int main(int argc, char **argv)
res = curl_easy_setopt(p.curl, CURLOPT_SSL_CTX_FUNCTION, sslctxfun) ; res = curl_easy_setopt(p.curl, CURLOPT_SSL_CTX_FUNCTION, sslctxfun) ;
if (res != CURLE_OK) if (res != CURLE_OK)
BIO_printf(p.errorbio, "%d %s=%d %d\n", __LINE__, BIO_printf(p.errorbio,"%d %s=%d %d\n", __LINE__, "CURLOPT_SSL_CTX_FUNCTION",CURLOPT_SSL_CTX_FUNCTION,res);
"CURLOPT_SSL_CTX_FUNCTION", CURLOPT_SSL_CTX_FUNCTION, res);
curl_easy_setopt(p.curl, CURLOPT_SSL_CTX_DATA, &p); curl_easy_setopt(p.curl, CURLOPT_SSL_CTX_DATA, &p);

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is
@ -119,12 +119,12 @@ static int multi_timer_cb(CURLM *multi, long timeout_ms, GlobalInfo *g)
{ {
DPRINT("%s %li\n", __PRETTY_FUNCTION__, timeout_ms); DPRINT("%s %li\n", __PRETTY_FUNCTION__, timeout_ms);
ev_timer_stop(g->loop, &g->timer_event); ev_timer_stop(g->loop, &g->timer_event);
if(timeout_ms > 0) { if (timeout_ms > 0)
{
double t = timeout_ms / 1000; double t = timeout_ms / 1000;
ev_timer_init(&g->timer_event, timer_cb, t, 0.); ev_timer_init(&g->timer_event, timer_cb, t, 0.);
ev_timer_start(g->loop, &g->timer_event); ev_timer_start(g->loop, &g->timer_event);
} }else
else
timer_cb(g->loop, &g->timer_event, 0); timer_cb(g->loop, &g->timer_event, 0);
return 0; return 0;
} }
@ -132,32 +132,20 @@ static int multi_timer_cb(CURLM *multi, long timeout_ms, GlobalInfo *g)
/* Die if we get a bad CURLMcode somewhere */ /* Die if we get a bad CURLMcode somewhere */
static void mcode_or_die(const char *where, CURLMcode code) static void mcode_or_die(const char *where, CURLMcode code)
{ {
if(CURLM_OK != code) { if ( CURLM_OK != code )
{
const char *s; const char *s;
switch (code) { switch ( code )
case CURLM_BAD_HANDLE: {
s="CURLM_BAD_HANDLE"; case CURLM_BAD_HANDLE: s="CURLM_BAD_HANDLE"; break;
case CURLM_BAD_EASY_HANDLE: s="CURLM_BAD_EASY_HANDLE"; break;
case CURLM_OUT_OF_MEMORY: s="CURLM_OUT_OF_MEMORY"; break;
case CURLM_INTERNAL_ERROR: s="CURLM_INTERNAL_ERROR"; break;
case CURLM_UNKNOWN_OPTION: s="CURLM_UNKNOWN_OPTION"; break;
case CURLM_LAST: s="CURLM_LAST"; break;
default: s="CURLM_unknown";
break; break;
case CURLM_BAD_EASY_HANDLE: case CURLM_BAD_SOCKET: s="CURLM_BAD_SOCKET";
s="CURLM_BAD_EASY_HANDLE";
break;
case CURLM_OUT_OF_MEMORY:
s="CURLM_OUT_OF_MEMORY";
break;
case CURLM_INTERNAL_ERROR:
s="CURLM_INTERNAL_ERROR";
break;
case CURLM_UNKNOWN_OPTION:
s="CURLM_UNKNOWN_OPTION";
break;
case CURLM_LAST:
s="CURLM_LAST";
break;
default:
s="CURLM_unknown";
break;
case CURLM_BAD_SOCKET:
s="CURLM_BAD_SOCKET";
fprintf(MSG_OUT, "ERROR: %s returns %s\n", where, s); fprintf(MSG_OUT, "ERROR: %s returns %s\n", where, s);
/* ignore this error */ /* ignore this error */
return; return;
@ -209,7 +197,8 @@ static void event_cb(EV_P_ struct ev_io *w, int revents)
rc = curl_multi_socket_action(g->multi, w->fd, action, &g->still_running); rc = curl_multi_socket_action(g->multi, w->fd, action, &g->still_running);
mcode_or_die("event_cb: curl_multi_socket_action", rc); mcode_or_die("event_cb: curl_multi_socket_action", rc);
check_multi_info(g); check_multi_info(g);
if(g->still_running <= 0) { if ( g->still_running <= 0 )
{
fprintf(MSG_OUT, "last transfer done, kill timeout\n"); fprintf(MSG_OUT, "last transfer done, kill timeout\n");
ev_timer_stop(g->loop, &g->timer_event); ev_timer_stop(g->loop, &g->timer_event);
} }
@ -223,8 +212,7 @@ static void timer_cb(EV_P_ struct ev_timer *w, int revents)
GlobalInfo *g = (GlobalInfo *)w->data; GlobalInfo *g = (GlobalInfo *)w->data;
CURLMcode rc; CURLMcode rc;
rc = curl_multi_socket_action(g->multi, CURL_SOCKET_TIMEOUT, 0, rc = curl_multi_socket_action(g->multi, CURL_SOCKET_TIMEOUT, 0, &g->still_running);
&g->still_running);
mcode_or_die("timer_cb: curl_multi_socket_action", rc); mcode_or_die("timer_cb: curl_multi_socket_action", rc);
check_multi_info(g); check_multi_info(g);
} }
@ -233,7 +221,8 @@ static void timer_cb(EV_P_ struct ev_timer *w, int revents)
static void remsock(SockInfo *f, GlobalInfo *g) static void remsock(SockInfo *f, GlobalInfo *g)
{ {
printf("%s \n", __PRETTY_FUNCTION__); printf("%s \n", __PRETTY_FUNCTION__);
if(f) { if ( f )
{
if ( f->evset ) if ( f->evset )
ev_io_stop(g->loop, &f->ev); ev_io_stop(g->loop, &f->ev);
free(f); free(f);
@ -284,16 +273,18 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
fprintf(MSG_OUT, fprintf(MSG_OUT,
"socket callback: s=%d e=%p what=%s ", s, e, whatstr[what]); "socket callback: s=%d e=%p what=%s ", s, e, whatstr[what]);
if(what == CURL_POLL_REMOVE) { if ( what == CURL_POLL_REMOVE )
{
fprintf(MSG_OUT, "\n"); fprintf(MSG_OUT, "\n");
remsock(fdp, g); remsock(fdp, g);
} } else
else { {
if(!fdp) { if ( !fdp )
{
fprintf(MSG_OUT, "Adding data: %s\n", whatstr[what]); fprintf(MSG_OUT, "Adding data: %s\n", whatstr[what]);
addsock(s, e, what, g); addsock(s, e, what, g);
} } else
else { {
fprintf(MSG_OUT, fprintf(MSG_OUT,
"Changing action from %s to %s\n", "Changing action from %s to %s\n",
whatstr[fdp->action], whatstr[what]); whatstr[fdp->action], whatstr[what]);
@ -339,7 +330,8 @@ static void new_conn(char *url, GlobalInfo *g )
conn->error[0]='\0'; conn->error[0]='\0';
conn->easy = curl_easy_init(); conn->easy = curl_easy_init();
if(!conn->easy) { if ( !conn->easy )
{
fprintf(MSG_OUT, "curl_easy_init() failed, exiting!\n"); fprintf(MSG_OUT, "curl_easy_init() failed, exiting!\n");
exit(2); exit(2);
} }
@ -374,15 +366,15 @@ static void fifo_cb(EV_P_ struct ev_io *w, int revents)
int n=0; int n=0;
GlobalInfo *g = (GlobalInfo *)w->data; GlobalInfo *g = (GlobalInfo *)w->data;
do { do
{
s[0]='\0'; s[0]='\0';
rv=fscanf(g->input, "%1023s%n", s, &n); rv=fscanf(g->input, "%1023s%n", s, &n);
s[n]='\0'; s[n]='\0';
if(n && s[0]) { if ( n && s[0] )
{
new_conn(s,g); /* if we read a URL, go get it! */ new_conn(s,g); /* if we read a URL, go get it! */
} } else break;
else
break;
} while ( rv != EOF ); } while ( rv != EOF );
} }
@ -394,20 +386,24 @@ static int init_fifo (GlobalInfo *g)
curl_socket_t sockfd; curl_socket_t sockfd;
fprintf(MSG_OUT, "Creating named pipe \"%s\"\n", fifo); fprintf(MSG_OUT, "Creating named pipe \"%s\"\n", fifo);
if(lstat (fifo, &st) == 0) { if ( lstat (fifo, &st) == 0 )
if((st.st_mode & S_IFMT) == S_IFREG) { {
if ( (st.st_mode & S_IFMT) == S_IFREG )
{
errno = EEXIST; errno = EEXIST;
perror("lstat"); perror("lstat");
exit (1); exit (1);
} }
} }
unlink(fifo); unlink(fifo);
if(mkfifo (fifo, 0600) == -1) { if ( mkfifo (fifo, 0600) == -1 )
{
perror("mkfifo"); perror("mkfifo");
exit (1); exit (1);
} }
sockfd = open(fifo, O_RDWR | O_NONBLOCK, 0); sockfd = open(fifo, O_RDWR | O_NONBLOCK, 0);
if(sockfd == -1) { if ( sockfd == -1 )
{
perror("open"); perror("open");
exit (1); exit (1);
} }

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is
@ -54,7 +54,7 @@
static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream) static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream)
{ {
size_t written = fwrite(ptr, size, nmemb, (FILE *)stream); int written = fwrite(ptr, size, nmemb, (FILE *)stream);
return written; return written;
} }

View File

@ -9,7 +9,7 @@
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is

View File

@ -165,7 +165,8 @@ static int fill_buffer(URL_FILE *file, size_t want)
/* get file descriptors from the transfers */ /* get file descriptors from the transfers */
mc = curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd); mc = curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
if(mc != CURLM_OK) { if(mc != CURLM_OK)
{
fprintf(stderr, "curl_multi_fdset() failed, code %d.\n", mc); fprintf(stderr, "curl_multi_fdset() failed, code %d.\n", mc);
break; break;
} }
@ -446,10 +447,6 @@ void url_rewind(URL_FILE *file)
} }
} }
#define FGETSFILE "fgets.test"
#define FREADFILE "fread.test"
#define REWINDFILE "rewind.test"
/* Small main program to retrive from a url using fgets and fread saving the /* Small main program to retrive from a url using fgets and fread saving the
* output to two test files (note the fgets method will corrupt binary files if * output to two test files (note the fgets method will corrupt binary files if
* they contain 0 chars */ * they contain 0 chars */
@ -468,7 +465,7 @@ int main(int argc, char *argv[])
url=argv[1];/* use passed url */ url=argv[1];/* use passed url */
/* copy from url line by line with fgets */ /* copy from url line by line with fgets */
outf=fopen(FGETSFILE, "wb+"); outf=fopen("fgets.test","w+");
if(!outf) { if(!outf) {
perror("couldn't open fgets output file\n"); perror("couldn't open fgets output file\n");
return 1; return 1;
@ -492,7 +489,7 @@ int main(int argc, char *argv[])
/* Copy from url with fread */ /* Copy from url with fread */
outf=fopen(FREADFILE, "wb+"); outf=fopen("fread.test","w+");
if(!outf) { if(!outf) {
perror("couldn't open fread output file\n"); perror("couldn't open fread output file\n");
return 1; return 1;
@ -516,7 +513,7 @@ int main(int argc, char *argv[])
/* Test rewind */ /* Test rewind */
outf=fopen(REWINDFILE, "wb+"); outf=fopen("rewind.test","w+");
if(!outf) { if(!outf) {
perror("couldn't open fread output file\n"); perror("couldn't open fread output file\n");
return 1; return 1;
@ -539,9 +536,11 @@ int main(int argc, char *argv[])
nread = url_fread(buffer, 1,sizeof(buffer), handle); nread = url_fread(buffer, 1,sizeof(buffer), handle);
fwrite(buffer,1,nread,outf); fwrite(buffer,1,nread,outf);
url_fclose(handle); url_fclose(handle);
fclose(outf); fclose(outf);
return 0;/* all done */ return 0;/* all done */
} }

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is
@ -119,7 +119,7 @@ static long file_is_coming(struct curl_fileinfo *finfo,
return CURL_CHUNK_BGN_FUNC_SKIP; return CURL_CHUNK_BGN_FUNC_SKIP;
} }
data->output = fopen(finfo->filename, "wb"); data->output = fopen(finfo->filename, "w");
if(!data->output) { if(!data->output) {
return CURL_CHUNK_BGN_FUNC_FAIL; return CURL_CHUNK_BGN_FUNC_FAIL;
} }

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is
@ -63,7 +63,7 @@ int main(void)
* You better replace the URL with one that works! * You better replace the URL with one that works!
*/ */
curl_easy_setopt(curl, CURLOPT_URL, curl_easy_setopt(curl, CURLOPT_URL,
"ftp://ftp.example.com/curl/curl-7.9.2.tar.gz"); "ftp://ftp.example.com/pub/www/utilities/curl/curl-7.9.2.tar.gz");
/* Define our callback to get called when there's data to be written */ /* Define our callback to get called when there's data to be written */
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_fwrite); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_fwrite);
/* Set a pointer to our struct to pass to the callback */ /* Set a pointer to our struct to pass to the callback */

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is
@ -65,18 +65,16 @@ int main(void)
res = curl_easy_perform(curl); res = curl_easy_perform(curl);
if(CURLE_OK == res) { if(CURLE_OK == res) {
/* https://curl.haxx.se/libcurl/c/curl_easy_getinfo.html */ /* http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html */
res = curl_easy_getinfo(curl, CURLINFO_FILETIME, &filetime); res = curl_easy_getinfo(curl, CURLINFO_FILETIME, &filetime);
if((CURLE_OK == res) && (filetime >= 0)) { if((CURLE_OK == res) && (filetime >= 0)) {
time_t file_time = (time_t)filetime; time_t file_time = (time_t)filetime;
printf("filetime %s: %s", filename, ctime(&file_time)); printf("filetime %s: %s", filename, ctime(&file_time));
} }
res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &filesize);
&filesize);
if((CURLE_OK == res) && (filesize>0.0)) if((CURLE_OK == res) && (filesize>0.0))
printf("filesize %s: %0.0f bytes\n", filename, filesize); printf("filesize %s: %0.0f bytes\n", filename, filesize);
} } else {
else {
/* we failed */ /* we failed */
fprintf(stderr, "curl told us %d\n", res); fprintf(stderr, "curl told us %d\n", res);
} }

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is
@ -35,9 +35,6 @@ write_response(void *ptr, size_t size, size_t nmemb, void *data)
return fwrite(ptr, size, nmemb, writehere); return fwrite(ptr, size, nmemb, writehere);
} }
#define FTPBODY "ftp-list"
#define FTPHEADERS "ftp-responses"
int main(void) int main(void)
{ {
CURL *curl; CURL *curl;
@ -46,10 +43,10 @@ int main(void)
FILE *respfile; FILE *respfile;
/* local file name to store the file as */ /* local file name to store the file as */
ftpfile = fopen(FTPBODY, "wb"); /* b is binary, needed on win32 */ ftpfile = fopen("ftp-list", "wb"); /* b is binary, needed on win32 */
/* local file name to store the FTP server's response lines in */ /* local file name to store the FTP server's response lines in */
respfile = fopen(FTPHEADERS, "wb"); /* b is binary, needed on win32 */ respfile = fopen("ftp-responses", "wb"); /* b is binary, needed on win32 */
curl = curl_easy_init(); curl = curl_easy_init();
if(curl) { if(curl) {

View File

@ -9,7 +9,7 @@
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is
@ -36,8 +36,7 @@
/* The MinGW headers are missing a few Win32 function definitions, /* The MinGW headers are missing a few Win32 function definitions,
you shouldn't need this if you use VC++ */ you shouldn't need this if you use VC++ */
#if defined(__MINGW32__) && !defined(__MINGW64__) #if defined(__MINGW32__) && !defined(__MINGW64__)
int __cdecl _snscanf(const char * input, size_t length, int __cdecl _snscanf(const char * input, size_t length, const char * format, ...);
const char * format, ...);
#endif #endif
@ -86,7 +85,7 @@ int upload(CURL *curlhandle, const char * remotepath, const char * localpath,
int c; int c;
f = fopen(localpath, "rb"); f = fopen(localpath, "rb");
if(!f) { if (f == NULL) {
perror(NULL); perror(NULL);
return 0; return 0;
} }
@ -106,8 +105,7 @@ int upload(CURL *curlhandle, const char * remotepath, const char * localpath,
curl_easy_setopt(curlhandle, CURLOPT_READFUNCTION, readfunc); curl_easy_setopt(curlhandle, CURLOPT_READFUNCTION, readfunc);
curl_easy_setopt(curlhandle, CURLOPT_READDATA, f); curl_easy_setopt(curlhandle, CURLOPT_READDATA, f);
/* disable passive mode */ curl_easy_setopt(curlhandle, CURLOPT_FTPPORT, "-"); /* disable passive mode */
curl_easy_setopt(curlhandle, CURLOPT_FTPPORT, "-");
curl_easy_setopt(curlhandle, CURLOPT_FTP_CREATE_MISSING_DIRS, 1L); curl_easy_setopt(curlhandle, CURLOPT_FTP_CREATE_MISSING_DIRS, 1L);
curl_easy_setopt(curlhandle, CURLOPT_VERBOSE, 1L); curl_easy_setopt(curlhandle, CURLOPT_VERBOSE, 1L);
@ -163,8 +161,7 @@ int main(int c, char **argv)
curl_global_init(CURL_GLOBAL_ALL); curl_global_init(CURL_GLOBAL_ALL);
curlhandle = curl_easy_init(); curlhandle = curl_easy_init();
upload(curlhandle, "ftp://user:pass@example.com/path/file", "C:\\file", upload(curlhandle, "ftp://user:pass@example.com/path/file", "C:\\file", 0, 3);
0, 3);
curl_easy_cleanup(curlhandle); curl_easy_cleanup(curlhandle);
curl_global_cleanup(); curl_global_cleanup();

View File

@ -9,7 +9,7 @@
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is

View File

@ -9,7 +9,7 @@
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is

View File

@ -9,7 +9,7 @@
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is
@ -48,7 +48,7 @@ int main(void)
else { else {
res = curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code); res = curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code);
if((res == CURLE_OK) && if((res == CURLE_OK) &&
((response_code / 100) != 3)) { ((code / 100) != 3)) {
/* a redirect implies a 3xx response code */ /* a redirect implies a 3xx response code */
fprintf(stderr, "Not a redirect.\n"); fprintf(stderr, "Not a redirect.\n");
} }

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is
@ -54,6 +54,7 @@
*/ */
#include <glib.h> #include <glib.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
@ -63,10 +64,13 @@
#include <errno.h> #include <errno.h>
#include <curl/curl.h> #include <curl/curl.h>
#define MSG_OUT g_print /* Change to "g_error" to write to stderr */ #define MSG_OUT g_print /* Change to "g_error" to write to stderr */
#define SHOW_VERBOSE 0 /* Set to non-zero for libcurl messages */ #define SHOW_VERBOSE 0 /* Set to non-zero for libcurl messages */
#define SHOW_PROGRESS 0 /* Set to non-zero to enable progress callback */ #define SHOW_PROGRESS 0 /* Set to non-zero to enable progress callback */
/* Global information, common to all connections */ /* Global information, common to all connections */
typedef struct _GlobalInfo { typedef struct _GlobalInfo {
CURLM *multi; CURLM *multi;
@ -74,6 +78,8 @@ typedef struct _GlobalInfo {
int still_running; int still_running;
} GlobalInfo; } GlobalInfo;
/* Information associated with a specific easy handle */ /* Information associated with a specific easy handle */
typedef struct _ConnInfo { typedef struct _ConnInfo {
CURL *easy; CURL *easy;
@ -82,6 +88,7 @@ typedef struct _ConnInfo {
char error[CURL_ERROR_SIZE]; char error[CURL_ERROR_SIZE];
} ConnInfo; } ConnInfo;
/* Information associated with a specific socket */ /* Information associated with a specific socket */
typedef struct _SockInfo { typedef struct _SockInfo {
curl_socket_t sockfd; curl_socket_t sockfd;
@ -93,6 +100,9 @@ typedef struct _SockInfo {
GlobalInfo *global; GlobalInfo *global;
} SockInfo; } SockInfo;
/* Die if we get a bad CURLMcode somewhere */ /* Die if we get a bad CURLMcode somewhere */
static void mcode_or_die(const char *where, CURLMcode code) { static void mcode_or_die(const char *where, CURLMcode code) {
if ( CURLM_OK != code ) { if ( CURLM_OK != code ) {
@ -112,6 +122,8 @@ static void mcode_or_die(const char *where, CURLMcode code) {
} }
} }
/* Check for completed transfers, and remove their easy handles */ /* Check for completed transfers, and remove their easy handles */
static void check_multi_info(GlobalInfo *g) static void check_multi_info(GlobalInfo *g)
{ {
@ -138,6 +150,8 @@ static void check_multi_info(GlobalInfo *g)
} }
} }
/* Called by glib when our timeout expires */ /* Called by glib when our timeout expires */
static gboolean timer_cb(gpointer data) static gboolean timer_cb(gpointer data)
{ {
@ -151,6 +165,8 @@ static gboolean timer_cb(gpointer data)
return FALSE; return FALSE;
} }
/* Update the event timer after curl_multi library calls */ /* Update the event timer after curl_multi library calls */
static int update_timeout_cb(CURLM *multi, long timeout_ms, void *userp) static int update_timeout_cb(CURLM *multi, long timeout_ms, void *userp)
{ {
@ -166,6 +182,9 @@ static int update_timeout_cb(CURLM *multi, long timeout_ms, void *userp)
return 0; return 0;
} }
/* Called by glib when we get action on a multi socket */ /* Called by glib when we get action on a multi socket */
static gboolean event_cb(GIOChannel *ch, GIOCondition condition, gpointer data) static gboolean event_cb(GIOChannel *ch, GIOCondition condition, gpointer data)
{ {
@ -183,28 +202,25 @@ static gboolean event_cb(GIOChannel *ch, GIOCondition condition, gpointer data)
check_multi_info(g); check_multi_info(g);
if(g->still_running) { if(g->still_running) {
return TRUE; return TRUE;
} } else {
else {
MSG_OUT("last transfer done, kill timeout\n"); MSG_OUT("last transfer done, kill timeout\n");
if(g->timer_event) { if (g->timer_event) { g_source_remove(g->timer_event); }
g_source_remove(g->timer_event);
}
return FALSE; return FALSE;
} }
} }
/* Clean up the SockInfo structure */ /* Clean up the SockInfo structure */
static void remsock(SockInfo *f) static void remsock(SockInfo *f)
{ {
if(!f) { if (!f) { return; }
return; if (f->ev) { g_source_remove(f->ev); }
}
if(f->ev) {
g_source_remove(f->ev);
}
g_free(f); g_free(f);
} }
/* Assign information to a SockInfo structure */ /* Assign information to a SockInfo structure */
static void setsock(SockInfo*f, curl_socket_t s, CURL*e, int act, GlobalInfo*g) static void setsock(SockInfo*f, curl_socket_t s, CURL*e, int act, GlobalInfo*g)
{ {
@ -214,12 +230,13 @@ static void setsock(SockInfo*f, curl_socket_t s, CURL*e, int act, GlobalInfo*g)
f->sockfd = s; f->sockfd = s;
f->action = act; f->action = act;
f->easy = e; f->easy = e;
if(f->ev) { if (f->ev) { g_source_remove(f->ev); }
g_source_remove(f->ev);
}
f->ev=g_io_add_watch(f->ch, kind, event_cb,g); f->ev=g_io_add_watch(f->ch, kind, event_cb,g);
} }
/* Initialize a new SockInfo structure */ /* Initialize a new SockInfo structure */
static void addsock(curl_socket_t s, CURL *easy, int action, GlobalInfo *g) static void addsock(curl_socket_t s, CURL *easy, int action, GlobalInfo *g)
{ {
@ -231,6 +248,8 @@ static void addsock(curl_socket_t s, CURL *easy, int action, GlobalInfo *g)
curl_multi_assign(g->multi, s, fdp); curl_multi_assign(g->multi, s, fdp);
} }
/* CURLMOPT_SOCKETFUNCTION */ /* CURLMOPT_SOCKETFUNCTION */
static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp) static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
{ {
@ -242,8 +261,7 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
if (what == CURL_POLL_REMOVE) { if (what == CURL_POLL_REMOVE) {
MSG_OUT("\n"); MSG_OUT("\n");
remsock(fdp); remsock(fdp);
} } else {
else {
if (!fdp) { if (!fdp) {
MSG_OUT("Adding data: %s%s\n", MSG_OUT("Adding data: %s%s\n",
what&CURL_POLL_IN?"READ":"", what&CURL_POLL_IN?"READ":"",
@ -259,6 +277,8 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
return 0; return 0;
} }
/* CURLOPT_WRITEFUNCTION */ /* CURLOPT_WRITEFUNCTION */
static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data) static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data)
{ {
@ -269,15 +289,18 @@ static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data)
return realsize; return realsize;
} }
/* CURLOPT_PROGRESSFUNCTION */ /* CURLOPT_PROGRESSFUNCTION */
static int prog_cb (void *p, double dltotal, double dlnow, double ult, static int prog_cb (void *p, double dltotal, double dlnow, double ult, double uln)
double uln)
{ {
ConnInfo *conn = (ConnInfo *)p; ConnInfo *conn = (ConnInfo *)p;
MSG_OUT("Progress: %s (%g/%g)\n", conn->url, dlnow, dltotal); MSG_OUT("Progress: %s (%g/%g)\n", conn->url, dlnow, dltotal);
return 0; return 0;
} }
/* Create a new easy handle, and add it to the global curl_multi */ /* Create a new easy handle, and add it to the global curl_multi */
static void new_conn(char *url, GlobalInfo *g ) static void new_conn(char *url, GlobalInfo *g )
{ {
@ -285,7 +308,9 @@ static void new_conn(char *url, GlobalInfo *g )
CURLMcode rc; CURLMcode rc;
conn = g_malloc0(sizeof(ConnInfo)); conn = g_malloc0(sizeof(ConnInfo));
conn->error[0]='\0'; conn->error[0]='\0';
conn->easy = curl_easy_init(); conn->easy = curl_easy_init();
if (!conn->easy) { if (!conn->easy) {
MSG_OUT("curl_easy_init() failed, exiting!\n"); MSG_OUT("curl_easy_init() failed, exiting!\n");
@ -315,6 +340,7 @@ static void new_conn(char *url, GlobalInfo *g )
that the necessary socket_action() call will be called by this app */ that the necessary socket_action() call will be called by this app */
} }
/* This gets called by glib whenever data is received from the fifo */ /* This gets called by glib whenever data is received from the fifo */
static gboolean fifo_cb (GIOChannel *ch, GIOCondition condition, gpointer data) static gboolean fifo_cb (GIOChannel *ch, GIOCondition condition, gpointer data)
{ {
@ -327,13 +353,10 @@ static gboolean fifo_cb (GIOChannel *ch, GIOCondition condition, gpointer data)
GError *err=NULL; GError *err=NULL;
rv = g_io_channel_read_line (ch,&buf,&len,&tp,&err); rv = g_io_channel_read_line (ch,&buf,&len,&tp,&err);
if ( buf ) { if ( buf ) {
if(tp) { if (tp) { buf[tp]='\0'; }
buf[tp]='\0';
}
new_conn(buf,(GlobalInfo*)data); new_conn(buf,(GlobalInfo*)data);
g_free(buf); g_free(buf);
} } else {
else {
buf = g_malloc(BUF_SIZE+1); buf = g_malloc(BUF_SIZE+1);
while (TRUE) { while (TRUE) {
buf[BUF_SIZE]='\0'; buf[BUF_SIZE]='\0';
@ -344,12 +367,10 @@ static gboolean fifo_cb (GIOChannel *ch, GIOCondition condition, gpointer data)
tmp=all; tmp=all;
all=g_strdup_printf("%s%s", tmp, buf); all=g_strdup_printf("%s%s", tmp, buf);
g_free(tmp); g_free(tmp);
} } else {
else {
all = g_strdup(buf); all = g_strdup(buf);
} }
} } else {
else {
break; break;
} }
} }
@ -368,6 +389,9 @@ static gboolean fifo_cb (GIOChannel *ch, GIOCondition condition, gpointer data)
return TRUE; return TRUE;
} }
int init_fifo(void) int init_fifo(void)
{ {
struct stat st; struct stat st;
@ -397,8 +421,12 @@ int init_fifo(void)
MSG_OUT("Now, pipe some URL's into > %s\n", fifo); MSG_OUT("Now, pipe some URL's into > %s\n", fifo);
return socket; return socket;
} }
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
GlobalInfo *g; GlobalInfo *g;

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is
@ -362,9 +362,7 @@ static void fifo_cb(int fd, short event, void *arg)
s[n]='\0'; s[n]='\0';
if ( n && s[0] ) { if ( n && s[0] ) {
new_conn(s,arg); /* if we read a URL, go get it! */ new_conn(s,arg); /* if we read a URL, go get it! */
} } else break;
else
break;
} while ( rv != EOF); } while ( rv != EOF);
} }

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 2012 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 2012 - 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is
@ -38,16 +38,18 @@ uint write_cb(char *in, uint size, uint nmemb, TidyBuffer *out)
uint r; uint r;
r = size * nmemb; r = size * nmemb;
tidyBufAppend( out, in, r ); tidyBufAppend( out, in, r );
return r; return(r);
} }
/* Traverse the document tree */ /* Traverse the document tree */
void dumpNode(TidyDoc doc, TidyNode tnod, int indent ) void dumpNode(TidyDoc doc, TidyNode tnod, int indent )
{ {
TidyNode child; TidyNode child;
for(child = tidyGetChild(tnod); child; child = tidyGetNext(child) ) { for ( child = tidyGetChild(tnod); child; child = tidyGetNext(child) )
{
ctmbstr name = tidyNodeGetName( child ); ctmbstr name = tidyNodeGetName( child );
if(name) { if ( name )
{
/* if it has a name, then it's an HTML tag ... */ /* if it has a name, then it's an HTML tag ... */
TidyAttr attr; TidyAttr attr;
printf( "%*.*s%s ", indent, indent, "<", name); printf( "%*.*s%s ", indent, indent, "<", name);
@ -117,11 +119,11 @@ int main(int argc, char **argv )
tidyBufFree(&docbuf); tidyBufFree(&docbuf);
tidyBufFree(&tidy_errbuf); tidyBufFree(&tidy_errbuf);
tidyRelease(tdoc); tidyRelease(tdoc);
return err; return(err);
} }
else else
printf( "usage: %s <url>\n", argv[0] ); printf( "usage: %s <url>\n", argv[0] );
return 0; return(0);
} }

View File

@ -9,7 +9,7 @@
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is
@ -42,7 +42,7 @@
// //
#ifdef _MSC_VER #ifdef _MSC_VER
#define COMPARE(a, b) (!_stricmp((a), (b))) #define COMPARE(a, b) (!stricmp((a), (b)))
#else #else
#define COMPARE(a, b) (!strcasecmp((a), (b))) #define COMPARE(a, b) (!strcasecmp((a), (b)))
#endif #endif

View File

@ -9,7 +9,7 @@
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is
@ -149,7 +149,7 @@ static void setup(CURL *hnd, int num)
FILE *out; FILE *out;
char filename[128]; char filename[128];
snprintf(filename, 128, "dl-%d", num); sprintf(filename, "dl-%d", num);
out = fopen(filename, "wb"); out = fopen(filename, "wb");
@ -244,7 +244,8 @@ int main(int argc, char **argv)
/* get file descriptors from the transfers */ /* get file descriptors from the transfers */
mc = curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd); mc = curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
if(mc != CURLM_OK) { if(mc != CURLM_OK)
{
fprintf(stderr, "curl_multi_fdset() failed, code %d.\n", mc); fprintf(stderr, "curl_multi_fdset() failed, code %d.\n", mc);
break; break;
} }

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is
@ -123,11 +123,9 @@ int my_trace(CURL *handle, curl_infotype type,
return 0; return 0;
} }
#define OUTPUTFILE "dl"
static void setup(CURL *hnd) static void setup(CURL *hnd)
{ {
FILE *out = fopen(OUTPUTFILE, "wb"); FILE *out = fopen("dl", "wb");
/* write to this file */ /* write to this file */
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, out); curl_easy_setopt(hnd, CURLOPT_WRITEDATA, out);
@ -169,7 +167,7 @@ static int server_push_callback(CURL *parent,
(void)parent; /* we have no use for this */ (void)parent; /* we have no use for this */
snprintf(filename, 128, "push%u", count++); sprintf(filename, "push%u", count++);
/* here's a new stream, save it in a new file for each new push */ /* here's a new stream, save it in a new file for each new push */
out = fopen(filename, "wb"); out = fopen(filename, "wb");

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is
@ -187,10 +187,10 @@ static void setup(CURL *hnd, int num, const char *upload)
struct stat file_info; struct stat file_info;
curl_off_t uploadsize; curl_off_t uploadsize;
snprintf(filename, 128, "dl-%d", num); sprintf(filename, "dl-%d", num);
out = fopen(filename, "wb"); out = fopen(filename, "wb");
snprintf(url, 256, "https://localhost:8443/upload-%d", num); sprintf(url, "https://localhost:8443/upload-%d", num);
/* get the file size of the local file */ /* get the file size of the local file */
stat(upload, &file_info); stat(upload, &file_info);
@ -308,7 +308,8 @@ int main(int argc, char **argv)
/* get file descriptors from the transfers */ /* get file descriptors from the transfers */
mc = curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd); mc = curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
if(mc != CURLM_OK) { if(mc != CURLM_OK)
{
fprintf(stderr, "curl_multi_fdset() failed, code %d.\n", mc); fprintf(stderr, "curl_multi_fdset() failed, code %d.\n", mc);
break; break;
} }

View File

@ -9,7 +9,7 @@
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is

View File

@ -9,7 +9,7 @@
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is
@ -44,8 +44,7 @@ static const char *payload_text[] = {
"To: " TO "\r\n", "To: " TO "\r\n",
"From: " FROM "(Example User)\r\n", "From: " FROM "(Example User)\r\n",
"Cc: " CC "(Another example User)\r\n", "Cc: " CC "(Another example User)\r\n",
"Message-ID: " "Message-ID: <dcd7cb36-11db-487a-9f3a-e652a9458efd@rfcpedant.example.org>\r\n",
"<dcd7cb36-11db-487a-9f3a-e652a9458efd@rfcpedant.example.org>\r\n",
"Subject: IMAP example message\r\n", "Subject: IMAP example message\r\n",
"\r\n", /* empty line to divide headers from body, see RFC5322 */ "\r\n", /* empty line to divide headers from body, see RFC5322 */
"The body of the message starts here.\r\n", "The body of the message starts here.\r\n",

View File

@ -9,7 +9,7 @@
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is

View File

@ -9,7 +9,7 @@
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is

View File

@ -9,7 +9,7 @@
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is

View File

@ -9,7 +9,7 @@
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is
@ -46,8 +46,7 @@ int main(void)
curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret"); curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
/* This will fetch message 1 from the user's inbox */ /* This will fetch message 1 from the user's inbox */
curl_easy_setopt(curl, CURLOPT_URL, curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com/INBOX/;UID=1");
"imap://imap.example.com/INBOX/;UID=1");
/* Perform the fetch */ /* Perform the fetch */
res = curl_easy_perform(curl); res = curl_easy_perform(curl);

View File

@ -9,7 +9,7 @@
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is

View File

@ -9,7 +9,7 @@
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is
@ -120,7 +120,8 @@ int main(void)
/* get file descriptors from the transfers */ /* get file descriptors from the transfers */
mc = curl_multi_fdset(mcurl, &fdread, &fdwrite, &fdexcep, &maxfd); mc = curl_multi_fdset(mcurl, &fdread, &fdwrite, &fdexcep, &maxfd);
if(mc != CURLM_OK) { if(mc != CURLM_OK)
{
fprintf(stderr, "curl_multi_fdset() failed, code %d.\n", mc); fprintf(stderr, "curl_multi_fdset() failed, code %d.\n", mc);
break; break;
} }

View File

@ -9,7 +9,7 @@
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is

View File

@ -9,7 +9,7 @@
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is
@ -48,8 +48,7 @@ int main(void)
/* This will fetch message 1 from the user's inbox. Note the use of /* This will fetch message 1 from the user's inbox. Note the use of
* imaps:// rather than imap:// to request a SSL based connection. */ * imaps:// rather than imap:// to request a SSL based connection. */
curl_easy_setopt(curl, CURLOPT_URL, curl_easy_setopt(curl, CURLOPT_URL, "imaps://imap.example.com/INBOX/;UID=1");
"imaps://imap.example.com/INBOX/;UID=1");
/* If you want to connect to a site who isn't using a certificate that is /* If you want to connect to a site who isn't using a certificate that is
* signed by one of the certs in the CA bundle you have, you can skip the * signed by one of the certs in the CA bundle you have, you can skip the

View File

@ -9,7 +9,7 @@
* *
* 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
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at http://curl.haxx.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * 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 * copies of the Software, and permit persons to whom the Software is

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