aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Deymo <deymo@google.com>2016-10-18 06:29:12 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-10-18 06:29:12 +0000
commitfedd5edab99efd53a9162273f64be270f7bf3282 (patch)
tree5dd15c327ae0fcd275b402e26e60c72d2931fec0
parentd6f8ac4be7ef9f6311d2229b8f22f42fa3426953 (diff)
parente3149cc1cf501b46caba8d47652ac90b95c78eac (diff)
downloadexternal_curl-fedd5edab99efd53a9162273f64be270f7bf3282.tar.gz
external_curl-fedd5edab99efd53a9162273f64be270f7bf3282.tar.bz2
external_curl-fedd5edab99efd53a9162273f64be270f7bf3282.zip
Update libcurl from 7.49.1 to 7.50.1.
am: e3149cc1cf Change-Id: Iddd6e2ae88a7194d5f035295367da4f6dc7a4b7b
-rw-r--r--.travis.yml1
-rw-r--r--CMakeLists.txt139
-rw-r--r--README.md13
-rw-r--r--README.version6
-rw-r--r--RELEASE-NOTES67
-rw-r--r--acinclude.m46
-rw-r--r--appveyor.yml34
-rw-r--r--configure.ac1
-rw-r--r--docs/FAQ32
-rw-r--r--docs/INTERNALS97
-rw-r--r--docs/KNOWN_BUGS35
-rw-r--r--docs/README.md12
-rw-r--r--docs/ROADMAP.md30
-rw-r--r--docs/SECURITY13
-rw-r--r--docs/THANKS21
-rw-r--r--docs/TODO46
-rw-r--r--docs/curl.18
-rw-r--r--docs/libcurl/curl_easy_getinfo.33
-rw-r--r--docs/libcurl/curl_global_init.335
-rw-r--r--docs/libcurl/curl_multi_socket_action.32
-rw-r--r--docs/libcurl/libcurl-multi.32
-rw-r--r--docs/libcurl/opts/CURLINFO_CERTINFO.36
-rw-r--r--docs/libcurl/opts/CURLINFO_HTTP_VERSION.356
-rw-r--r--docs/libcurl/opts/CURLMOPT_SOCKETFUNCTION.32
-rw-r--r--docs/libcurl/opts/CURLOPT_POSTFIELDS.313
-rw-r--r--docs/libcurl/opts/Makefile.am1
-rw-r--r--docs/libcurl/symbols-in-versions1
-rw-r--r--include/curl/curl.h10
-rw-r--r--include/curl/curlver.h6
-rw-r--r--include/curl/multi.h6
-rw-r--r--lib/Makefile.m324
-rw-r--r--lib/Makefile.vc66
-rw-r--r--lib/asyn-ares.c16
-rw-r--r--lib/asyn-thread.c24
-rw-r--r--lib/asyn.h2
-rw-r--r--lib/base64.c8
-rwxr-xr-xlib/checksrc.pl8
-rw-r--r--lib/conncache.c4
-rw-r--r--lib/connect.c62
-rw-r--r--lib/connect.h6
-rw-r--r--lib/content_encoding.c4
-rw-r--r--lib/cookie.c16
-rw-r--r--lib/cookie.h12
-rw-r--r--lib/curl_addrinfo.c29
-rw-r--r--lib/curl_addrinfo.h10
-rw-r--r--lib/curl_base64.h4
-rw-r--r--lib/curl_config.h.cmake3
-rw-r--r--lib/curl_gssapi.c4
-rw-r--r--lib/curl_gssapi.h4
-rw-r--r--lib/curl_ntlm_core.c4
-rw-r--r--lib/curl_ntlm_core.h4
-rw-r--r--lib/curl_sasl.c4
-rw-r--r--lib/curl_sasl.h2
-rw-r--r--lib/curl_setup.h9
-rw-r--r--lib/curl_sspi.c43
-rw-r--r--lib/dict.c4
-rw-r--r--lib/easy.c63
-rw-r--r--lib/easyif.h4
-rw-r--r--lib/escape.c13
-rw-r--r--lib/escape.h2
-rw-r--r--lib/file.c16
-rw-r--r--lib/formdata.c8
-rw-r--r--lib/formdata.h4
-rw-r--r--lib/ftp.c66
-rw-r--r--lib/ftp.h4
-rw-r--r--lib/getinfo.c30
-rw-r--r--lib/getinfo.h4
-rw-r--r--lib/gopher.c2
-rw-r--r--lib/hostasyn.c2
-rw-r--r--lib/hostip.c18
-rw-r--r--lib/hostip.h22
-rw-r--r--lib/hostip6.c14
-rw-r--r--lib/hostsyn.c8
-rw-r--r--lib/http.c143
-rw-r--r--lib/http.h8
-rw-r--r--lib/http2.c50
-rw-r--r--lib/http2.h2
-rw-r--r--lib/http_chunks.c2
-rw-r--r--lib/http_digest.c6
-rw-r--r--lib/http_digest.h2
-rw-r--r--lib/http_negotiate.c4
-rw-r--r--lib/http_negotiate.h2
-rw-r--r--lib/http_proxy.c2
-rw-r--r--lib/imap.c36
-rw-r--r--lib/imap.h4
-rw-r--r--lib/krb5.c2
-rw-r--r--lib/ldap.c2
-rw-r--r--lib/memdebug.c2
-rw-r--r--lib/multi.c143
-rw-r--r--lib/multihandle.h8
-rw-r--r--lib/multiif.h12
-rw-r--r--lib/non-ascii.c22
-rw-r--r--lib/non-ascii.h16
-rw-r--r--lib/openldap.c10
-rw-r--r--lib/pingpong.c8
-rw-r--r--lib/pipeline.c35
-rw-r--r--lib/pipeline.h18
-rw-r--r--lib/pop3.c34
-rw-r--r--lib/pop3.h4
-rw-r--r--lib/progress.c18
-rw-r--r--lib/progress.h14
-rw-r--r--lib/rtsp.c16
-rw-r--r--lib/security.c2
-rw-r--r--lib/sendf.c18
-rw-r--r--lib/sendf.h6
-rw-r--r--lib/share.c13
-rw-r--r--lib/share.h4
-rw-r--r--lib/sigpipe.h4
-rw-r--r--lib/smb.c3
-rw-r--r--lib/smtp.c44
-rw-r--r--lib/smtp.h4
-rw-r--r--lib/socks.c4
-rw-r--r--lib/socks_gssapi.c4
-rw-r--r--lib/socks_sspi.c6
-rw-r--r--lib/speedcheck.c4
-rw-r--r--lib/speedcheck.h4
-rw-r--r--lib/ssh.c29
-rw-r--r--lib/ssh.h2
-rw-r--r--lib/system_win32.c174
-rw-r--r--lib/system_win32.h22
-rw-r--r--lib/telnet.c24
-rw-r--r--lib/tftp.c20
-rw-r--r--lib/transfer.c26
-rw-r--r--lib/transfer.h12
-rw-r--r--lib/url.c145
-rw-r--r--lib/url.h28
-rw-r--r--lib/urldata.h37
-rw-r--r--lib/vauth/cleartext.c6
-rw-r--r--lib/vauth/cram.c2
-rw-r--r--lib/vauth/digest.c4
-rw-r--r--lib/vauth/digest_sspi.c24
-rw-r--r--lib/vauth/krb5_gssapi.c4
-rw-r--r--lib/vauth/krb5_sspi.c4
-rw-r--r--lib/vauth/ntlm.c6
-rw-r--r--lib/vauth/ntlm_sspi.c4
-rw-r--r--lib/vauth/oauth2.c2
-rw-r--r--lib/vauth/spnego_gssapi.c6
-rw-r--r--lib/vauth/spnego_sspi.c6
-rw-r--r--lib/vauth/vauth.h34
-rw-r--r--lib/vtls/axtls.c52
-rw-r--r--lib/vtls/axtls.h2
-rw-r--r--lib/vtls/cyassl.c75
-rw-r--r--lib/vtls/cyassl.h2
-rw-r--r--lib/vtls/darwinssl.c91
-rw-r--r--lib/vtls/gskit.c32
-rw-r--r--lib/vtls/gtls.c42
-rw-r--r--lib/vtls/gtls.h2
-rw-r--r--lib/vtls/mbedtls.c91
-rw-r--r--lib/vtls/mbedtls.h2
-rw-r--r--lib/vtls/nss.c42
-rw-r--r--lib/vtls/nssg.h6
-rw-r--r--lib/vtls/openssl.c223
-rw-r--r--lib/vtls/openssl.h10
-rw-r--r--lib/vtls/polarssl.c78
-rw-r--r--lib/vtls/schannel.c197
-rw-r--r--lib/vtls/schannel.h3
-rw-r--r--lib/vtls/vtls.c87
-rw-r--r--lib/vtls/vtls.h63
-rw-r--r--lib/wildcard.h2
-rw-r--r--lib/x509asn1.c12
-rw-r--r--lib/x509asn1.h4
-rw-r--r--m4/curl-compilers.m44
-rw-r--r--packages/OS400/ccsidcurl.c8
-rw-r--r--packages/OS400/curl.inc.in11
-rw-r--r--packages/OS400/initscript.sh6
-rw-r--r--packages/OS400/make-lib.sh2
-rw-r--r--projects/README11
-rw-r--r--projects/Windows/VC10/lib/libcurl.tmpl16
-rw-r--r--projects/Windows/VC10/src/curl.tmpl16
-rw-r--r--projects/Windows/VC11/lib/libcurl.tmpl16
-rw-r--r--projects/Windows/VC11/src/curl.tmpl16
-rw-r--r--projects/Windows/VC12/lib/libcurl.tmpl16
-rw-r--r--projects/Windows/VC12/src/curl.tmpl16
-rw-r--r--projects/Windows/VC14/lib/libcurl.tmpl16
-rw-r--r--projects/Windows/VC14/src/curl.tmpl16
-rw-r--r--projects/Windows/VC6/lib/libcurl.tmpl16
-rw-r--r--projects/Windows/VC6/src/curl.tmpl16
-rw-r--r--projects/Windows/VC7.1/lib/libcurl.tmpl8
-rw-r--r--projects/Windows/VC7.1/src/curl.tmpl8
-rw-r--r--projects/Windows/VC7/lib/libcurl.tmpl8
-rw-r--r--projects/Windows/VC7/src/curl.tmpl8
-rw-r--r--projects/Windows/VC8/lib/libcurl.tmpl16
-rw-r--r--projects/Windows/VC8/src/curl.tmpl16
-rw-r--r--projects/Windows/VC9/lib/libcurl.tmpl16
-rw-r--r--projects/Windows/VC9/src/curl.tmpl16
-rw-r--r--src/Makefile.m324
-rw-r--r--src/tool_operate.c2
-rw-r--r--src/tool_urlglob.c2
-rw-r--r--src/tool_writeout.c24
-rw-r--r--tests/CMakeLists.txt1
-rw-r--r--tests/FILEFORMAT6
-rw-r--r--tests/Makefile.am2
-rw-r--r--tests/data/Makefile.inc5
-rw-r--r--tests/data/test114168
-rw-r--r--tests/data/test114263
-rw-r--r--tests/data/test114345
-rw-r--r--tests/data/test124460
-rw-r--r--tests/data/test1700101
-rw-r--r--tests/data/test170183
-rw-r--r--tests/data/test170278
-rw-r--r--tests/data/test18004
-rw-r--r--tests/data/test18014
-rw-r--r--tests/data/test5585
-rwxr-xr-xtests/http2-server.pl75
-rwxr-xr-xtests/runtests.pl100
-rw-r--r--tests/server/getpart.c2
-rw-r--r--tests/serverhelp.pm5
-rw-r--r--tests/unit/CMakeLists.txt46
-rw-r--r--tests/unit/unit1302.c2
-rw-r--r--tests/unit/unit1303.c2
-rw-r--r--tests/unit/unit1305.c2
-rw-r--r--winbuild/MakefileBuild.vc3
212 files changed, 3114 insertions, 1742 deletions
diff --git a/.travis.yml b/.travis.yml
index c76d10c5..49e3f15a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,6 +8,7 @@ language: c
install:
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update > /dev/null; fi
+ - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew reinstall -s libtool > /dev/null; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install openssl libidn rtmpdump libssh2 c-ares libmetalink libressl nghttp2; fi
before_script:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 06f18cf5..7f7c4d6d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -72,7 +72,6 @@ include_directories(${PROJECT_BINARY_DIR}/include/curl)
include_directories( ${CURL_SOURCE_DIR}/include )
option(BUILD_CURL_EXE "Set to ON to build cURL executable." ON)
-option(BUILD_CURL_TESTS "Set to ON to build cURL tests." ON)
option(CURL_STATICLIB "Set to ON to build libcurl with static linking." OFF)
option(ENABLE_ARES "Set to ON to enable c-ares support" OFF)
option(ENABLE_THREADED_RESOLVER "Set to ON to enable POSIX threaded DNS lookup" OFF)
@@ -108,12 +107,6 @@ if(ENABLE_ARES)
set(CURL_LIBS ${CURL_LIBS} ${CARES_LIBRARY})
endif()
-option(BUILD_DASHBOARD_REPORTS "Set to ON to activate reporting of cURL builds here http://www.cdash.org/CDashPublic/index.php?project=CURL" OFF)
-if(BUILD_DASHBOARD_REPORTS)
- #INCLUDE(Dart)
- include(CTest)
-endif(BUILD_DASHBOARD_REPORTS)
-
if(MSVC)
option(BUILD_RELEASE_DEBUG_DIRS "Set OFF to build each configuration to a separate directory" OFF)
mark_as_advanced(BUILD_RELEASE_DEBUG_DIRS)
@@ -330,11 +323,10 @@ if(CMAKE_USE_OPENSSL)
endif()
if(NOT CURL_DISABLE_LDAP)
-
if(WIN32)
option(USE_WIN32_LDAP "Use Windows LDAP implementation" ON)
if(USE_WIN32_LDAP)
- check_library_exists("wldap32" cldap_open "" HAVE_WLDAP32)
+ check_library_exists_concat("wldap32" cldap_open HAVE_WLDAP32)
if(NOT HAVE_WLDAP32)
set(USE_WIN32_LDAP OFF)
endif()
@@ -349,78 +341,78 @@ if(NOT CURL_DISABLE_LDAP)
if(CMAKE_USE_OPENLDAP AND USE_WIN32_LDAP)
message(FATAL_ERROR "Cannot use USE_WIN32_LDAP and CMAKE_USE_OPENLDAP at the same time")
endif()
-
+
# Now that we know, we're not using windows LDAP...
- if(NOT USE_WIN32_LDAP)
+ if(USE_WIN32_LDAP)
+ check_include_file_concat("winldap.h" HAVE_WINLDAP_H)
+ check_include_file_concat("winber.h" HAVE_WINBER_H)
+ else()
# Check for LDAP
set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES})
check_library_exists_concat(${CMAKE_LDAP_LIB} ldap_init HAVE_LIBLDAP)
check_library_exists_concat(${CMAKE_LBER_LIB} ber_init HAVE_LIBLBER)
- else()
- check_include_file_concat("winldap.h" HAVE_WINLDAP_H)
- check_include_file_concat("winber.h" HAVE_WINBER_H)
- endif()
-
- set(CMAKE_REQUIRED_INCLUDES_BAK ${CMAKE_REQUIRED_INCLUDES})
- set(CMAKE_LDAP_INCLUDE_DIR "" CACHE STRING "Path to LDAP include directory")
- if(CMAKE_LDAP_INCLUDE_DIR)
- list(APPEND CMAKE_REQUIRED_INCLUDES ${CMAKE_LDAP_INCLUDE_DIR})
- endif()
- check_include_file_concat("ldap.h" HAVE_LDAP_H)
- check_include_file_concat("lber.h" HAVE_LBER_H)
-
- if(NOT HAVE_LDAP_H)
- message(STATUS "LDAP_H not found CURL_DISABLE_LDAP set ON")
- set(CURL_DISABLE_LDAP ON CACHE BOOL "" FORCE)
- set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_BAK}) #LDAP includes won't be used
- elseif(NOT HAVE_LIBLDAP)
- message(STATUS "LDAP library '${CMAKE_LDAP_LIB}' not found CURL_DISABLE_LDAP set ON")
- set(CURL_DISABLE_LDAP ON CACHE BOOL "" FORCE)
- set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_BAK}) #LDAP includes won't be used
- else()
- if(CMAKE_USE_OPENLDAP)
- set(USE_OPENLDAP ON)
- endif()
+
+ set(CMAKE_REQUIRED_INCLUDES_BAK ${CMAKE_REQUIRED_INCLUDES})
+ set(CMAKE_LDAP_INCLUDE_DIR "" CACHE STRING "Path to LDAP include directory")
if(CMAKE_LDAP_INCLUDE_DIR)
- include_directories(${CMAKE_LDAP_INCLUDE_DIR})
- endif()
- set(NEED_LBER_H ON)
- set(_HEADER_LIST)
- if(HAVE_WINDOWS_H)
- list(APPEND _HEADER_LIST "windows.h")
+ list(APPEND CMAKE_REQUIRED_INCLUDES ${CMAKE_LDAP_INCLUDE_DIR})
endif()
- if(HAVE_SYS_TYPES_H)
- list(APPEND _HEADER_LIST "sys/types.h")
- endif()
- list(APPEND _HEADER_LIST "ldap.h")
+ check_include_file_concat("ldap.h" HAVE_LDAP_H)
+ check_include_file_concat("lber.h" HAVE_LBER_H)
+
+ if(NOT HAVE_LDAP_H)
+ message(STATUS "LDAP_H not found CURL_DISABLE_LDAP set ON")
+ set(CURL_DISABLE_LDAP ON CACHE BOOL "" FORCE)
+ set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_BAK}) #LDAP includes won't be used
+ elseif(NOT HAVE_LIBLDAP)
+ message(STATUS "LDAP library '${CMAKE_LDAP_LIB}' not found CURL_DISABLE_LDAP set ON")
+ set(CURL_DISABLE_LDAP ON CACHE BOOL "" FORCE)
+ set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_BAK}) #LDAP includes won't be used
+ else()
+ if(CMAKE_USE_OPENLDAP)
+ set(USE_OPENLDAP ON)
+ endif()
+ if(CMAKE_LDAP_INCLUDE_DIR)
+ include_directories(${CMAKE_LDAP_INCLUDE_DIR})
+ endif()
+ set(NEED_LBER_H ON)
+ set(_HEADER_LIST)
+ if(HAVE_WINDOWS_H)
+ list(APPEND _HEADER_LIST "windows.h")
+ endif()
+ if(HAVE_SYS_TYPES_H)
+ list(APPEND _HEADER_LIST "sys/types.h")
+ endif()
+ list(APPEND _HEADER_LIST "ldap.h")
- set(_SRC_STRING "")
- foreach(_HEADER ${_HEADER_LIST})
- set(_INCLUDE_STRING "${_INCLUDE_STRING}#include <${_HEADER}>\n")
- endforeach()
+ set(_SRC_STRING "")
+ foreach(_HEADER ${_HEADER_LIST})
+ set(_INCLUDE_STRING "${_INCLUDE_STRING}#include <${_HEADER}>\n")
+ endforeach()
- set(_SRC_STRING
- "
- ${_INCLUDE_STRING}
- int main(int argc, char ** argv)
- {
- BerValue *bvp = NULL;
- BerElement *bep = ber_init(bvp);
- ber_free(bep, 1);
- return 0;
- }"
- )
- set(CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -DLDAP_DEPRECATED=1")
- list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_LDAP_LIB})
- if(HAVE_LIBLBER)
- list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_LBER_LIB})
- endif()
- check_c_source_compiles("${_SRC_STRING}" NOT_NEED_LBER_H)
+ set(_SRC_STRING
+ "
+ ${_INCLUDE_STRING}
+ int main(int argc, char ** argv)
+ {
+ BerValue *bvp = NULL;
+ BerElement *bep = ber_init(bvp);
+ ber_free(bep, 1);
+ return 0;
+ }"
+ )
+ set(CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -DLDAP_DEPRECATED=1")
+ list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_LDAP_LIB})
+ if(HAVE_LIBLBER)
+ list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_LBER_LIB})
+ endif()
+ check_c_source_compiles("${_SRC_STRING}" NOT_NEED_LBER_H)
- if(NOT_NEED_LBER_H)
- set(NEED_LBER_H OFF)
- else()
- set(CURL_TEST_DEFINES "${CURL_TEST_DEFINES} -DNEED_LBER_H")
+ if(NOT_NEED_LBER_H)
+ set(NEED_LBER_H OFF)
+ else()
+ set(CURL_TEST_DEFINES "${CURL_TEST_DEFINES} -DNEED_LBER_H")
+ endif()
endif()
endif()
@@ -578,6 +570,7 @@ if(NOT UNIX)
if(HAVE_SCHANNEL_H)
set(USE_SCHANNEL ON)
set(SSL_ENABLED ON)
+ set(CURL_LIBS ${CURL_LIBS} "crypt32")
endif()
endif()
endif()
@@ -1041,7 +1034,9 @@ add_subdirectory(lib)
if(BUILD_CURL_EXE)
add_subdirectory(src)
endif()
-if(BUILD_CURL_TESTS)
+
+include(CTest)
+if(BUILD_TESTING)
add_subdirectory(tests)
endif()
diff --git a/README.md b/README.md
index 1b0ca553..64883dc9 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,6 @@
+![curl logo](https://cdn.rawgit.com/curl/curl-www/master/logo/curl-logo.svg)
-Curl is a command line tool for transferring data specified with URL
+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
@@ -17,7 +18,7 @@ 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
+## Contact
If you have problems, questions, ideas or suggestions, please contact us by
posting to a suitable [mailing list](https://curl.haxx.se/mail/).
@@ -25,20 +26,20 @@ 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
+## Website
Visit the [curl web site](https://curl.haxx.se/) for the latest news and
downloads.
-## 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
(you'll get a directory named curl created, filled with the source code)
-## NOTICE
+## 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
diff --git a/README.version b/README.version
index f5c6e2d7..41ae42b1 100644
--- a/README.version
+++ b/README.version
@@ -1,6 +1,6 @@
-URL: https://curl.haxx.se/download/curl-7.49.1.tar.gz
-Version: 7.49.1
-Upstream commit: cf93a7b364a70b56150cf6ea77492b799ec02a45
+URL: https://curl.haxx.se/download/curl-7.50.1.tar.gz
+Version: 7.50.1
+Upstream commit: f2cb3a01192d36395d16acec6cdb93446ca6fd45
License: MIT
License File: NOTICE
BugComponent: 31714
diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index ca3142c0..163ceb1a 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -1,30 +1,26 @@
-Curl and libcurl 7.49.1
+Curl and libcurl 7.50.1
- Public curl releases: 155
+ Public curl releases: 157
Command line options: 185
curl_easy_setopt() options: 224
Public functions in libcurl: 61
- Contributors: 1404
+ Contributors: 1418
This release includes the following bugfixes:
- o Windows: prevent DLL hijacking, CVE-2016-4802 [11]
- o dist: include manpage-scan.pl, nroff-scan.pl and CHECKSRC.md [1]
- o schannel: fix compile break with MSVC XP toolset [2]
- o curlbuild.h.dist: check __LP64__ as well to fix MIPS build [3]
- o dist: include curl_multi_socket_all.3 [4]
- o http2: use HTTP/2 in the HTTP/1.1-alike response
- o openssl: ERR_remove_thread_state() is deprecated in latest 1.1.0
- o CURLOPT_CONNECT_TO.3: user must not free the list prematurely [5]
- o libcurl.m4: Avoid obsolete warning [6]
- o winbuild/Makefile.vc: Fix check on SSL, MBEDTLS, WINSSL exclusivity [7]
- o curl_multibyte: fix compiler error
- o openssl: cleanup must free compression methods (memory leak) [8]
- o mbedtls: fix includes so snprintf() works [9]
- o checksrc.pl: Added variants of strcat() & strncat() to banned function list
- o contributors.sh: better grep pattern and show GitHub username [10]
- o ssh: fix build for libssh2 before 1.2.6 [12]
- o curl_share_setopt.3: Add min ver needed for ssl session lock [13]
+ o TLS: switch off SSL session id when client cert is used [7]
+ o TLS: only reuse connections with the same client cert [8]
+ o curl_multi_cleanup: clear connection pointer for easy handles [9]
+ o include the CURLINFO_HTTP_VERSION(3) man page into the release tarball
+ o include the http2-server.pl script in the release tarball
+ o test558: fix test by stripping file paths from FD lines
+ o spnego: Corrected miss-placed * in Curl_auth_spnego_cleanup() declaration
+ o tests: Fix for http/2 feature [1]
+ o cmake: Fix for schannel support [2]
+ o curl.h: make public types void * again [3]
+ o win32: fix a potential memory leak in Curl_load_library [4]
+ o travis: fix OSX build by re-installing libtool [5]
+ o mbedtls: Fix debug function name [6]
This release includes the following known bugs:
@@ -33,25 +29,22 @@ This release includes the following known bugs:
This release would not have looked like this without help, code, reports and
advice from friends like these:
- Alexander Traud, Daniel Stenberg, Gisle Vanem, Jan Ehrhardt,
- jveazey on github, Marcel Raad, Michael Kaufmann, Michael Wallner,
- Moti Avrahami, Paul Howarth, Ray Satiro, Steve Holme, Tomas Jakobsson,
- (13 contributors)
+ Alain Danteny, Bru Rom, Dan Fandrich, Daniel Stenberg, Eric Rescorla,
+ Fernando Muñoz, Kamil Dudka, Marcelo Echeverria, Martin Vejnár,
+ Patrick Monnerat, Paul Howarth, Peter Frühberger, Ray Satiro, Sergei Nikulov,
+ Steve Holme, Thomas Glanzmann, Viktor Szakáts, Yonggang Luo,
+ (18 contributors)
Thanks! (and sorry if I forgot to mention someone)
References to bug reports and discussions on issues:
- [1] = https://curl.haxx.se/mail/lib-2016-05/0113.html
- [2] = https://curl.haxx.se/bug/?i=812
- [3] = https://curl.haxx.se/bug/?i=813
- [4] = https://curl.haxx.se/bug/?i=816
- [5] = https://curl.haxx.se/bug/?i=819
- [6] = https://curl.haxx.se/bug/?i=821
- [7] = https://curl.haxx.se/bug/?i=818
- [8] = https://curl.haxx.se/bug/?i=817
- [9] = https://curl.haxx.se/mail/lib-2016-05/0196.html
- [10] = https://curl.haxx.se/bug/?i=824
- [11] = https://curl.haxx.se/docs/adv_20160527.html
- [12] = https://curl.haxx.se/bug/?i=831
- [13] = https://github.com/curl/curl/issues/826
+ [1] = https://curl.haxx.se/mail/lib-2016-07/0070.html
+ [2] = https://curl.haxx.se/bug/?i=917
+ [3] = https://curl.haxx.se/bug/?i=926
+ [4] = https://curl.haxx.se/bug/?i=938
+ [5] = https://curl.haxx.se/bug/?i=939
+ [6] = https://curl.haxx.se/mail/lib-2016-08/0001.html
+ [7] = https://curl.haxx.se/docs/adv_20160803A.html
+ [8] = https://curl.haxx.se/docs/adv_20160803B.html
+ [9] = https://curl.haxx.se/docs/adv_20160803C.html
diff --git a/acinclude.m4 b/acinclude.m4
index 68a3710c..fa621b5b 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -2565,8 +2565,8 @@ dnl regarding the paths this will scan:
dnl /etc/ssl/certs/ca-certificates.crt Debian systems
dnl /etc/pki/tls/certs/ca-bundle.crt Redhat and Mandriva
dnl /usr/share/ssl/certs/ca-bundle.crt old(er) Redhat
-dnl /usr/local/share/certs/ca-root.crt FreeBSD
-dnl /etc/ssl/cert.pem OpenBSD
+dnl /usr/local/share/certs/ca-root-nss.crt FreeBSD
+dnl /etc/ssl/cert.pem OpenBSD, FreeBSD (symlink)
dnl /etc/ssl/certs/ (ca path) SUSE
AC_DEFUN([CURL_CHECK_CA_BUNDLE], [
@@ -2640,7 +2640,7 @@ AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]),
for a in /etc/ssl/certs/ca-certificates.crt \
/etc/pki/tls/certs/ca-bundle.crt \
/usr/share/ssl/certs/ca-bundle.crt \
- /usr/local/share/certs/ca-root.crt \
+ /usr/local/share/certs/ca-root-nss.crt \
/etc/ssl/cert.pem \
"$cac"; do
if test -f "$a"; then
diff --git a/appveyor.yml b/appveyor.yml
index 0725c44f..b9d5a7f2 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -1,4 +1,4 @@
-version: 7.47.0.{build}
+version: 7.50.0.{build}
environment:
matrix:
@@ -6,30 +6,60 @@ environment:
BDIR: msvc2012
PRJ_CFG: Release
OPENSSL: OFF
+ TESTING: OFF
+ STATICLIB: OFF
- PRJ_GEN: "Visual Studio 12 2013 Win64"
BDIR: msvc2013
PRJ_CFG: Release
OPENSSL: OFF
+ TESTING: OFF
+ STATICLIB: OFF
- PRJ_GEN: "Visual Studio 14 2015 Win64"
BDIR: msvc2015
PRJ_CFG: Release
OPENSSL: OFF
+ TESTING: OFF
+ STATICLIB: OFF
- PRJ_GEN: "Visual Studio 11 2012 Win64"
BDIR: msvc2012
PRJ_CFG: Release
OPENSSL: ON
+ TESTING: OFF
+ STATICLIB: OFF
- PRJ_GEN: "Visual Studio 12 2013 Win64"
BDIR: msvc2013
PRJ_CFG: Release
OPENSSL: ON
+ TESTING: OFF
+ STATICLIB: OFF
- PRJ_GEN: "Visual Studio 14 2015 Win64"
BDIR: msvc2015
PRJ_CFG: Release
OPENSSL: ON
+ TESTING: OFF
+ STATICLIB: OFF
+ - PRJ_GEN: "Visual Studio 11 2012 Win64"
+ BDIR: msvc2012
+ PRJ_CFG: Release
+ OPENSSL: OFF
+ TESTING: ON
+ STATICLIB: ON
+ - PRJ_GEN: "Visual Studio 12 2013 Win64"
+ BDIR: msvc2013
+ PRJ_CFG: Release
+ OPENSSL: OFF
+ TESTING: ON
+ STATICLIB: ON
+ - PRJ_GEN: "Visual Studio 14 2015 Win64"
+ BDIR: msvc2015
+ PRJ_CFG: Release
+ OPENSSL: OFF
+ TESTING: ON
+ STATICLIB: ON
build_script:
- mkdir build.%BDIR%
- cd build.%BDIR%
- - cmake .. -G"%PRJ_GEN%" -DCMAKE_USE_OPENSSL=%OPENSSL%
+ - cmake .. -G"%PRJ_GEN%" -DCMAKE_USE_OPENSSL=%OPENSSL% -DCURL_STATICLIB=%STATICLIB% -DBUILD_TESTING=%TESTING%
- cmake --build . --config %PRJ_CFG% --clean-first
diff --git a/configure.ac b/configure.ac
index da0e9d88..ec3d22a4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1340,6 +1340,7 @@ if test "$curl_ssl_msg" = "$init_ssl_msg"; then
AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
AC_SUBST(USE_WINDOWS_SSPI, [1])
curl_sspi_msg="enabled"
+ LIBS="-lcrypt32 $LIBS"
else
AC_MSG_RESULT(no)
fi
diff --git a/docs/FAQ b/docs/FAQ
index 8ce52175..681ce292 100644
--- a/docs/FAQ
+++ b/docs/FAQ
@@ -1402,17 +1402,27 @@ FAQ
CURLOPT_CUSTOMREQUEST to alter what exact listing command libcurl would use
to list the files.
- The follow-up question that tend to follow the previous one, is how a
- program is supposed to parse the directory listing. How does it know what's
- a file and what's a dir and what's a symlink etc. The harsh reality is that
- FTP provides no such fine and easy-to-parse output. The output format FTP
- servers respond to LIST commands are entirely at the server's own liking and
- the NLST output doesn't reveal any types and in many cases don't even
- include all the directory entries. Also, both LIST and NLST tend to hide
- unix-style hidden files (those that start with a dot) by default so you need
- to do "LIST -a" or similar to see them.
-
- The application thus needs to parse the LIST output. One such existing
+ The follow-up question tends to be how is a program supposed to parse the
+ directory listing. How does it know what's a file and what's a dir and what's
+ a symlink etc. If the FTP server supports the MLSD command then it will
+ return data in a machine-readable format that can be parsed for type. The
+ types are specified by RFC3659 section 7.5.1. If MLSD is not supported then
+ you have to work with what you're given. The LIST output format is entirely
+ at the server's own liking and the NLST output doesn't reveal any types and
+ in many cases doesn't even include all the directory entries. Also, both LIST
+ and NLST tend to hide unix-style hidden files (those that start with a dot)
+ by default so you need to do "LIST -a" or similar to see them.
+
+ Example - List only directories.
+ ftp.funet.fi supports MLSD and ftp.kernel.org does not:
+
+ curl -s ftp.funet.fi/pub/ -X MLSD | \
+ perl -lne 'print if s/(?:^|;)type=dir;[^ ]+ (.+)$/$1/'
+
+ curl -s ftp.kernel.org/pub/linux/kernel/ | \
+ perl -lne 'print if s/^d[-rwx]{9}(?: +[^ ]+){7} (.+)$/$1/'
+
+ If you need to parse LIST output in libcurl one such existing
list parser is available at https://cr.yp.to/ftpparse.html Versions of
libcurl since 7.21.0 also provide the ability to specify a wildcard to
download multiple files from one FTP directory.
diff --git a/docs/INTERNALS b/docs/INTERNALS
index 698d66ec..565d9df6 100644
--- a/docs/INTERNALS
+++ b/docs/INTERNALS
@@ -166,8 +166,8 @@ Windows vs Unix
Library
=======
- (See `LIBCURL-STRUCTS` for a separate document describing all major internal
- structs and their purposes.)
+ (See [Structs in libcurl](#structs) for the separate section describing all
+ major internal structs and their purposes.)
There are plenty of entry points to the library, namely each publicly defined
function that libcurl offers to applications. All of those functions are
@@ -184,14 +184,14 @@ Library
[ `curl_easy_init()`][2] allocates an internal struct and makes some
initializations. The returned handle does not reveal internals. This is the
- 'SessionHandle' struct which works as an "anchor" struct for all `curl_easy`
+ 'Curl_easy' struct which works as an "anchor" struct for all `curl_easy`
functions. All connections performed will get connect-specific data allocated
that should be used for things related to particular connections/requests.
[`curl_easy_setopt()`][1] takes three arguments, where the option stuff must
be passed in pairs: the parameter-ID and the parameter-value. The list of
options is documented in the man page. This function mainly sets things in
- the 'SessionHandle' struct.
+ the 'Curl_easy' struct.
`curl_easy_perform()` is just a wrapper function that makes use of the multi
API. It basically calls `curl_multi_init()`, `curl_multi_add_handle()`,
@@ -218,7 +218,7 @@ Curl_connect()
This function makes sure there's an allocated and initiated 'connectdata'
struct that is used for this particular connection only (although there may
be several requests performed on the same connect). A bunch of things are
- inited/inherited from the SessionHandle struct.
+ inited/inherited from the Curl_easy struct.
<a name="Curl_do"></a>
Curl_do()
@@ -385,11 +385,11 @@ Persistent Connections
The persistent connection support in libcurl requires some considerations on
how to do things inside of the library.
- - The 'SessionHandle' struct returned in the [`curl_easy_init()`][2] call
+ - The 'Curl_easy' struct returned in the [`curl_easy_init()`][2] call
must never hold connection-oriented data. It is meant to hold the root data
as well as all the options etc that the library-user may choose.
- - The 'SessionHandle' struct holds the "connection cache" (an array of
+ - The 'Curl_easy' struct holds the "connection cache" (an array of
pointers to 'connectdata' structs).
- This enables the 'curl handle' to be reused on subsequent transfers.
@@ -856,38 +856,38 @@ Structs in libcurl
This section should cover 7.32.0 pretty accurately, but will make sense even
for older and later versions as things don't change drastically that often.
-## SessionHandle
+## Curl_easy
- The SessionHandle handle struct is the one returned to the outside in the
- external API as a "CURL *". This is usually known as an easy handle in API
- documentations and examples.
+ The Curl_easy struct is the one returned to the outside in the external API
+ as a "CURL *". This is usually known as an easy handle in API documentations
+ and examples.
Information and state that is related to the actual connection is in the
'connectdata' struct. When a transfer is about to be made, libcurl will
either create a new connection or re-use an existing one. The particular
connectdata that is used by this handle is pointed out by
- SessionHandle->easy_conn.
+ Curl_easy->easy_conn.
Data and information that regard this particular single transfer is put in
the SingleRequest sub-struct.
- When the SessionHandle struct is added to a multi handle, as it must be in
- order to do any transfer, the ->multi member will point to the `Curl_multi`
- struct it belongs to. The ->prev and ->next members will then be used by the
- multi code to keep a linked list of SessionHandle structs that are added to
- that same multi handle. libcurl always uses multi so ->multi *will* point to
- a `Curl_multi` when a transfer is in progress.
+ When the Curl_easy struct is added to a multi handle, as it must be in order
+ to do any transfer, the ->multi member will point to the `Curl_multi` struct
+ it belongs to. The ->prev and ->next members will then be used by the multi
+ code to keep a linked list of Curl_easy structs that are added to that same
+ multi handle. libcurl always uses multi so ->multi *will* point to a
+ `Curl_multi` when a transfer is in progress.
- ->mstate is the multi state of this particular SessionHandle. When
+ ->mstate is the multi state of this particular Curl_easy. When
`multi_runsingle()` is called, it will act on this handle according to which
state it is in. The mstate is also what tells which sockets to return for a
- specific SessionHandle when [`curl_multi_fdset()`][12] is called etc.
+ specific Curl_easy when [`curl_multi_fdset()`][12] is called etc.
The libcurl source code generally use the name 'data' for the variable that
- points to the SessionHandle.
+ points to the Curl_easy.
- When doing multiplexed HTTP/2 transfers, each SessionHandle is associated
- with an individual stream, sharing the same connectdata struct. Multiplexing
+ When doing multiplexed HTTP/2 transfers, each Curl_easy is associated with
+ an individual stream, sharing the same connectdata struct. Multiplexing
makes it even more important to keep things associated with the right thing!
## connectdata
@@ -901,22 +901,21 @@ for older and later versions as things don't change drastically that often.
the connection can't be kept alive, the connection will be closed after use
and then this struct can be removed from the cache and freed.
- Thus, the same SessionHandle can be used multiple times and each time select
+ Thus, the same Curl_easy can be used multiple times and each time select
another connectdata struct to use for the connection. Keep this in mind, as
it is then important to consider if options or choices are based on the
- connection or the SessionHandle.
+ connection or the Curl_easy.
Functions in libcurl will assume that connectdata->data points to the
- SessionHandle that uses this connection (for the moment).
+ Curl_easy that uses this connection (for the moment).
As a special complexity, some protocols supported by libcurl require a
special disconnect procedure that is more than just shutting down the
socket. It can involve sending one or more commands to the server before
doing so. Since connections are kept in the connection cache after use, the
- original SessionHandle may no longer be around when the time comes to shut
- down a particular connection. For this purpose, libcurl holds a special
- dummy `closure_handle` SessionHandle in the `Curl_multi` struct to use when
- needed.
+ original Curl_easy may no longer be around when the time comes to shut down
+ a particular connection. For this purpose, libcurl holds a special dummy
+ `closure_handle` Curl_easy in the `Curl_multi` struct to use when needed.
FTP uses two TCP connections for a typical transfer but it keeps both in
this single struct and thus can be considered a single connection for most
@@ -932,25 +931,25 @@ for older and later versions as things don't change drastically that often.
`Curl_multi` is the multi handle struct exposed as "CURLM *" in external APIs.
- This struct holds a list of SessionHandle structs that have been added to
- this handle with [`curl_multi_add_handle()`][13]. The start of the list is
- ->easyp and ->num_easy is a counter of added SessionHandles.
+ This struct holds a list of Curl_easy structs that have been added to this
+ handle with [`curl_multi_add_handle()`][13]. The start of the list is
+ ->easyp and ->num_easy is a counter of added Curl_easys.
->msglist is a linked list of messages to send back when
[`curl_multi_info_read()`][14] is called. Basically a node is added to that
- list when an individual SessionHandle's transfer has completed.
+ list when an individual Curl_easy's transfer has completed.
->hostcache points to the name cache. It is a hash table for looking up name
to IP. The nodes have a limited life time in there and this cache is meant
to reduce the time for when the same name is wanted within a short period of
time.
- ->timetree points to a tree of SessionHandles, sorted by the remaining time
- until it should be checked - normally some sort of timeout. Each
- SessionHandle has one node in the tree.
+ ->timetree points to a tree of Curl_easys, sorted by the remaining time
+ until it should be checked - normally some sort of timeout. Each Curl_easy
+ has one node in the tree.
->sockhash is a hash table to allow fast lookups of socket descriptor to
- which SessionHandle that uses that descriptor. This is necessary for the
+ which Curl_easy that uses that descriptor. This is necessary for the
`multi_socket` API.
->conn_cache points to the connection cache. It keeps track of all
@@ -977,11 +976,11 @@ for older and later versions as things don't change drastically that often.
setup so HTTPS separate from HTTP.
->setup_connection is called to allow the protocol code to allocate protocol
- specific data that then gets associated with that SessionHandle for the rest
- of this transfer. It gets freed again at the end of the transfer. It will be
+ specific data that then gets associated with that Curl_easy for the rest of
+ this transfer. It gets freed again at the end of the transfer. It will be
called before the 'connectdata' for the transfer has been selected/created.
Most protocols will allocate its private 'struct [PROTOCOL]' here and assign
- SessionHandle->req.protop to point to it.
+ Curl_easy->req.protop to point to it.
->connect_it allows a protocol to do some specific actions after the TCP
connect is done, that can still be considered part of the connection phase.
@@ -1036,7 +1035,7 @@ for older and later versions as things don't change drastically that often.
- `PROTOPT_CLOSEACTION` - this protocol has actions to do before closing the
connection. This flag is no longer used by code, yet still set for a bunch
protocol handlers.
-
+
- `PROTOPT_DIRLOCK` - "direction lock". The SSH protocols set this bit to
limit which "direction" of socket actions that the main engine will
concern itself about.
@@ -1051,21 +1050,21 @@ for older and later versions as things don't change drastically that often.
## conncache
- Is a hash table with connections for later re-use. Each SessionHandle has
- a pointer to its connection cache. Each multi handle sets up a connection
- cache that all added SessionHandles share by default.
+ Is a hash table with connections for later re-use. Each Curl_easy has a
+ pointer to its connection cache. Each multi handle sets up a connection
+ cache that all added Curl_easys share by default.
## Curl_share
-
+
The libcurl share API allocates a `Curl_share` struct, exposed to the
external API as "CURLSH *".
The idea is that the struct can have a set of own versions of caches and
pools and then by providing this struct in the `CURLOPT_SHARE` option, those
- specific SessionHandles will use the caches/pools that this share handle
+ specific Curl_easys will use the caches/pools that this share handle
holds.
- Then individual SessionHandle structs can be made to share specific things
+ Then individual Curl_easy structs can be made to share specific things
that they otherwise wouldn't, such as cookies.
The `Curl_share` struct can currently hold cookies, DNS cache and the SSL
@@ -1074,7 +1073,7 @@ for older and later versions as things don't change drastically that often.
## CookieInfo
This is the main cookie struct. It holds all known cookies and related
- information. Each SessionHandle has its own private CookieInfo even when
+ information. Each Curl_easy has its own private CookieInfo even when
they are added to a multi handle. They can be made to share cookies by using
the share API.
diff --git a/docs/KNOWN_BUGS b/docs/KNOWN_BUGS
index c91c388b..578e0153 100644
--- a/docs/KNOWN_BUGS
+++ b/docs/KNOWN_BUGS
@@ -22,6 +22,8 @@ problems may have been fixed or changed somewhat since this was written!
1.8 DNS timing is wrong for HTTP redirects
1.9 HTTP/2 frames while in the connection pool kill reuse
1.10 Strips trailing dot from host name
+ 1.11 transfer-encoding: chunked in HTTP/2
+ 1.12 CURLOPT_SEEKFUNCTION not called with CURLFORM_STREAM
2. TLS
2.1 Hangs with PolarSSL
@@ -33,6 +35,7 @@ problems may have been fixed or changed somewhat since this was written!
3.1 IMAP SEARCH ALL truncated response
3.2 No disconnect command
3.3 SMTP to multiple recipients
+ 3.4 POP3 expects "CRLF.CRLF" eob for some single-line responses
4. Command line
4.1 -J with %-encoded file nameas
@@ -73,6 +76,7 @@ problems may have been fixed or changed somewhat since this was written!
10.2 SOCKS don't support timeouts
10.3 FTPS over SOCKS
10.4 active FTP over a SOCKS
+ 10.5 SOCKS proxy not working via IPv6
11. Internals
11.1 Curl leaks .onion hostnames in DNS
@@ -192,6 +196,25 @@ problems may have been fixed or changed somewhat since this was written!
See https://github.com/curl/curl/issues/716 for the discussion.
+1.11 transfer-encoding: chunked in HTTP/2
+
+ For HTTP/1, when -H transfer-encoding:chunked option is given, curl encodes
+ the request using chunked encoding. But when HTTP/2 is being used, the
+ command wrongly sends a request with both content-length and
+ transfer-encoding: chunked headers being set (and the request body is not
+ chunked-encoded). See https://github.com/curl/curl/issues/662
+
+1.12 CURLOPT_SEEKFUNCTION not called with CURLFORM_STREAM
+
+ I'm using libcurl to POST form data using a FILE* with the CURLFORM_STREAM
+ option of curl_formadd(). I've noticed that if the connection drops at just
+ the right time, the POST is reattempted without the data from the file. It
+ seems like the file stream position isn't getting reset to the beginning of
+ the file. I found the CURLOPT_SEEKFUNCTION option and set that with a
+ function that performs an fseek() on the FILE*. However, setting that didn't
+ seem to fix the issue or even get called. See
+ https://github.com/curl/curl/issues/768
+
2. TLS
@@ -243,6 +266,12 @@ problems may have been fixed or changed somewhat since this was written!
that can receive data. This is subject for change in the future.
https://curl.haxx.se/bug/view.cgi?id=1116
+3.4 POP3 expects "CRLF.CRLF" eob for some single-line responses
+
+ You have to tell libcurl not to expect a body, when dealing with one line
+ response commands. Please see the POP3 examples and test cases which show
+ this for the NOOP and DELE commands. https://curl.haxx.se/bug/?i=740
+
4. Command line
@@ -464,6 +493,12 @@ problems may have been fixed or changed somewhat since this was written!
libcurl doesn't support active FTP over a SOCKS proxy
+10.5 SOCKS proxy not working via IPv6
+
+ `curl --proxy "socks://hostname-with-AAAA-record" example.com`
+
+ curl: (7) Can't complete SOCKS4 connection to 1.2.3.4:109. (91),
+ request rejected or failed.
11. Internals
diff --git a/docs/README.md b/docs/README.md
new file mode 100644
index 00000000..eaf85ae2
--- /dev/null
+++ b/docs/README.md
@@ -0,0 +1,12 @@
+![curl logo](https://cdn.rawgit.com/curl/curl-www/master/logo/curl-logo.svg)
+
+# Documentation
+
+You'll find a mix of various documentation in this directory and
+subdirectories, using several different formats. Some of them are not ideally
+for reading directly in your browser.
+
+If you rather see the rendered version of the documentation, check out the
+curl web site's [documentation section](https://curl.haxx.se/docs/) for
+general curl stuff or the [libcurl section](https://curl.haxx.se/libcurl/) for
+libcurl related documentation.
diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md
index d664403c..367130d3 100644
--- a/docs/ROADMAP.md
+++ b/docs/ROADMAP.md
@@ -8,15 +8,31 @@ possible participation.
HTTP/2
------
-- test suite
+Improve performance. Measurements and tests have shown that in several cases
+doing transfers over HTTP/2 can be notably slower than the same transfer done
+over HTTP/1. Some of that difference can be attributed the inefficient window
+size handling currently in use but there are probably more to be learned and
+worked on to optimize this.
+
+QUIC
+----
+
+The standardization process of QUIC has been taken to the IETF and can be
+followed on the [IETF QUIC Mailing
+list](https://www.ietf.org/mailman/listinfo/quic). I'd like us to get on the
+bandwagon. Ideally, this would be done with a separate library/project to
+handle the binary/framing layer in a similar fashion to how HTTP/2 is
+implemented. This, to allow other projects to benefit from the work and to
+thus broaden the interest and chance of others to participate.
+
+TLS 1.3
+-------
- Base this on existing nghttp2 server to start with to make functional
- tests. Later on we can adopt that code or work with nghttp2 to provide ways
- to have the http2 server respond with broken responses to make sure we deal
- with that nicely as well.
+The new version of the TLS protocol is in the pipeline and will soon start to
+get used out in the wild. It offers some new interesting features and will
+need the TLS libraries to adapt and quite likely provide additional or
+modified APIs. libcurl needs to adapt accordingly.
- To decide: if we need to bundle parts of the nghttp2 stuff that probably
- won't be shipped by many distros.
HTTP cookies
------------
diff --git a/docs/SECURITY b/docs/SECURITY
index 7b245d7b..3c07e0bb 100644
--- a/docs/SECURITY
+++ b/docs/SECURITY
@@ -66,10 +66,13 @@ announcement.
workarounds, when the release is out and make sure to credit all
contributors properly.
-- Request a CVE number from distros@openwall[1] when also informing and
- preparing them for the upcoming public security vulnerability announcement -
- attach the advisory draft for information. Note that 'distros' won't accept
- an embargo longer than 19 days.
+- Request a CVE number from
+ [distros@openwall](http://oss-security.openwall.org/wiki/mailing-lists/distros)
+ when also informing and preparing them for the upcoming public security
+ vulnerability announcement - attach the advisory draft for information. Note
+ that 'distros' won't accept an embargo longer than 19 days and they do not
+ care for Windows-specific flaws. For windows-specific flaws, request CVE
+ directly from MITRE.
- Update the "security advisory" with the CVE number.
@@ -91,7 +94,7 @@ announcement.
- The security web page on the web site should get the new vulnerability
mentioned.
-[1] = http://oss-security.openwall.org/wiki/mailing-lists/distros
+
CURL-SECURITY (at haxx dot se)
------------------------------
diff --git a/docs/THANKS b/docs/THANKS
index e81192cf..0f1a94fa 100644
--- a/docs/THANKS
+++ b/docs/THANKS
@@ -20,6 +20,7 @@ Adriano Meirelles
Ajit Dhumale
Aki Koskinen
Akos Pasztory
+Alain Danteny
Alan Pinstein
Albert Chin-A-Young
Albert Choy
@@ -87,6 +88,7 @@ Andrew Francis
Andrew Fuller
Andrew Kurushin
Andrew Moise
+Andrew Robbins
Andrew Wansink
Andrew de los Reyes
Andrey Labunets
@@ -394,6 +396,7 @@ Eric Lubin
Eric Melville
Eric Mertens
Eric Rautman
+Eric Rescorla
Eric Ridge
Eric S. Raymond
Eric Thelin
@@ -415,12 +418,14 @@ Eygene Ryabinkin
Fabian Frank
Fabian Hiernaux
Fabian Keil
+Fabian Ruff
Fabrizio Ammollo
Fedor Karpelevitch
Feist Josselin
Felix Yan
Felix von Leitner
Feng Tu
+Fernando Muñoz
Flavio Medeiros
Florian Schoppmann
Florian Weimer
@@ -476,6 +481,7 @@ Glenn Sheridan
Google Inc.
Gordon Marler
Gorilla Maguila
+Gou Lingfeng
Grant Erickson
Grant Pannell
Greg Hewgill
@@ -543,6 +549,7 @@ Ingo Wilken
Irfan Adilovic
Isaac Boukris
Ishan SinghLevett
+Ivan Avdeev
Ivo Bellin Salarin
Jack Zhang
Jacky Lam
@@ -799,6 +806,7 @@ Lukasz Czekierda
Luke Amery
Luke Call
Luke Dashjr
+Luo Jinghua
Luong Dinh Dung
Lyndon Hill
Maciej Karpiuk
@@ -820,6 +828,7 @@ Marc Kleine-Budde
Marc Renault
Marcel Raad
Marcel Roelofs
+Marcelo Echeverria
Marcelo Juchem
Marcin Adamski
Marcin Gryszkalis
@@ -854,6 +863,7 @@ Martin Jansen
Martin Lemke
Martin Skinner
Martin Storsjo
+Martin Vejnár
Marty Kuhrt
Maruko
Massimiliano Ziccardi
@@ -926,6 +936,7 @@ Mike Power
Mike Protts
Mike Revi
Miklos Nemeth
+Miroslav Franc
Miroslav Spousta
Mitz Wark
Mohamed Lrhazi
@@ -1024,6 +1035,7 @@ Pedro Neves
Per Malmberg
Peter Bray
Peter Forret
+Peter Frühberger
Peter Gal
Peter Heuchert
Peter Hjalmarsson
@@ -1088,12 +1100,14 @@ Ray Dassen
Ray Pekowski
Ray Satiro
Razvan Cojocaru
+Reinhard Max
Reinout van Schouwen
Remi Gacogne
Renato Botelho
Renaud Chaillat
Renaud Duhaut
Renaud Guillard
+Renaud Lehoux
Rene Bernhardt
Rene Rebe
Reuven Wachtfogel
@@ -1108,6 +1122,7 @@ Richard Bramante
Richard Clayton
Richard Cooper
Richard Gorton
+Richard Gray
Richard Hosking
Richard Michael
Richard Moore
@@ -1143,6 +1158,7 @@ Roland Blom
Roland Krikava
Roland Zimmermann
Rolland Dudemaine
+Romain Coltel
Roman Koifman
Roman Mamedov
Romulo A. Ceccon
@@ -1177,6 +1193,7 @@ Sara Golemon
Saran Neti
Sascha Swiercy
Saul good
+Saurav Babu
Scott Bailey
Scott Barrett
Scott Cantor
@@ -1217,6 +1234,7 @@ Stanislav Ivochkin
Stefan Bühler
Stefan Eissing
Stefan Esser
+Stefan Kanthak
Stefan Krause
Stefan Neis
Stefan Teleman
@@ -1286,6 +1304,7 @@ Tim Stack
Tim Starling
Timo Sirainen
Timotej Lazar
+Timothy Polich
Tinus van den Berg
Tobias Markus
Tobias Rundström
@@ -1383,6 +1402,7 @@ Yehezkel Horowitz
Yehoshua Hershberg
Yi Huang
Yingwei Liu
+Yonggang Luo
Yousuke Kimoto
Yukihiro Kawada
Yun SangHo
@@ -1406,5 +1426,6 @@ nk
silveja1 on github
swalkaus at yahoo.com
tommink[at]post.pl
+vanillajonathan on github
Štefan Kremeň
Никита Дорохин
diff --git a/docs/TODO b/docs/TODO
index f3b06000..30f20871 100644
--- a/docs/TODO
+++ b/docs/TODO
@@ -33,6 +33,8 @@
1.15 TCP Fast Open
1.16 Try to URL encode given URL
1.17 Add support for IRIs
+ 1.18 try next proxy if one doesn't work
+ 1.19 Timeout idle connections from the pool
2. libcurl - multi interface
2.1 More non-blocking
@@ -43,6 +45,7 @@
3. Documentation
3.1 Update date and version in man pages
+ 3.2 Provide cmake config-file
4. FTP
4.1 HOST
@@ -288,10 +291,19 @@
curl_easy_set_cb() - sets a callback PLUS its callback data
-1.15 TCP Fast Open
+1.15 Monitor connections in the connection pool
- RFC 7413 defines how to include data already in the TCP SYN handshake to
- reduce latency.
+ libcurl's connection cache or pool holds a number of open connections for the
+ purpose of possible subsequent connection reuse. It may contain a few up to a
+ significant amount of connections. Currently, libcurl leaves all connections
+ as they are and first when a connection is iterated over for matching or
+ reuse purpose it is verified that it is still alive.
+
+ Those connections may get closed by the server side for idleness or they may
+ get a HTTP/2 ping from the peer to verify that they're still alive. By adding
+ monitoring of the connections while in the pool, libcurl can detect dead
+ connections (and close them) better and earlier, and it can handle HTTP/2
+ pings to keep such ones alive even when not actively doing transfers on them.
1.16 Try to URL encode given URL
@@ -311,6 +323,25 @@
To make that work smoothly for curl users even on Windows, curl would
probably need to be able to convert from several input encodings.
+1.18 try next proxy if one doesn't work
+
+ Allow an application to specify a list of proxies to try, and failing to
+ connect to the first go on and try the next instead until the list is
+ exhausted. Browsers support this feature at least when they specify proxies
+ using PACs.
+
+ https://github.com/curl/curl/issues/896
+
+1.19 Timeout idle connections from the pool
+
+ libcurl currently keeps connections in its connection pool for an indefinite
+ period of time, until it either gets reused, gets noticed that it has been
+ closed by the server or gets pruned to make room for a new connection.
+
+ To reduce overhead (especially for when we add monitoring of the connections
+ in the pool), we should introduce a timeout so that connections that have
+ been idle for N seconds get closed.
+
2. libcurl - multi interface
@@ -365,6 +396,12 @@
pages at release time to use the current date and curl/libcurl version
number.
+3.2 Provide cmake config-file
+
+ A config-file package is a set of files provided by us to allow applications
+ to write cmake scripts to find and use libcurl easier. See
+ https://github.com/curl/curl/issues/885
+
4. FTP
4.1 HOST
@@ -716,6 +753,9 @@ that doesn't exist on the server, just like --ftp-create-dirs.
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
+ Using the multi interface would also allow properly using parallel transfers
+ with HTTP/2 and supporting HTTP/2 server push from the command line.
+
17.5 provide formpost headers
Extending the capabilities of the multipart formposting. How about leaving
diff --git a/docs/curl.1 b/docs/curl.1
index f2d48f17..c573ff95 100644
--- a/docs/curl.1
+++ b/docs/curl.1
@@ -98,7 +98,10 @@ specified on a single command line and cannot be used between separate curl
invokes.
.SH "PROGRESS METER"
curl normally displays a progress meter during operations, indicating the
-amount of transferred data, transfer speeds and estimated time left, etc.
+amount of transferred data, transfer speeds and estimated time left, etc. The
+progress meter displays number of bytes and the speeds are in bytes per
+second. The suffixes (k, M, G, T, P) are 1024 based. For example 1k is 1024
+bytes. 1M is 1048576 bytes.
curl displays this data to the terminal by default, so if you invoke curl to
do an operation and it is about to write data to the terminal, it
@@ -1944,6 +1947,9 @@ same info.
The numerical code that was found in the last response (from a proxy) to a
curl CONNECT request. (Added in 7.12.4)
.TP
+.B http_version
+The http version that was effectively used. (Added in 7.50.0)
+.TP
.B local_ip
The IP address of the local end of the most recently done connection - can be
either IPv4 or IPv6 (Added in 7.29.0)
diff --git a/docs/libcurl/curl_easy_getinfo.3 b/docs/libcurl/curl_easy_getinfo.3
index 2b4c7fe5..9ffcd14a 100644
--- a/docs/libcurl/curl_easy_getinfo.3
+++ b/docs/libcurl/curl_easy_getinfo.3
@@ -50,6 +50,9 @@ See \fICURLINFO_RESPONSE_CODE(3)\fP
.IP CURLINFO_HTTP_CONNECTCODE
Last proxy CONNECT response code.
See \fICURLINFO_HTTP_CONNECTCODE(3)\fP
+.IP CURLINFO_HTTP_VERSION
+The http version used in the connection.
+See \fICURLINFO_HTTP_VERSION(3)\fP
.IP CURLINFO_FILETIME
Remote time of the retrieved document.
See \fICURLINFO_FILETIME(3)\fP
diff --git a/docs/libcurl/curl_global_init.3 b/docs/libcurl/curl_global_init.3
index d56df5b3..d2bd79ef 100644
--- a/docs/libcurl/curl_global_init.3
+++ b/docs/libcurl/curl_global_init.3
@@ -56,27 +56,34 @@ during that time and it could cause a deadlock.
See the description in \fIlibcurl(3)\fP of global environment requirements for
details of how to use this function.
-
.SH FLAGS
-.TP 5
-.B CURL_GLOBAL_ALL
+.IP CURL_GLOBAL_ALL
Initialize everything possible. This sets all known bits except
\fBCURL_GLOBAL_ACK_EINTR\fP.
-.TP
-.B CURL_GLOBAL_SSL
-Initialize SSL
-.TP
-.B CURL_GLOBAL_WIN32
+
+.IP CURL_GLOBAL_SSL
+Initialize SSL.
+
+The implication here is that if this bit is not set, the initialization of the
+SSL layer needs to be done by the application or at least outside of
+libcurl. The exact procedure how to do SSL initializtion depends on the TLS
+backend libcurl uses.
+
+Doing TLS based transfers without having the TLS layer initialized may lead to
+unexpected behaviors.
+.IP CURL_GLOBAL_WIN32
Initialize the Win32 socket libraries.
-.TP
-.B CURL_GLOBAL_NOTHING
+
+The implication here is that if this bit is not set, the initialization of
+winsock has to be done by the application or you risk getting undefined
+behaviors. This option exists for when the initialization is handled outside
+of libcurl so there's no need for libcurl to do it again.
+.IP CURL_GLOBAL_NOTHING
Initialise nothing extra. This sets no bit.
-.TP
-.B CURL_GLOBAL_DEFAULT
+.IP CURL_GLOBAL_DEFAULT
A sensible default. It will init both SSL and Win32. Right now, this equals
the functionality of the \fBCURL_GLOBAL_ALL\fP mask.
-.TP
-.B CURL_GLOBAL_ACK_EINTR
+.IP CURL_GLOBAL_ACK_EINTR
When this flag is set, curl will acknowledge EINTR condition when connecting
or when waiting for data. Otherwise, curl waits until full timeout
elapses. (Added in 7.30.0)
diff --git a/docs/libcurl/curl_multi_socket_action.3 b/docs/libcurl/curl_multi_socket_action.3
index 65a3fb39..2b841923 100644
--- a/docs/libcurl/curl_multi_socket_action.3
+++ b/docs/libcurl/curl_multi_socket_action.3
@@ -43,7 +43,7 @@ libcurl will test the descriptor internally. It is also permissible to pass
CURL_SOCKET_TIMEOUT to the \fBsockfd\fP parameter in order to initiate the
whole process or when a timeout occurs.
-At return, the integer \fBrunning_handles\fP points to will contain the number
+At return, \fBrunning_handles\fP points to the number
of running easy handles within the multi handle. When this number reaches
zero, all transfers are complete/done. When you call
\fIcurl_multi_socket_action(3)\fP on a specific socket and the counter
diff --git a/docs/libcurl/libcurl-multi.3 b/docs/libcurl/libcurl-multi.3
index a7f3dbbf..e5a58920 100644
--- a/docs/libcurl/libcurl-multi.3
+++ b/docs/libcurl/libcurl-multi.3
@@ -153,7 +153,7 @@ timeout expires, your application should call the
\fIcurl_multi_socket_action(3)\fP function saying it was due to a timeout.
This API is typically used with an event-driven underlying functionality (like
-libevent, libev, kqueue, epoll or similar) which which the application
+libevent, libev, kqueue, epoll or similar) with which the application
"subscribes" on socket changes. This allows applications and libcurl to much
better scale upward and beyond thousands of simultaneous transfers without
losing performance.
diff --git a/docs/libcurl/opts/CURLINFO_CERTINFO.3 b/docs/libcurl/opts/CURLINFO_CERTINFO.3
index c76daa7a..cb0bd8aa 100644
--- a/docs/libcurl/opts/CURLINFO_CERTINFO.3
+++ b/docs/libcurl/opts/CURLINFO_CERTINFO.3
@@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
@@ -41,8 +41,8 @@ All TLS-based
.SH EXAMPLE
TODO
.SH AVAILABILITY
-This option is only working in libcurl built with OpenSSL, NSS or GSKit
-support.
+This option is only working in libcurl built with OpenSSL, NSS, schannel or
+GSKit support. schannel support added in 7.50.0
Added in 7.19.1
.SH RETURN VALUE
diff --git a/docs/libcurl/opts/CURLINFO_HTTP_VERSION.3 b/docs/libcurl/opts/CURLINFO_HTTP_VERSION.3
new file mode 100644
index 00000000..b0f43e54
--- /dev/null
+++ b/docs/libcurl/opts/CURLINFO_HTTP_VERSION.3
@@ -0,0 +1,56 @@
+.\" **************************************************************************
+.\" * _ _ ____ _
+.\" * Project ___| | | | _ \| |
+.\" * / __| | | | |_) | |
+.\" * | (__| |_| | _ <| |___
+.\" * \___|\___/|_| \_\_____|
+.\" *
+.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" *
+.\" * This software is licensed as described in the file COPYING, which
+.\" * you should have received as part of this distribution. The terms
+.\" * are also available at https://curl.haxx.se/docs/copyright.html.
+.\" *
+.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+.\" * copies of the Software, and permit persons to whom the Software is
+.\" * furnished to do so, under the terms of the COPYING file.
+.\" *
+.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+.\" * KIND, either express or implied.
+.\" *
+.\" **************************************************************************
+.\"
+.TH CURLINFO_HTTP_VERSION 3 "11 May 2016" "libcurl 7.50.0" "curl_easy_getinfo options"
+.SH NAME
+CURLINFO_HTTP_VERSION \- get the http version used in the connection
+.SH SYNOPSIS
+#include <curl/curl.h>
+
+CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_HTTP_VERSION, long *p);
+.SH DESCRIPTION
+Pass a pointer to a long to receive the version used in the last http connection.
+The returned value will be CURL_HTTP_VERSION_1_0, CURL_HTTP_VERSION_1_1, or
+CURL_HTTP_VERSION_2_0, or 0 if the version can't be determined.
+.SH PROTOCOLS
+HTTP
+.SH EXAMPLE
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+ CURLcode res;
+ curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
+ res = curl_easy_perform(curl);
+ if(res == CURLE_OK) {
+ long http_version;
+ curl_easy_getinfo(curl, CURLINFO_HTTP_VERSION, &http_version);
+ }
+ curl_easy_cleanup(curl);
+}
+.fi
+.SH AVAILABILITY
+Added in 7.50.0
+.SH RETURN VALUE
+Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
+.SH "SEE ALSO"
+.BR CURLINFO_RESPONSE_CODE "(3), "
+.BR curl_easy_getinfo "(3), " curl_easy_setopt "(3), "
diff --git a/docs/libcurl/opts/CURLMOPT_SOCKETFUNCTION.3 b/docs/libcurl/opts/CURLMOPT_SOCKETFUNCTION.3
index 113021e7..51961972 100644
--- a/docs/libcurl/opts/CURLMOPT_SOCKETFUNCTION.3
+++ b/docs/libcurl/opts/CURLMOPT_SOCKETFUNCTION.3
@@ -54,7 +54,7 @@ Wait for incoming data. For the socket to become readable.
.IP CURL_POLL_OUT
Wait for outgoing data. For the socket to become writable.
.IP CURL_POLL_INOUT
-Wait for incoming abd outgoing data. For the socket to become readable or
+Wait for incoming and outgoing data. For the socket to become readable or
writable.
.IP CURL_POLL_REMOVE
The specified socket/file descriptor is no longer used by libcurl.
diff --git a/docs/libcurl/opts/CURLOPT_POSTFIELDS.3 b/docs/libcurl/opts/CURLOPT_POSTFIELDS.3
index f9f9eadc..17ec2d76 100644
--- a/docs/libcurl/opts/CURLOPT_POSTFIELDS.3
+++ b/docs/libcurl/opts/CURLOPT_POSTFIELDS.3
@@ -42,16 +42,15 @@ This POST is a normal application/x-www-form-urlencoded kind (and libcurl will
set that Content-Type by default when this option is used), which is commonly
used by HTML forms. Change Content-Type with \fICURLOPT_HTTPHEADER(3)\fP.
-Using \fICURLOPT_POSTFIELDS(3)\fP implies \fICURLOPT_POST(3)\fP.
-
You can use \fIcurl_easy_escape(3)\fP to url-encode your data, if necessary. It
returns a pointer to an encoded string that can be passed as \fIpostdata\fP.
-If you want to do a zero-byte POST, you need to set
-\fICURLOPT_POSTFIELDSIZE(3)\fP explicitly to zero, as simply setting
-\fICURLOPT_POSTFIELDS(3)\fP to NULL or "" just effectively disables the
-sending of the specified string. libcurl will instead assume that you'll send
-the POST data using the read callback!
+Using \fICURLOPT_POSTFIELDS(3)\fP implies \fICURLOPT_POST(3)\fP.
+
+If \fICURLOPT_POSTFIELDS(3)\fP is explicitly set to NULL then libcurl will get
+the POST data from the read callback. If you want to send a zero-byte POST set
+\fICURLOPT_POSTFIELDS(3)\fP to an empty string, or set \fICURLOPT_POST(3)\fP to
+1 and \fICURLOPT_POSTFIELDSIZE(3)\fP to 0.
Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header.
You can disable this header with \fICURLOPT_HTTPHEADER(3)\fP as usual.
diff --git a/docs/libcurl/opts/Makefile.am b/docs/libcurl/opts/Makefile.am
index 49674d5c..a3fc0647 100644
--- a/docs/libcurl/opts/Makefile.am
+++ b/docs/libcurl/opts/Makefile.am
@@ -38,6 +38,7 @@ man_MANS = \
CURLINFO_HEADER_SIZE.3 \
CURLINFO_HTTPAUTH_AVAIL.3 \
CURLINFO_HTTP_CONNECTCODE.3 \
+ CURLINFO_HTTP_VERSION.3 \
CURLINFO_LASTSOCKET.3 \
CURLINFO_LOCAL_IP.3 \
CURLINFO_LOCAL_PORT.3 \
diff --git a/docs/libcurl/symbols-in-versions b/docs/libcurl/symbols-in-versions
index fa26efbe..d05a4690 100644
--- a/docs/libcurl/symbols-in-versions
+++ b/docs/libcurl/symbols-in-versions
@@ -223,6 +223,7 @@ CURLINFO_HEADER_SIZE 7.4.1
CURLINFO_HTTPAUTH_AVAIL 7.10.8
CURLINFO_HTTP_CODE 7.4.1 7.10.8
CURLINFO_HTTP_CONNECTCODE 7.10.7
+CURLINFO_HTTP_VERSION 7.50.0
CURLINFO_LASTONE 7.4.1
CURLINFO_LASTSOCKET 7.15.2
CURLINFO_LOCAL_IP 7.21.0
diff --git a/include/curl/curl.h b/include/curl/curl.h
index 57e716b3..7fd6d1fa 100644
--- a/include/curl/curl.h
+++ b/include/curl/curl.h
@@ -91,7 +91,13 @@
extern "C" {
#endif
+#if defined(BUILDING_LIBCURL) || defined(CURL_STRICTER)
+typedef struct Curl_easy CURL;
+typedef struct Curl_share CURLSH;
+#else
typedef void CURL;
+typedef void CURLSH;
+#endif
/*
* libcurl external API function linkage decorations.
@@ -2193,9 +2199,10 @@ typedef enum {
CURLINFO_TLS_SESSION = CURLINFO_SLIST + 43,
CURLINFO_ACTIVESOCKET = CURLINFO_SOCKET + 44,
CURLINFO_TLS_SSL_PTR = CURLINFO_SLIST + 45,
+ CURLINFO_HTTP_VERSION = CURLINFO_LONG + 46,
/* Fill in new entries below here! */
- CURLINFO_LASTONE = 45
+ CURLINFO_LASTONE = 46
} CURLINFO;
/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
@@ -2257,7 +2264,6 @@ typedef void (*curl_unlock_function)(CURL *handle,
curl_lock_data data,
void *userptr);
-typedef void CURLSH;
typedef enum {
CURLSHE_OK, /* all is fine */
diff --git a/include/curl/curlver.h b/include/curl/curlver.h
index 7cea993e..81563f22 100644
--- a/include/curl/curlver.h
+++ b/include/curl/curlver.h
@@ -30,12 +30,12 @@
/* This is the version number of the libcurl package from which this header
file origins: */
-#define LIBCURL_VERSION "7.49.1-DEV"
+#define LIBCURL_VERSION "7.50.1-DEV"
/* The numeric version number is also available "in parts" by using these
defines: */
#define LIBCURL_VERSION_MAJOR 7
-#define LIBCURL_VERSION_MINOR 49
+#define LIBCURL_VERSION_MINOR 50
#define LIBCURL_VERSION_PATCH 1
/* This is the numeric version of the libcurl version number, meant for easier
@@ -57,7 +57,7 @@
CURL_VERSION_BITS() macro since curl's own configure script greps for it
and needs it to contain the full number.
*/
-#define LIBCURL_VERSION_NUM 0x073101
+#define LIBCURL_VERSION_NUM 0x073201
/*
* This is the date and time when the full source package was created. The
diff --git a/include/curl/multi.h b/include/curl/multi.h
index 0fbbd96f..d1e00cc5 100644
--- a/include/curl/multi.h
+++ b/include/curl/multi.h
@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -52,7 +52,11 @@
extern "C" {
#endif
+#if defined(BUILDING_LIBCURL) || defined(CURL_STRICTER)
+typedef struct Curl_multi CURLM;
+#else
typedef void CURLM;
+#endif
typedef enum {
CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or
diff --git a/lib/Makefile.m32 b/lib/Makefile.m32
index 2142bfc4..522dbd1d 100644
--- a/lib/Makefile.m32
+++ b/lib/Makefile.m32
@@ -258,6 +258,10 @@ ifdef SSL
CFLAGS += -DHAVE_OPENSSL_SRP -DUSE_TLS_SRP
endif
endif
+else
+ifdef WINSSL
+ DLL_LIBS += -lcrypt32
+endif
endif
ifdef ZLIB
INCLUDES += -I"$(ZLIB_PATH)"
diff --git a/lib/Makefile.vc6 b/lib/Makefile.vc6
index b4cb229a..e783e3ae 100644
--- a/lib/Makefile.vc6
+++ b/lib/Makefile.vc6
@@ -115,6 +115,7 @@ LNKDLL = link.exe /DLL
LNKLIB = link.exe /lib
LFLAGS = /nologo /machine:$(MACHINE)
SSLLIBS = libeay32.lib ssleay32.lib
+WINSSLLIBS = crypt32.lib
ZLIBLIBSDLL = zdll.lib
ZLIBLIBS = zlib.lib
WINLIBS = ws2_32.lib wldap32.lib advapi32.lib
@@ -176,7 +177,7 @@ CFGSET = TRUE
TARGET = $(LIBCURL_STA_LIB_REL)
DIROBJ = $(CFG)
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
-LNK = $(LNKLIB) /out:$(DIROBJ)\$(TARGET)
+LNK = $(LNKLIB) $(WINSSLLIBS) /out:$(DIROBJ)\$(TARGET)
CC = $(CCNODBG) $(RTLIB) $(CFLAGSWINSSL) $(CFLAGSLIB)
CFGSET = TRUE
!ENDIF
@@ -213,7 +214,7 @@ CFGSET = TRUE
TARGET = $(LIBCURL_STA_LIB_REL)
DIROBJ = $(CFG)
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
-LNK = $(LNKLIB) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
+LNK = $(LNKLIB) $(LFLAGSZLIB) $(WINSSLLIBS) /out:$(DIROBJ)\$(TARGET)
CC = $(CCNODBG) $(RTLIB) $(CFLAGSWINSSL) $(CFLAGSZLIB) $(CFLAGSLIB)
CFGSET = TRUE
!ENDIF
@@ -644,6 +645,7 @@ X_OBJS= \
$(DIROBJ)\version.obj \
$(DIROBJ)\warnless.obj \
$(DIROBJ)\wildcard.obj \
+ $(DIROBJ)\x509asn1.obj \
$(RESOURCE)
all : $(TARGET)
diff --git a/lib/asyn-ares.c b/lib/asyn-ares.c
index 51f61dee..2aed94fe 100644
--- a/lib/asyn-ares.c
+++ b/lib/asyn-ares.c
@@ -249,7 +249,7 @@ int Curl_resolver_getsock(struct connectdata *conn,
static int waitperform(struct connectdata *conn, int timeout_ms)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
int nfds;
int bitmask;
ares_socket_t socks[ARES_GETSOCK_MAXNUM];
@@ -309,7 +309,7 @@ static int waitperform(struct connectdata *conn, int timeout_ms)
CURLcode Curl_resolver_is_resolved(struct connectdata *conn,
struct Curl_dns_entry **dns)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ResolverResults *res = (struct ResolverResults *)
conn->async.os_specific;
CURLcode result = CURLE_OK;
@@ -353,7 +353,7 @@ CURLcode Curl_resolver_wait_resolv(struct connectdata *conn,
struct Curl_dns_entry **entry)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
long timeout;
struct timeval now = Curl_tvnow();
struct Curl_dns_entry *temp_entry;
@@ -492,7 +492,7 @@ Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn,
int *waitp)
{
char *bufp;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct in_addr in;
int family = PF_INET;
#ifdef ENABLE_IPV6 /* CURLRES_IPV6 */
@@ -583,7 +583,7 @@ Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn,
return NULL; /* no struct yet */
}
-CURLcode Curl_set_dns_servers(struct SessionHandle *data,
+CURLcode Curl_set_dns_servers(struct Curl_easy *data,
char *servers)
{
CURLcode result = CURLE_NOT_BUILT_IN;
@@ -621,7 +621,7 @@ CURLcode Curl_set_dns_servers(struct SessionHandle *data,
return result;
}
-CURLcode Curl_set_dns_interface(struct SessionHandle *data,
+CURLcode Curl_set_dns_interface(struct Curl_easy *data,
const char *interf)
{
#if (ARES_VERSION >= 0x010704)
@@ -638,7 +638,7 @@ CURLcode Curl_set_dns_interface(struct SessionHandle *data,
#endif
}
-CURLcode Curl_set_dns_local_ip4(struct SessionHandle *data,
+CURLcode Curl_set_dns_local_ip4(struct Curl_easy *data,
const char *local_ip4)
{
#if (ARES_VERSION >= 0x010704)
@@ -663,7 +663,7 @@ CURLcode Curl_set_dns_local_ip4(struct SessionHandle *data,
#endif
}
-CURLcode Curl_set_dns_local_ip6(struct SessionHandle *data,
+CURLcode Curl_set_dns_local_ip6(struct Curl_easy *data,
const char *local_ip6)
{
#if (ARES_VERSION >= 0x010704) && defined(ENABLE_IPV6)
diff --git a/lib/asyn-thread.c b/lib/asyn-thread.c
index 81caedb0..7cce01aa 100644
--- a/lib/asyn-thread.c
+++ b/lib/asyn-thread.c
@@ -279,6 +279,9 @@ static unsigned int CURL_STDCALL getaddrinfo_thread (void *arg)
if(tsd->sock_error == 0)
tsd->sock_error = RESOLVER_ENOMEM;
}
+ else {
+ Curl_addrinfo_set_port(tsd->res, tsd->port);
+ }
Curl_mutex_acquire(tsd->mtx);
if(tsd->done) {
@@ -494,7 +497,7 @@ CURLcode Curl_resolver_wait_resolv(struct connectdata *conn,
CURLcode Curl_resolver_is_resolved(struct connectdata *conn,
struct Curl_dns_entry **entry)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct thread_data *td = (struct thread_data*) conn->async.os_specific;
int done = 0;
@@ -602,6 +605,7 @@ Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn,
*waitp = 0; /* default to synchronous response */
+#ifndef USE_RESOLVE_ON_IPS
/* First check if this is an IPv4 address string */
if(Curl_inet_pton(AF_INET, hostname, &in) > 0)
/* This is a dotted IP address 123.123.123.123-style */
@@ -609,10 +613,13 @@ Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn,
#ifdef CURLRES_IPV6
/* check if this is an IPv6 address string */
- if(Curl_inet_pton (AF_INET6, hostname, &in6) > 0)
+ if(Curl_inet_pton(AF_INET6, hostname, &in6) > 0)
/* This is an IPv6 address literal */
return Curl_ip2addr(AF_INET6, &in6, hostname, port);
+#endif /* CURLRES_IPV6 */
+#endif /* !USE_RESOLVE_ON_IPS */
+#ifdef CURLRES_IPV6
/*
* Check if a limited name resolve has been requested.
*/
@@ -631,7 +638,6 @@ Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn,
if((pf != PF_INET) && !Curl_ipv6works())
/* The stack seems to be a non-IPv6 one */
pf = PF_INET;
-
#endif /* CURLRES_IPV6 */
memset(&hints, 0, sizeof(hints));
@@ -656,12 +662,16 @@ Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn,
hostname, port, Curl_strerror(conn, SOCKERRNO));
return NULL;
}
+ else {
+ Curl_addrinfo_set_port(res, port);
+ }
+
return res;
}
#endif /* !HAVE_GETADDRINFO */
-CURLcode Curl_set_dns_servers(struct SessionHandle *data,
+CURLcode Curl_set_dns_servers(struct Curl_easy *data,
char *servers)
{
(void)data;
@@ -670,7 +680,7 @@ CURLcode Curl_set_dns_servers(struct SessionHandle *data,
}
-CURLcode Curl_set_dns_interface(struct SessionHandle *data,
+CURLcode Curl_set_dns_interface(struct Curl_easy *data,
const char *interf)
{
(void)data;
@@ -678,7 +688,7 @@ CURLcode Curl_set_dns_interface(struct SessionHandle *data,
return CURLE_NOT_BUILT_IN;
}
-CURLcode Curl_set_dns_local_ip4(struct SessionHandle *data,
+CURLcode Curl_set_dns_local_ip4(struct Curl_easy *data,
const char *local_ip4)
{
(void)data;
@@ -686,7 +696,7 @@ CURLcode Curl_set_dns_local_ip4(struct SessionHandle *data,
return CURLE_NOT_BUILT_IN;
}
-CURLcode Curl_set_dns_local_ip6(struct SessionHandle *data,
+CURLcode Curl_set_dns_local_ip6(struct Curl_easy *data,
const char *local_ip6)
{
(void)data;
diff --git a/lib/asyn.h b/lib/asyn.h
index 416510f9..3adc3664 100644
--- a/lib/asyn.h
+++ b/lib/asyn.h
@@ -27,7 +27,7 @@
struct addrinfo;
struct hostent;
-struct SessionHandle;
+struct Curl_easy;
struct connectdata;
struct Curl_dns_entry;
diff --git a/lib/base64.c b/lib/base64.c
index 0ef24d51..ad254595 100644
--- a/lib/base64.c
+++ b/lib/base64.c
@@ -23,7 +23,7 @@
/* Base64 encoding/decoding */
#include "curl_setup.h"
-#include "urldata.h" /* for the SessionHandle definition */
+#include "urldata.h" /* for the Curl_easy definition */
#include "warnless.h"
#include "curl_base64.h"
#include "non-ascii.h"
@@ -169,7 +169,7 @@ CURLcode Curl_base64_decode(const char *src,
}
static CURLcode base64_encode(const char *table64,
- struct SessionHandle *data,
+ struct Curl_easy *data,
const char *inputbuff, size_t insize,
char **outptr, size_t *outlen)
{
@@ -283,7 +283,7 @@ static CURLcode base64_encode(const char *table64,
*
* @unittest: 1302
*/
-CURLcode Curl_base64_encode(struct SessionHandle *data,
+CURLcode Curl_base64_encode(struct Curl_easy *data,
const char *inputbuff, size_t insize,
char **outptr, size_t *outlen)
{
@@ -307,7 +307,7 @@ CURLcode Curl_base64_encode(struct SessionHandle *data,
*
* @unittest: 1302
*/
-CURLcode Curl_base64url_encode(struct SessionHandle *data,
+CURLcode Curl_base64url_encode(struct Curl_easy *data,
const char *inputbuff, size_t insize,
char **outptr, size_t *outlen)
{
diff --git a/lib/checksrc.pl b/lib/checksrc.pl
index aacb242b..f31083a6 100755
--- a/lib/checksrc.pl
+++ b/lib/checksrc.pl
@@ -421,7 +421,13 @@ sub scanfile {
}
# scan for use of banned functions
- if($l =~ /^(.*\W)(sprintf|vsprintf|strcat|strncat|_mbscat|_mbsncat|_tcscat|_tcsncat|wcscat|wcsncat|gets)\s*\(/) {
+ if($l =~ /^(.*\W)
+ (gets|
+ v?sprintf|
+ (str|_mbs|_tcs|_wcs)n?cat|
+ LoadLibrary(Ex)?(A|W)?)
+ \s*\(
+ /x) {
checkwarn("BANNEDFUNC",
$line, length($1), $file, $ol,
"use of $2 is banned");
diff --git a/lib/conncache.c b/lib/conncache.c
index d0c09c82..32a70303 100644
--- a/lib/conncache.c
+++ b/lib/conncache.c
@@ -45,7 +45,7 @@ static void conn_llist_dtor(void *user, void *element)
data->bundle = NULL;
}
-static CURLcode bundle_create(struct SessionHandle *data,
+static CURLcode bundle_create(struct Curl_easy *data,
struct connectbundle **cb_ptr)
{
(void)data;
@@ -199,7 +199,7 @@ CURLcode Curl_conncache_add_conn(struct conncache *connc,
CURLcode result;
struct connectbundle *bundle;
struct connectbundle *new_bundle = NULL;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
bundle = Curl_conncache_find_bundle(conn, data->state.conn_cache);
if(!bundle) {
diff --git a/lib/connect.c b/lib/connect.c
index ac2f2683..0047f9a0 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -72,6 +72,7 @@
#include "warnless.h"
#include "conncache.h"
#include "multihandle.h"
+#include "system_win32.h"
/* The last 3 #include files should be in this order */
#include "curl_printf.h"
@@ -103,7 +104,7 @@ struct tcp_keepalive {
#endif
static void
-tcpkeepalive(struct SessionHandle *data,
+tcpkeepalive(struct Curl_easy *data,
curl_socket_t sockfd)
{
int optval = data->set.tcp_keepalive?1:0;
@@ -178,7 +179,7 @@ singleipconnect(struct connectdata *conn,
*
* @unittest: 1303
*/
-long Curl_timeleft(struct SessionHandle *data,
+long Curl_timeleft(struct Curl_easy *data,
struct timeval *nowp,
bool duringconnect)
{
@@ -238,7 +239,7 @@ long Curl_timeleft(struct SessionHandle *data,
static CURLcode bindlocal(struct connectdata *conn,
curl_socket_t sockfd, int af, unsigned int scope)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct Curl_sockaddr_storage sa;
struct sockaddr *sock = (struct sockaddr *)&sa; /* bind to this address */
@@ -662,7 +663,7 @@ void Curl_updateconninfo(struct connectdata *conn, curl_socket_t sockfd)
curl_socklen_t len;
struct Curl_sockaddr_storage ssrem;
struct Curl_sockaddr_storage ssloc;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
if(conn->socktype == SOCK_DGRAM)
/* there's no connection! */
@@ -719,7 +720,7 @@ CURLcode Curl_is_connected(struct connectdata *conn,
int sockindex,
bool *connected)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
CURLcode result = CURLE_OK;
long allow;
int error = 0;
@@ -870,7 +871,7 @@ void Curl_tcpnodelay(struct connectdata *conn, curl_socket_t sockfd)
{
#if defined(TCP_NODELAY)
#if !defined(CURL_DISABLE_VERBOSE_STRINGS)
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
#endif
curl_socklen_t onoff = (curl_socklen_t) 1;
int level = IPPROTO_TCP;
@@ -912,7 +913,7 @@ void Curl_tcpnodelay(struct connectdata *conn, curl_socket_t sockfd)
static void nosigpipe(struct connectdata *conn,
curl_socket_t sockfd)
{
- struct SessionHandle *data= conn->data;
+ struct Curl_easy *data= conn->data;
int onoff = 1;
if(setsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE, (void *)&onoff,
sizeof(onoff)) < 0)
@@ -945,43 +946,15 @@ void Curl_sndbufset(curl_socket_t sockfd)
int val = CURL_MAX_WRITE_SIZE + 32;
int curval = 0;
int curlen = sizeof(curval);
- DWORD majorVersion = 6;
static int detectOsState = DETECT_OS_NONE;
if(detectOsState == DETECT_OS_NONE) {
-#if !defined(_WIN32_WINNT) || !defined(_WIN32_WINNT_WIN2K) || \
- (_WIN32_WINNT < _WIN32_WINNT_WIN2K)
- OSVERSIONINFO osver;
-
- memset(&osver, 0, sizeof(osver));
- osver.dwOSVersionInfoSize = sizeof(osver);
-
- detectOsState = DETECT_OS_PREVISTA;
- if(GetVersionEx(&osver)) {
- if(osver.dwMajorVersion >= majorVersion)
- detectOsState = DETECT_OS_VISTA_OR_LATER;
- }
-#else
- ULONGLONG cm;
- OSVERSIONINFOEX osver;
-
- memset(&osver, 0, sizeof(osver));
- osver.dwOSVersionInfoSize = sizeof(osver);
- osver.dwMajorVersion = majorVersion;
-
- cm = VerSetConditionMask(0, VER_MAJORVERSION, VER_GREATER_EQUAL);
- cm = VerSetConditionMask(cm, VER_MINORVERSION, VER_GREATER_EQUAL);
- cm = VerSetConditionMask(cm, VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL);
- cm = VerSetConditionMask(cm, VER_SERVICEPACKMINOR, VER_GREATER_EQUAL);
-
- if(VerifyVersionInfo(&osver, (VER_MAJORVERSION | VER_MINORVERSION |
- VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR),
- cm))
+ if(Curl_verify_windows_version(6, 0, PLATFORM_WINNT,
+ VERSION_GREATER_THAN_EQUAL))
detectOsState = DETECT_OS_VISTA_OR_LATER;
else
detectOsState = DETECT_OS_PREVISTA;
-#endif
}
if(detectOsState == DETECT_OS_VISTA_OR_LATER)
@@ -1012,7 +985,7 @@ static CURLcode singleipconnect(struct connectdata *conn,
int rc = -1;
int error = 0;
bool isconnected = FALSE;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
curl_socket_t sockfd;
CURLcode result;
char ipaddress[MAX_IPADR_LEN];
@@ -1111,7 +1084,10 @@ static CURLcode singleipconnect(struct connectdata *conn,
CONNECT_RESUME_ON_READ_WRITE | CONNECT_DATA_IDEMPOTENT,
NULL, 0, NULL, NULL);
#elif defined(MSG_FASTOPEN) /* Linux */
- rc = 0; /* Do nothing */
+ if(conn->given->flags & PROTOPT_SSL)
+ rc = connect(sockfd, &addr.sa_addr, addr.addrlen);
+ else
+ rc = 0; /* Do nothing */
#endif
}
else {
@@ -1173,7 +1149,7 @@ static CURLcode singleipconnect(struct connectdata *conn,
CURLcode Curl_connecthost(struct connectdata *conn, /* context */
const struct Curl_dns_entry *remotehost)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct timeval before = Curl_tvnow();
CURLcode result = CURLE_COULDNT_CONNECT;
@@ -1232,11 +1208,11 @@ static int conn_is_conn(struct connectdata *conn, void *param)
/*
* Used to extract socket and connectdata struct for the most recent
- * transfer on the given SessionHandle.
+ * transfer on the given Curl_easy.
*
* The returned socket will be CURL_SOCKET_BAD in case of failure!
*/
-curl_socket_t Curl_getconnectinfo(struct SessionHandle *data,
+curl_socket_t Curl_getconnectinfo(struct Curl_easy *data,
struct connectdata **connp)
{
curl_socket_t sockfd;
@@ -1336,7 +1312,7 @@ CURLcode Curl_socket(struct connectdata *conn,
struct Curl_sockaddr_ex *addr,
curl_socket_t *sockfd)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct Curl_sockaddr_ex dummy;
if(!addr)
diff --git a/lib/connect.h b/lib/connect.h
index f3d4ac74..6d60e0d8 100644
--- a/lib/connect.h
+++ b/lib/connect.h
@@ -35,7 +35,7 @@ CURLcode Curl_connecthost(struct connectdata *conn,
/* generic function that returns how much time there's left to run, according
to the timeouts set */
-long Curl_timeleft(struct SessionHandle *data,
+long Curl_timeleft(struct Curl_easy *data,
struct timeval *nowp,
bool duringconnect);
@@ -45,11 +45,11 @@ long Curl_timeleft(struct SessionHandle *data,
/*
* Used to extract socket and connectdata struct for the most recent
- * transfer on the given SessionHandle.
+ * transfer on the given Curl_easy.
*
* The returned socket will be CURL_SOCKET_BAD in case of failure!
*/
-curl_socket_t Curl_getconnectinfo(struct SessionHandle *data,
+curl_socket_t Curl_getconnectinfo(struct Curl_easy *data,
struct connectdata **connp);
#ifdef USE_WINSOCK
diff --git a/lib/content_encoding.c b/lib/content_encoding.c
index 2d30816c..fa36aca4 100644
--- a/lib/content_encoding.c
+++ b/lib/content_encoding.c
@@ -67,7 +67,7 @@ zfree_cb(voidpf opaque, voidpf ptr)
static CURLcode
process_zlib_error(struct connectdata *conn, z_stream *z)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
if(z->msg)
failf (data, "Error while processing content unencoding: %s",
z->msg);
@@ -425,7 +425,7 @@ Curl_unencode_gzip_write(struct connectdata *conn,
void Curl_unencode_cleanup(struct connectdata *conn)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct SingleRequest *k = &data->req;
z_stream *z = &k->z;
if(k->zlib_init != ZLIB_UNINIT)
diff --git a/lib/cookie.c b/lib/cookie.c
index 4e4c290b..b06a1398 100644
--- a/lib/cookie.c
+++ b/lib/cookie.c
@@ -26,13 +26,13 @@
RECEIVING COOKIE INFORMATION
============================
-struct CookieInfo *Curl_cookie_init(struct SessionHandle *data,
+struct CookieInfo *Curl_cookie_init(struct Curl_easy *data,
const char *file, struct CookieInfo *inc, bool newsession);
Inits a cookie struct to store data in a local file. This is always
called before any cookies are set.
-struct Cookie *Curl_cookie_add(struct SessionHandle *data,
+struct Cookie *Curl_cookie_add(struct Curl_easy *data,
struct CookieInfo *c, bool httpheader, char *lineptr,
const char *domain, const char *path);
@@ -259,7 +259,7 @@ static char *sanitize_cookie_path(const char *cookie_path)
*
* NOTE: OOM or cookie parsing failures are ignored.
*/
-void Curl_cookie_loadfiles(struct SessionHandle *data)
+void Curl_cookie_loadfiles(struct Curl_easy *data)
{
struct curl_slist *list = data->change.cookielist;
if(list) {
@@ -361,7 +361,7 @@ static bool isip(const char *domain)
***************************************************************************/
struct Cookie *
-Curl_cookie_add(struct SessionHandle *data,
+Curl_cookie_add(struct Curl_easy *data,
/* The 'data' pointer here may be NULL at times, and thus
must only be used very carefully for things that can deal
with data being NULL. Such as infof() and similar */
@@ -912,7 +912,7 @@ Curl_cookie_add(struct SessionHandle *data,
*
* Returns NULL on out of memory. Invalid cookies are ignored.
****************************************************************************/
-struct CookieInfo *Curl_cookie_init(struct SessionHandle *data,
+struct CookieInfo *Curl_cookie_init(struct Curl_easy *data,
const char *file,
struct CookieInfo *inc,
bool newsession)
@@ -1313,7 +1313,7 @@ static int cookie_output(struct CookieInfo *c, const char *dumphere)
fprintf(out, "#\n# Fatal libcurl error\n");
if(!use_stdout)
fclose(out);
- return 1;
+ return 1;
}
fprintf(out, "%s\n", format_ptr);
free(format_ptr);
@@ -1325,7 +1325,7 @@ static int cookie_output(struct CookieInfo *c, const char *dumphere)
return 0;
}
-struct curl_slist *Curl_cookie_list(struct SessionHandle *data)
+struct curl_slist *Curl_cookie_list(struct Curl_easy *data)
{
struct curl_slist *list = NULL;
struct curl_slist *beg;
@@ -1356,7 +1356,7 @@ struct curl_slist *Curl_cookie_list(struct SessionHandle *data)
return list;
}
-void Curl_flush_cookies(struct SessionHandle *data, int cleanup)
+void Curl_flush_cookies(struct Curl_easy *data, int cleanup)
{
if(data->set.str[STRING_COOKIEJAR]) {
if(data->change.cookielist) {
diff --git a/lib/cookie.h b/lib/cookie.h
index 74a9224e..cd7c54a2 100644
--- a/lib/cookie.h
+++ b/lib/cookie.h
@@ -70,13 +70,13 @@ struct CookieInfo {
#define MAX_NAME 1024
#define MAX_NAME_TXT "1023"
-struct SessionHandle;
+struct Curl_easy;
/*
* Add a cookie to the internal list of cookies. The domain and path arguments
* are only used if the header boolean is TRUE.
*/
-struct Cookie *Curl_cookie_add(struct SessionHandle *data,
+struct Cookie *Curl_cookie_add(struct Curl_easy *data,
struct CookieInfo *, bool header, char *lineptr,
const char *domain, const char *path);
@@ -93,12 +93,12 @@ void Curl_cookie_clearsess(struct CookieInfo *cookies);
#define Curl_cookie_cleanup(x) Curl_nop_stmt
#define Curl_flush_cookies(x,y) Curl_nop_stmt
#else
-void Curl_flush_cookies(struct SessionHandle *data, int cleanup);
+void Curl_flush_cookies(struct Curl_easy *data, int cleanup);
void Curl_cookie_cleanup(struct CookieInfo *);
-struct CookieInfo *Curl_cookie_init(struct SessionHandle *data,
+struct CookieInfo *Curl_cookie_init(struct Curl_easy *data,
const char *, struct CookieInfo *, bool);
-struct curl_slist *Curl_cookie_list(struct SessionHandle *data);
-void Curl_cookie_loadfiles(struct SessionHandle *data);
+struct curl_slist *Curl_cookie_list(struct Curl_easy *data);
+void Curl_cookie_loadfiles(struct Curl_easy *data);
#endif
#endif /* HEADER_CURL_COOKIE_H */
diff --git a/lib/curl_addrinfo.c b/lib/curl_addrinfo.c
index 8fa0c84c..35eb2ddb 100644
--- a/lib/curl_addrinfo.c
+++ b/lib/curl_addrinfo.c
@@ -563,3 +563,32 @@ curl_dogetaddrinfo(const char *hostname,
}
#endif /* defined(CURLDEBUG) && defined(HAVE_GETADDRINFO) */
+#if defined(HAVE_GETADDRINFO) && defined(USE_RESOLVE_ON_IPS)
+/*
+ * Work-arounds the sin6_port is always zero bug on iOS 9.3.2 and Mac OS X
+ * 10.11.5.
+ */
+void Curl_addrinfo_set_port(Curl_addrinfo *addrinfo, int port)
+{
+ Curl_addrinfo *ca;
+ struct sockaddr_in *addr;
+#ifdef ENABLE_IPV6
+ struct sockaddr_in6 *addr6;
+#endif
+ for(ca = addrinfo; ca != NULL; ca = ca->ai_next) {
+ switch (ca->ai_family) {
+ case AF_INET:
+ addr = (void *)ca->ai_addr; /* storage area for this info */
+ addr->sin_port = htons((unsigned short)port);
+ break;
+
+#ifdef ENABLE_IPV6
+ case AF_INET6:
+ addr6 = (void *)ca->ai_addr; /* storage area for this info */
+ addr6->sin6_port = htons((unsigned short)port);
+ break;
+#endif
+ }
+ }
+}
+#endif
diff --git a/lib/curl_addrinfo.h b/lib/curl_addrinfo.h
index 01f28647..1a681e61 100644
--- a/lib/curl_addrinfo.h
+++ b/lib/curl_addrinfo.h
@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -99,4 +99,12 @@ curl_dogetaddrinfo(const char *hostname,
int line, const char *source);
#endif
+#ifdef HAVE_GETADDRINFO
+#ifdef USE_RESOLVE_ON_IPS
+void Curl_addrinfo_set_port(Curl_addrinfo *addrinfo, int port);
+#else
+#define Curl_addrinfo_set_port(x,y)
+#endif
+#endif
+
#endif /* HEADER_CURL_ADDRINFO_H */
diff --git a/lib/curl_base64.h b/lib/curl_base64.h
index c2624176..7e9fc260 100644
--- a/lib/curl_base64.h
+++ b/lib/curl_base64.h
@@ -22,10 +22,10 @@
*
***************************************************************************/
-CURLcode Curl_base64_encode(struct SessionHandle *data,
+CURLcode Curl_base64_encode(struct Curl_easy *data,
const char *inputbuff, size_t insize,
char **outptr, size_t *outlen);
-CURLcode Curl_base64url_encode(struct SessionHandle *data,
+CURLcode Curl_base64url_encode(struct Curl_easy *data,
const char *inputbuff, size_t insize,
char **outptr, size_t *outlen);
diff --git a/lib/curl_config.h.cmake b/lib/curl_config.h.cmake
index 6b5070a8..65a414b6 100644
--- a/lib/curl_config.h.cmake
+++ b/lib/curl_config.h.cmake
@@ -915,6 +915,9 @@
/* if PolarSSL is enabled */
#cmakedefine USE_POLARSSL 1
+/* if mbedTLS is enabled */
+#cmakedefine USE_MBEDTLS 1
+
/* if libSSH2 is in use */
#cmakedefine USE_LIBSSH2 1
diff --git a/lib/curl_gssapi.c b/lib/curl_gssapi.c
index 6f9121e4..bf7c766e 100644
--- a/lib/curl_gssapi.c
+++ b/lib/curl_gssapi.c
@@ -33,7 +33,7 @@ static char krb5_oid_bytes[] = "\x2a\x86\x48\x86\xf7\x12\x01\x02\x02";
gss_OID_desc Curl_krb5_mech_oid = { 9, &krb5_oid_bytes };
OM_uint32 Curl_gss_init_sec_context(
- struct SessionHandle *data,
+ struct Curl_easy *data,
OM_uint32 *minor_status,
gss_ctx_id_t *context,
gss_name_t target_name,
@@ -114,7 +114,7 @@ static size_t display_gss_error(OM_uint32 status, int type,
* major [in] - The major status code.
* minor [in] - The minor status code.
*/
-void Curl_gss_log_error(struct SessionHandle *data, const char *prefix,
+void Curl_gss_log_error(struct Curl_easy *data, const char *prefix,
OM_uint32 major, OM_uint32 minor)
{
char buf[GSS_LOG_BUFFER_LEN];
diff --git a/lib/curl_gssapi.h b/lib/curl_gssapi.h
index 42fd1e41..9700a281 100644
--- a/lib/curl_gssapi.h
+++ b/lib/curl_gssapi.h
@@ -44,7 +44,7 @@ extern gss_OID_desc Curl_krb5_mech_oid;
/* Common method for using GSS-API */
OM_uint32 Curl_gss_init_sec_context(
- struct SessionHandle *data,
+ struct Curl_easy *data,
OM_uint32 *minor_status,
gss_ctx_id_t *context,
gss_name_t target_name,
@@ -56,7 +56,7 @@ OM_uint32 Curl_gss_init_sec_context(
OM_uint32 *ret_flags);
/* Helper to log a GSS-API error status */
-void Curl_gss_log_error(struct SessionHandle *data, const char *prefix,
+void Curl_gss_log_error(struct Curl_easy *data, const char *prefix,
OM_uint32 major, OM_uint32 minor);
/* Provide some definitions missing in old headers */
diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c
index ea7548dd..f3fb0132 100644
--- a/lib/curl_ntlm_core.c
+++ b/lib/curl_ntlm_core.c
@@ -411,7 +411,7 @@ void Curl_ntlm_core_lm_resp(const unsigned char *keys,
/*
* Set up lanmanager hashed password
*/
-CURLcode Curl_ntlm_core_mk_lm_hash(struct SessionHandle *data,
+CURLcode Curl_ntlm_core_mk_lm_hash(struct Curl_easy *data,
const char *password,
unsigned char *lmbuffer /* 21 bytes */)
{
@@ -505,7 +505,7 @@ static void ascii_uppercase_to_unicode_le(unsigned char *dest,
* Set up nt hashed passwords
* @unittest: 1600
*/
-CURLcode Curl_ntlm_core_mk_nt_hash(struct SessionHandle *data,
+CURLcode Curl_ntlm_core_mk_nt_hash(struct Curl_easy *data,
const char *password,
unsigned char *ntbuffer /* 21 bytes */)
{
diff --git a/lib/curl_ntlm_core.h b/lib/curl_ntlm_core.h
index cf37dc81..c5f90e77 100644
--- a/lib/curl_ntlm_core.h
+++ b/lib/curl_ntlm_core.h
@@ -64,12 +64,12 @@ void Curl_ntlm_core_lm_resp(const unsigned char *keys,
const unsigned char *plaintext,
unsigned char *results);
-CURLcode Curl_ntlm_core_mk_lm_hash(struct SessionHandle *data,
+CURLcode Curl_ntlm_core_mk_lm_hash(struct Curl_easy *data,
const char *password,
unsigned char *lmbuffer /* 21 bytes */);
#if USE_NTRESPONSES
-CURLcode Curl_ntlm_core_mk_nt_hash(struct SessionHandle *data,
+CURLcode Curl_ntlm_core_mk_nt_hash(struct Curl_easy *data,
const char *password,
unsigned char *ntbuffer /* 21 bytes */);
diff --git a/lib/curl_sasl.c b/lib/curl_sasl.c
index 94b39e4a..35e9feaa 100644
--- a/lib/curl_sasl.c
+++ b/lib/curl_sasl.c
@@ -257,7 +257,7 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn,
bool force_ir, saslprogress *progress)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
unsigned int enabledmechs;
const char *mech = NULL;
char *resp = NULL;
@@ -405,7 +405,7 @@ CURLcode Curl_sasl_continue(struct SASL *sasl, struct connectdata *conn,
int code, saslprogress *progress)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
saslstate newstate = SASL_FINAL;
char *resp = NULL;
#if !defined(CURL_DISABLE_CRYPTO_AUTH)
diff --git a/lib/curl_sasl.h b/lib/curl_sasl.h
index 6535fedb..7647a48b 100644
--- a/lib/curl_sasl.h
+++ b/lib/curl_sasl.h
@@ -24,7 +24,7 @@
#include <curl/curl.h>
-struct SessionHandle;
+struct Curl_easy;
struct connectdata;
/* Authentication mechanism flags */
diff --git a/lib/curl_setup.h b/lib/curl_setup.h
index 24000a5d..3fe00dcc 100644
--- a/lib/curl_setup.h
+++ b/lib/curl_setup.h
@@ -222,6 +222,15 @@
#endif
/*
+ * Use getaddrinfo to resolve the IPv4 address literal. If the current network
+ * interface doesn’t support IPv4, but supports IPv6, NAT64, and DNS64,
+ * performing this task will result in a synthesized IPv6 address.
+ */
+#ifdef __APPLE__
+#define USE_RESOLVE_ON_IPS 1
+#endif
+
+/*
* Include header files for windows builds before redefining anything.
* Use this preprocessor block only to include or exclude windows.h,
* winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs
diff --git a/lib/curl_sspi.c b/lib/curl_sspi.c
index 54bbef6f..ee3f1b1c 100644
--- a/lib/curl_sspi.c
+++ b/lib/curl_sspi.c
@@ -67,7 +67,6 @@ PSecurityFunctionTable s_pSecFn = NULL;
*/
CURLcode Curl_sspi_global_init(void)
{
- bool securityDll = FALSE;
INITSECURITYINTERFACE_FN pInitSecurityInterface;
/* If security interface is not yet initialized try to do this */
@@ -75,49 +74,9 @@ CURLcode Curl_sspi_global_init(void)
/* Security Service Provider Interface (SSPI) functions are located in
* security.dll on WinNT 4.0 and in secur32.dll on Win9x. Win2K and XP
* have both these DLLs (security.dll forwards calls to secur32.dll) */
- DWORD majorVersion = 4;
- DWORD platformId = VER_PLATFORM_WIN32_NT;
-
-#if !defined(_WIN32_WINNT) || !defined(_WIN32_WINNT_WIN2K) || \
- (_WIN32_WINNT < _WIN32_WINNT_WIN2K)
- OSVERSIONINFO osver;
-
- memset(&osver, 0, sizeof(osver));
- osver.dwOSVersionInfoSize = sizeof(osver);
-
- /* Find out Windows version */
- if(!GetVersionEx(&osver))
- return CURLE_FAILED_INIT;
-
- /* Verify the major version number == 4 and platform id == WIN_NT */
- if(osver.dwMajorVersion == majorVersion &&
- osver.dwPlatformId == platformId)
- securityDll = TRUE;
-#else
- ULONGLONG cm;
- OSVERSIONINFOEX osver;
-
- memset(&osver, 0, sizeof(osver));
- osver.dwOSVersionInfoSize = sizeof(osver);
- osver.dwMajorVersion = majorVersion;
- osver.dwPlatformId = platformId;
-
- cm = VerSetConditionMask(0, VER_MAJORVERSION, VER_EQUAL);
- cm = VerSetConditionMask(cm, VER_MINORVERSION, VER_GREATER_EQUAL);
- cm = VerSetConditionMask(cm, VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL);
- cm = VerSetConditionMask(cm, VER_SERVICEPACKMINOR, VER_GREATER_EQUAL);
- cm = VerSetConditionMask(cm, VER_PLATFORMID, VER_EQUAL);
-
- /* Verify the major version number == 4 and platform id == WIN_NT */
- if(VerifyVersionInfo(&osver, (VER_MAJORVERSION | VER_MINORVERSION |
- VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR |
- VER_PLATFORMID),
- cm))
- securityDll = TRUE;
-#endif
/* Load SSPI dll into the address space of the calling process */
- if(securityDll)
+ if(Curl_verify_windows_version(4, 0, PLATFORM_WINNT, VERSION_EQUAL))
s_hSecDll = Curl_load_library(TEXT("security.dll"));
else
s_hSecDll = Curl_load_library(TEXT("secur32.dll"));
diff --git a/lib/dict.c b/lib/dict.c
index 2e7cb477..a7b5965b 100644
--- a/lib/dict.c
+++ b/lib/dict.c
@@ -91,7 +91,7 @@ const struct Curl_handler Curl_handler_dict = {
PROTOPT_NONE | PROTOPT_NOURLQUERY /* flags */
};
-static char *unescape_word(struct SessionHandle *data, const char *inputbuff)
+static char *unescape_word(struct Curl_easy *data, const char *inputbuff)
{
char *newp;
char *dictp;
@@ -133,7 +133,7 @@ static CURLcode dict_do(struct connectdata *conn, bool *done)
char *nthdef = NULL; /* This is not part of the protocol, but required
by RFC 2229 */
CURLcode result=CURLE_OK;
- struct SessionHandle *data=conn->data;
+ struct Curl_easy *data=conn->data;
curl_socket_t sockfd = conn->sock[FIRSTSOCKET];
char *path = data->state.path;
diff --git a/lib/easy.c b/lib/easy.c
index ea7af5e5..dc7139f2 100644
--- a/lib/easy.c
+++ b/lib/easy.c
@@ -271,6 +271,8 @@ static CURLcode global_init(long flags, bool memoryfuncs)
return CURLE_FAILED_INIT;
}
+ (void)Curl_ipv6works();
+
#if defined(USE_LIBSSH2) && defined(HAVE_LIBSSH2_INIT)
if(libssh2_init(0)) {
DEBUGF(fprintf(stderr, "Error: libssh2_init failed\n"));
@@ -365,10 +367,10 @@ void curl_global_cleanup(void)
* curl_easy_init() is the external interface to alloc, setup and init an
* easy handle that is returned. If anything goes wrong, NULL is returned.
*/
-CURL *curl_easy_init(void)
+struct Curl_easy *curl_easy_init(void)
{
CURLcode result;
- struct SessionHandle *data;
+ struct Curl_easy *data;
/* Make sure we inited the global SSL stuff */
if(!initialized) {
@@ -396,13 +398,12 @@ CURL *curl_easy_init(void)
*/
#undef curl_easy_setopt
-CURLcode curl_easy_setopt(CURL *curl, CURLoption tag, ...)
+CURLcode curl_easy_setopt(struct Curl_easy *data, CURLoption tag, ...)
{
va_list arg;
- struct SessionHandle *data = curl;
CURLcode result;
- if(!curl)
+ if(!data)
return CURLE_BAD_FUNCTION_ARGUMENT;
va_start(arg, tag);
@@ -434,7 +435,7 @@ struct events {
* updated.
*/
-static int events_timer(CURLM *multi, /* multi handle */
+static int events_timer(struct Curl_multi *multi, /* multi handle */
long timeout_ms, /* see above */
void *userp) /* private callback pointer */
{
@@ -489,7 +490,7 @@ static short socketcb2poll(int pollmask)
* Callback that gets called with information about socket activity to
* monitor.
*/
-static int events_socket(CURL *easy, /* easy handle */
+static int events_socket(struct Curl_easy *easy, /* easy handle */
curl_socket_t s, /* socket */
int what, /* see above */
void *userp, /* private callback
@@ -567,7 +568,7 @@ static int events_socket(CURL *easy, /* easy handle */
*
* Do the multi handle setups that only event-based transfers need.
*/
-static void events_setup(CURLM *multi, struct events *ev)
+static void events_setup(struct Curl_multi *multi, struct events *ev)
{
/* timer callback */
curl_multi_setopt(multi, CURLMOPT_TIMERFUNCTION, events_timer);
@@ -671,7 +672,7 @@ static CURLcode wait_or_timeout(struct Curl_multi *multi, struct events *ev)
*
* Runs a transfer in a blocking manner using the events-based API
*/
-static CURLcode easy_events(CURLM *multi)
+static CURLcode easy_events(struct Curl_multi *multi)
{
struct events evs= {2, FALSE, 0, NULL, 0};
@@ -685,7 +686,7 @@ static CURLcode easy_events(CURLM *multi)
#define easy_events(x) CURLE_NOT_BUILT_IN
#endif
-static CURLcode easy_transfer(CURLM *multi)
+static CURLcode easy_transfer(struct Curl_multi *multi)
{
bool done = FALSE;
CURLMcode mcode = CURLM_OK;
@@ -765,9 +766,9 @@ static CURLcode easy_transfer(CURLM *multi)
* DEBUG: if 'events' is set TRUE, this function will use a replacement engine
* instead of curl_multi_perform() and use curl_multi_socket_action().
*/
-static CURLcode easy_perform(struct SessionHandle *data, bool events)
+static CURLcode easy_perform(struct Curl_easy *data, bool events)
{
- CURLM *multi;
+ struct Curl_multi *multi;
CURLMcode mcode;
CURLcode result = CURLE_OK;
SIGPIPE_VARIABLE(pipe_st);
@@ -827,9 +828,9 @@ static CURLcode easy_perform(struct SessionHandle *data, bool events)
* curl_easy_perform() is the external interface that performs a blocking
* transfer as previously setup.
*/
-CURLcode curl_easy_perform(CURL *easy)
+CURLcode curl_easy_perform(struct Curl_easy *data)
{
- return easy_perform(easy, FALSE);
+ return easy_perform(data, FALSE);
}
#ifdef CURLDEBUG
@@ -837,9 +838,9 @@ CURLcode curl_easy_perform(CURL *easy)
* curl_easy_perform_ev() is the external interface that performs a blocking
* transfer using the event-based API internally.
*/
-CURLcode curl_easy_perform_ev(CURL *easy)
+CURLcode curl_easy_perform_ev(struct Curl_easy *data)
{
- return easy_perform(easy, TRUE);
+ return easy_perform(data, TRUE);
}
#endif
@@ -848,9 +849,8 @@ CURLcode curl_easy_perform_ev(CURL *easy)
* curl_easy_cleanup() is the external interface to cleaning/freeing the given
* easy handle.
*/
-void curl_easy_cleanup(CURL *curl)
+void curl_easy_cleanup(struct Curl_easy *data)
{
- struct SessionHandle *data = (struct SessionHandle *)curl;
SIGPIPE_VARIABLE(pipe_st);
if(!data)
@@ -866,12 +866,11 @@ void curl_easy_cleanup(CURL *curl)
* information from a performed transfer and similar.
*/
#undef curl_easy_getinfo
-CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...)
+CURLcode curl_easy_getinfo(struct Curl_easy *data, CURLINFO info, ...)
{
va_list arg;
void *paramp;
CURLcode result;
- struct SessionHandle *data = (struct SessionHandle *)curl;
va_start(arg, info);
paramp = va_arg(arg, void *);
@@ -887,11 +886,9 @@ CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...)
* given input easy handle. The returned handle will be a new working handle
* with all options set exactly as the input source handle.
*/
-CURL *curl_easy_duphandle(CURL *incurl)
+struct Curl_easy *curl_easy_duphandle(struct Curl_easy *data)
{
- struct SessionHandle *data=(struct SessionHandle *)incurl;
-
- struct SessionHandle *outcurl = calloc(1, sizeof(struct SessionHandle));
+ struct Curl_easy *outcurl = calloc(1, sizeof(struct Curl_easy));
if(NULL == outcurl)
goto fail;
@@ -982,10 +979,8 @@ CURL *curl_easy_duphandle(CURL *incurl)
* curl_easy_reset() is an external interface that allows an app to re-
* initialize a session handle to the default values.
*/
-void curl_easy_reset(CURL *curl)
+void curl_easy_reset(struct Curl_easy *data)
{
- struct SessionHandle *data = (struct SessionHandle *)curl;
-
Curl_safefree(data->state.pathbuffer);
data->state.path = NULL;
@@ -1014,9 +1009,8 @@ void curl_easy_reset(CURL *curl)
*
* Action is a bitmask consisting of CURLPAUSE_* bits in curl/curl.h
*/
-CURLcode curl_easy_pause(CURL *curl, int action)
+CURLcode curl_easy_pause(struct Curl_easy *data, int action)
{
- struct SessionHandle *data = (struct SessionHandle *)curl;
struct SingleRequest *k = &data->req;
CURLcode result = CURLE_OK;
@@ -1056,7 +1050,7 @@ CURLcode curl_easy_pause(CURL *curl, int action)
}
-static CURLcode easy_connection(struct SessionHandle *data,
+static CURLcode easy_connection(struct Curl_easy *data,
curl_socket_t *sfd,
struct connectdata **connp)
{
@@ -1084,13 +1078,13 @@ static CURLcode easy_connection(struct SessionHandle *data,
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
* Returns CURLE_OK on success, error code on error.
*/
-CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen, size_t *n)
+CURLcode curl_easy_recv(struct Curl_easy *data, void *buffer, size_t buflen,
+ size_t *n)
{
curl_socket_t sfd;
CURLcode result;
ssize_t n1;
struct connectdata *c;
- struct SessionHandle *data = (struct SessionHandle *)curl;
result = easy_connection(data, &sfd, &c);
if(result)
@@ -1111,14 +1105,13 @@ CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen, size_t *n)
* Sends data over the connected socket. Use after successful
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
*/
-CURLcode curl_easy_send(CURL *curl, const void *buffer, size_t buflen,
- size_t *n)
+CURLcode curl_easy_send(struct Curl_easy *data, const void *buffer,
+ size_t buflen, size_t *n)
{
curl_socket_t sfd;
CURLcode result;
ssize_t n1;
struct connectdata *c = NULL;
- struct SessionHandle *data = (struct SessionHandle *)curl;
result = easy_connection(data, &sfd, &c);
if(result)
diff --git a/lib/easyif.h b/lib/easyif.h
index 65333494..f6132cc7 100644
--- a/lib/easyif.h
+++ b/lib/easyif.h
@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -26,7 +26,7 @@
* Prototypes for library-wide functions provided by easy.c
*/
#ifdef CURLDEBUG
-CURL_EXTERN CURLcode curl_easy_perform_ev(CURL *easy);
+CURL_EXTERN CURLcode curl_easy_perform_ev(struct Curl_easy *easy);
#endif
#endif /* HEADER_CURL_EASYIF_H */
diff --git a/lib/escape.c b/lib/escape.c
index 2c6a7f65..04230b4c 100644
--- a/lib/escape.c
+++ b/lib/escape.c
@@ -75,7 +75,8 @@ char *curl_unescape(const char *string, int length)
return curl_easy_unescape(NULL, string, length, NULL);
}
-char *curl_easy_escape(CURL *handle, const char *string, int inlength)
+char *curl_easy_escape(struct Curl_easy *data, const char *string,
+ int inlength)
{
size_t alloc = (inlength?(size_t)inlength:strlen(string))+1;
char *ns;
@@ -112,7 +113,7 @@ char *curl_easy_escape(CURL *handle, const char *string, int inlength)
}
}
- result = Curl_convert_to_network(handle, &in, 1);
+ result = Curl_convert_to_network(data, &in, 1);
if(result) {
/* Curl_convert_to_network calls failf if unsuccessful */
free(ns);
@@ -139,7 +140,7 @@ char *curl_easy_escape(CURL *handle, const char *string, int inlength)
* *olen. If length == 0, the length is assumed to be strlen(string).
*
*/
-CURLcode Curl_urldecode(struct SessionHandle *data,
+CURLcode Curl_urldecode(struct Curl_easy *data,
const char *string, size_t length,
char **ostring, size_t *olen,
bool reject_ctrl)
@@ -206,13 +207,13 @@ CURLcode Curl_urldecode(struct SessionHandle *data,
* If length == 0, the length is assumed to be strlen(string).
* If olen == NULL, no output length is stored.
*/
-char *curl_easy_unescape(CURL *handle, const char *string, int length,
- int *olen)
+char *curl_easy_unescape(struct Curl_easy *data, const char *string,
+ int length, int *olen)
{
char *str = NULL;
size_t inputlen = length;
size_t outputlen;
- CURLcode res = Curl_urldecode(handle, string, inputlen, &str, &outputlen,
+ CURLcode res = Curl_urldecode(data, string, inputlen, &str, &outputlen,
FALSE);
if(res)
return NULL;
diff --git a/lib/escape.h b/lib/escape.h
index a6e2967b..638666f0 100644
--- a/lib/escape.h
+++ b/lib/escape.h
@@ -24,7 +24,7 @@
/* Escape and unescape URL encoding in strings. The functions return a new
* allocated string or NULL if an error occurred. */
-CURLcode Curl_urldecode(struct SessionHandle *data,
+CURLcode Curl_urldecode(struct Curl_easy *data,
const char *string, size_t length,
char **ostring, size_t *olen,
bool reject_crlf);
diff --git a/lib/file.c b/lib/file.c
index 1eeb84d5..b534ec18 100644
--- a/lib/file.c
+++ b/lib/file.c
@@ -135,7 +135,7 @@ static CURLcode file_range(struct connectdata *conn)
curl_off_t totalsize=-1;
char *ptr;
char *ptr2;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
if(data->state.use_range && data->state.range) {
from=curlx_strtoofft(data->state.range, &ptr, 0);
@@ -185,7 +185,7 @@ static CURLcode file_range(struct connectdata *conn)
*/
static CURLcode file_connect(struct connectdata *conn, bool *done)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
char *real_path;
struct FILEPROTO *file = data->req.protop;
int fd;
@@ -227,15 +227,19 @@ static CURLcode file_connect(struct connectdata *conn, bool *done)
for(i=0; i < real_path_len; ++i)
if(actual_path[i] == '/')
actual_path[i] = '\\';
- else if(!actual_path[i]) /* binary zero */
+ else if(!actual_path[i]) { /* binary zero */
+ Curl_safefree(real_path);
return CURLE_URL_MALFORMAT;
+ }
fd = open_readonly(actual_path, O_RDONLY|O_BINARY);
file->path = actual_path;
#else
- if(memchr(real_path, 0, real_path_len))
+ if(memchr(real_path, 0, real_path_len)) {
/* binary zeroes indicate foul play */
+ Curl_safefree(real_path);
return CURLE_URL_MALFORMAT;
+ }
fd = open_readonly(real_path, O_RDONLY);
file->path = real_path;
@@ -301,7 +305,7 @@ static CURLcode file_upload(struct connectdata *conn)
int fd;
int mode;
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
char *buf = data->state.buffer;
size_t nread;
size_t nwrite;
@@ -428,7 +432,7 @@ static CURLcode file_do(struct connectdata *conn, bool *done)
bool size_known;
bool fstated=FALSE;
ssize_t nread;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
char *buf = data->state.buffer;
curl_off_t bytecount = 0;
int fd;
diff --git a/lib/formdata.c b/lib/formdata.c
index a71f099c..673759de 100644
--- a/lib/formdata.c
+++ b/lib/formdata.c
@@ -30,7 +30,7 @@
#include <libgen.h>
#endif
-#include "urldata.h" /* for struct SessionHandle */
+#include "urldata.h" /* for struct Curl_easy */
#include "formdata.h"
#include "vtls/vtls.h"
#include "strequal.h"
@@ -47,7 +47,7 @@ static char *Curl_basename(char *path);
#endif
static size_t readfromfile(struct Form *form, char *buffer, size_t size);
-static char *formboundary(struct SessionHandle *data);
+static char *formboundary(struct Curl_easy *data);
/* What kind of Content-Type to use on un-specified files with unrecognized
extensions. */
@@ -1136,7 +1136,7 @@ static CURLcode formdata_add_filename(const struct curl_httppost *file,
* a NULL pointer in the 'data' argument.
*/
-CURLcode Curl_getformdata(struct SessionHandle *data,
+CURLcode Curl_getformdata(struct Curl_easy *data,
struct FormData **finalform,
struct curl_httppost *post,
const char *custom_content_type,
@@ -1549,7 +1549,7 @@ char *Curl_formpostheader(void *formp, size_t *len)
* formboundary() creates a suitable boundary string and returns an allocated
* one.
*/
-static char *formboundary(struct SessionHandle *data)
+static char *formboundary(struct Curl_easy *data)
{
/* 24 dashes and 16 hexadecimal digits makes 64 bit (18446744073709551615)
combinations */
diff --git a/lib/formdata.h b/lib/formdata.h
index a5ebc1d4..6eb7c6c9 100644
--- a/lib/formdata.h
+++ b/lib/formdata.h
@@ -70,7 +70,7 @@ typedef struct FormInfo {
int Curl_FormInit(struct Form *form, struct FormData *formdata);
-CURLcode Curl_getformdata(struct SessionHandle *data,
+CURLcode Curl_getformdata(struct Curl_easy *data,
struct FormData **,
struct curl_httppost *post,
const char *custom_contenttype,
@@ -93,6 +93,6 @@ char *Curl_FormBoundary(void);
void Curl_formclean(struct FormData **);
-CURLcode Curl_formconvert(struct SessionHandle *, struct FormData *);
+CURLcode Curl_formconvert(struct Curl_easy *, struct FormData *);
#endif /* HEADER_CURL_FORMDATA_H */
diff --git a/lib/ftp.c b/lib/ftp.c
index cfa1bbb8..8af65315 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -327,7 +327,7 @@ static bool isBadFtpString(const char *string)
*/
static CURLcode AcceptServerConnect(struct connectdata *conn)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
curl_socket_t sock = conn->sock[SECONDARYSOCKET];
curl_socket_t s = CURL_SOCKET_BAD;
#ifdef ENABLE_IPV6
@@ -384,7 +384,7 @@ static CURLcode AcceptServerConnect(struct connectdata *conn)
* Curl_pgrsTime(..., TIMER_STARTACCEPT);
*
*/
-static long ftp_timeleft_accept(struct SessionHandle *data)
+static long ftp_timeleft_accept(struct Curl_easy *data)
{
long timeout_ms = DEFAULT_ACCEPT_TIMEOUT;
long other;
@@ -424,7 +424,7 @@ static long ftp_timeleft_accept(struct SessionHandle *data)
*/
static CURLcode ReceivedServerConnect(struct connectdata *conn, bool *received)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
curl_socket_t ctrl_sock = conn->sock[FIRSTSOCKET];
curl_socket_t data_sock = conn->sock[SECONDARYSOCKET];
struct ftp_conn *ftpc = &conn->proto.ftpc;
@@ -495,7 +495,7 @@ static CURLcode ReceivedServerConnect(struct connectdata *conn, bool *received)
*/
static CURLcode InitiateTransfer(struct connectdata *conn)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct FTP *ftp = data->req.protop;
CURLcode result = CURLE_OK;
@@ -546,7 +546,7 @@ static CURLcode InitiateTransfer(struct connectdata *conn)
*/
static CURLcode AllowServerConnect(struct connectdata *conn, bool *connected)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
long timeout_ms;
CURLcode result = CURLE_OK;
@@ -617,7 +617,7 @@ static CURLcode ftp_readresp(curl_socket_t sockfd,
size_t *size) /* size of the response */
{
struct connectdata *conn = pp->conn;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
#ifdef HAVE_GSSAPI
char * const buf = data->state.buffer;
#endif
@@ -689,7 +689,7 @@ CURLcode Curl_GetFTPResponse(ssize_t *nreadp, /* return number of bytes read */
curl_socket_t sockfd = conn->sock[FIRSTSOCKET];
long timeout; /* timeout in milliseconds */
long interval_ms;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
CURLcode result = CURLE_OK;
struct ftp_conn *ftpc = &conn->proto.ftpc;
struct pingpong *pp = &ftpc->pp;
@@ -980,7 +980,7 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
{
CURLcode result = CURLE_OK;
struct ftp_conn *ftpc = &conn->proto.ftpc;
- struct SessionHandle *data=conn->data;
+ struct Curl_easy *data=conn->data;
curl_socket_t portsock= CURL_SOCKET_BAD;
char myhost[256] = "";
@@ -1403,7 +1403,7 @@ static CURLcode ftp_state_prepare_transfer(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
struct FTP *ftp = conn->data->req.protop;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
if(ftp->transfer != FTPTRANSFER_BODY) {
/* doesn't transfer any data */
@@ -1486,7 +1486,7 @@ static CURLcode ftp_state_size(struct connectdata *conn)
static CURLcode ftp_state_list(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
/* If this output is to be machine-parsed, the NLST command might be better
to use, since the LIST command output is not specified or standard in any
@@ -1575,7 +1575,7 @@ static CURLcode ftp_state_type(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
struct FTP *ftp = conn->data->req.protop;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ftp_conn *ftpc = &conn->proto.ftpc;
/* If we have selected NOBODY and HEADER, it means that we only want file
@@ -1607,7 +1607,7 @@ static CURLcode ftp_state_type(struct connectdata *conn)
static CURLcode ftp_state_mdtm(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ftp_conn *ftpc = &conn->proto.ftpc;
/* Requested time of file or time-depended transfer? */
@@ -1632,7 +1632,7 @@ static CURLcode ftp_state_ul_setup(struct connectdata *conn,
{
CURLcode result = CURLE_OK;
struct FTP *ftp = conn->data->req.protop;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ftp_conn *ftpc = &conn->proto.ftpc;
int seekerr = CURL_SEEKFUNC_OK;
@@ -1728,7 +1728,7 @@ static CURLcode ftp_state_quote(struct connectdata *conn,
ftpstate instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct FTP *ftp = data->req.protop;
struct ftp_conn *ftpc = &conn->proto.ftpc;
bool quote=FALSE;
@@ -1859,7 +1859,7 @@ static CURLcode proxy_magic(struct connectdata *conn,
bool *magicdone)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
#if defined(CURL_DISABLE_PROXY)
(void) newhost;
@@ -1950,7 +1950,7 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
{
struct ftp_conn *ftpc = &conn->proto.ftpc;
CURLcode result;
- struct SessionHandle *data=conn->data;
+ struct Curl_easy *data=conn->data;
struct Curl_dns_entry *addr=NULL;
int rc;
unsigned short connectport; /* the local port connect() should use! */
@@ -2125,7 +2125,7 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
static CURLcode ftp_state_port_resp(struct connectdata *conn,
int ftpcode)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ftp_conn *ftpc = &conn->proto.ftpc;
ftpport fcmd = (ftpport)ftpc->count1;
CURLcode result = CURLE_OK;
@@ -2162,7 +2162,7 @@ static CURLcode ftp_state_mdtm_resp(struct connectdata *conn,
int ftpcode)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data=conn->data;
+ struct Curl_easy *data=conn->data;
struct FTP *ftp = data->req.protop;
struct ftp_conn *ftpc = &conn->proto.ftpc;
@@ -2267,7 +2267,7 @@ static CURLcode ftp_state_type_resp(struct connectdata *conn,
ftpstate instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data=conn->data;
+ struct Curl_easy *data=conn->data;
if(ftpcode/100 != 2) {
/* "sasserftpd" and "(u)r(x)bot ftpd" both responds with 226 after a
@@ -2296,7 +2296,7 @@ static CURLcode ftp_state_retr(struct connectdata *conn,
curl_off_t filesize)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data=conn->data;
+ struct Curl_easy *data=conn->data;
struct FTP *ftp = data->req.protop;
struct ftp_conn *ftpc = &conn->proto.ftpc;
@@ -2379,7 +2379,7 @@ static CURLcode ftp_state_size_resp(struct connectdata *conn,
ftpstate instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data=conn->data;
+ struct Curl_easy *data=conn->data;
curl_off_t filesize;
char *buf = data->state.buffer;
@@ -2451,7 +2451,7 @@ static CURLcode ftp_state_stor_resp(struct connectdata *conn,
int ftpcode, ftpstate instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
if(ftpcode>=400) {
failf(data, "Failed FTP upload: %0d", ftpcode);
@@ -2490,7 +2490,7 @@ static CURLcode ftp_state_get_resp(struct connectdata *conn,
ftpstate instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct FTP *ftp = data->req.protop;
char *buf = data->state.buffer;
@@ -2647,7 +2647,7 @@ static CURLcode ftp_state_user_resp(struct connectdata *conn,
ftpstate instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct FTP *ftp = data->req.protop;
struct ftp_conn *ftpc = &conn->proto.ftpc;
(void)instate; /* no use for this yet */
@@ -2702,7 +2702,7 @@ static CURLcode ftp_state_acct_resp(struct connectdata *conn,
int ftpcode)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
if(ftpcode != 230) {
failf(data, "ACCT rejected by server: %03d", ftpcode);
result = CURLE_FTP_WEIRD_PASS_REPLY; /* FIX */
@@ -2718,7 +2718,7 @@ static CURLcode ftp_statemach_act(struct connectdata *conn)
{
CURLcode result;
curl_socket_t sock = conn->sock[FIRSTSOCKET];
- struct SessionHandle *data=conn->data;
+ struct Curl_easy *data=conn->data;
int ftpcode;
struct ftp_conn *ftpc = &conn->proto.ftpc;
struct pingpong *pp = &ftpc->pp;
@@ -3243,7 +3243,7 @@ static CURLcode ftp_connect(struct connectdata *conn,
static CURLcode ftp_done(struct connectdata *conn, CURLcode status,
bool premature)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct FTP *ftp = data->req.protop;
struct ftp_conn *ftpc = &conn->proto.ftpc;
struct pingpong *pp = &ftpc->pp;
@@ -3587,7 +3587,7 @@ static CURLcode ftp_range(struct connectdata *conn)
curl_off_t from, to;
char *ptr;
char *ptr2;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ftp_conn *ftpc = &conn->proto.ftpc;
if(data->state.use_range && data->state.range) {
@@ -3645,7 +3645,7 @@ static CURLcode ftp_range(struct connectdata *conn)
static CURLcode ftp_do_more(struct connectdata *conn, int *completep)
{
- struct SessionHandle *data=conn->data;
+ struct Curl_easy *data=conn->data;
struct ftp_conn *ftpc = &conn->proto.ftpc;
CURLcode result = CURLE_OK;
bool connected = FALSE;
@@ -4209,7 +4209,7 @@ static CURLcode ftp_disconnect(struct connectdata *conn, bool dead_connection)
(void)ftp_quit(conn); /* ignore errors on the QUIT */
if(ftpc->entrypath) {
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
if(data->state.most_recent_ftp_entrypath == ftpc->entrypath) {
data->state.most_recent_ftp_entrypath = NULL;
}
@@ -4242,7 +4242,7 @@ static CURLcode ftp_disconnect(struct connectdata *conn, bool dead_connection)
static
CURLcode ftp_parse_url_path(struct connectdata *conn)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
/* the ftp struct is already inited in ftp_connect() */
struct FTP *ftp = data->req.protop;
struct ftp_conn *ftpc = &conn->proto.ftpc;
@@ -4494,7 +4494,7 @@ CURLcode ftp_regular_transfer(struct connectdata *conn,
{
CURLcode result=CURLE_OK;
bool connected=FALSE;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ftp_conn *ftpc = &conn->proto.ftpc;
data->req.size = -1; /* make sure this is unknown at this point */
@@ -4528,7 +4528,7 @@ CURLcode ftp_regular_transfer(struct connectdata *conn,
static CURLcode ftp_setup_connection(struct connectdata *conn)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
char *type;
char command;
struct FTP *ftp;
diff --git a/lib/ftp.h b/lib/ftp.h
index 7495e3e0..2ed5b434 100644
--- a/lib/ftp.h
+++ b/lib/ftp.h
@@ -97,9 +97,9 @@ typedef enum {
file */
} curl_ftpfile;
-/* This FTP struct is used in the SessionHandle. All FTP data that is
+/* This FTP struct is used in the Curl_easy. All FTP data that is
connection-oriented must be in FTP_conn to properly deal with the fact that
- perhaps the SessionHandle is changed between the times the connection is
+ perhaps the Curl_easy is changed between the times the connection is
used. */
struct FTP {
curl_off_t *bytecountp;
diff --git a/lib/getinfo.c b/lib/getinfo.c
index d4b01bf2..262cd934 100644
--- a/lib/getinfo.c
+++ b/lib/getinfo.c
@@ -39,7 +39,7 @@
* This is supposed to be called in the beginning of a perform() session
* and should reset all session-info variables
*/
-CURLcode Curl_initinfo(struct SessionHandle *data)
+CURLcode Curl_initinfo(struct Curl_easy *data)
{
struct Progress *pro = &data->progress;
struct PureInfo *info = &data->info;
@@ -73,7 +73,7 @@ CURLcode Curl_initinfo(struct SessionHandle *data)
return CURLE_OK;
}
-static CURLcode getinfo_char(struct SessionHandle *data, CURLINFO info,
+static CURLcode getinfo_char(struct Curl_easy *data, CURLINFO info,
char **param_charp)
{
switch(info) {
@@ -119,7 +119,7 @@ static CURLcode getinfo_char(struct SessionHandle *data, CURLINFO info,
return CURLE_OK;
}
-static CURLcode getinfo_long(struct SessionHandle *data, CURLINFO info,
+static CURLcode getinfo_long(struct Curl_easy *data, CURLINFO info,
long *param_longp)
{
curl_socket_t sockfd;
@@ -198,6 +198,22 @@ static CURLcode getinfo_long(struct SessionHandle *data, CURLINFO info,
case CURLINFO_RTSP_CSEQ_RECV:
*param_longp = data->state.rtsp_CSeq_recv;
break;
+ case CURLINFO_HTTP_VERSION:
+ switch (data->info.httpversion) {
+ case 10:
+ *param_longp = CURL_HTTP_VERSION_1_0;
+ break;
+ case 11:
+ *param_longp = CURL_HTTP_VERSION_1_1;
+ break;
+ case 20:
+ *param_longp = CURL_HTTP_VERSION_2_0;
+ break;
+ default:
+ *param_longp = CURL_HTTP_VERSION_NONE;
+ break;
+ }
+ break;
default:
return CURLE_UNKNOWN_OPTION;
@@ -206,7 +222,7 @@ static CURLcode getinfo_long(struct SessionHandle *data, CURLINFO info,
return CURLE_OK;
}
-static CURLcode getinfo_double(struct SessionHandle *data, CURLINFO info,
+static CURLcode getinfo_double(struct Curl_easy *data, CURLINFO info,
double *param_doublep)
{
switch(info) {
@@ -259,7 +275,7 @@ static CURLcode getinfo_double(struct SessionHandle *data, CURLINFO info,
return CURLE_OK;
}
-static CURLcode getinfo_slist(struct SessionHandle *data, CURLINFO info,
+static CURLcode getinfo_slist(struct Curl_easy *data, CURLINFO info,
struct curl_slist **param_slistp)
{
union {
@@ -335,7 +351,7 @@ static CURLcode getinfo_slist(struct SessionHandle *data, CURLINFO info,
return CURLE_OK;
}
-static CURLcode getinfo_socket(struct SessionHandle *data, CURLINFO info,
+static CURLcode getinfo_socket(struct Curl_easy *data, CURLINFO info,
curl_socket_t *param_socketp)
{
switch(info) {
@@ -349,7 +365,7 @@ static CURLcode getinfo_socket(struct SessionHandle *data, CURLINFO info,
return CURLE_OK;
}
-CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...)
+CURLcode Curl_getinfo(struct Curl_easy *data, CURLINFO info, ...)
{
va_list arg;
long *param_longp = NULL;
diff --git a/lib/getinfo.h b/lib/getinfo.h
index 4c2c1684..aecf717f 100644
--- a/lib/getinfo.h
+++ b/lib/getinfo.h
@@ -21,7 +21,7 @@
* KIND, either express or implied.
*
***************************************************************************/
-CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...);
-CURLcode Curl_initinfo(struct SessionHandle *data);
+CURLcode Curl_getinfo(struct Curl_easy *data, CURLINFO info, ...);
+CURLcode Curl_initinfo(struct Curl_easy *data);
#endif /* HEADER_CURL_GETINFO_H */
diff --git a/lib/gopher.c b/lib/gopher.c
index 19f2f5a8..f1efb604 100644
--- a/lib/gopher.c
+++ b/lib/gopher.c
@@ -75,7 +75,7 @@ const struct Curl_handler Curl_handler_gopher = {
static CURLcode gopher_do(struct connectdata *conn, bool *done)
{
CURLcode result=CURLE_OK;
- struct SessionHandle *data=conn->data;
+ struct Curl_easy *data=conn->data;
curl_socket_t sockfd = conn->sock[FIRSTSOCKET];
curl_off_t *bytecount = &data->req.bytecount;
diff --git a/lib/hostasyn.c b/lib/hostasyn.c
index c96734a5..28bdf7a4 100644
--- a/lib/hostasyn.c
+++ b/lib/hostasyn.c
@@ -77,7 +77,7 @@ CURLcode Curl_addrinfo_callback(struct connectdata *conn,
if(CURL_ASYNC_SUCCESS == status) {
if(ai) {
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
if(data->share)
Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE);
diff --git a/lib/hostip.c b/lib/hostip.c
index ead78de7..f2d98416 100644
--- a/lib/hostip.c
+++ b/lib/hostip.c
@@ -254,7 +254,7 @@ hostcache_prune(struct curl_hash *hostcache, long cache_timeout, time_t now)
* Library-wide function for pruning the DNS cache. This function takes and
* returns the appropriate locks.
*/
-void Curl_hostcache_prune(struct SessionHandle *data)
+void Curl_hostcache_prune(struct Curl_easy *data)
{
time_t now;
@@ -293,7 +293,7 @@ fetch_addr(struct connectdata *conn,
char *entry_id = NULL;
struct Curl_dns_entry *dns = NULL;
size_t entry_len;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
/* Create an entry id, based upon the hostname and port */
entry_id = create_hostcache_id(hostname, port);
@@ -345,7 +345,7 @@ Curl_fetch_addr(struct connectdata *conn,
const char *hostname,
int port)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct Curl_dns_entry *dns = NULL;
if(data->share)
@@ -372,7 +372,7 @@ Curl_fetch_addr(struct connectdata *conn,
* Returns the Curl_dns_entry entry pointer or NULL if the storage failed.
*/
struct Curl_dns_entry *
-Curl_cache_addr(struct SessionHandle *data,
+Curl_cache_addr(struct Curl_easy *data,
Curl_addrinfo *addr,
const char *hostname,
int port)
@@ -447,7 +447,7 @@ int Curl_resolv(struct connectdata *conn,
struct Curl_dns_entry **entry)
{
struct Curl_dns_entry *dns = NULL;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
CURLcode result;
int rc = CURLRESOLV_ERROR; /* default to failure */
@@ -582,7 +582,7 @@ int Curl_resolv_timeout(struct connectdata *conn,
#endif /* HAVE_SIGACTION */
volatile long timeout;
volatile unsigned int prev_alarm = 0;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
#endif /* USE_ALARM_TIMEOUT */
int rc;
@@ -716,7 +716,7 @@ clean_up:
*
* May be called with 'data' == NULL for global cache.
*/
-void Curl_resolv_unlock(struct SessionHandle *data, struct Curl_dns_entry *dns)
+void Curl_resolv_unlock(struct Curl_easy *data, struct Curl_dns_entry *dns)
{
if(data && data->share)
Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE);
@@ -758,7 +758,7 @@ int Curl_mk_dnscache(struct curl_hash *hash)
* can be done!
*/
-void Curl_hostcache_clean(struct SessionHandle *data,
+void Curl_hostcache_clean(struct Curl_easy *data,
struct curl_hash *hash)
{
if(data && data->share)
@@ -771,7 +771,7 @@ void Curl_hostcache_clean(struct SessionHandle *data,
}
-CURLcode Curl_loadhostpairs(struct SessionHandle *data)
+CURLcode Curl_loadhostpairs(struct Curl_easy *data)
{
struct curl_slist *hostp;
char hostname[256];
diff --git a/lib/hostip.h b/lib/hostip.h
index 37ccd96e..9098ee39 100644
--- a/lib/hostip.h
+++ b/lib/hostip.h
@@ -50,7 +50,7 @@
struct addrinfo;
struct hostent;
-struct SessionHandle;
+struct Curl_easy;
struct connectdata;
/*
@@ -118,7 +118,7 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
/* unlock a previously resolved dns entry */
-void Curl_resolv_unlock(struct SessionHandle *data,
+void Curl_resolv_unlock(struct Curl_easy *data,
struct Curl_dns_entry *dns);
/* for debugging purposes only: */
@@ -128,7 +128,7 @@ void Curl_scan_cache_used(void *user, void *ptr);
int Curl_mk_dnscache(struct curl_hash *hash);
/* prune old entries from the DNS cache */
-void Curl_hostcache_prune(struct SessionHandle *data);
+void Curl_hostcache_prune(struct Curl_easy *data);
/* Return # of adresses in a Curl_addrinfo struct */
int Curl_num_addresses (const Curl_addrinfo *addr);
@@ -188,7 +188,7 @@ Curl_fetch_addr(struct connectdata *conn,
* Returns the Curl_dns_entry entry pointer or NULL if the storage failed.
*/
struct Curl_dns_entry *
-Curl_cache_addr(struct SessionHandle *data, Curl_addrinfo *addr,
+Curl_cache_addr(struct Curl_easy *data, Curl_addrinfo *addr,
const char *hostname, int port);
#ifndef INADDR_NONE
@@ -209,42 +209,42 @@ extern sigjmp_buf curl_jmpenv;
/*
* Function provided by the resolver backend to set DNS servers to use.
*/
-CURLcode Curl_set_dns_servers(struct SessionHandle *data, char *servers);
+CURLcode Curl_set_dns_servers(struct Curl_easy *data, char *servers);
/*
* Function provided by the resolver backend to set
* outgoing interface to use for DNS requests
*/
-CURLcode Curl_set_dns_interface(struct SessionHandle *data,
+CURLcode Curl_set_dns_interface(struct Curl_easy *data,
const char *interf);
/*
* Function provided by the resolver backend to set
* local IPv4 address to use as source address for DNS requests
*/
-CURLcode Curl_set_dns_local_ip4(struct SessionHandle *data,
+CURLcode Curl_set_dns_local_ip4(struct Curl_easy *data,
const char *local_ip4);
/*
* Function provided by the resolver backend to set
* local IPv6 address to use as source address for DNS requests
*/
-CURLcode Curl_set_dns_local_ip6(struct SessionHandle *data,
+CURLcode Curl_set_dns_local_ip6(struct Curl_easy *data,
const char *local_ip6);
/*
* Clean off entries from the cache
*/
-void Curl_hostcache_clean(struct SessionHandle *data, struct curl_hash *hash);
+void Curl_hostcache_clean(struct Curl_easy *data, struct curl_hash *hash);
/*
* Destroy the hostcache of this handle.
*/
-void Curl_hostcache_destroy(struct SessionHandle *data);
+void Curl_hostcache_destroy(struct Curl_easy *data);
/*
* Populate the cache with specified entries from CURLOPT_RESOLVE.
*/
-CURLcode Curl_loadhostpairs(struct SessionHandle *data);
+CURLcode Curl_loadhostpairs(struct Curl_easy *data);
#endif /* HEADER_CURL_HOSTIP_H */
diff --git a/lib/hostip6.c b/lib/hostip6.c
index 59bc4e4a..4ebfc2dc 100644
--- a/lib/hostip6.c
+++ b/lib/hostip6.c
@@ -167,10 +167,12 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
int error;
char sbuf[12];
char *sbufptr = NULL;
+#ifndef USE_RESOLVE_ON_IPS
char addrbuf[128];
+#endif
int pf;
#if !defined(CURL_DISABLE_VERBOSE_STRINGS)
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
#endif
*waitp = 0; /* synchronous response only */
@@ -196,11 +198,17 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
hints.ai_family = pf;
hints.ai_socktype = conn->socktype;
+#ifndef USE_RESOLVE_ON_IPS
+ /*
+ * The AI_NUMERICHOST must not be set to get synthesized IPv6 address from
+ * an IPv4 address on iOS and Mac OS X.
+ */
if((1 == Curl_inet_pton(AF_INET, hostname, addrbuf)) ||
(1 == Curl_inet_pton(AF_INET6, hostname, addrbuf))) {
/* the given address is numerical only, prevent a reverse lookup */
hints.ai_flags = AI_NUMERICHOST;
}
+#endif
if(port) {
snprintf(sbuf, sizeof(sbuf), "%d", port);
@@ -213,6 +221,10 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
return NULL;
}
+ if(port) {
+ Curl_addrinfo_set_port(res, port);
+ }
+
dump_addrinfo(conn, res);
return res;
diff --git a/lib/hostsyn.c b/lib/hostsyn.c
index db4c82fc..1a95263c 100644
--- a/lib/hostsyn.c
+++ b/lib/hostsyn.c
@@ -59,7 +59,7 @@
/*
* Function provided by the resolver backend to set DNS servers to use.
*/
-CURLcode Curl_set_dns_servers(struct SessionHandle *data,
+CURLcode Curl_set_dns_servers(struct Curl_easy *data,
char *servers)
{
(void)data;
@@ -72,7 +72,7 @@ CURLcode Curl_set_dns_servers(struct SessionHandle *data,
* Function provided by the resolver backend to set
* outgoing interface to use for DNS requests
*/
-CURLcode Curl_set_dns_interface(struct SessionHandle *data,
+CURLcode Curl_set_dns_interface(struct Curl_easy *data,
const char *interf)
{
(void)data;
@@ -84,7 +84,7 @@ CURLcode Curl_set_dns_interface(struct SessionHandle *data,
* Function provided by the resolver backend to set
* local IPv4 address to use as source address for DNS requests
*/
-CURLcode Curl_set_dns_local_ip4(struct SessionHandle *data,
+CURLcode Curl_set_dns_local_ip4(struct Curl_easy *data,
const char *local_ip4)
{
(void)data;
@@ -96,7 +96,7 @@ CURLcode Curl_set_dns_local_ip4(struct SessionHandle *data,
* Function provided by the resolver backend to set
* local IPv6 address to use as source address for DNS requests
*/
-CURLcode Curl_set_dns_local_ip6(struct SessionHandle *data,
+CURLcode Curl_set_dns_local_ip6(struct Curl_easy *data,
const char *local_ip6)
{
(void)data;
diff --git a/lib/http.c b/lib/http.c
index 6a76b88e..378d8f77 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -151,7 +151,7 @@ const struct Curl_handler Curl_handler_https = {
CURLcode Curl_http_setup_conn(struct connectdata *conn)
{
- /* allocate the HTTP-specific struct for the SessionHandle, only to survive
+ /* allocate the HTTP-specific struct for the Curl_easy, only to survive
during this request */
struct HTTP *http;
DEBUGASSERT(conn->data->req.protop == NULL);
@@ -179,7 +179,7 @@ char *Curl_checkheaders(const struct connectdata *conn,
{
struct curl_slist *head;
size_t thislen = strlen(thisheader);
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
for(head = data->set.headers;head; head=head->next) {
if(Curl_raw_nequal(head->data, thisheader, thislen))
@@ -194,7 +194,7 @@ char *Curl_checkheaders(const struct connectdata *conn,
* if proxy headers are not available, then it will lookup into http header
* link list
*
- * It takes a connectdata struct as input instead of the SessionHandle simply
+ * It takes a connectdata struct as input instead of the Curl_easy simply
* to know if this is a proxy request or not, as it then might check a
* different header list.
*/
@@ -203,7 +203,7 @@ char *Curl_checkProxyheaders(const struct connectdata *conn,
{
struct curl_slist *head;
size_t thislen = strlen(thisheader);
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
for(head = (conn->bits.proxy && data->set.sep_headers) ?
data->set.proxyheaders : data->set.headers;
@@ -280,7 +280,7 @@ static CURLcode http_output_basic(struct connectdata *conn, bool proxy)
{
size_t size = 0;
char *authorization = NULL;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
char **userp;
const char *user;
const char *pwd;
@@ -377,7 +377,7 @@ static bool pickoneauth(struct auth *pick)
*/
static CURLcode http_perhapsrewind(struct connectdata *conn)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct HTTP *http = data->req.protop;
curl_off_t bytessent;
curl_off_t expectsend = -1; /* default is unknown */
@@ -485,7 +485,7 @@ static CURLcode http_perhapsrewind(struct connectdata *conn)
CURLcode Curl_http_auth_act(struct connectdata *conn)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
bool pickhost = FALSE;
bool pickproxy = FALSE;
CURLcode result = CURLE_OK;
@@ -567,7 +567,7 @@ output_auth_headers(struct connectdata *conn,
const char *auth = NULL;
CURLcode result = CURLE_OK;
#if !defined(CURL_DISABLE_VERBOSE_STRINGS) || defined(USE_SPNEGO)
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
#endif
#ifdef USE_SPNEGO
struct negotiatedata *negdata = proxy ?
@@ -674,7 +674,7 @@ Curl_http_output_auth(struct connectdata *conn,
up the proxy tunnel */
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct auth *authhost;
struct auth *authproxy;
@@ -747,7 +747,7 @@ CURLcode Curl_http_input_auth(struct connectdata *conn, bool proxy,
/*
* This resource requires authentication
*/
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
#ifdef USE_SPNEGO
struct negotiatedata *negdata = proxy?
@@ -907,7 +907,7 @@ CURLcode Curl_http_input_auth(struct connectdata *conn, bool proxy,
*/
static int http_should_fail(struct connectdata *conn)
{
- struct SessionHandle *data;
+ struct Curl_easy *data;
int httpcode;
DEBUGASSERT(conn);
@@ -1441,7 +1441,7 @@ static int https_getsock(struct connectdata *conn,
CURLcode Curl_http_done(struct connectdata *conn,
CURLcode status, bool premature)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct HTTP *http = data->req.protop;
#ifdef USE_NGHTTP2
struct http_conn *httpc = &conn->proto.httpc;
@@ -1539,7 +1539,7 @@ CURLcode Curl_http_done(struct connectdata *conn,
* - if any server previously contacted to handle this request only supports
* 1.0.
*/
-static bool use_http_1_1plus(const struct SessionHandle *data,
+static bool use_http_1_1plus(const struct Curl_easy *data,
const struct connectdata *conn)
{
if((data->state.httpversion == 10) || (conn->httpversion == 10))
@@ -1552,7 +1552,7 @@ static bool use_http_1_1plus(const struct SessionHandle *data,
}
/* check and possibly add an Expect: header */
-static CURLcode expect100(struct SessionHandle *data,
+static CURLcode expect100(struct Curl_easy *data,
struct connectdata *conn,
Curl_send_buffer *req_buffer)
{
@@ -1595,7 +1595,7 @@ CURLcode Curl_add_custom_headers(struct connectdata *conn,
struct curl_slist *h[2];
struct curl_slist *headers;
int numlists=1; /* by default */
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
int i;
enum proxy_use proxy;
@@ -1700,7 +1700,7 @@ CURLcode Curl_add_custom_headers(struct connectdata *conn,
return CURLE_OK;
}
-CURLcode Curl_add_timecondition(struct SessionHandle *data,
+CURLcode Curl_add_timecondition(struct Curl_easy *data,
Curl_send_buffer *req_buffer)
{
const struct tm *tm;
@@ -1758,13 +1758,13 @@ CURLcode Curl_add_timecondition(struct SessionHandle *data,
}
/*
- * Curl_http() gets called from the generic Curl_do() function when a HTTP
+ * Curl_http() gets called from the generic multi_do() function when a HTTP
* request is to be performed. This creates and sends a properly constructed
* HTTP request.
*/
CURLcode Curl_http(struct connectdata *conn, bool *done)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
CURLcode result = CURLE_OK;
struct HTTP *http;
const char *ppath = data->state.path;
@@ -2777,7 +2777,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
* Returns TRUE if member of the list matches prefix of string
*/
static bool
-checkhttpprefix(struct SessionHandle *data,
+checkhttpprefix(struct Curl_easy *data,
const char *s)
{
struct curl_slist *head = data->set.http200aliases;
@@ -2816,7 +2816,7 @@ checkhttpprefix(struct SessionHandle *data,
#ifndef CURL_DISABLE_RTSP
static bool
-checkrtspprefix(struct SessionHandle *data,
+checkrtspprefix(struct Curl_easy *data,
const char *s)
{
@@ -2844,7 +2844,7 @@ checkrtspprefix(struct SessionHandle *data,
#endif /* CURL_DISABLE_RTSP */
static bool
-checkprotoprefix(struct SessionHandle *data, struct connectdata *conn,
+checkprotoprefix(struct Curl_easy *data, struct connectdata *conn,
const char *s)
{
#ifndef CURL_DISABLE_RTSP
@@ -2862,7 +2862,7 @@ checkprotoprefix(struct SessionHandle *data, struct connectdata *conn,
* header. We make sure that the full string fit in the allocated header
* buffer, or else we enlarge it.
*/
-static CURLcode header_append(struct SessionHandle *data,
+static CURLcode header_append(struct Curl_easy *data,
struct SingleRequest *k,
size_t length)
{
@@ -2900,7 +2900,7 @@ static CURLcode header_append(struct SessionHandle *data,
return CURLE_OK;
}
-static void print_http_error(struct SessionHandle *data)
+static void print_http_error(struct Curl_easy *data)
{
struct SingleRequest *k = &data->req;
char *beg = k->p;
@@ -2940,7 +2940,7 @@ static void print_http_error(struct SessionHandle *data)
/*
* Read any HTTP header lines from the server and pass them to the client app.
*/
-CURLcode Curl_http_readwrite_headers(struct SessionHandle *data,
+CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
struct connectdata *conn,
ssize_t *nread,
bool *stop_reading)
@@ -3054,7 +3054,7 @@ CURLcode Curl_http_readwrite_headers(struct SessionHandle *data,
switch(k->httpcode) {
case 100:
/* if we did wait for this do enable write now! */
- if(k->exp100) {
+ if(k->exp100 > EXP100_SEND_DATA) {
k->exp100 = EXP100_SEND_DATA;
k->keepon |= KEEP_SEND;
}
@@ -3138,52 +3138,50 @@ CURLcode Curl_http_readwrite_headers(struct SessionHandle *data,
data->req.deductheadercount =
(100 <= k->httpcode && 199 >= k->httpcode)?data->req.headerbytecount:0;
- if(!*stop_reading) {
- /* Curl_http_auth_act() checks what authentication methods
- * that are available and decides which one (if any) to
- * use. It will set 'newurl' if an auth method was picked. */
- result = Curl_http_auth_act(conn);
+ /* Curl_http_auth_act() checks what authentication methods
+ * that are available and decides which one (if any) to
+ * use. It will set 'newurl' if an auth method was picked. */
+ result = Curl_http_auth_act(conn);
- if(result)
- return result;
+ if(result)
+ return result;
- if(k->httpcode >= 300) {
- if((!conn->bits.authneg) && !conn->bits.close &&
- !conn->bits.rewindaftersend) {
- /*
- * General treatment of errors when about to send data. Including :
- * "417 Expectation Failed", while waiting for 100-continue.
- *
- * The check for close above is done simply because of something
- * else has already deemed the connection to get closed then
- * something else should've considered the big picture and we
- * avoid this check.
- *
- * rewindaftersend indicates that something has told libcurl to
- * continue sending even if it gets discarded
+ if(k->httpcode >= 300) {
+ if((!conn->bits.authneg) && !conn->bits.close &&
+ !conn->bits.rewindaftersend) {
+ /*
+ * General treatment of errors when about to send data. Including :
+ * "417 Expectation Failed", while waiting for 100-continue.
+ *
+ * The check for close above is done simply because of something
+ * else has already deemed the connection to get closed then
+ * something else should've considered the big picture and we
+ * avoid this check.
+ *
+ * rewindaftersend indicates that something has told libcurl to
+ * continue sending even if it gets discarded
+ */
+
+ switch(data->set.httpreq) {
+ case HTTPREQ_PUT:
+ case HTTPREQ_POST:
+ case HTTPREQ_POST_FORM:
+ /* We got an error response. If this happened before the whole
+ * request body has been sent we stop sending and mark the
+ * connection for closure after we've read the entire response.
*/
-
- switch(data->set.httpreq) {
- case HTTPREQ_PUT:
- case HTTPREQ_POST:
- case HTTPREQ_POST_FORM:
- /* We got an error response. If this happened before the whole
- * request body has been sent we stop sending and mark the
- * connection for closure after we've read the entire response.
- */
- if(!k->upload_done) {
- infof(data, "HTTP error before end of send, stop sending\n");
- connclose(conn, "Stop sending data before everything sent");
- k->upload_done = TRUE;
- k->keepon &= ~KEEP_SEND; /* don't send */
- if(data->state.expect100header)
- k->exp100 = EXP100_FAILED;
- }
- break;
-
- default: /* default label present to avoid compiler warnings */
- break;
+ if(!k->upload_done) {
+ infof(data, "HTTP error before end of send, stop sending\n");
+ connclose(conn, "Stop sending data before everything sent");
+ k->upload_done = TRUE;
+ k->keepon &= ~KEEP_SEND; /* don't send */
+ if(data->state.expect100header)
+ k->exp100 = EXP100_FAILED;
}
+ break;
+
+ default: /* default label present to avoid compiler warnings */
+ break;
}
}
@@ -3210,7 +3208,7 @@ CURLcode Curl_http_readwrite_headers(struct SessionHandle *data,
(k->size <= -1))
/* Respect section 4.4 of rfc2326: If the Content-Length header is
absent, a length 0 must be assumed. It will prevent libcurl from
- hanging on DECRIBE request that got refused for whatever
+ hanging on DESCRIBE request that got refused for whatever
reason */
*stop_reading = TRUE;
#endif
@@ -3308,6 +3306,13 @@ CURLcode Curl_http_readwrite_headers(struct SessionHandle *data,
&httpversion_major,
&conn->httpversion,
&k->httpcode);
+
+ if(nc == 1 && httpversion_major == 2 &&
+ 1 == sscanf(HEADER1, " HTTP/2 %d", &k->httpcode)) {
+ conn->httpversion = 0;
+ nc = 3;
+ }
+
if(nc==3) {
conn->httpversion += 10 * httpversion_major;
@@ -3754,7 +3759,7 @@ CURLcode Curl_http_readwrite_headers(struct SessionHandle *data,
k->hbufp = data->state.headerbuff;
k->hbuflen = 0;
}
- while(!*stop_reading && *k->str); /* header line within buffer */
+ while(*k->str); /* header line within buffer */
/* We might have reached the end of the header part here, but
there might be a non-header part left in the end of the read
diff --git a/lib/http.h b/lib/http.h
index 981472e0..65290055 100644
--- a/lib/http.h
+++ b/lib/http.h
@@ -69,7 +69,7 @@ CURLcode Curl_add_buffer_send(Curl_send_buffer *in,
size_t included_body_bytes,
int socketindex);
-CURLcode Curl_add_timecondition(struct SessionHandle *data,
+CURLcode Curl_add_timecondition(struct Curl_easy *data,
Curl_send_buffer *buf);
CURLcode Curl_add_custom_headers(struct connectdata *conn,
bool is_connect,
@@ -87,7 +87,7 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn, char *datap,
ssize_t length, ssize_t *wrote);
/* These functions are in http.c */
-void Curl_http_auth_stage(struct SessionHandle *data, int stage);
+void Curl_http_auth_stage(struct Curl_easy *data, int stage);
CURLcode Curl_http_input_auth(struct connectdata *conn, bool proxy,
const char *auth);
CURLcode Curl_http_auth_act(struct connectdata *conn);
@@ -216,14 +216,14 @@ struct http_conn {
nghttp2_session_mem_recv */
size_t drain_total; /* sum of all stream's UrlState.drain */
- /* this is a hash of all individual streams (SessionHandle structs) */
+ /* this is a hash of all individual streams (Curl_easy structs) */
struct h2settings settings;
#else
int unused; /* prevent a compiler warning */
#endif
};
-CURLcode Curl_http_readwrite_headers(struct SessionHandle *data,
+CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
struct connectdata *conn,
ssize_t *nread,
bool *stop_reading);
diff --git a/lib/http2.c b/lib/http2.c
index 3fe02a57..efc082dd 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -139,7 +139,7 @@ static CURLcode http2_disconnect(struct connectdata *conn,
}
/* called from Curl_http_setup_conn */
-void Curl_http2_setup_req(struct SessionHandle *data)
+void Curl_http2_setup_req(struct Curl_easy *data)
{
struct HTTP *http = data->req.protop;
@@ -284,7 +284,7 @@ static ssize_t send_callback(nghttp2_session *h2,
/* We pass a pointer to this struct in the push callback, but the contents of
the struct are hidden from the user. */
struct curl_pushheaders {
- struct SessionHandle *data;
+ struct Curl_easy *data;
const nghttp2_push_promise *frame;
};
@@ -335,9 +335,9 @@ char *curl_pushheader_byname(struct curl_pushheaders *h, const char *header)
return NULL;
}
-static CURL *duphandle(struct SessionHandle *data)
+static struct Curl_easy *duphandle(struct Curl_easy *data)
{
- struct SessionHandle *second = curl_easy_duphandle(data);
+ struct Curl_easy *second = curl_easy_duphandle(data);
if(second) {
/* setup the request struct */
struct HTTP *http = calloc(1, sizeof(struct HTTP));
@@ -363,7 +363,7 @@ static CURL *duphandle(struct SessionHandle *data)
}
-static int push_promise(struct SessionHandle *data,
+static int push_promise(struct Curl_easy *data,
struct connectdata *conn,
const nghttp2_push_promise *frame)
{
@@ -378,7 +378,7 @@ static int push_promise(struct SessionHandle *data,
struct http_conn *httpc;
size_t i;
/* clone the parent */
- struct SessionHandle *newhandle = duphandle(data);
+ struct Curl_easy *newhandle = duphandle(data);
if(!newhandle) {
infof(data, "failed to duplicate handle\n");
rv = 1; /* FAIL HARD */
@@ -445,7 +445,7 @@ static int on_frame_recv(nghttp2_session *session, const nghttp2_frame *frame,
{
struct connectdata *conn = (struct connectdata *)userp;
struct http_conn *httpc = &conn->proto.httpc;
- struct SessionHandle *data_s = NULL;
+ struct Curl_easy *data_s = NULL;
struct HTTP *stream = NULL;
static int lastStream = -1;
int rv;
@@ -482,7 +482,7 @@ static int on_frame_recv(nghttp2_session *session, const nghttp2_frame *frame,
}
if(!data_s) {
DEBUGF(infof(conn->data,
- "No SessionHandle associated with stream: %x\n",
+ "No Curl_easy associated with stream: %x\n",
stream_id));
return 0;
}
@@ -573,7 +573,7 @@ static int on_invalid_frame_recv(nghttp2_session *session,
const nghttp2_frame *frame,
int lib_error_code, void *userp)
{
- struct SessionHandle *data_s = NULL;
+ struct Curl_easy *data_s = NULL;
(void)userp;
data_s = nghttp2_session_get_stream_user_data(session, frame->hd.stream_id);
@@ -590,7 +590,7 @@ static int on_data_chunk_recv(nghttp2_session *session, uint8_t flags,
const uint8_t *data, size_t len, void *userp)
{
struct HTTP *stream;
- struct SessionHandle *data_s;
+ struct Curl_easy *data_s;
size_t nread;
struct connectdata *conn = (struct connectdata *)userp;
(void)session;
@@ -656,7 +656,7 @@ static int before_frame_send(nghttp2_session *session,
const nghttp2_frame *frame,
void *userp)
{
- struct SessionHandle *data_s;
+ struct Curl_easy *data_s;
(void)userp;
data_s = nghttp2_session_get_stream_user_data(session, frame->hd.stream_id);
@@ -670,7 +670,7 @@ static int on_frame_send(nghttp2_session *session,
const nghttp2_frame *frame,
void *userp)
{
- struct SessionHandle *data_s;
+ struct Curl_easy *data_s;
(void)userp;
data_s = nghttp2_session_get_stream_user_data(session, frame->hd.stream_id);
@@ -684,7 +684,7 @@ static int on_frame_not_send(nghttp2_session *session,
const nghttp2_frame *frame,
int lib_error_code, void *userp)
{
- struct SessionHandle *data_s;
+ struct Curl_easy *data_s;
(void)userp;
data_s = nghttp2_session_get_stream_user_data(session, frame->hd.stream_id);
@@ -698,7 +698,7 @@ static int on_frame_not_send(nghttp2_session *session,
static int on_stream_close(nghttp2_session *session, int32_t stream_id,
uint32_t error_code, void *userp)
{
- struct SessionHandle *data_s;
+ struct Curl_easy *data_s;
struct HTTP *stream;
struct connectdata *conn = (struct connectdata *)userp;
(void)session;
@@ -735,7 +735,7 @@ static int on_begin_headers(nghttp2_session *session,
const nghttp2_frame *frame, void *userp)
{
struct HTTP *stream;
- struct SessionHandle *data_s = NULL;
+ struct Curl_easy *data_s = NULL;
(void)userp;
data_s = nghttp2_session_get_stream_user_data(session, frame->hd.stream_id);
@@ -802,7 +802,7 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame,
void *userp)
{
struct HTTP *stream;
- struct SessionHandle *data_s;
+ struct Curl_easy *data_s;
int32_t stream_id = frame->hd.stream_id;
struct connectdata *conn = (struct connectdata *)userp;
(void)flags;
@@ -914,7 +914,7 @@ static ssize_t data_source_read_callback(nghttp2_session *session,
nghttp2_data_source *source,
void *userp)
{
- struct SessionHandle *data_s;
+ struct Curl_easy *data_s;
struct HTTP *stream = NULL;
size_t nread;
(void)source;
@@ -1096,7 +1096,7 @@ static int should_close_session(struct http_conn *httpc) {
!nghttp2_session_want_write(httpc->h2);
}
-static int h2_session_send(struct SessionHandle *data,
+static int h2_session_send(struct Curl_easy *data,
nghttp2_session *h2);
/*
@@ -1105,7 +1105,7 @@ static int h2_session_send(struct SessionHandle *data,
* This function returns 0 if it succeeds, or -1 and error code will
* be assigned to *err.
*/
-static int h2_process_pending_input(struct SessionHandle *data,
+static int h2_process_pending_input(struct Curl_easy *data,
struct http_conn *httpc,
CURLcode *err) {
ssize_t nread;
@@ -1156,7 +1156,7 @@ static int h2_process_pending_input(struct SessionHandle *data,
}
static ssize_t http2_handle_stream_close(struct connectdata *conn,
- struct SessionHandle *data,
+ struct Curl_easy *data,
struct HTTP *stream, CURLcode *err) {
char *trailer_pos, *trailer_end;
CURLcode result;
@@ -1226,7 +1226,7 @@ static ssize_t http2_handle_stream_close(struct connectdata *conn,
* struct.
*/
-static void h2_pri_spec(struct SessionHandle *data,
+static void h2_pri_spec(struct Curl_easy *data,
nghttp2_priority_spec *pri_spec)
{
struct HTTP *depstream = (data->set.stream_depends_on?
@@ -1244,7 +1244,7 @@ static void h2_pri_spec(struct SessionHandle *data,
* dependency settings and if so it submits a PRIORITY frame with the updated
* info.
*/
-static int h2_session_send(struct SessionHandle *data,
+static int h2_session_send(struct Curl_easy *data,
nghttp2_session *h2)
{
struct HTTP *stream = data->req.protop;
@@ -1279,7 +1279,7 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex,
ssize_t rv;
ssize_t nread;
struct http_conn *httpc = &conn->proto.httpc;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct HTTP *stream = data->req.protop;
(void)sockindex; /* we always do HTTP2 on sockindex 0 */
@@ -1297,7 +1297,7 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex,
stream->upload_len = 0;
/*
- * At this point 'stream' is just in the SessionHandle the connection
+ * At this point 'stream' is just in the Curl_easy the connection
* identifies as its owner at this time.
*/
@@ -1864,7 +1864,7 @@ CURLcode Curl_http2_switched(struct connectdata *conn,
struct http_conn *httpc = &conn->proto.httpc;
int rv;
ssize_t nproc;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct HTTP *stream = conn->data->req.protop;
result = Curl_http2_setup(conn);
diff --git a/lib/http2.h b/lib/http2.h
index 1aec3040..bedbebf1 100644
--- a/lib/http2.h
+++ b/lib/http2.h
@@ -50,7 +50,7 @@ CURLcode Curl_http2_switched(struct connectdata *conn,
const char *data, size_t nread);
/* called from Curl_http_setup_conn */
void Curl_http2_setup_conn(struct connectdata *conn);
-void Curl_http2_setup_req(struct SessionHandle *data);
+void Curl_http2_setup_req(struct Curl_easy *data);
#else /* USE_NGHTTP2 */
#define Curl_http2_init(x) CURLE_UNSUPPORTED_PROTOCOL
#define Curl_http2_send_request(x) CURLE_UNSUPPORTED_PROTOCOL
diff --git a/lib/http_chunks.c b/lib/http_chunks.c
index 433f76e1..ea171092 100644
--- a/lib/http_chunks.c
+++ b/lib/http_chunks.c
@@ -108,7 +108,7 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
ssize_t *wrotep)
{
CURLcode result=CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct Curl_chunker *ch = &conn->chunk;
struct SingleRequest *k = &data->req;
size_t piece;
diff --git a/lib/http_digest.c b/lib/http_digest.c
index a1768b86..97230e79 100644
--- a/lib/http_digest.c
+++ b/lib/http_digest.c
@@ -45,7 +45,7 @@ CURLcode Curl_input_digest(struct connectdata *conn,
const char *header) /* rest of the *-authenticate:
header */
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
/* Point to the correct struct with this */
struct digestdata *digest;
@@ -73,7 +73,7 @@ CURLcode Curl_output_digest(struct connectdata *conn,
const unsigned char *uripath)
{
CURLcode result;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
unsigned char *path;
char *tmp;
char *response;
@@ -169,7 +169,7 @@ CURLcode Curl_output_digest(struct connectdata *conn,
return CURLE_OK;
}
-void Curl_digest_cleanup(struct SessionHandle *data)
+void Curl_digest_cleanup(struct Curl_easy *data)
{
Curl_auth_digest_cleanup(&data->state.digest);
Curl_auth_digest_cleanup(&data->state.proxydigest);
diff --git a/lib/http_digest.h b/lib/http_digest.h
index 49aad897..fd225c7c 100644
--- a/lib/http_digest.h
+++ b/lib/http_digest.h
@@ -34,7 +34,7 @@ CURLcode Curl_output_digest(struct connectdata *conn,
const unsigned char *uripath);
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_CRYPTO_AUTH)
-void Curl_digest_cleanup(struct SessionHandle *data);
+void Curl_digest_cleanup(struct Curl_easy *data);
#else
#define Curl_digest_cleanup(x) Curl_nop_stmt
#endif
diff --git a/lib/http_negotiate.c b/lib/http_negotiate.c
index 999bc0c5..c39d6f36 100644
--- a/lib/http_negotiate.c
+++ b/lib/http_negotiate.c
@@ -38,7 +38,7 @@
CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy,
const char *header)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
size_t len;
/* Point to the username, password, service and host */
@@ -124,7 +124,7 @@ CURLcode Curl_output_negotiate(struct connectdata *conn, bool proxy)
return (userp == NULL) ? CURLE_OUT_OF_MEMORY : CURLE_OK;
}
-void Curl_cleanup_negotiate(struct SessionHandle *data)
+void Curl_cleanup_negotiate(struct Curl_easy *data)
{
Curl_auth_spnego_cleanup(&data->state.negotiate);
Curl_auth_spnego_cleanup(&data->state.proxyneg);
diff --git a/lib/http_negotiate.h b/lib/http_negotiate.h
index 21b7f883..c64e5482 100644
--- a/lib/http_negotiate.h
+++ b/lib/http_negotiate.h
@@ -31,7 +31,7 @@ CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy,
/* this is for creating Negotiate header output */
CURLcode Curl_output_negotiate(struct connectdata *conn, bool proxy);
-void Curl_cleanup_negotiate(struct SessionHandle *data);
+void Curl_cleanup_negotiate(struct Curl_easy *data);
#endif /* USE_SPNEGO */
diff --git a/lib/http_proxy.c b/lib/http_proxy.c
index 814c572f..c6b05e30 100644
--- a/lib/http_proxy.c
+++ b/lib/http_proxy.c
@@ -107,7 +107,7 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn,
bool blocking)
{
int subversion=0;
- struct SessionHandle *data=conn->data;
+ struct Curl_easy *data=conn->data;
struct SingleRequest *k = &data->req;
CURLcode result;
curl_socket_t tunnelsocket = conn->sock[sockindex];
diff --git a/lib/imap.c b/lib/imap.c
index 16ba402c..123ea3b2 100644
--- a/lib/imap.c
+++ b/lib/imap.c
@@ -648,7 +648,7 @@ static CURLcode imap_perform_authentication(struct connectdata *conn)
static CURLcode imap_perform_list(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct IMAP *imap = data->req.protop;
char *mailbox;
@@ -683,7 +683,7 @@ static CURLcode imap_perform_list(struct connectdata *conn)
static CURLcode imap_perform_select(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct IMAP *imap = data->req.protop;
struct imap_conn *imapc = &conn->proto.imapc;
char *mailbox;
@@ -840,7 +840,7 @@ static CURLcode imap_state_servergreet_resp(struct connectdata *conn,
imapstate instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
(void)instate; /* no use for this yet */
@@ -860,7 +860,7 @@ static CURLcode imap_state_capability_resp(struct connectdata *conn,
imapstate instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct imap_conn *imapc = &conn->proto.imapc;
const char *line = data->state.buffer;
size_t wordlen;
@@ -947,7 +947,7 @@ static CURLcode imap_state_starttls_resp(struct connectdata *conn,
imapstate instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
(void)instate; /* no use for this yet */
@@ -971,7 +971,7 @@ static CURLcode imap_state_auth_resp(struct connectdata *conn,
imapstate instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct imap_conn *imapc = &conn->proto.imapc;
saslprogress progress;
@@ -1005,7 +1005,7 @@ static CURLcode imap_state_login_resp(struct connectdata *conn,
imapstate instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
(void)instate; /* no use for this yet */
@@ -1051,7 +1051,7 @@ static CURLcode imap_state_select_resp(struct connectdata *conn, int imapcode,
imapstate instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct IMAP *imap = conn->data->req.protop;
struct imap_conn *imapc = &conn->proto.imapc;
const char *line = data->state.buffer;
@@ -1098,7 +1098,7 @@ static CURLcode imap_state_fetch_resp(struct connectdata *conn, int imapcode,
imapstate instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct imap_conn *imapc = &conn->proto.imapc;
struct pingpong *pp = &imapc->pp;
const char *ptr = data->state.buffer;
@@ -1211,7 +1211,7 @@ static CURLcode imap_state_append_resp(struct connectdata *conn, int imapcode,
imapstate instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
(void)instate; /* No use for this yet */
@@ -1371,12 +1371,12 @@ static CURLcode imap_block_statemach(struct connectdata *conn)
return result;
}
-/* Allocate and initialize the struct IMAP for the current SessionHandle if
+/* Allocate and initialize the struct IMAP for the current Curl_easy if
required */
static CURLcode imap_init(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct IMAP *imap;
imap = data->req.protop = calloc(sizeof(struct IMAP), 1);
@@ -1456,7 +1456,7 @@ static CURLcode imap_done(struct connectdata *conn, CURLcode status,
bool premature)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct IMAP *imap = data->req.protop;
(void)premature;
@@ -1518,7 +1518,7 @@ static CURLcode imap_perform(struct connectdata *conn, bool *connected,
{
/* This is IMAP and no proxy */
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct IMAP *imap = data->req.protop;
struct imap_conn *imapc = &conn->proto.imapc;
bool selected = FALSE;
@@ -1683,7 +1683,7 @@ static CURLcode imap_regular_transfer(struct connectdata *conn,
{
CURLcode result = CURLE_OK;
bool connected = FALSE;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
/* Make sure size is unknown at this point */
data->req.size = -1;
@@ -1706,7 +1706,7 @@ static CURLcode imap_regular_transfer(struct connectdata *conn,
static CURLcode imap_setup_connection(struct connectdata *conn)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
/* Initialise the IMAP layer */
CURLcode result = imap_init(conn);
@@ -1971,7 +1971,7 @@ static CURLcode imap_parse_url_path(struct connectdata *conn)
{
/* The imap struct is already initialised in imap_connect() */
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct IMAP *imap = data->req.protop;
const char *begin = data->state.path;
const char *ptr = begin;
@@ -2101,7 +2101,7 @@ static CURLcode imap_parse_url_path(struct connectdata *conn)
static CURLcode imap_parse_custom_request(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct IMAP *imap = data->req.protop;
const char *custom = data->set.str[STRING_CUSTOMREQUEST];
diff --git a/lib/imap.h b/lib/imap.h
index e6b9b894..5e0e228f 100644
--- a/lib/imap.h
+++ b/lib/imap.h
@@ -49,9 +49,9 @@ typedef enum {
IMAP_LAST /* never used */
} imapstate;
-/* This IMAP struct is used in the SessionHandle. All IMAP data that is
+/* This IMAP struct is used in the Curl_easy. All IMAP data that is
connection-oriented must be in imap_conn to properly deal with the fact that
- perhaps the SessionHandle is changed between the times the connection is
+ perhaps the Curl_easy is changed between the times the connection is
used. */
struct IMAP {
curl_pp_transfer transfer;
diff --git a/lib/krb5.c b/lib/krb5.c
index 0b146e06..87ce8ee6 100644
--- a/lib/krb5.c
+++ b/lib/krb5.c
@@ -150,7 +150,7 @@ krb5_auth(void *app_data, struct connectdata *conn)
const char *host = conn->host.name;
ssize_t nread;
curl_socklen_t l = sizeof(conn->local_addr);
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
CURLcode result;
const char *service = data->set.str[STRING_SERVICE_NAME] ?
data->set.str[STRING_SERVICE_NAME] :
diff --git a/lib/ldap.c b/lib/ldap.c
index 1f1f72fb..a1646279 100644
--- a/lib/ldap.c
+++ b/lib/ldap.c
@@ -192,7 +192,7 @@ static CURLcode Curl_ldap(struct connectdata *conn, bool *done)
LDAPMessage *ldapmsg = NULL;
LDAPMessage *entryIterator;
int num = 0;
- struct SessionHandle *data=conn->data;
+ struct Curl_easy *data=conn->data;
int ldap_proto = LDAP_VERSION3;
int ldap_ssl = 0;
char *val_b64 = NULL;
diff --git a/lib/memdebug.c b/lib/memdebug.c
index 1618bbaf..ccbf461b 100644
--- a/lib/memdebug.c
+++ b/lib/memdebug.c
@@ -119,7 +119,7 @@ void curl_memdebug(const char *logname)
logfile = stderr;
#ifdef MEMDEBUG_LOG_SYNC
/* Flush the log file after every line so the log isn't lost in a crash */
- setvbuf(logfile, (char *)NULL, _IOLBF, 0);
+ setbuf(logfile, (char *)NULL);
#endif
}
}
diff --git a/lib/multi.c b/lib/multi.c
index 7e2725ba..8bb93660 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -61,15 +61,15 @@
#define CURL_MULTI_HANDLE 0x000bab1e
#define GOOD_MULTI_HANDLE(x) \
- ((x) && (((struct Curl_multi *)(x))->type == CURL_MULTI_HANDLE))
+ ((x) && (x)->type == CURL_MULTI_HANDLE)
static void singlesocket(struct Curl_multi *multi,
- struct SessionHandle *data);
+ struct Curl_easy *data);
static int update_timer(struct Curl_multi *multi);
static CURLMcode add_next_timeout(struct timeval now,
struct Curl_multi *multi,
- struct SessionHandle *d);
+ struct Curl_easy *d);
static CURLMcode multi_timeout(struct Curl_multi *multi,
long *timeout_ms);
@@ -100,10 +100,10 @@ static const char * const statename[]={
static void multi_freetimeout(void *a, void *b);
/* function pointer called once when switching TO a state */
-typedef void (*init_multistate_func)(struct SessionHandle *data);
+typedef void (*init_multistate_func)(struct Curl_easy *data);
/* always use this function to change state, to make debugging easier */
-static void mstate(struct SessionHandle *data, CURLMstate state
+static void mstate(struct Curl_easy *data, CURLMstate state
#ifdef DEBUGBUILD
, int lineno
#endif
@@ -162,7 +162,7 @@ static void mstate(struct SessionHandle *data, CURLMstate state
*/
struct Curl_sh_entry {
- struct SessionHandle *easy;
+ struct Curl_easy *easy;
int action; /* what action READ/WRITE this socket waits for */
curl_socket_t socket; /* mainly to ease debugging */
void *socketp; /* settable by users with curl_multi_assign() */
@@ -185,7 +185,7 @@ static struct Curl_sh_entry *sh_getentry(struct curl_hash *sh,
/* make sure this socket is present in the hash for this handle */
static struct Curl_sh_entry *sh_addentry(struct curl_hash *sh,
curl_socket_t s,
- struct SessionHandle *data)
+ struct Curl_easy *data)
{
struct Curl_sh_entry *there = sh_getentry(sh, s);
struct Curl_sh_entry *check;
@@ -334,7 +334,7 @@ struct Curl_multi *Curl_multi_handle(int hashsize, /* socket hash */
/* -1 means it not set by user, use the default value */
multi->maxconnects = -1;
- return (CURLM *) multi;
+ return multi;
error:
@@ -350,25 +350,23 @@ struct Curl_multi *Curl_multi_handle(int hashsize, /* socket hash */
return NULL;
}
-CURLM *curl_multi_init(void)
+struct Curl_multi *curl_multi_init(void)
{
return Curl_multi_handle(CURL_SOCKET_HASH_TABLE_SIZE,
CURL_CONNECTION_HASH_SIZE);
}
-CURLMcode curl_multi_add_handle(CURLM *multi_handle,
- CURL *easy_handle)
+CURLMcode curl_multi_add_handle(struct Curl_multi *multi,
+ struct Curl_easy *data)
{
struct curl_llist *timeoutlist;
- struct Curl_multi *multi = (struct Curl_multi *)multi_handle;
- struct SessionHandle *data = (struct SessionHandle *)easy_handle;
/* First, make some basic checks that the CURLM handle is a good handle */
if(!GOOD_MULTI_HANDLE(multi))
return CURLM_BAD_HANDLE;
/* Verify that we got a somewhat good easy handle too */
- if(!GOOD_EASY_HANDLE(easy_handle))
+ if(!GOOD_EASY_HANDLE(data))
return CURLM_BAD_EASY_HANDLE;
/* Prevent users from adding same easy handle more than once and prevent
@@ -417,14 +415,14 @@ CURLMcode curl_multi_add_handle(CURLM *multi_handle,
data->state.conn_cache = &multi->conn_cache;
/* This adds the new entry at the 'end' of the doubly-linked circular
- list of SessionHandle structs to try and maintain a FIFO queue so
+ list of Curl_easy structs to try and maintain a FIFO queue so
the pipelined requests are in order. */
/* We add this new entry last in the list. */
data->next = NULL; /* end of the line */
if(multi->easyp) {
- struct SessionHandle *last = multi->easylp;
+ struct Curl_easy *last = multi->easylp;
last->next = data;
data->prev = last;
multi->easylp = data; /* the new last node */
@@ -435,8 +433,8 @@ CURLMcode curl_multi_add_handle(CURLM *multi_handle,
multi->easylp = multi->easyp = data; /* both first and last */
}
- /* make the SessionHandle refer back to this multi handle */
- data->multi = multi_handle;
+ /* make the Curl_easy refer back to this multi handle */
+ data->multi = multi;
/* Set the timeout for this handle to expire really soon so that it will
be taken care of even when this handle is added in the midst of operation
@@ -487,7 +485,7 @@ static void debug_print_sock_hash(void *p)
/* Mark the connection as 'idle', or close it if the cache is full.
Returns TRUE if the connection is kept, or FALSE if it was closed. */
static bool
-ConnectionDone(struct SessionHandle *data, struct connectdata *conn)
+ConnectionDone(struct Curl_easy *data, struct connectdata *conn)
{
/* data->multi->maxconnects can be negative, deal with it. */
size_t maxconnects =
@@ -523,7 +521,7 @@ static CURLcode multi_done(struct connectdata **connp,
{
CURLcode result;
struct connectdata *conn;
- struct SessionHandle *data;
+ struct Curl_easy *data;
DEBUGASSERT(*connp);
@@ -645,12 +643,10 @@ static CURLcode multi_done(struct connectdata **connp,
return result;
}
-CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
- CURL *curl_handle)
+CURLMcode curl_multi_remove_handle(struct Curl_multi *multi,
+ struct Curl_easy *data)
{
- struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
- struct SessionHandle *easy = curl_handle;
- struct SessionHandle *data = easy;
+ struct Curl_easy *easy = data;
bool premature;
bool easy_owns_conn;
struct curl_llist_element *e;
@@ -660,7 +656,7 @@ CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
return CURLM_BAD_HANDLE;
/* Verify that we got a somewhat good easy handle too */
- if(!GOOD_EASY_HANDLE(curl_handle))
+ if(!GOOD_EASY_HANDLE(data))
return CURLM_BAD_EASY_HANDLE;
/* Prevent users from trying to remove same easy handle more than once */
@@ -791,7 +787,7 @@ bool Curl_pipeline_wanted(const struct Curl_multi *multi, int bits)
return (multi && (multi->pipelining & bits)) ? TRUE : FALSE;
}
-void Curl_multi_handlePipeBreak(struct SessionHandle *data)
+void Curl_multi_handlePipeBreak(struct Curl_easy *data)
{
data->easy_conn = NULL;
}
@@ -844,7 +840,7 @@ static int domore_getsock(struct connectdata *conn,
}
/* returns bitmapped flags for this handle and its sockets */
-static int multi_getsock(struct SessionHandle *data,
+static int multi_getsock(struct Curl_easy *data,
curl_socket_t *socks, /* points to numsocks number
of sockets */
int numsocks)
@@ -910,15 +906,14 @@ static int multi_getsock(struct SessionHandle *data,
}
-CURLMcode curl_multi_fdset(CURLM *multi_handle,
+CURLMcode curl_multi_fdset(struct Curl_multi *multi,
fd_set *read_fd_set, fd_set *write_fd_set,
fd_set *exc_fd_set, int *max_fd)
{
/* Scan through all the easy handles to get the file descriptors set.
Some easy handles may not have connected to the remote host yet,
and then we must make sure that is done. */
- struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
- struct SessionHandle *data;
+ struct Curl_easy *data;
int this_max_fd=-1;
curl_socket_t sockbunch[MAX_SOCKSPEREASYHANDLE];
int bitmap;
@@ -960,14 +955,13 @@ CURLMcode curl_multi_fdset(CURLM *multi_handle,
return CURLM_OK;
}
-CURLMcode curl_multi_wait(CURLM *multi_handle,
+CURLMcode curl_multi_wait(struct Curl_multi *multi,
struct curl_waitfd extra_fds[],
unsigned int extra_nfds,
int timeout_ms,
int *ret)
{
- struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
- struct SessionHandle *data;
+ struct Curl_easy *data;
curl_socket_t sockbunch[MAX_SOCKSPEREASYHANDLE];
int bitmap;
unsigned int i;
@@ -1130,7 +1124,7 @@ static bool multi_ischanged(struct Curl_multi *multi, bool clear)
}
CURLMcode Curl_multi_add_perform(struct Curl_multi *multi,
- struct SessionHandle *data,
+ struct Curl_easy *data,
struct connectdata *conn)
{
CURLMcode rc;
@@ -1155,7 +1149,7 @@ static CURLcode multi_reconnect_request(struct connectdata **connp)
{
CURLcode result = CURLE_OK;
struct connectdata *conn = *connp;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
/* This was a re-use of a connection and we got a write error in the
* DO-phase. Then we DISCONNECT this connection and have another attempt to
@@ -1223,7 +1217,7 @@ static CURLcode multi_do(struct connectdata **connp, bool *done)
{
CURLcode result=CURLE_OK;
struct connectdata *conn = *connp;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
if(conn->handler->do_it) {
/* generic protocol-specific function pointer set in curl_connect() */
@@ -1286,7 +1280,7 @@ static CURLcode multi_do_more(struct connectdata *conn, int *complete)
static CURLMcode multi_runsingle(struct Curl_multi *multi,
struct timeval now,
- struct SessionHandle *data)
+ struct Curl_easy *data)
{
struct Curl_message *msg = NULL;
bool connected;
@@ -2102,10 +2096,9 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
}
-CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles)
+CURLMcode curl_multi_perform(struct Curl_multi *multi, int *running_handles)
{
- struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
- struct SessionHandle *data;
+ struct Curl_easy *data;
CURLMcode returncode=CURLM_OK;
struct Curl_tree *t;
struct timeval now = Curl_tvnow();
@@ -2164,6 +2157,8 @@ static void close_all_connections(struct Curl_multi *multi)
conn->data = multi->closure_handle;
sigpipe_ignore(conn->data, &pipe_st);
+ conn->data->easy_conn = NULL; /* clear the easy handle's connection
+ pointer */
/* This will remove the connection from the cache */
(void)Curl_disconnect(conn, FALSE);
sigpipe_restore(&pipe_st);
@@ -2172,11 +2167,10 @@ static void close_all_connections(struct Curl_multi *multi)
}
}
-CURLMcode curl_multi_cleanup(CURLM *multi_handle)
+CURLMcode curl_multi_cleanup(struct Curl_multi *multi)
{
- struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
- struct SessionHandle *data;
- struct SessionHandle *nextdata;
+ struct Curl_easy *data;
+ struct Curl_easy *nextdata;
if(GOOD_MULTI_HANDLE(multi)) {
bool restore_pipe = FALSE;
@@ -2247,9 +2241,8 @@ CURLMcode curl_multi_cleanup(CURLM *multi_handle)
* beyond. The current design is fully O(1).
*/
-CURLMsg *curl_multi_info_read(CURLM *multi_handle, int *msgs_in_queue)
+CURLMsg *curl_multi_info_read(struct Curl_multi *multi, int *msgs_in_queue)
{
- struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
struct Curl_message *msg;
*msgs_in_queue = 0; /* default to none */
@@ -2280,7 +2273,7 @@ CURLMsg *curl_multi_info_read(CURLM *multi_handle, int *msgs_in_queue)
* call the callback accordingly.
*/
static void singlesocket(struct Curl_multi *multi,
- struct SessionHandle *data)
+ struct Curl_easy *data)
{
curl_socket_t socks[MAX_SOCKSPEREASYHANDLE];
int i;
@@ -2452,7 +2445,7 @@ void Curl_multi_closed(struct connectdata *conn, curl_socket_t s)
/*
* add_next_timeout()
*
- * Each SessionHandle has a list of timeouts. The add_next_timeout() is called
+ * Each Curl_easy has a list of timeouts. The add_next_timeout() is called
* when it has just been removed from the splay tree because the timeout has
* expired. This function is then to advance in the list to pick the next
* timeout to use (skip the already expired ones) and add this node back to
@@ -2463,7 +2456,7 @@ void Curl_multi_closed(struct connectdata *conn, curl_socket_t s)
*/
static CURLMcode add_next_timeout(struct timeval now,
struct Curl_multi *multi,
- struct SessionHandle *d)
+ struct Curl_easy *d)
{
struct timeval *tv = &d->state.expiretime;
struct curl_llist *list = d->state.timeoutlist;
@@ -2511,7 +2504,7 @@ static CURLMcode multi_socket(struct Curl_multi *multi,
int *running_handles)
{
CURLMcode result = CURLM_OK;
- struct SessionHandle *data = NULL;
+ struct Curl_easy *data = NULL;
struct Curl_tree *t;
struct timeval now = Curl_tvnow();
@@ -2639,10 +2632,9 @@ static CURLMcode multi_socket(struct Curl_multi *multi,
}
#undef curl_multi_setopt
-CURLMcode curl_multi_setopt(CURLM *multi_handle,
+CURLMcode curl_multi_setopt(struct Curl_multi *multi,
CURLMoption option, ...)
{
- struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
CURLMcode res = CURLM_OK;
va_list param;
@@ -2710,33 +2702,32 @@ CURLMcode curl_multi_setopt(CURLM *multi_handle,
/* we define curl_multi_socket() in the public multi.h header */
#undef curl_multi_socket
-CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s,
+CURLMcode curl_multi_socket(struct Curl_multi *multi, curl_socket_t s,
int *running_handles)
{
- CURLMcode result = multi_socket((struct Curl_multi *)multi_handle, FALSE, s,
- 0, running_handles);
+ CURLMcode result = multi_socket(multi, FALSE, s, 0, running_handles);
if(CURLM_OK >= result)
- update_timer((struct Curl_multi *)multi_handle);
+ update_timer(multi);
return result;
}
-CURLMcode curl_multi_socket_action(CURLM *multi_handle, curl_socket_t s,
+CURLMcode curl_multi_socket_action(struct Curl_multi *multi, curl_socket_t s,
int ev_bitmask, int *running_handles)
{
- CURLMcode result = multi_socket((struct Curl_multi *)multi_handle, FALSE, s,
+ CURLMcode result = multi_socket(multi, FALSE, s,
ev_bitmask, running_handles);
if(CURLM_OK >= result)
- update_timer((struct Curl_multi *)multi_handle);
+ update_timer(multi);
return result;
}
-CURLMcode curl_multi_socket_all(CURLM *multi_handle, int *running_handles)
+CURLMcode curl_multi_socket_all(struct Curl_multi *multi, int *running_handles)
{
- CURLMcode result = multi_socket((struct Curl_multi *)multi_handle,
- TRUE, CURL_SOCKET_BAD, 0, running_handles);
+ CURLMcode result = multi_socket(multi, TRUE, CURL_SOCKET_BAD, 0,
+ running_handles);
if(CURLM_OK >= result)
- update_timer((struct Curl_multi *)multi_handle);
+ update_timer(multi);
return result;
}
@@ -2775,11 +2766,9 @@ static CURLMcode multi_timeout(struct Curl_multi *multi,
return CURLM_OK;
}
-CURLMcode curl_multi_timeout(CURLM *multi_handle,
+CURLMcode curl_multi_timeout(struct Curl_multi *multi,
long *timeout_ms)
{
- struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
-
/* First, make some basic checks that the CURLM handle is a good handle */
if(!GOOD_MULTI_HANDLE(multi))
return CURLM_BAD_HANDLE;
@@ -2806,7 +2795,7 @@ static int update_timer(struct Curl_multi *multi)
multi->timer_lastcall = none;
/* there's no timeout now but there was one previously, tell the app to
disable it */
- return multi->timer_cb((CURLM*)multi, -1, multi->timer_userp);
+ return multi->timer_cb(multi, -1, multi->timer_userp);
}
return 0;
}
@@ -2820,7 +2809,7 @@ static int update_timer(struct Curl_multi *multi)
multi->timer_lastcall = multi->timetree->key;
- return multi->timer_cb((CURLM*)multi, timeout_ms, multi->timer_userp);
+ return multi->timer_cb(multi, timeout_ms, multi->timer_userp);
}
/*
@@ -2892,7 +2881,7 @@ multi_addtimeout(struct curl_llist *timeoutlist,
*
* Pass zero to clear all timeout values for this handle.
*/
-void Curl_expire(struct SessionHandle *data, long milli)
+void Curl_expire(struct Curl_easy *data, long milli)
{
struct Curl_multi *multi = data->multi;
struct timeval *nowp = &data->state.expiretime;
@@ -2986,7 +2975,7 @@ void Curl_expire(struct SessionHandle *data, long milli)
* time-out period to expire.
*
*/
-void Curl_expire_latest(struct SessionHandle *data, long milli)
+void Curl_expire_latest(struct Curl_easy *data, long milli)
{
struct timeval *expire = &data->state.expiretime;
@@ -3015,11 +3004,10 @@ void Curl_expire_latest(struct SessionHandle *data, long milli)
Curl_expire(data, milli);
}
-CURLMcode curl_multi_assign(CURLM *multi_handle,
- curl_socket_t s, void *hashp)
+CURLMcode curl_multi_assign(struct Curl_multi *multi, curl_socket_t s,
+ void *hashp)
{
struct Curl_sh_entry *there = NULL;
- struct Curl_multi *multi = (struct Curl_multi *)multi_handle;
there = sh_getentry(&multi->sockhash, s);
@@ -3066,7 +3054,7 @@ void Curl_multi_process_pending_handles(struct Curl_multi *multi)
struct curl_llist_element *e = multi->pending->head;
while(e) {
- struct SessionHandle *data = e->ptr;
+ struct Curl_easy *data = e->ptr;
struct curl_llist_element *next = e->next;
if(data->mstate == CURLM_STATE_CONNECT_PEND) {
@@ -3084,10 +3072,9 @@ void Curl_multi_process_pending_handles(struct Curl_multi *multi)
}
#ifdef DEBUGBUILD
-void Curl_multi_dump(const struct Curl_multi *multi_handle)
+void Curl_multi_dump(struct Curl_multi *multi)
{
- struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
- struct SessionHandle *data;
+ struct Curl_easy *data;
int i;
fprintf(stderr, "* Multi status: %d handles, %d alive\n",
multi->num_easy, multi->num_alive);
diff --git a/lib/multihandle.h b/lib/multihandle.h
index fc81a554..c56b6aec 100644
--- a/lib/multihandle.h
+++ b/lib/multihandle.h
@@ -71,8 +71,8 @@ struct Curl_multi {
long type;
/* We have a doubly-linked circular list with easy handles */
- struct SessionHandle *easyp;
- struct SessionHandle *easylp; /* last node */
+ struct Curl_easy *easyp;
+ struct Curl_easy *easylp; /* last node */
int num_easy; /* amount of entries in the linked list above. */
int num_alive; /* amount of easy handles that are added but have not yet
@@ -80,7 +80,7 @@ struct Curl_multi {
struct curl_llist *msglist; /* a list of messages from completed transfers */
- struct curl_llist *pending; /* SessionHandles that are in the
+ struct curl_llist *pending; /* Curl_easys that are in the
CURLM_STATE_CONNECT_PEND state */
/* callback function and user data pointer for the *socket() API */
@@ -113,7 +113,7 @@ struct Curl_multi {
/* This handle will be used for closing the cached connections in
curl_multi_cleanup() */
- struct SessionHandle *closure_handle;
+ struct Curl_easy *closure_handle;
long maxconnects; /* if >0, a fixed limit of the maximum number of entries
we're allowed to grow the connection cache to */
diff --git a/lib/multiif.h b/lib/multiif.h
index b229f53e..fd2df556 100644
--- a/lib/multiif.h
+++ b/lib/multiif.h
@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -25,10 +25,10 @@
/*
* Prototypes for library-wide functions provided by multi.c
*/
-void Curl_expire(struct SessionHandle *data, long milli);
-void Curl_expire_latest(struct SessionHandle *data, long milli);
+void Curl_expire(struct Curl_easy *data, long milli);
+void Curl_expire_latest(struct Curl_easy *data, long milli);
bool Curl_pipeline_wanted(const struct Curl_multi* multi, int bits);
-void Curl_multi_handlePipeBreak(struct SessionHandle *data);
+void Curl_multi_handlePipeBreak(struct Curl_easy *data);
/* Internal version of curl_multi_init() accepts size parameters for the
socket and connection hashes */
@@ -51,7 +51,7 @@ struct Curl_multi *Curl_multi_handle(int hashsize, int chashsize);
* allow easier tracking of the internal handle's state and what sockets
* they use. Only for research and development DEBUGBUILD enabled builds.
*/
-void Curl_multi_dump(const struct Curl_multi *multi_handle);
+void Curl_multi_dump(struct Curl_multi *multi);
#endif
void Curl_multi_process_pending_handles(struct Curl_multi *multi);
@@ -92,6 +92,6 @@ void Curl_multi_closed(struct connectdata *conn, curl_socket_t s);
* Add a handle and move it into PERFORM state at once. For pushed streams.
*/
CURLMcode Curl_multi_add_perform(struct Curl_multi *multi,
- struct SessionHandle *data,
+ struct Curl_easy *data,
struct connectdata *conn);
#endif /* HEADER_CURL_MULTIIF_H */
diff --git a/lib/non-ascii.c b/lib/non-ascii.c
index 205ff04b..ed146180 100644
--- a/lib/non-ascii.c
+++ b/lib/non-ascii.c
@@ -51,7 +51,7 @@
* Curl_convert_clone() returns a malloced copy of the source string (if
* returning CURLE_OK), with the data converted to network format.
*/
-CURLcode Curl_convert_clone(struct SessionHandle *data,
+CURLcode Curl_convert_clone(struct Curl_easy *data,
const char *indata,
size_t insize,
char **outbuf)
@@ -79,7 +79,7 @@ CURLcode Curl_convert_clone(struct SessionHandle *data,
* Curl_convert_to_network() is an internal function for performing ASCII
* conversions on non-ASCII platforms. It convers the buffer _in place_.
*/
-CURLcode Curl_convert_to_network(struct SessionHandle *data,
+CURLcode Curl_convert_to_network(struct Curl_easy *data,
char *buffer, size_t length)
{
if(data->set.convtonetwork) {
@@ -139,7 +139,7 @@ CURLcode Curl_convert_to_network(struct SessionHandle *data,
* Curl_convert_from_network() is an internal function for performing ASCII
* conversions on non-ASCII platforms. It convers the buffer _in place_.
*/
-CURLcode Curl_convert_from_network(struct SessionHandle *data,
+CURLcode Curl_convert_from_network(struct Curl_easy *data,
char *buffer, size_t length)
{
if(data->set.convfromnetwork) {
@@ -199,7 +199,7 @@ CURLcode Curl_convert_from_network(struct SessionHandle *data,
* Curl_convert_from_utf8() is an internal function for performing UTF-8
* conversions on non-ASCII platforms.
*/
-CURLcode Curl_convert_from_utf8(struct SessionHandle *data,
+CURLcode Curl_convert_from_utf8(struct Curl_easy *data,
char *buffer, size_t length)
{
if(data->set.convfromutf8) {
@@ -261,9 +261,9 @@ CURLcode Curl_convert_from_utf8(struct SessionHandle *data,
}
/*
- * Init conversion stuff for a SessionHandle
+ * Init conversion stuff for a Curl_easy
*/
-void Curl_convert_init(struct SessionHandle *data)
+void Curl_convert_init(struct Curl_easy *data)
{
#if defined(CURL_DOES_CONVERSIONS) && defined(HAVE_ICONV)
/* conversion descriptors for iconv calls */
@@ -276,9 +276,9 @@ void Curl_convert_init(struct SessionHandle *data)
}
/*
- * Setup conversion stuff for a SessionHandle
+ * Setup conversion stuff for a Curl_easy
*/
-void Curl_convert_setup(struct SessionHandle *data)
+void Curl_convert_setup(struct Curl_easy *data)
{
data->inbound_cd = iconv_open(CURL_ICONV_CODESET_OF_HOST,
CURL_ICONV_CODESET_OF_NETWORK);
@@ -289,10 +289,10 @@ void Curl_convert_setup(struct SessionHandle *data)
}
/*
- * Close conversion stuff for a SessionHandle
+ * Close conversion stuff for a Curl_easy
*/
-void Curl_convert_close(struct SessionHandle *data)
+void Curl_convert_close(struct Curl_easy *data)
{
#ifdef HAVE_ICONV
/* close iconv conversion descriptors */
@@ -314,7 +314,7 @@ void Curl_convert_close(struct SessionHandle *data)
* Curl_convert_form() is used from http.c, this converts any form items that
need to be sent in the network encoding. Returns CURLE_OK on success.
*/
-CURLcode Curl_convert_form(struct SessionHandle *data, struct FormData *form)
+CURLcode Curl_convert_form(struct Curl_easy *data, struct FormData *form)
{
CURLcode result;
diff --git a/lib/non-ascii.h b/lib/non-ascii.h
index f3e2049e..e27f1f41 100644
--- a/lib/non-ascii.h
+++ b/lib/non-ascii.h
@@ -33,22 +33,22 @@
*
* If no conversion was needed *outbuf may be NULL.
*/
-CURLcode Curl_convert_clone(struct SessionHandle *data,
+CURLcode Curl_convert_clone(struct Curl_easy *data,
const char *indata,
size_t insize,
char **outbuf);
-void Curl_convert_init(struct SessionHandle *data);
-void Curl_convert_setup(struct SessionHandle *data);
-void Curl_convert_close(struct SessionHandle *data);
+void Curl_convert_init(struct Curl_easy *data);
+void Curl_convert_setup(struct Curl_easy *data);
+void Curl_convert_close(struct Curl_easy *data);
-CURLcode Curl_convert_to_network(struct SessionHandle *data,
+CURLcode Curl_convert_to_network(struct Curl_easy *data,
char *buffer, size_t length);
-CURLcode Curl_convert_from_network(struct SessionHandle *data,
+CURLcode Curl_convert_from_network(struct Curl_easy *data,
char *buffer, size_t length);
-CURLcode Curl_convert_from_utf8(struct SessionHandle *data,
+CURLcode Curl_convert_from_utf8(struct Curl_easy *data,
char *buffer, size_t length);
-CURLcode Curl_convert_form(struct SessionHandle *data, struct FormData *form);
+CURLcode Curl_convert_form(struct Curl_easy *data, struct FormData *form);
#else
#define Curl_convert_clone(a,b,c,d) ((void)a, CURLE_OK)
#define Curl_convert_init(x) Curl_nop_stmt
diff --git a/lib/openldap.c b/lib/openldap.c
index 01567acd..4b8cfb9c 100644
--- a/lib/openldap.c
+++ b/lib/openldap.c
@@ -150,7 +150,7 @@ static CURLcode ldap_setup_connection(struct connectdata *conn)
{
ldapconninfo *li;
LDAPURLDesc *lud;
- struct SessionHandle *data=conn->data;
+ struct Curl_easy *data=conn->data;
int rc, proto;
CURLcode status;
@@ -188,7 +188,7 @@ static Sockbuf_IO ldapsb_tls;
static CURLcode ldap_connect(struct connectdata *conn, bool *done)
{
ldapconninfo *li = conn->proto.generic;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
int rc, proto = LDAP_VERSION3;
char hosturl[1024];
char *ptr;
@@ -226,7 +226,7 @@ static CURLcode ldap_connect(struct connectdata *conn, bool *done)
static CURLcode ldap_connecting(struct connectdata *conn, bool *done)
{
ldapconninfo *li = conn->proto.generic;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
LDAPMessage *msg = NULL;
struct timeval tv = {0, 1}, *tvp;
int rc, err;
@@ -352,7 +352,7 @@ static CURLcode ldap_do(struct connectdata *conn, bool *done)
int rc = 0;
LDAPURLDesc *ludp = NULL;
int msgid;
- struct SessionHandle *data=conn->data;
+ struct Curl_easy *data=conn->data;
connkeep(conn, "OpenLDAP do");
@@ -415,7 +415,7 @@ static ssize_t ldap_recv(struct connectdata *conn, int sockindex, char *buf,
size_t len, CURLcode *err)
{
ldapconninfo *li = conn->proto.generic;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
ldapreqinfo *lr = data->req.protop;
int rc, ret;
LDAPMessage *msg = NULL;
diff --git a/lib/pingpong.c b/lib/pingpong.c
index ce2b5861..92ff84ba 100644
--- a/lib/pingpong.c
+++ b/lib/pingpong.c
@@ -47,7 +47,7 @@
long Curl_pp_state_timeout(struct pingpong *pp)
{
struct connectdata *conn = pp->conn;
- struct SessionHandle *data=conn->data;
+ struct Curl_easy *data=conn->data;
long timeout_ms; /* in milliseconds */
long timeout2_ms; /* in milliseconds */
long response_time= (data->set.server_response_timeout)?
@@ -85,7 +85,7 @@ CURLcode Curl_pp_statemach(struct pingpong *pp, bool block)
int rc;
long interval_ms;
long timeout_ms = Curl_pp_state_timeout(pp);
- struct SessionHandle *data=conn->data;
+ struct Curl_easy *data=conn->data;
CURLcode result = CURLE_OK;
if(timeout_ms <=0) {
@@ -165,7 +165,7 @@ CURLcode Curl_pp_vsendf(struct pingpong *pp,
char *s;
CURLcode result;
struct connectdata *conn = pp->conn;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
#ifdef HAVE_GSSAPI
enum protection_level data_sec = conn->data_prot;
@@ -271,7 +271,7 @@ CURLcode Curl_pp_readresp(curl_socket_t sockfd,
ssize_t gotbytes;
char *ptr;
struct connectdata *conn = pp->conn;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
char * const buf = data->state.buffer;
CURLcode result = CURLE_OK;
diff --git a/lib/pipeline.c b/lib/pipeline.c
index 95b89b54..0ff82f08 100644
--- a/lib/pipeline.c
+++ b/lib/pipeline.c
@@ -57,7 +57,7 @@ static void server_blacklist_llist_dtor(void *user, void *element)
free(element);
}
-bool Curl_pipeline_penalized(struct SessionHandle *data,
+bool Curl_pipeline_penalized(struct Curl_easy *data,
struct connectdata *conn)
{
if(data) {
@@ -70,7 +70,7 @@ bool Curl_pipeline_penalized(struct SessionHandle *data,
/* Find the head of the recv pipe, if any */
if(conn->recv_pipe && conn->recv_pipe->head) {
- struct SessionHandle *recv_handle = conn->recv_pipe->head->ptr;
+ struct Curl_easy *recv_handle = conn->recv_pipe->head->ptr;
recv_size = recv_handle->req.size;
@@ -91,7 +91,7 @@ bool Curl_pipeline_penalized(struct SessionHandle *data,
return FALSE;
}
-static CURLcode addHandleToPipeline(struct SessionHandle *data,
+static CURLcode addHandleToPipeline(struct Curl_easy *data,
struct curl_llist *pipeline)
{
if(!Curl_llist_insert_next(pipeline, pipeline->tail, data))
@@ -100,7 +100,7 @@ static CURLcode addHandleToPipeline(struct SessionHandle *data,
}
-CURLcode Curl_add_handle_to_pipeline(struct SessionHandle *handle,
+CURLcode Curl_add_handle_to_pipeline(struct Curl_easy *handle,
struct connectdata *conn)
{
struct curl_llist_element *sendhead = conn->send_pipe->head;
@@ -130,7 +130,7 @@ CURLcode Curl_add_handle_to_pipeline(struct SessionHandle *handle,
checked to update what sockets it acts on.
*/
-void Curl_move_handle_from_send_to_recv_pipe(struct SessionHandle *handle,
+void Curl_move_handle_from_send_to_recv_pipe(struct Curl_easy *handle,
struct connectdata *conn)
{
struct curl_llist_element *curr;
@@ -162,7 +162,7 @@ void Curl_move_handle_from_send_to_recv_pipe(struct SessionHandle *handle,
}
}
-bool Curl_pipeline_site_blacklisted(struct SessionHandle *handle,
+bool Curl_pipeline_site_blacklisted(struct Curl_easy *handle,
struct connectdata *conn)
{
if(handle->multi) {
@@ -254,7 +254,7 @@ CURLMcode Curl_pipeline_set_site_blacklist(char **sites,
return CURLM_OK;
}
-bool Curl_pipeline_server_blacklisted(struct SessionHandle *handle,
+bool Curl_pipeline_server_blacklisted(struct Curl_easy *handle,
char *server_name)
{
if(handle->multi && server_name) {
@@ -299,11 +299,16 @@ CURLMcode Curl_pipeline_set_server_blacklist(char **servers,
char *server_name;
server_name = strdup(*servers);
- if(!server_name)
+ if(!server_name) {
+ Curl_llist_destroy(new_list, NULL);
return CURLM_OUT_OF_MEMORY;
+ }
- if(!Curl_llist_insert_next(new_list, new_list->tail, server_name))
+ if(!Curl_llist_insert_next(new_list, new_list->tail, server_name)) {
+ Curl_llist_destroy(new_list, NULL);
+ Curl_safefree(server_name);
return CURLM_OUT_OF_MEMORY;
+ }
servers++;
}
@@ -320,7 +325,7 @@ CURLMcode Curl_pipeline_set_server_blacklist(char **servers,
return CURLM_OK;
}
-static bool pipe_head(struct SessionHandle *data,
+static bool pipe_head(struct Curl_easy *data,
struct curl_llist *pipeline)
{
if(pipeline) {
@@ -332,14 +337,14 @@ static bool pipe_head(struct SessionHandle *data,
}
/* returns TRUE if the given handle is head of the recv pipe */
-bool Curl_recvpipe_head(struct SessionHandle *data,
+bool Curl_recvpipe_head(struct Curl_easy *data,
struct connectdata *conn)
{
return pipe_head(data, conn->recv_pipe);
}
/* returns TRUE if the given handle is head of the send pipe */
-bool Curl_sendpipe_head(struct SessionHandle *data,
+bool Curl_sendpipe_head(struct Curl_easy *data,
struct connectdata *conn)
{
return pipe_head(data, conn->send_pipe);
@@ -353,7 +358,7 @@ bool Curl_sendpipe_head(struct SessionHandle *data,
* If not available, return FALSE.
*/
-bool Curl_pipeline_checkget_write(struct SessionHandle *data,
+bool Curl_pipeline_checkget_write(struct Curl_easy *data,
struct connectdata *conn)
{
if(conn->bits.multiplex)
@@ -376,7 +381,7 @@ bool Curl_pipeline_checkget_write(struct SessionHandle *data,
* If not available, return FALSE.
*/
-bool Curl_pipeline_checkget_read(struct SessionHandle *data,
+bool Curl_pipeline_checkget_read(struct Curl_easy *data,
struct connectdata *conn)
{
if(conn->bits.multiplex)
@@ -413,7 +418,7 @@ void print_pipeline(struct connectdata *conn)
{
struct curl_llist_element *curr;
struct connectbundle *cb_ptr;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
cb_ptr = conn->bundle;
diff --git a/lib/pipeline.h b/lib/pipeline.h
index a39dfa8d..a64f7102 100644
--- a/lib/pipeline.h
+++ b/lib/pipeline.h
@@ -23,34 +23,34 @@
*
***************************************************************************/
-CURLcode Curl_add_handle_to_pipeline(struct SessionHandle *handle,
+CURLcode Curl_add_handle_to_pipeline(struct Curl_easy *handle,
struct connectdata *conn);
-void Curl_move_handle_from_send_to_recv_pipe(struct SessionHandle *handle,
+void Curl_move_handle_from_send_to_recv_pipe(struct Curl_easy *handle,
struct connectdata *conn);
-bool Curl_pipeline_penalized(struct SessionHandle *data,
+bool Curl_pipeline_penalized(struct Curl_easy *data,
struct connectdata *conn);
-bool Curl_pipeline_site_blacklisted(struct SessionHandle *handle,
+bool Curl_pipeline_site_blacklisted(struct Curl_easy *handle,
struct connectdata *conn);
CURLMcode Curl_pipeline_set_site_blacklist(char **sites,
struct curl_llist **list_ptr);
-bool Curl_pipeline_server_blacklisted(struct SessionHandle *handle,
+bool Curl_pipeline_server_blacklisted(struct Curl_easy *handle,
char *server_name);
CURLMcode Curl_pipeline_set_server_blacklist(char **servers,
struct curl_llist **list_ptr);
-bool Curl_pipeline_checkget_write(struct SessionHandle *data,
+bool Curl_pipeline_checkget_write(struct Curl_easy *data,
struct connectdata *conn);
-bool Curl_pipeline_checkget_read(struct SessionHandle *data,
+bool Curl_pipeline_checkget_read(struct Curl_easy *data,
struct connectdata *conn);
void Curl_pipeline_leave_write(struct connectdata *conn);
void Curl_pipeline_leave_read(struct connectdata *conn);
-bool Curl_recvpipe_head(struct SessionHandle *data,
+bool Curl_recvpipe_head(struct Curl_easy *data,
struct connectdata *conn);
-bool Curl_sendpipe_head(struct SessionHandle *data,
+bool Curl_sendpipe_head(struct Curl_easy *data,
struct connectdata *conn);
#endif /* HEADER_CURL_PIPELINE_H */
diff --git a/lib/pop3.c b/lib/pop3.c
index a6b2c3f7..591e877f 100644
--- a/lib/pop3.c
+++ b/lib/pop3.c
@@ -597,7 +597,7 @@ static CURLcode pop3_perform_authentication(struct connectdata *conn)
static CURLcode pop3_perform_command(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct POP3 *pop3 = data->req.protop;
const char *command = NULL;
@@ -653,7 +653,7 @@ static CURLcode pop3_state_servergreet_resp(struct connectdata *conn,
pop3state instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct pop3_conn *pop3c = &conn->proto.pop3c;
const char *line = data->state.buffer;
size_t len = strlen(line);
@@ -704,7 +704,7 @@ static CURLcode pop3_state_capa_resp(struct connectdata *conn, int pop3code,
pop3state instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct pop3_conn *pop3c = &conn->proto.pop3c;
const char *line = data->state.buffer;
size_t len = strlen(line);
@@ -795,7 +795,7 @@ static CURLcode pop3_state_starttls_resp(struct connectdata *conn,
pop3state instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
(void)instate; /* no use for this yet */
@@ -819,7 +819,7 @@ static CURLcode pop3_state_auth_resp(struct connectdata *conn,
pop3state instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct pop3_conn *pop3c = &conn->proto.pop3c;
saslprogress progress;
@@ -859,7 +859,7 @@ static CURLcode pop3_state_apop_resp(struct connectdata *conn, int pop3code,
pop3state instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
(void)instate; /* no use for this yet */
@@ -880,7 +880,7 @@ static CURLcode pop3_state_user_resp(struct connectdata *conn, int pop3code,
pop3state instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
(void)instate; /* no use for this yet */
@@ -903,7 +903,7 @@ static CURLcode pop3_state_pass_resp(struct connectdata *conn, int pop3code,
pop3state instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
(void)instate; /* no use for this yet */
@@ -924,7 +924,7 @@ static CURLcode pop3_state_command_resp(struct connectdata *conn,
pop3state instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct POP3 *pop3 = data->req.protop;
struct pop3_conn *pop3c = &conn->proto.pop3c;
struct pingpong *pp = &pop3c->pp;
@@ -1078,12 +1078,12 @@ static CURLcode pop3_block_statemach(struct connectdata *conn)
return result;
}
-/* Allocate and initialize the POP3 struct for the current SessionHandle if
+/* Allocate and initialize the POP3 struct for the current Curl_easy if
required */
static CURLcode pop3_init(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct POP3 *pop3;
pop3 = data->req.protop = calloc(sizeof(struct POP3), 1);
@@ -1160,7 +1160,7 @@ static CURLcode pop3_done(struct connectdata *conn, CURLcode status,
bool premature)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct POP3 *pop3 = data->req.protop;
(void)premature;
@@ -1324,7 +1324,7 @@ static CURLcode pop3_regular_transfer(struct connectdata *conn,
{
CURLcode result = CURLE_OK;
bool connected = FALSE;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
/* Make sure size is unknown at this point */
data->req.size = -1;
@@ -1347,7 +1347,7 @@ static CURLcode pop3_regular_transfer(struct connectdata *conn,
static CURLcode pop3_setup_connection(struct connectdata *conn)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
/* Initialise the POP3 layer */
CURLcode result = pop3_init(conn);
@@ -1454,7 +1454,7 @@ static CURLcode pop3_parse_url_options(struct connectdata *conn)
static CURLcode pop3_parse_url_path(struct connectdata *conn)
{
/* The POP3 struct is already initialised in pop3_connect() */
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct POP3 *pop3 = data->req.protop;
const char *path = data->state.path;
@@ -1471,7 +1471,7 @@ static CURLcode pop3_parse_url_path(struct connectdata *conn)
static CURLcode pop3_parse_custom_request(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct POP3 *pop3 = data->req.protop;
const char *custom = data->set.str[STRING_CUSTOMREQUEST];
@@ -1493,7 +1493,7 @@ CURLcode Curl_pop3_write(struct connectdata *conn, char *str, size_t nread)
{
/* This code could be made into a special function in the handler struct */
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct SingleRequest *k = &data->req;
struct pop3_conn *pop3c = &conn->proto.pop3c;
diff --git a/lib/pop3.h b/lib/pop3.h
index 2d961016..a8e697cd 100644
--- a/lib/pop3.h
+++ b/lib/pop3.h
@@ -45,9 +45,9 @@ typedef enum {
POP3_LAST /* never used */
} pop3state;
-/* This POP3 struct is used in the SessionHandle. All POP3 data that is
+/* This POP3 struct is used in the Curl_easy. All POP3 data that is
connection-oriented must be in pop3_conn to properly deal with the fact that
- perhaps the SessionHandle is changed between the times the connection is
+ perhaps the Curl_easy is changed between the times the connection is
used. */
struct POP3 {
curl_pp_transfer transfer;
diff --git a/lib/progress.c b/lib/progress.c
index 713ab085..760ca1cc 100644
--- a/lib/progress.c
+++ b/lib/progress.c
@@ -133,7 +133,7 @@ static char *max5data(curl_off_t bytes, char *max5)
int Curl_pgrsDone(struct connectdata *conn)
{
int rc;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
data->progress.lastshow=0;
rc = Curl_pgrsUpdate(conn); /* the final (forced) update */
if(rc)
@@ -150,7 +150,7 @@ int Curl_pgrsDone(struct connectdata *conn)
}
/* reset all times except redirect, and reset the known transfer sizes */
-void Curl_pgrsResetTimesSizes(struct SessionHandle *data)
+void Curl_pgrsResetTimesSizes(struct Curl_easy *data)
{
data->progress.t_nslookup = 0.0;
data->progress.t_connect = 0.0;
@@ -161,7 +161,7 @@ void Curl_pgrsResetTimesSizes(struct SessionHandle *data)
Curl_pgrsSetUploadSize(data, -1);
}
-void Curl_pgrsTime(struct SessionHandle *data, timerid timer)
+void Curl_pgrsTime(struct Curl_easy *data, timerid timer)
{
struct timeval now = Curl_tvnow();
@@ -212,7 +212,7 @@ void Curl_pgrsTime(struct SessionHandle *data, timerid timer)
}
}
-void Curl_pgrsStartNow(struct SessionHandle *data)
+void Curl_pgrsStartNow(struct Curl_easy *data)
{
data->progress.speeder_c = 0; /* reset the progress meter display */
data->progress.start = Curl_tvnow();
@@ -220,17 +220,17 @@ void Curl_pgrsStartNow(struct SessionHandle *data)
data->progress.flags &= PGRS_HIDE|PGRS_HEADERS_OUT;
}
-void Curl_pgrsSetDownloadCounter(struct SessionHandle *data, curl_off_t size)
+void Curl_pgrsSetDownloadCounter(struct Curl_easy *data, curl_off_t size)
{
data->progress.downloaded = size;
}
-void Curl_pgrsSetUploadCounter(struct SessionHandle *data, curl_off_t size)
+void Curl_pgrsSetUploadCounter(struct Curl_easy *data, curl_off_t size)
{
data->progress.uploaded = size;
}
-void Curl_pgrsSetDownloadSize(struct SessionHandle *data, curl_off_t size)
+void Curl_pgrsSetDownloadSize(struct Curl_easy *data, curl_off_t size)
{
if(size >= 0) {
data->progress.size_dl = size;
@@ -242,7 +242,7 @@ void Curl_pgrsSetDownloadSize(struct SessionHandle *data, curl_off_t size)
}
}
-void Curl_pgrsSetUploadSize(struct SessionHandle *data, curl_off_t size)
+void Curl_pgrsSetUploadSize(struct Curl_easy *data, curl_off_t size)
{
if(size >= 0) {
data->progress.size_ul = size;
@@ -269,7 +269,7 @@ int Curl_pgrsUpdate(struct connectdata *conn)
curl_off_t total_transfer;
curl_off_t total_expected_transfer;
curl_off_t timespent;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
int nowindex = data->progress.speeder_c% CURR_TIME;
int checkindex;
int countindex; /* amount of seconds stored in the speeder array */
diff --git a/lib/progress.h b/lib/progress.h
index ea00afa9..a77b7ce5 100644
--- a/lib/progress.h
+++ b/lib/progress.h
@@ -41,14 +41,14 @@ typedef enum {
} timerid;
int Curl_pgrsDone(struct connectdata *);
-void Curl_pgrsStartNow(struct SessionHandle *data);
-void Curl_pgrsSetDownloadSize(struct SessionHandle *data, curl_off_t size);
-void Curl_pgrsSetUploadSize(struct SessionHandle *data, curl_off_t size);
-void Curl_pgrsSetDownloadCounter(struct SessionHandle *data, curl_off_t size);
-void Curl_pgrsSetUploadCounter(struct SessionHandle *data, curl_off_t size);
+void Curl_pgrsStartNow(struct Curl_easy *data);
+void Curl_pgrsSetDownloadSize(struct Curl_easy *data, curl_off_t size);
+void Curl_pgrsSetUploadSize(struct Curl_easy *data, curl_off_t size);
+void Curl_pgrsSetDownloadCounter(struct Curl_easy *data, curl_off_t size);
+void Curl_pgrsSetUploadCounter(struct Curl_easy *data, curl_off_t size);
int Curl_pgrsUpdate(struct connectdata *);
-void Curl_pgrsResetTimesSizes(struct SessionHandle *data);
-void Curl_pgrsTime(struct SessionHandle *data, timerid timer);
+void Curl_pgrsResetTimesSizes(struct Curl_easy *data);
+void Curl_pgrsTime(struct Curl_easy *data, timerid timer);
/* Don't show progress for sizes smaller than: */
diff --git a/lib/rtsp.c b/lib/rtsp.c
index 5cb10448..27955bc4 100644
--- a/lib/rtsp.c
+++ b/lib/rtsp.c
@@ -73,7 +73,7 @@ static int rtsp_getsock_do(struct connectdata *conn,
* data is parsed and k->str is moved up
* readmore: whether or not the RTP parser needs more data right away
*/
-static CURLcode rtsp_rtp_readwrite(struct SessionHandle *data,
+static CURLcode rtsp_rtp_readwrite(struct Curl_easy *data,
struct connectdata *conn,
ssize_t *nread,
bool *readmore);
@@ -158,7 +158,7 @@ bool Curl_rtsp_connisdead(struct connectdata *check)
}
else if((sval & CURL_CSELECT_IN) && check->data) {
/* readable with no error. could be closed or could be alive but we can
- only check if we have a proper SessionHandle for the connection */
+ only check if we have a proper Curl_easy for the connection */
curl_socket_t connectinfo = Curl_getconnectinfo(check->data, &check);
if(connectinfo != CURL_SOCKET_BAD)
ret_val = FALSE;
@@ -170,7 +170,7 @@ bool Curl_rtsp_connisdead(struct connectdata *check)
static CURLcode rtsp_connect(struct connectdata *conn, bool *done)
{
CURLcode httpStatus;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
httpStatus = Curl_http_connect(conn, done);
@@ -196,7 +196,7 @@ static CURLcode rtsp_disconnect(struct connectdata *conn, bool dead)
static CURLcode rtsp_done(struct connectdata *conn,
CURLcode status, bool premature)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct RTSP *rtsp = data->req.protop;
CURLcode httpStatus;
long CSeq_sent;
@@ -230,7 +230,7 @@ static CURLcode rtsp_done(struct connectdata *conn,
static CURLcode rtsp_do(struct connectdata *conn, bool *done)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
CURLcode result=CURLE_OK;
Curl_RtspReq rtspreq = data->set.rtspreq;
struct RTSP *rtsp = data->req.protop;
@@ -600,7 +600,7 @@ static CURLcode rtsp_do(struct connectdata *conn, bool *done)
}
-static CURLcode rtsp_rtp_readwrite(struct SessionHandle *data,
+static CURLcode rtsp_rtp_readwrite(struct Curl_easy *data,
struct connectdata *conn,
ssize_t *nread,
bool *readmore) {
@@ -731,7 +731,7 @@ static CURLcode rtsp_rtp_readwrite(struct SessionHandle *data,
static
CURLcode rtp_client_write(struct connectdata *conn, char *ptr, size_t len)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
size_t wrote;
curl_write_callback writeit;
@@ -759,7 +759,7 @@ CURLcode rtp_client_write(struct connectdata *conn, char *ptr, size_t len)
CURLcode Curl_rtsp_parseheader(struct connectdata *conn,
char *header)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
long CSeq = 0;
if(checkprefix("CSeq:", header)) {
diff --git a/lib/security.c b/lib/security.c
index 014bbf1b..a0bcaeae 100644
--- a/lib/security.c
+++ b/lib/security.c
@@ -476,7 +476,7 @@ Curl_sec_request_prot(struct connectdata *conn, const char *level)
static CURLcode choose_mech(struct connectdata *conn)
{
int ret;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
void *tmp_allocation;
const struct Curl_sec_client_mech *mech = &Curl_krb5_client_mech;
diff --git a/lib/sendf.c b/lib/sendf.c
index 22f3bf27..21017973 100644
--- a/lib/sendf.c
+++ b/lib/sendf.c
@@ -46,7 +46,7 @@
* blocks of data. Remaining, bare CRs are changed to LFs. The possibly new
* size of the data is returned.
*/
-static size_t convert_lineends(struct SessionHandle *data,
+static size_t convert_lineends(struct Curl_easy *data,
char *startPtr, size_t size)
{
char *inPtr, *outPtr;
@@ -207,7 +207,7 @@ static ssize_t get_pre_recved(struct connectdata *conn, int num, char *buf,
/* Curl_infof() is for info message along the way */
-void Curl_infof(struct SessionHandle *data, const char *fmt, ...)
+void Curl_infof(struct Curl_easy *data, const char *fmt, ...)
{
if(data && data->set.verbose) {
va_list ap;
@@ -225,7 +225,7 @@ void Curl_infof(struct SessionHandle *data, const char *fmt, ...)
* The message SHALL NOT include any LF or CR.
*/
-void Curl_failf(struct SessionHandle *data, const char *fmt, ...)
+void Curl_failf(struct Curl_easy *data, const char *fmt, ...)
{
va_list ap;
size_t len;
@@ -253,7 +253,7 @@ void Curl_failf(struct SessionHandle *data, const char *fmt, ...)
CURLcode Curl_sendf(curl_socket_t sockfd, struct connectdata *conn,
const char *fmt, ...)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
ssize_t bytes_written;
size_t write_len;
CURLcode result = CURLE_OK;
@@ -452,7 +452,7 @@ ssize_t Curl_recv_plain(struct connectdata *conn, int num, char *buf,
return nread;
}
-static CURLcode pausewrite(struct SessionHandle *data,
+static CURLcode pausewrite(struct Curl_easy *data,
int type, /* what type of data */
const char *ptr,
size_t len)
@@ -491,7 +491,7 @@ CURLcode Curl_client_chop_write(struct connectdata *conn,
char * ptr,
size_t len)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
curl_write_callback writeheader = NULL;
curl_write_callback writebody = NULL;
@@ -598,7 +598,7 @@ CURLcode Curl_client_write(struct connectdata *conn,
char *ptr,
size_t len)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
if(0 == len)
len = strlen(ptr);
@@ -718,7 +718,7 @@ CURLcode Curl_read(struct connectdata *conn, /* connection data */
}
/* return 0 on success */
-static int showit(struct SessionHandle *data, curl_infotype type,
+static int showit(struct Curl_easy *data, curl_infotype type,
char *ptr, size_t size)
{
static const char s_infotype[CURLINFO_END][3] = {
@@ -787,7 +787,7 @@ static int showit(struct SessionHandle *data, curl_infotype type,
return 0;
}
-int Curl_debug(struct SessionHandle *data, curl_infotype type,
+int Curl_debug(struct Curl_easy *data, curl_infotype type,
char *ptr, size_t size,
struct connectdata *conn)
{
diff --git a/lib/sendf.h b/lib/sendf.h
index 48e9444c..a951a0b4 100644
--- a/lib/sendf.h
+++ b/lib/sendf.h
@@ -26,8 +26,8 @@
CURLcode Curl_sendf(curl_socket_t sockfd, struct connectdata *,
const char *fmt, ...);
-void Curl_infof(struct SessionHandle *, const char *fmt, ...);
-void Curl_failf(struct SessionHandle *, const char *fmt, ...);
+void Curl_infof(struct Curl_easy *, const char *fmt, ...);
+void Curl_failf(struct Curl_easy *, const char *fmt, ...);
#if defined(CURL_DISABLE_VERBOSE_STRINGS)
@@ -84,7 +84,7 @@ CURLcode Curl_write_plain(struct connectdata *conn,
ssize_t *written);
/* the function used to output verbose information */
-int Curl_debug(struct SessionHandle *handle, curl_infotype type,
+int Curl_debug(struct Curl_easy *handle, curl_infotype type,
char *data, size_t size,
struct connectdata *conn);
diff --git a/lib/share.c b/lib/share.c
index 58c59123..5b3957fc 100644
--- a/lib/share.c
+++ b/lib/share.c
@@ -31,7 +31,7 @@
/* The last #include file should be: */
#include "memdebug.h"
-CURLSH *
+struct Curl_share *
curl_share_init(void)
{
struct Curl_share *share = calloc(1, sizeof(struct Curl_share));
@@ -49,9 +49,8 @@ curl_share_init(void)
#undef curl_share_setopt
CURLSHcode
-curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
+curl_share_setopt(struct Curl_share *share, CURLSHoption option, ...)
{
- struct Curl_share *share = (struct Curl_share *)sh;
va_list param;
int type;
curl_lock_function lockfunc;
@@ -172,10 +171,8 @@ curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
}
CURLSHcode
-curl_share_cleanup(CURLSH *sh)
+curl_share_cleanup(struct Curl_share *share)
{
- struct Curl_share *share = (struct Curl_share *)sh;
-
if(share == NULL)
return CURLSHE_INVALID;
@@ -213,7 +210,7 @@ curl_share_cleanup(CURLSH *sh)
CURLSHcode
-Curl_share_lock(struct SessionHandle *data, curl_lock_data type,
+Curl_share_lock(struct Curl_easy *data, curl_lock_data type,
curl_lock_access accesstype)
{
struct Curl_share *share = data->share;
@@ -231,7 +228,7 @@ Curl_share_lock(struct SessionHandle *data, curl_lock_data type,
}
CURLSHcode
-Curl_share_unlock(struct SessionHandle *data, curl_lock_data type)
+Curl_share_unlock(struct Curl_easy *data, curl_lock_data type)
{
struct Curl_share *share = data->share;
diff --git a/lib/share.h b/lib/share.h
index d23d3a04..e689ff2d 100644
--- a/lib/share.h
+++ b/lib/share.h
@@ -54,8 +54,8 @@ struct Curl_share {
long sessionage;
};
-CURLSHcode Curl_share_lock (struct SessionHandle *, curl_lock_data,
+CURLSHcode Curl_share_lock (struct Curl_easy *, curl_lock_data,
curl_lock_access);
-CURLSHcode Curl_share_unlock (struct SessionHandle *, curl_lock_data);
+CURLSHcode Curl_share_unlock (struct Curl_easy *, curl_lock_data);
#endif /* HEADER_CURL_SHARE_H */
diff --git a/lib/sigpipe.h b/lib/sigpipe.h
index 6559c742..800f9d3b 100644
--- a/lib/sigpipe.h
+++ b/lib/sigpipe.h
@@ -38,10 +38,10 @@ struct sigpipe_ignore {
* internals, and then sigpipe_restore() will restore the situation when we
* return from libcurl again.
*/
-static void sigpipe_ignore(struct SessionHandle *data,
+static void sigpipe_ignore(struct Curl_easy *data,
struct sigpipe_ignore *ig)
{
- /* get a local copy of no_signal because the SessionHandle might not be
+ /* get a local copy of no_signal because the Curl_easy might not be
around when we restore */
ig->no_signal = data->set.no_signal;
if(!data->set.no_signal) {
diff --git a/lib/smb.c b/lib/smb.c
index 2c33c117..56a38c2f 100644
--- a/lib/smb.c
+++ b/lib/smb.c
@@ -905,7 +905,6 @@ static CURLcode smb_disconnect(struct connectdata *conn, bool dead)
/* smb_done is not always called, so cleanup the request */
if(req) {
Curl_safefree(req->share);
- Curl_safefree(conn->data->req.protop);
}
return CURLE_OK;
@@ -930,7 +929,7 @@ static int smb_getsock(struct connectdata *conn, curl_socket_t *socks,
static CURLcode smb_parse_url_path(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct smb_request *req = data->req.protop;
char *path;
char *slash;
diff --git a/lib/smtp.c b/lib/smtp.c
index 2a5b2bfe..d203b532 100644
--- a/lib/smtp.c
+++ b/lib/smtp.c
@@ -520,7 +520,7 @@ static CURLcode smtp_perform_authentication(struct connectdata *conn)
static CURLcode smtp_perform_command(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct SMTP *smtp = data->req.protop;
/* Send the command */
@@ -552,7 +552,7 @@ static CURLcode smtp_perform_mail(struct connectdata *conn)
char *auth = NULL;
char *size = NULL;
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
/* Calculate the FROM parameter */
if(!data->set.str[STRING_MAIL_FROM])
@@ -627,7 +627,7 @@ static CURLcode smtp_perform_mail(struct connectdata *conn)
static CURLcode smtp_perform_rcpt_to(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct SMTP *smtp = data->req.protop;
/* Send the RCPT TO command */
@@ -668,7 +668,7 @@ static CURLcode smtp_state_servergreet_resp(struct connectdata *conn,
smtpstate instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
(void)instate; /* no use for this yet */
@@ -688,7 +688,7 @@ static CURLcode smtp_state_starttls_resp(struct connectdata *conn,
smtpstate instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
(void)instate; /* no use for this yet */
@@ -711,7 +711,7 @@ static CURLcode smtp_state_ehlo_resp(struct connectdata *conn, int smtpcode,
smtpstate instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct smtp_conn *smtpc = &conn->proto.smtpc;
const char *line = data->state.buffer;
size_t len = strlen(line);
@@ -806,7 +806,7 @@ static CURLcode smtp_state_helo_resp(struct connectdata *conn, int smtpcode,
smtpstate instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
(void)instate; /* no use for this yet */
@@ -827,7 +827,7 @@ static CURLcode smtp_state_auth_resp(struct connectdata *conn,
smtpstate instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct smtp_conn *smtpc = &conn->proto.smtpc;
saslprogress progress;
@@ -855,7 +855,7 @@ static CURLcode smtp_state_command_resp(struct connectdata *conn, int smtpcode,
smtpstate instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct SMTP *smtp = data->req.protop;
char *line = data->state.buffer;
size_t len = strlen(line);
@@ -901,7 +901,7 @@ static CURLcode smtp_state_mail_resp(struct connectdata *conn, int smtpcode,
smtpstate instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
(void)instate; /* no use for this yet */
@@ -921,7 +921,7 @@ static CURLcode smtp_state_rcpt_resp(struct connectdata *conn, int smtpcode,
smtpstate instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct SMTP *smtp = data->req.protop;
(void)instate; /* no use for this yet */
@@ -953,7 +953,7 @@ static CURLcode smtp_state_data_resp(struct connectdata *conn, int smtpcode,
smtpstate instate)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
(void)instate; /* no use for this yet */
@@ -998,7 +998,7 @@ static CURLcode smtp_statemach_act(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
curl_socket_t sock = conn->sock[FIRSTSOCKET];
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
int smtpcode;
struct smtp_conn *smtpc = &conn->proto.smtpc;
struct pingpong *pp = &smtpc->pp;
@@ -1108,12 +1108,12 @@ static CURLcode smtp_block_statemach(struct connectdata *conn)
return result;
}
-/* Allocate and initialize the SMTP struct for the current SessionHandle if
+/* Allocate and initialize the SMTP struct for the current Curl_easy if
required */
static CURLcode smtp_init(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct SMTP *smtp;
smtp = data->req.protop = calloc(sizeof(struct SMTP), 1);
@@ -1194,7 +1194,7 @@ static CURLcode smtp_done(struct connectdata *conn, CURLcode status,
bool premature)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct SMTP *smtp = data->req.protop;
struct pingpong *pp = &conn->proto.smtpc.pp;
char *eob;
@@ -1284,7 +1284,7 @@ static CURLcode smtp_perform(struct connectdata *conn, bool *connected,
{
/* This is SMTP and no proxy */
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct SMTP *smtp = data->req.protop;
DEBUGF(infof(conn->data, "DO phase starts\n"));
@@ -1423,7 +1423,7 @@ static CURLcode smtp_regular_transfer(struct connectdata *conn,
{
CURLcode result = CURLE_OK;
bool connected = FALSE;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
/* Make sure size is unknown at this point */
data->req.size = -1;
@@ -1446,7 +1446,7 @@ static CURLcode smtp_regular_transfer(struct connectdata *conn,
static CURLcode smtp_setup_connection(struct connectdata *conn)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
CURLcode result;
/* Clear the TLS upgraded flag */
@@ -1534,7 +1534,7 @@ static CURLcode smtp_parse_url_options(struct connectdata *conn)
static CURLcode smtp_parse_url_path(struct connectdata *conn)
{
/* The SMTP struct is already initialised in smtp_connect() */
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct smtp_conn *smtpc = &conn->proto.smtpc;
const char *path = data->state.path;
char localhost[HOSTNAME_MAX + 1];
@@ -1560,7 +1560,7 @@ static CURLcode smtp_parse_url_path(struct connectdata *conn)
static CURLcode smtp_parse_custom_request(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct SMTP *smtp = data->req.protop;
const char *custom = data->set.str[STRING_CUSTOMREQUEST];
@@ -1581,7 +1581,7 @@ CURLcode Curl_smtp_escape_eob(struct connectdata *conn, const ssize_t nread)
*/
ssize_t i;
ssize_t si;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct SMTP *smtp = data->req.protop;
char *scratch = data->state.scratch;
char *newscratch = NULL;
diff --git a/lib/smtp.h b/lib/smtp.h
index 6ebec183..b67340a4 100644
--- a/lib/smtp.h
+++ b/lib/smtp.h
@@ -47,9 +47,9 @@ typedef enum {
SMTP_LAST /* never used */
} smtpstate;
-/* This SMTP struct is used in the SessionHandle. All SMTP data that is
+/* This SMTP struct is used in the Curl_easy. All SMTP data that is
connection-oriented must be in smtp_conn to properly deal with the fact that
- perhaps the SessionHandle is changed between the times the connection is
+ perhaps the Curl_easy is changed between the times the connection is
used. */
struct SMTP {
curl_pp_transfer transfer;
diff --git a/lib/socks.c b/lib/socks.c
index 8c412964..fccb16d4 100644
--- a/lib/socks.c
+++ b/lib/socks.c
@@ -119,7 +119,7 @@ CURLcode Curl_SOCKS4(const char *proxy_name,
int result;
CURLcode code;
curl_socket_t sock = conn->sock[sockindex];
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
if(Curl_timeleft(data, NULL, TRUE) < 0) {
/* time-out, bail out, go home */
@@ -374,7 +374,7 @@ CURLcode Curl_SOCKS5(const char *proxy_name,
int result;
CURLcode code;
curl_socket_t sock = conn->sock[sockindex];
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
long timeout;
bool socks5_resolve_local = (conn->proxytype == CURLPROXY_SOCKS5)?TRUE:FALSE;
const size_t hostname_len = strlen(hostname);
diff --git a/lib/socks_gssapi.c b/lib/socks_gssapi.c
index 1214048b..369245a6 100644
--- a/lib/socks_gssapi.c
+++ b/lib/socks_gssapi.c
@@ -43,7 +43,7 @@ static gss_ctx_id_t gss_context = GSS_C_NO_CONTEXT;
/*
* Helper GSS-API error functions.
*/
-static int check_gss_err(struct SessionHandle *data,
+static int check_gss_err(struct Curl_easy *data,
OM_uint32 major_status,
OM_uint32 minor_status,
const char* function)
@@ -102,7 +102,7 @@ static int check_gss_err(struct SessionHandle *data,
CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
struct connectdata *conn)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
curl_socket_t sock = conn->sock[sockindex];
CURLcode code;
ssize_t actualread;
diff --git a/lib/socks_sspi.c b/lib/socks_sspi.c
index ec564b48..60534903 100644
--- a/lib/socks_sspi.c
+++ b/lib/socks_sspi.c
@@ -34,6 +34,7 @@
#include "curl_sspi.h"
#include "curl_multibyte.h"
#include "warnless.h"
+#include "strdup.h"
/* The last 3 #include files should be in this order */
#include "curl_printf.h"
#include "curl_memory.h"
@@ -61,7 +62,7 @@ static int check_sspi_err(struct connectdata *conn,
CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
struct connectdata *conn)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
curl_socket_t sock = conn->sock[sockindex];
CURLcode code;
ssize_t actualread;
@@ -96,10 +97,9 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
/* prepare service name */
if(strchr(service, '/')) {
- service_name = malloc(strlen(service));
+ service_name = strdup(service);
if(!service_name)
return CURLE_OUT_OF_MEMORY;
- memcpy(service_name, service, strlen(service));
}
else {
service_name = malloc(strlen(service) + strlen(conn->proxy.name) + 2);
diff --git a/lib/speedcheck.c b/lib/speedcheck.c
index 4706d2df..13c34af9 100644
--- a/lib/speedcheck.c
+++ b/lib/speedcheck.c
@@ -28,12 +28,12 @@
#include "multiif.h"
#include "speedcheck.h"
-void Curl_speedinit(struct SessionHandle *data)
+void Curl_speedinit(struct Curl_easy *data)
{
memset(&data->state.keeps_speed, 0, sizeof(struct timeval));
}
-CURLcode Curl_speedcheck(struct SessionHandle *data,
+CURLcode Curl_speedcheck(struct Curl_easy *data,
struct timeval now)
{
if((data->progress.current_speed >= 0) &&
diff --git a/lib/speedcheck.h b/lib/speedcheck.h
index e1921d66..7dbe3d6d 100644
--- a/lib/speedcheck.h
+++ b/lib/speedcheck.h
@@ -26,8 +26,8 @@
#include "timeval.h"
-void Curl_speedinit(struct SessionHandle *data);
-CURLcode Curl_speedcheck(struct SessionHandle *data,
+void Curl_speedinit(struct Curl_easy *data);
+CURLcode Curl_speedcheck(struct Curl_easy *data,
struct timeval now);
#endif /* HEADER_CURL_SPEEDCHECK_H */
diff --git a/lib/ssh.c b/lib/ssh.c
index d5a1a2a8..7bc31362 100644
--- a/lib/ssh.c
+++ b/lib/ssh.c
@@ -413,7 +413,7 @@ static CURLcode ssh_getworkingpath(struct connectdata *conn,
char **path) /* returns the allocated
real path to work with */
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
char *real_path = NULL;
char *working_path;
int working_path_len;
@@ -473,7 +473,7 @@ static CURLcode ssh_getworkingpath(struct connectdata *conn,
}
#ifdef HAVE_LIBSSH2_KNOWNHOST_API
-static int sshkeycallback(CURL *easy,
+static int sshkeycallback(struct Curl_easy *easy,
const struct curl_khkey *knownkey, /* known */
const struct curl_khkey *foundkey, /* found */
enum curl_khmatch match,
@@ -522,7 +522,7 @@ static CURLcode ssh_knownhost(struct connectdata *conn)
CURLcode result = CURLE_OK;
#ifdef HAVE_LIBSSH2_KNOWNHOST_API
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
if(data->set.str[STRING_SSH_KNOWNHOSTS]) {
/* we're asked to verify the host against a file */
@@ -657,7 +657,7 @@ static CURLcode ssh_knownhost(struct connectdata *conn)
static CURLcode ssh_check_fingerprint(struct connectdata *conn)
{
struct ssh_conn *sshc = &conn->proto.sshc;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
const char *pubkey_md5 = data->set.str[STRING_SSH_HOST_PUBLIC_KEY_MD5];
char md5buffer[33];
int i;
@@ -708,7 +708,7 @@ static CURLcode ssh_check_fingerprint(struct connectdata *conn)
static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct SSHPROTO *sftp_scp = data->req.protop;
struct ssh_conn *sshc = &conn->proto.sshc;
curl_socket_t sock = conn->sock[FIRSTSOCKET];
@@ -1161,8 +1161,13 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
else {
/* Return the error type */
err = sftp_libssh2_last_error(sshc->sftp_session);
- result = sftp_libssh2_error_to_CURLE(err);
- sshc->actualcode = result?result:CURLE_SSH;
+ if(err)
+ result = sftp_libssh2_error_to_CURLE(err);
+ else
+ /* in this case, the error wasn't in the SFTP level but for example
+ a time-out or similar */
+ result = CURLE_SSH;
+ sshc->actualcode = result;
DEBUGF(infof(data, "error = %d makes libcurl = %d\n",
err, (int)result));
state(conn, SSH_STOP);
@@ -2819,7 +2824,7 @@ static CURLcode ssh_block_statemach(struct connectdata *conn,
{
struct ssh_conn *sshc = &conn->proto.sshc;
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
while((sshc->state != SSH_STOP) && !result) {
bool block;
@@ -2893,7 +2898,7 @@ static CURLcode ssh_connect(struct connectdata *conn, bool *done)
#endif
struct ssh_conn *ssh;
CURLcode result;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
/* initialize per-handle data if not already */
if(!data->req.protop)
@@ -3019,7 +3024,7 @@ static CURLcode ssh_do(struct connectdata *conn, bool *done)
{
CURLcode result;
bool connected = 0;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ssh_conn *sshc = &conn->proto.sshc;
*done = FALSE; /* default to false */
@@ -3052,8 +3057,6 @@ static CURLcode scp_disconnect(struct connectdata *conn, bool dead_connection)
struct ssh_conn *ssh = &conn->proto.sshc;
(void) dead_connection;
- Curl_safefree(conn->data->req.protop);
-
if(ssh->ssh_session) {
/* only if there's a session still around to use! */
@@ -3215,8 +3218,6 @@ static CURLcode sftp_disconnect(struct connectdata *conn, bool dead_connection)
DEBUGF(infof(conn->data, "SSH DISCONNECT starts now\n"));
- Curl_safefree(conn->data->req.protop);
-
if(conn->proto.sshc.ssh_session) {
/* only if there's a session still around to use! */
state(conn, SSH_SFTP_SHUTDOWN);
diff --git a/lib/ssh.h b/lib/ssh.h
index 5b4b78ff..b350dcf3 100644
--- a/lib/ssh.h
+++ b/lib/ssh.h
@@ -98,7 +98,7 @@ typedef enum {
} sshstate;
/* this struct is used in the HandleData struct which is part of the
- SessionHandle, which means this is used on a per-easy handle basis.
+ Curl_easy, which means this is used on a per-easy handle basis.
Everything that is strictly related to a connection is banned from this
struct. */
struct SSHPROTO {
diff --git a/lib/system_win32.c b/lib/system_win32.c
index 73d30b42..d6a998b2 100644
--- a/lib/system_win32.c
+++ b/lib/system_win32.c
@@ -24,9 +24,6 @@
#if defined(WIN32)
-#if defined(USE_WINDOWS_SSPI) || (!defined(CURL_DISABLE_TELNET) && \
- defined(USE_WINSOCK))
-
#include <curl/curl.h>
#include "system_win32.h"
@@ -34,6 +31,10 @@
#include "curl_memory.h"
#include "memdebug.h"
+#if defined(USE_WINDOWS_SSPI) || (!defined(CURL_DISABLE_TELNET) && \
+ defined(USE_WINSOCK))
+
+
#if !defined(LOAD_WITH_ALTERED_SEARCH_PATH)
#define LOAD_WITH_ALTERED_SEARCH_PATH 0x00000008
#endif
@@ -56,6 +57,166 @@ typedef HMODULE (APIENTRY *LOADLIBRARYEX_FN)(LPCTSTR, HANDLE, DWORD);
# define LOADLIBARYEX "LoadLibraryExA"
#endif
+#endif /* USE_WINDOWS_SSPI || (!CURL_DISABLE_TELNET && USE_WINSOCK) */
+
+/*
+ * Curl_verify_windows_version()
+ *
+ * This is used to verify if we are running on a specific windows version.
+ *
+ * Parameters:
+ *
+ * majorVersion [in] - The major version number.
+ * minorVersion [in] - The minor version number.
+ * platform [in] - The optional platform identifer.
+ * condition [in] - The test condition used to specifier whether we are
+ * checking a version less then, equal to or greater than
+ * what is specified in the major and minor version
+ * numbers.
+ *
+ * Returns TRUE if matched; otherwise FALSE.
+ */
+bool Curl_verify_windows_version(const unsigned int majorVersion,
+ const unsigned int minorVersion,
+ const PlatformIdentifier platform,
+ const VersionCondition condition)
+{
+ bool matched = FALSE;
+
+#if !defined(_WIN32_WINNT) || !defined(_WIN32_WINNT_WIN2K) || \
+ (_WIN32_WINNT < _WIN32_WINNT_WIN2K)
+ OSVERSIONINFO osver;
+
+ memset(&osver, 0, sizeof(osver));
+ osver.dwOSVersionInfoSize = sizeof(osver);
+
+ /* Find out Windows version */
+ if(GetVersionEx(&osver)) {
+ /* Verify the Operating System version number */
+ switch(condition) {
+ case VERSION_LESS_THAN:
+ if(osver.dwMajorVersion < majorVersion ||
+ (osver.dwMajorVersion == majorVersion &&
+ osver.dwMinorVersion < minorVersion))
+ matched = TRUE;
+ break;
+
+ case VERSION_LESS_THAN_EQUAL:
+ if(osver.dwMajorVersion <= majorVersion &&
+ osver.dwMinorVersion <= minorVersion)
+ matched = TRUE;
+ break;
+
+ case VERSION_EQUAL:
+ if(osver.dwMajorVersion == majorVersion &&
+ osver.dwMinorVersion == minorVersion)
+ matched = TRUE;
+ break;
+
+ case VERSION_GREATER_THAN_EQUAL:
+ if(osver.dwMajorVersion >= majorVersion &&
+ osver.dwMinorVersion >= minorVersion)
+ matched = TRUE;
+ break;
+
+ case VERSION_GREATER_THAN:
+ if(osver.dwMajorVersion > majorVersion ||
+ (osver.dwMajorVersion == majorVersion &&
+ osver.dwMinorVersion > minorVersion))
+ matched = TRUE;
+ break;
+ }
+
+ /* Verify the platform identifier (if necessary) */
+ if(matched && platform != PLATFORM_DONT_CARE) {
+ switch(platform) {
+ case PLATFORM_WINDOWS:
+ if(osver.dwPlatformId != VER_PLATFORM_WIN32_WINDOWS)
+ matched = FALSE;
+ break;
+
+ case PLATFORM_WINNT:
+ if(osver.dwPlatformId != VER_PLATFORM_WIN32_NT)
+ matched = FALSE;
+ }
+ }
+ }
+#else
+ ULONGLONG cm = 0;
+ OSVERSIONINFOEX osver;
+ BYTE majorCondition;
+ BYTE minorCondition;
+ BYTE spMajorCondition;
+ BYTE spMinorCondition;
+
+ switch(condition) {
+ case VERSION_LESS_THAN:
+ majorCondition = VER_LESS;
+ minorCondition = VER_LESS;
+ spMajorCondition = VER_LESS_EQUAL;
+ spMinorCondition = VER_LESS_EQUAL;
+ break;
+
+ case VERSION_LESS_THAN_EQUAL:
+ majorCondition = VER_LESS_EQUAL;
+ minorCondition = VER_LESS_EQUAL;
+ spMajorCondition = VER_LESS_EQUAL;
+ spMinorCondition = VER_LESS_EQUAL;
+ break;
+
+ case VERSION_EQUAL:
+ majorCondition = VER_EQUAL;
+ minorCondition = VER_EQUAL;
+ spMajorCondition = VER_GREATER_EQUAL;
+ spMinorCondition = VER_GREATER_EQUAL;
+ break;
+
+ case VERSION_GREATER_THAN_EQUAL:
+ majorCondition = VER_GREATER_EQUAL;
+ minorCondition = VER_GREATER_EQUAL;
+ spMajorCondition = VER_GREATER_EQUAL;
+ spMinorCondition = VER_GREATER_EQUAL;
+ break;
+
+ case VERSION_GREATER_THAN:
+ majorCondition = VER_GREATER;
+ minorCondition = VER_GREATER;
+ spMajorCondition = VER_GREATER_EQUAL;
+ spMinorCondition = VER_GREATER_EQUAL;
+ break;
+
+ default:
+ return FALSE;
+ }
+
+ memset(&osver, 0, sizeof(osver));
+ osver.dwOSVersionInfoSize = sizeof(osver);
+ osver.dwMajorVersion = majorVersion;
+ osver.dwMinorVersion = minorVersion;
+ if(platform == PLATFORM_WINDOWS)
+ osver.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS;
+ else if(platform == PLATFORM_WINNT)
+ osver.dwPlatformId = VER_PLATFORM_WIN32_NT;
+
+ cm = VerSetConditionMask(cm, VER_MAJORVERSION, majorCondition);
+ cm = VerSetConditionMask(cm, VER_MINORVERSION, minorCondition);
+ cm = VerSetConditionMask(cm, VER_SERVICEPACKMAJOR, spMajorCondition);
+ cm = VerSetConditionMask(cm, VER_SERVICEPACKMINOR, spMinorCondition);
+ if(platform != PLATFORM_DONT_CARE)
+ cm = VerSetConditionMask(cm, VER_PLATFORMID, VER_EQUAL);
+
+ if(VerifyVersionInfo(&osver, (VER_MAJORVERSION | VER_MINORVERSION |
+ VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR),
+ cm))
+ matched = TRUE;
+#endif
+
+ return matched;
+}
+
+#if defined(USE_WINDOWS_SSPI) || (!defined(CURL_DISABLE_TELNET) && \
+ defined(USE_WINSOCK))
+
/*
* Curl_load_library()
*
@@ -88,10 +249,12 @@ HMODULE Curl_load_library(LPCTSTR filename)
there is. Note: Both back slashes and forward slashes have been supported
since the earlier days of DOS at an API level although they are not
supported by command prompt */
- if(_tcspbrk(filename, TEXT("\\/")))
+ if(_tcspbrk(filename, TEXT("\\/"))) {
+ /** !checksrc! disable BANNEDFUNC 1 **/
hModule = pLoadLibraryEx ?
pLoadLibraryEx(filename, NULL, LOAD_WITH_ALTERED_SEARCH_PATH) :
LoadLibrary(filename);
+ }
/* Detect if KB2533623 is installed, as LOAD_LIBARY_SEARCH_SYSTEM32 is only
supported on Windows Vista, Windows Server 2008, Windows 7 and Windows
Server 2008 R2 with this patch or natively on Windows 8 and above */
@@ -113,12 +276,13 @@ HMODULE Curl_load_library(LPCTSTR filename)
_tcscpy(path + _tcslen(path), filename);
/* Load the DLL from the Windows system directory */
+ /** !checksrc! disable BANNEDFUNC 1 **/
hModule = pLoadLibraryEx ?
pLoadLibraryEx(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH) :
LoadLibrary(path);
- free(path);
}
+ free(path);
}
}
diff --git a/lib/system_win32.h b/lib/system_win32.h
index dec18899..1e772856 100644
--- a/lib/system_win32.h
+++ b/lib/system_win32.h
@@ -26,6 +26,28 @@
#if defined(WIN32)
+/* Version condition */
+typedef enum {
+ VERSION_LESS_THAN,
+ VERSION_LESS_THAN_EQUAL,
+ VERSION_EQUAL,
+ VERSION_GREATER_THAN_EQUAL,
+ VERSION_GREATER_THAN
+} VersionCondition;
+
+/* Platform identifier */
+typedef enum {
+ PLATFORM_DONT_CARE,
+ PLATFORM_WINDOWS,
+ PLATFORM_WINNT
+} PlatformIdentifier;
+
+/* This is used to verify if we are running on a specific windows version */
+bool Curl_verify_windows_version(const unsigned int majorVersion,
+ const unsigned int minorVersion,
+ const PlatformIdentifier platform,
+ const VersionCondition condition);
+
#if defined(USE_WINDOWS_SSPI) || (!defined(CURL_DISABLE_TELNET) && \
defined(USE_WINSOCK))
diff --git a/lib/telnet.c b/lib/telnet.c
index 870a1b82..cc705cfc 100644
--- a/lib/telnet.c
+++ b/lib/telnet.c
@@ -92,7 +92,7 @@
#ifdef USE_WINSOCK
typedef FARPROC WSOCK2_FUNC;
-static CURLcode check_wsock2 (struct SessionHandle *data);
+static CURLcode check_wsock2 (struct Curl_easy *data);
#endif
static
@@ -101,7 +101,7 @@ CURLcode telrcv(struct connectdata *,
ssize_t count); /* Number of bytes received */
#ifndef CURL_DISABLE_VERBOSE_STRINGS
-static void printoption(struct SessionHandle *data,
+static void printoption(struct Curl_easy *data,
const char *direction,
int cmd, int option);
#endif
@@ -111,7 +111,7 @@ static void send_negotiation(struct connectdata *, int cmd, int option);
static void set_local_option(struct connectdata *, int cmd, int option);
static void set_remote_option(struct connectdata *, int cmd, int option);
-static void printsub(struct SessionHandle *data,
+static void printsub(struct Curl_easy *data,
int direction, unsigned char *pointer,
size_t length);
static void suboption(struct connectdata *);
@@ -199,7 +199,7 @@ const struct Curl_handler Curl_handler_telnet = {
#ifdef USE_WINSOCK
static CURLcode
-check_wsock2(struct SessionHandle *data)
+check_wsock2(struct Curl_easy *data)
{
int err;
WORD wVersionRequested;
@@ -306,7 +306,7 @@ static void negotiate(struct connectdata *conn)
}
#ifndef CURL_DISABLE_VERBOSE_STRINGS
-static void printoption(struct SessionHandle *data,
+static void printoption(struct Curl_easy *data,
const char *direction, int cmd, int option)
{
const char *fmt;
@@ -347,7 +347,7 @@ static void send_negotiation(struct connectdata *conn, int cmd, int option)
unsigned char buf[3];
ssize_t bytes_written;
int err;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
buf[0] = CURL_IAC;
buf[1] = (unsigned char)cmd;
@@ -703,7 +703,7 @@ void rec_dont(struct connectdata *conn, int option)
}
-static void printsub(struct SessionHandle *data,
+static void printsub(struct Curl_easy *data,
int direction, /* '<' or '>' */
unsigned char *pointer, /* where suboption data is */
size_t length) /* length of suboption data */
@@ -822,7 +822,7 @@ static CURLcode check_telnet_options(struct connectdata *conn)
struct curl_slist *beg;
char option_keyword[128] = "";
char option_arg[256] = "";
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct TELNET *tn = (struct TELNET *)conn->data->req.protop;
CURLcode result = CURLE_OK;
int binary_option;
@@ -932,7 +932,7 @@ static void suboption(struct connectdata *conn)
int err;
char varname[128] = "";
char varval[128] = "";
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct TELNET *tn = (struct TELNET *)data->req.protop;
printsub(data, '<', (unsigned char *)tn->subbuffer, CURL_SB_LEN(tn)+2);
@@ -1007,7 +1007,7 @@ static void sendsuboption(struct connectdata *conn, int option)
unsigned short x, y;
unsigned char*uc1, *uc2;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct TELNET *tn = (struct TELNET *)data->req.protop;
switch (option) {
@@ -1065,7 +1065,7 @@ CURLcode telrcv(struct connectdata *conn,
CURLcode result;
int in = 0;
int startwrite=-1;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct TELNET *tn = (struct TELNET *)data->req.protop;
#define startskipping() \
@@ -1282,7 +1282,7 @@ static CURLcode telnet_done(struct connectdata *conn,
static CURLcode telnet_do(struct connectdata *conn, bool *done)
{
CURLcode result;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
curl_socket_t sockfd = conn->sock[FIRSTSOCKET];
#ifdef USE_WINSOCK
HMODULE wsock2;
diff --git a/lib/tftp.c b/lib/tftp.c
index 3c3eb5e1..d7ff94f7 100644
--- a/lib/tftp.c
+++ b/lib/tftp.c
@@ -333,7 +333,7 @@ static CURLcode tftp_parse_option_ack(tftp_state_data_t *state,
const char *ptr, int len)
{
const char *tmp = ptr;
- struct SessionHandle *data = state->conn->data;
+ struct Curl_easy *data = state->conn->data;
/* if OACK doesn't contain blksize option, the default (512) must be used */
state->blksize = TFTP_BLKSIZE_DEFAULT;
@@ -416,7 +416,7 @@ static CURLcode tftp_connect_for_tx(tftp_state_data_t *state,
{
CURLcode result;
#ifndef CURL_DISABLE_VERBOSE_STRINGS
- struct SessionHandle *data = state->conn->data;
+ struct Curl_easy *data = state->conn->data;
infof(data, "%s\n", "Connected for transmit");
#endif
@@ -432,7 +432,7 @@ static CURLcode tftp_connect_for_rx(tftp_state_data_t *state,
{
CURLcode result;
#ifndef CURL_DISABLE_VERBOSE_STRINGS
- struct SessionHandle *data = state->conn->data;
+ struct Curl_easy *data = state->conn->data;
infof(data, "%s\n", "Connected for receive");
#endif
@@ -450,7 +450,7 @@ static CURLcode tftp_send_first(tftp_state_data_t *state, tftp_event_t event)
const char *mode = "octet";
char *filename;
char buf[64];
- struct SessionHandle *data = state->conn->data;
+ struct Curl_easy *data = state->conn->data;
CURLcode result = CURLE_OK;
/* Set ascii mode if -B flag was used */
@@ -581,7 +581,7 @@ static CURLcode tftp_rx(tftp_state_data_t *state, tftp_event_t event)
{
ssize_t sbytes;
int rblock;
- struct SessionHandle *data = state->conn->data;
+ struct Curl_easy *data = state->conn->data;
switch(event) {
@@ -700,7 +700,7 @@ static CURLcode tftp_rx(tftp_state_data_t *state, tftp_event_t event)
**********************************************************/
static CURLcode tftp_tx(tftp_state_data_t *state, tftp_event_t event)
{
- struct SessionHandle *data = state->conn->data;
+ struct Curl_easy *data = state->conn->data;
ssize_t sbytes;
int rblock;
CURLcode result = CURLE_OK;
@@ -889,7 +889,7 @@ static CURLcode tftp_state_machine(tftp_state_data_t *state,
tftp_event_t event)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = state->conn->data;
+ struct Curl_easy *data = state->conn->data;
switch(state->state) {
case TFTP_STATE_START:
@@ -1081,7 +1081,7 @@ static CURLcode tftp_receive_packet(struct connectdata *conn)
struct Curl_sockaddr_storage fromaddr;
curl_socklen_t fromlen;
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
tftp_state_data_t *state = (tftp_state_data_t *)conn->proto.tftpc;
struct SingleRequest *k = &data->req;
@@ -1200,7 +1200,7 @@ static CURLcode tftp_multi_statemach(struct connectdata *conn, bool *done)
int rc;
tftp_event_t event;
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
tftp_state_data_t *state = (tftp_state_data_t *)conn->proto.tftpc;
long timeout_ms = tftp_state_timeout(conn, &event);
@@ -1342,7 +1342,7 @@ static CURLcode tftp_do(struct connectdata *conn, bool *done)
static CURLcode tftp_setup_connection(struct connectdata * conn)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
char * type;
char command;
diff --git a/lib/transfer.c b/lib/transfer.c
index 4a12ee9a..f5987feb 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -87,7 +87,7 @@
*/
CURLcode Curl_fillreadbuffer(struct connectdata *conn, int bytes, int *nreadp)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
size_t buffersize = (size_t)bytes;
int nread;
#ifdef CURL_DOES_CONVERSIONS
@@ -242,7 +242,7 @@ CURLcode Curl_fillreadbuffer(struct connectdata *conn, int bytes, int *nreadp)
*/
CURLcode Curl_readrewind(struct connectdata *conn)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
conn->bits.rewindaftersend = FALSE; /* we rewind now */
@@ -352,7 +352,7 @@ static void read_rewind(struct connectdata *conn,
* Check to see if CURLOPT_TIMECONDITION was met by comparing the time of the
* remote document with the time provided by CURLOPT_TIMEVAL
*/
-bool Curl_meets_timecondition(struct SessionHandle *data, time_t timeofdoc)
+bool Curl_meets_timecondition(struct Curl_easy *data, time_t timeofdoc)
{
if((timeofdoc == 0) || (data->set.timevalue == 0))
return TRUE;
@@ -385,7 +385,7 @@ bool Curl_meets_timecondition(struct SessionHandle *data, time_t timeofdoc)
* the stream was rewound (in which case we have data in a
* buffer)
*/
-static CURLcode readwrite_data(struct SessionHandle *data,
+static CURLcode readwrite_data(struct Curl_easy *data,
struct connectdata *conn,
struct SingleRequest *k,
int *didwhat, bool *done)
@@ -833,7 +833,7 @@ static CURLcode done_sending(struct connectdata *conn,
/*
* Send data to upload to the server, when the socket is writable.
*/
-static CURLcode readwrite_upload(struct SessionHandle *data,
+static CURLcode readwrite_upload(struct Curl_easy *data,
struct connectdata *conn,
struct SingleRequest *k,
int *didwhat)
@@ -1031,7 +1031,7 @@ static CURLcode readwrite_upload(struct SessionHandle *data,
* be read and written to/from the connection.
*/
CURLcode Curl_readwrite(struct connectdata *conn,
- struct SessionHandle *data,
+ struct Curl_easy *data,
bool *done)
{
struct SingleRequest *k = &data->req;
@@ -1208,7 +1208,7 @@ int Curl_single_getsock(const struct connectdata *conn,
of sockets */
int numsocks)
{
- const struct SessionHandle *data = conn->data;
+ const struct Curl_easy *data = conn->data;
int bitmap = GETSOCK_BLANK;
unsigned sockindex = 0;
@@ -1305,7 +1305,7 @@ long Curl_sleep_time(curl_off_t rate_bps, curl_off_t cur_rate_bps,
/* Curl_init_CONNECT() gets called each time the handle switches to CONNECT
which means this gets called once for each subsequent redirect etc */
-void Curl_init_CONNECT(struct SessionHandle *data)
+void Curl_init_CONNECT(struct Curl_easy *data)
{
data->state.fread_func = data->set.fread_func_set;
data->state.in = data->set.in_set;
@@ -1316,7 +1316,7 @@ void Curl_init_CONNECT(struct SessionHandle *data)
* once for one transfer no matter if it has redirects or do multi-pass
* authentication etc.
*/
-CURLcode Curl_pretransfer(struct SessionHandle *data)
+CURLcode Curl_pretransfer(struct Curl_easy *data)
{
CURLcode result;
if(!data->change.url) {
@@ -1403,7 +1403,7 @@ CURLcode Curl_pretransfer(struct SessionHandle *data)
/*
* Curl_posttransfer() is called immediately after a transfer ends
*/
-CURLcode Curl_posttransfer(struct SessionHandle *data)
+CURLcode Curl_posttransfer(struct Curl_easy *data)
{
#if defined(HAVE_SIGNAL) && defined(SIGPIPE) && !defined(HAVE_MSG_NOSIGNAL)
/* restore the signal handler for SIGPIPE before we get back */
@@ -1660,7 +1660,7 @@ static char *concat_url(const char *base, const char *relurl)
* Curl_follow() handles the URL redirect magic. Pass in the 'newurl' string
* as given by the remote server and set up the new URL to request.
*/
-CURLcode Curl_follow(struct SessionHandle *data,
+CURLcode Curl_follow(struct Curl_easy *data,
char *newurl, /* this 'newurl' is the Location: string,
and it must be malloc()ed before passed
here */
@@ -1864,7 +1864,7 @@ CURLcode Curl_follow(struct SessionHandle *data,
CURLcode Curl_retry_request(struct connectdata *conn,
char **url)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
*url = NULL;
@@ -1920,7 +1920,7 @@ Curl_setup_transfer(
curl_off_t *writecountp /* return number of bytes written or NULL */
)
{
- struct SessionHandle *data;
+ struct Curl_easy *data;
struct SingleRequest *k;
DEBUGASSERT(conn != NULL);
diff --git a/lib/transfer.h b/lib/transfer.h
index 802344f2..0e253e37 100644
--- a/lib/transfer.h
+++ b/lib/transfer.h
@@ -22,11 +22,11 @@
*
***************************************************************************/
-void Curl_init_CONNECT(struct SessionHandle *data);
+void Curl_init_CONNECT(struct Curl_easy *data);
-CURLcode Curl_pretransfer(struct SessionHandle *data);
+CURLcode Curl_pretransfer(struct Curl_easy *data);
CURLcode Curl_second_connect(struct connectdata *conn);
-CURLcode Curl_posttransfer(struct SessionHandle *data);
+CURLcode Curl_posttransfer(struct Curl_easy *data);
typedef enum {
FOLLOW_NONE, /* not used within the function, just a placeholder to
@@ -38,19 +38,19 @@ typedef enum {
FOLLOW_LAST /* never used */
} followtype;
-CURLcode Curl_follow(struct SessionHandle *data, char *newurl,
+CURLcode Curl_follow(struct Curl_easy *data, char *newurl,
followtype type);
CURLcode Curl_readwrite(struct connectdata *conn,
- struct SessionHandle *data, bool *done);
+ struct Curl_easy *data, bool *done);
int Curl_single_getsock(const struct connectdata *conn,
curl_socket_t *socks,
int numsocks);
CURLcode Curl_readrewind(struct connectdata *conn);
CURLcode Curl_fillreadbuffer(struct connectdata *conn, int bytes, int *nreadp);
CURLcode Curl_retry_request(struct connectdata *conn, char **url);
-bool Curl_meets_timecondition(struct SessionHandle *data, time_t timeofdoc);
+bool Curl_meets_timecondition(struct Curl_easy *data, time_t timeofdoc);
/* This sets up a forthcoming transfer */
void
diff --git a/lib/url.c b/lib/url.c
index 2a302665..e547e5c1 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -137,12 +137,12 @@ bool curl_win32_idn_to_ascii(const char *in, char **out);
/* Local static prototypes */
static struct connectdata *
-find_oldest_idle_connection_in_bundle(struct SessionHandle *data,
+find_oldest_idle_connection_in_bundle(struct Curl_easy *data,
struct connectbundle *bundle);
static void conn_free(struct connectdata *conn);
static void free_fixed_hostname(struct hostname *host);
static void signalPipeClose(struct curl_llist *pipeline, bool pipe_broke);
-static CURLcode parse_url_login(struct SessionHandle *data,
+static CURLcode parse_url_login(struct Curl_easy *data,
struct connectdata *conn,
char **userptr, char **passwdptr,
char **optionsptr);
@@ -277,7 +277,7 @@ static const struct Curl_handler Curl_handler_dummy = {
PROTOPT_NONE /* flags */
};
-void Curl_freeset(struct SessionHandle *data)
+void Curl_freeset(struct Curl_easy *data)
{
/* Free all dynamic strings stored in the data->set substructure. */
enum dupstring i;
@@ -355,7 +355,7 @@ static CURLcode setstropt_userpwd(char *option, char **userp, char **passwdp)
return result;
}
-CURLcode Curl_dupset(struct SessionHandle *dst, struct SessionHandle *src)
+CURLcode Curl_dupset(struct Curl_easy *dst, struct Curl_easy *src)
{
CURLcode result = CURLE_OK;
enum dupstring i;
@@ -398,7 +398,7 @@ CURLcode Curl_dupset(struct SessionHandle *dst, struct SessionHandle *src)
* when curl_easy_perform() is invoked.
*/
-CURLcode Curl_close(struct SessionHandle *data)
+CURLcode Curl_close(struct Curl_easy *data)
{
struct Curl_multi *m;
@@ -496,8 +496,8 @@ CURLcode Curl_close(struct SessionHandle *data)
}
/*
- * Initialize the UserDefined fields within a SessionHandle.
- * This may be safely called on a new or existing SessionHandle.
+ * Initialize the UserDefined fields within a Curl_easy.
+ * This may be safely called on a new or existing Curl_easy.
*/
CURLcode Curl_init_userdefined(struct UserDefined *set)
{
@@ -621,16 +621,16 @@ CURLcode Curl_init_userdefined(struct UserDefined *set)
* @return CURLcode
*/
-CURLcode Curl_open(struct SessionHandle **curl)
+CURLcode Curl_open(struct Curl_easy **curl)
{
CURLcode result;
- struct SessionHandle *data;
+ struct Curl_easy *data;
/* Very simple start-up: alloc the struct, init it with zeroes and return */
- data = calloc(1, sizeof(struct SessionHandle));
+ data = calloc(1, sizeof(struct Curl_easy));
if(!data) {
/* this is a very serious error */
- DEBUGF(fprintf(stderr, "Error: calloc of SessionHandle failed\n"));
+ DEBUGF(fprintf(stderr, "Error: calloc of Curl_easy failed\n"));
return CURLE_OUT_OF_MEMORY;
}
@@ -684,7 +684,7 @@ CURLcode Curl_open(struct SessionHandle **curl)
return result;
}
-CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
+CURLcode Curl_setopt(struct Curl_easy *data, CURLoption option,
va_list param)
{
char *argptr;
@@ -2684,7 +2684,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
#ifndef USE_NGHTTP2
return CURLE_NOT_BUILT_IN;
#else
- struct SessionHandle *dep = va_arg(param, struct SessionHandle *);
+ struct Curl_easy *dep = va_arg(param, struct Curl_easy *);
if(dep && GOOD_EASY_HANDLE(dep)) {
data->set.stream_depends_on = dep;
data->set.stream_depends_e = (option == CURLOPT_STREAM_DEPENDS_E);
@@ -2812,14 +2812,14 @@ static void conn_free(struct connectdata *conn)
* primary connection, like when freeing room in the connection cache or
* killing of a dead old connection.
*
- * This function MUST NOT reset state in the SessionHandle struct if that
+ * This function MUST NOT reset state in the Curl_easy struct if that
* isn't strictly bound to the life-time of *this* particular connection.
*
*/
CURLcode Curl_disconnect(struct connectdata *conn, bool dead_connection)
{
- struct SessionHandle *data;
+ struct Curl_easy *data;
if(!conn)
return CURLE_OK; /* this is closed and fine already */
data = conn->data;
@@ -2888,7 +2888,7 @@ static bool SocketIsDead(curl_socket_t sock)
* IsPipeliningPossible() returns TRUE if the options set would allow
* pipelining/multiplexing and the connection is using a HTTP protocol.
*/
-static bool IsPipeliningPossible(const struct SessionHandle *handle,
+static bool IsPipeliningPossible(const struct Curl_easy *handle,
const struct connectdata *conn)
{
/* If a HTTP protocol and pipelining is enabled */
@@ -2909,7 +2909,7 @@ static bool IsPipeliningPossible(const struct SessionHandle *handle,
return FALSE;
}
-int Curl_removeHandleFromPipeline(struct SessionHandle *handle,
+int Curl_removeHandleFromPipeline(struct Curl_easy *handle,
struct curl_llist *pipeline)
{
if(pipeline) {
@@ -2935,18 +2935,18 @@ static void Curl_printPipeline(struct curl_llist *pipeline)
curr = pipeline->head;
while(curr) {
- struct SessionHandle *data = (struct SessionHandle *) curr->ptr;
+ struct Curl_easy *data = (struct Curl_easy *) curr->ptr;
infof(data, "Handle in pipeline: %s\n", data->state.path);
curr = curr->next;
}
}
#endif
-static struct SessionHandle* gethandleathead(struct curl_llist *pipeline)
+static struct Curl_easy* gethandleathead(struct curl_llist *pipeline)
{
struct curl_llist_element *curr = pipeline->head;
if(curr) {
- return (struct SessionHandle *) curr->ptr;
+ return (struct Curl_easy *) curr->ptr;
}
return NULL;
@@ -2954,7 +2954,7 @@ static struct SessionHandle* gethandleathead(struct curl_llist *pipeline)
/* remove the specified connection from all (possible) pipelines and related
queues */
-void Curl_getoff_all_pipelines(struct SessionHandle *data,
+void Curl_getoff_all_pipelines(struct Curl_easy *data,
struct connectdata *conn)
{
bool recv_head = (conn->readchannel_inuse &&
@@ -2978,7 +2978,7 @@ static void signalPipeClose(struct curl_llist *pipeline, bool pipe_broke)
curr = pipeline->head;
while(curr) {
struct curl_llist_element *next = curr->next;
- struct SessionHandle *data = (struct SessionHandle *) curr->ptr;
+ struct Curl_easy *data = (struct Curl_easy *) curr->ptr;
#ifdef DEBUGBUILD /* debug-only code */
if(data->magic != CURLEASY_MAGIC_NUMBER) {
@@ -3003,7 +3003,7 @@ static void signalPipeClose(struct curl_llist *pipeline, bool pipe_broke)
* found.
*/
struct connectdata *
-Curl_oldest_idle_connection(struct SessionHandle *data)
+Curl_oldest_idle_connection(struct Curl_easy *data)
{
struct conncache *bc = data->state.conn_cache;
struct curl_hash_iterator iter;
@@ -3055,7 +3055,7 @@ Curl_oldest_idle_connection(struct SessionHandle *data)
* found.
*/
static struct connectdata *
-find_oldest_idle_connection_in_bundle(struct SessionHandle *data,
+find_oldest_idle_connection_in_bundle(struct Curl_easy *data,
struct connectbundle *bundle)
{
struct curl_llist_element *curr;
@@ -3095,7 +3095,7 @@ find_oldest_idle_connection_in_bundle(struct SessionHandle *data,
* Returns TRUE if the connection actually was dead and disconnected.
*/
static bool disconnect_if_dead(struct connectdata *conn,
- struct SessionHandle *data)
+ struct Curl_easy *data)
{
size_t pipeLen = conn->send_pipe->size + conn->recv_pipe->size;
if(!pipeLen && !conn->inuse) {
@@ -3129,7 +3129,7 @@ static bool disconnect_if_dead(struct connectdata *conn,
static int call_disconnect_if_dead(struct connectdata *conn,
void *param)
{
- struct SessionHandle* data = (struct SessionHandle*)param;
+ struct Curl_easy* data = (struct Curl_easy*)param;
disconnect_if_dead(conn, data);
return 0; /* continue iteration */
}
@@ -3139,7 +3139,7 @@ static int call_disconnect_if_dead(struct connectdata *conn,
* closes and removes them.
* The cleanup is done at most once per second.
*/
-static void prune_dead_connections(struct SessionHandle *data)
+static void prune_dead_connections(struct Curl_easy *data)
{
struct timeval now = Curl_tvnow();
long elapsed = Curl_tvdiff(now, data->state.conn_cache->last_cleanup);
@@ -3171,7 +3171,7 @@ static size_t max_pipeline_length(struct Curl_multi *multi)
* the pipelining strategy wants to open a new connection instead of reusing.
*/
static bool
-ConnectionExists(struct SessionHandle *data,
+ConnectionExists(struct Curl_easy *data,
struct connectdata *needle,
struct connectdata **usethis,
bool *force_reuse,
@@ -3270,8 +3270,8 @@ ConnectionExists(struct SessionHandle *data,
if(!check->bits.multiplex) {
/* If not multiplexing, make sure the pipe has only GET requests */
- struct SessionHandle* sh = gethandleathead(check->send_pipe);
- struct SessionHandle* rh = gethandleathead(check->recv_pipe);
+ struct Curl_easy* sh = gethandleathead(check->send_pipe);
+ struct Curl_easy* rh = gethandleathead(check->recv_pipe);
if(sh) {
if(!IsPipeliningPossible(sh, check))
continue;
@@ -3756,7 +3756,7 @@ static bool is_ASCII_name(const char *hostname)
/*
* Check if characters in hostname is allowed in Top Level Domain.
*/
-static bool tld_check_name(struct SessionHandle *data,
+static bool tld_check_name(struct Curl_easy *data,
const char *ace_hostname)
{
size_t err_pos;
@@ -3798,7 +3798,7 @@ static bool tld_check_name(struct SessionHandle *data,
/*
* Perform any necessary IDN conversion of hostname
*/
-static void fix_hostname(struct SessionHandle *data,
+static void fix_hostname(struct Curl_easy *data,
struct connectdata *conn, struct hostname *host)
{
size_t len;
@@ -3887,7 +3887,7 @@ static void llist_dtor(void *user, void *element)
/*
* Allocate and initialize a new connectdata object.
*/
-static struct connectdata *allocate_conn(struct SessionHandle *data)
+static struct connectdata *allocate_conn(struct Curl_easy *data)
{
struct connectdata *conn = calloc(1, sizeof(struct connectdata));
if(!conn)
@@ -3920,7 +3920,7 @@ static struct connectdata *allocate_conn(struct SessionHandle *data)
conn->created = Curl_tvnow();
conn->data = data; /* Setup the association between this connection
- and the SessionHandle */
+ and the Curl_easy */
conn->proxytype = data->set.proxytype; /* type */
@@ -3992,7 +3992,7 @@ static struct connectdata *allocate_conn(struct SessionHandle *data)
conn->localport = data->set.localport;
/* the close socket stuff needs to be copied to the connection struct as
- it may live on without (this specific) SessionHandle */
+ it may live on without (this specific) Curl_easy */
conn->fclosesocket = data->set.fclosesocket;
conn->closesocket_client = data->set.closesocket_client;
@@ -4011,7 +4011,7 @@ static struct connectdata *allocate_conn(struct SessionHandle *data)
return NULL;
}
-static CURLcode findprotocol(struct SessionHandle *data,
+static CURLcode findprotocol(struct Curl_easy *data,
struct connectdata *conn,
const char *protostr)
{
@@ -4056,7 +4056,7 @@ static CURLcode findprotocol(struct SessionHandle *data,
/*
* Parse URL and fill in the relevant members of the connection struct.
*/
-static CURLcode parseurlandfillconn(struct SessionHandle *data,
+static CURLcode parseurlandfillconn(struct Curl_easy *data,
struct connectdata *conn,
bool *prot_missing,
char **userp, char **passwdp,
@@ -4141,12 +4141,17 @@ static CURLcode parseurlandfillconn(struct SessionHandle *data,
}
else {
/* clear path */
+ char slashbuf[4];
path[0]=0;
- if(2 > sscanf(data->change.url,
- "%15[^\n:]://%[^\n/?]%[^\n]",
- protobuf,
- conn->host.name, path)) {
+ rc = sscanf(data->change.url,
+ "%15[^\n:]:%3[/]%[^\n/?]%[^\n]",
+ protobuf, slashbuf, conn->host.name, path);
+ if(2 == rc) {
+ failf(data, "Bad URL");
+ return CURLE_URL_MALFORMAT;
+ }
+ if(3 > rc) {
/*
* The URL was badly formatted, let's try the browser-style _without_
@@ -4197,8 +4202,23 @@ static CURLcode parseurlandfillconn(struct SessionHandle *data,
*prot_missing = TRUE; /* not given in URL */
}
- else
+ else {
+ size_t s = strlen(slashbuf);
protop = protobuf;
+ if(s != 2) {
+ infof(data, "Unwillingly accepted illegal URL using %d slash%s!\n",
+ s, s>1?"es":"");
+
+ if(data->change.url_alloc)
+ free(data->change.url);
+ /* repair the URL to use two slashes */
+ data->change.url = aprintf("%s://%s%s",
+ protobuf, conn->host.name, path);
+ if(!data->change.url)
+ return CURLE_OUT_OF_MEMORY;
+ data->change.url_alloc = TRUE;
+ }
+ }
}
/* We search for '?' in the host name (but only on the right side of a
@@ -4404,7 +4424,7 @@ static CURLcode parseurlandfillconn(struct SessionHandle *data,
* If we're doing a resumed transfer, we need to setup our stuff
* properly.
*/
-static CURLcode setup_range(struct SessionHandle *data)
+static CURLcode setup_range(struct Curl_easy *data)
{
struct UrlState *s = &data->state;
s->resume_from = data->set.set_resume_from;
@@ -4436,7 +4456,7 @@ static CURLcode setup_range(struct SessionHandle *data)
* setup_connection_internals() -
*
* Setup connection internals specific to the requested protocol in the
- * SessionHandle. This is inited and setup before the connection is made but
+ * Curl_easy. This is inited and setup before the connection is made but
* is about the particular protocol that is to be used.
*
* This MUST get called after proxy magic has been figured out.
@@ -4445,7 +4465,7 @@ static CURLcode setup_connection_internals(struct connectdata *conn)
{
const struct Curl_handler * p;
CURLcode result;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
/* in some case in the multi state-machine, we go back to the CONNECT state
and then a second (or third or...) call to this function will be made
@@ -4481,10 +4501,10 @@ static CURLcode setup_connection_internals(struct connectdata *conn)
/*
* Curl_free_request_state() should free temp data that was allocated in the
- * SessionHandle for this single request.
+ * Curl_easy for this single request.
*/
-void Curl_free_request_state(struct SessionHandle *data)
+void Curl_free_request_state(struct Curl_easy *data)
{
Curl_safefree(data->req.protop);
Curl_safefree(data->req.newurl);
@@ -4658,7 +4678,7 @@ static char *detect_proxy(struct connectdata *conn)
* host name, so that we can re-use an existing connection
* that may exist registered to the same proxy host.
*/
-static CURLcode parse_proxy(struct SessionHandle *data,
+static CURLcode parse_proxy(struct Curl_easy *data,
struct connectdata *conn, char *proxy)
{
char *prox_portno;
@@ -4821,7 +4841,7 @@ static CURLcode parse_proxy(struct SessionHandle *data,
/*
* Extract the user and password from the authentication string
*/
-static CURLcode parse_proxy_auth(struct SessionHandle *data,
+static CURLcode parse_proxy_auth(struct Curl_easy *data,
struct connectdata *conn)
{
char proxyuser[MAX_CURL_USER_LENGTH]="";
@@ -4866,7 +4886,7 @@ static CURLcode parse_proxy_auth(struct SessionHandle *data,
* options - non-zero length if defined
* conn->host.name - remove user name and password
*/
-static CURLcode parse_url_login(struct SessionHandle *data,
+static CURLcode parse_url_login(struct Curl_easy *data,
struct connectdata *conn,
char **user, char **passwd, char **options)
{
@@ -5105,7 +5125,7 @@ static CURLcode parse_login_details(const char *login, const size_t len,
*
* The port number embedded in the URL is replaced, if necessary.
*************************************************************/
-static CURLcode parse_remote_port(struct SessionHandle *data,
+static CURLcode parse_remote_port(struct Curl_easy *data,
struct connectdata *conn)
{
char *portptr;
@@ -5217,7 +5237,7 @@ static CURLcode parse_remote_port(struct SessionHandle *data,
* Override the login details from the URL with that in the CURLOPT_USERPWD
* option or a .netrc file, if applicable.
*/
-static CURLcode override_login(struct SessionHandle *data,
+static CURLcode override_login(struct Curl_easy *data,
struct connectdata *conn,
char **userp, char **passwdp, char **optionsp)
{
@@ -5320,7 +5340,7 @@ static CURLcode set_login(struct connectdata *conn,
* The hostname and the port may be empty; in this case, NULL is returned for
* the hostname and -1 for the port.
*/
-static CURLcode parse_connect_to_host_port(struct SessionHandle *data,
+static CURLcode parse_connect_to_host_port(struct Curl_easy *data,
const char *host,
char **hostname_result,
int *port_result)
@@ -5411,7 +5431,7 @@ static CURLcode parse_connect_to_host_port(struct SessionHandle *data,
* Parses one "connect to" string in the form:
* "HOST:PORT:CONNECT-TO-HOST:CONNECT-TO-PORT".
*/
-static CURLcode parse_connect_to_string(struct SessionHandle *data,
+static CURLcode parse_connect_to_string(struct Curl_easy *data,
struct connectdata *conn,
const char *conn_to_host,
char **host_result,
@@ -5477,7 +5497,7 @@ static CURLcode parse_connect_to_string(struct SessionHandle *data,
* Processes all strings in the "connect to" slist, and uses the "connect
* to host" and "connect to port" of the first string that matches.
*/
-static CURLcode parse_connect_to_slist(struct SessionHandle *data,
+static CURLcode parse_connect_to_slist(struct Curl_easy *data,
struct connectdata *conn,
struct curl_slist *conn_to_host)
{
@@ -5526,7 +5546,7 @@ static CURLcode parse_connect_to_slist(struct SessionHandle *data,
/*************************************************************
* Resolve the address of the server or proxy
*************************************************************/
-static CURLcode resolve_server(struct SessionHandle *data,
+static CURLcode resolve_server(struct Curl_easy *data,
struct connectdata *conn,
bool *async)
{
@@ -5721,7 +5741,7 @@ static void reuse_conn(struct connectdata *old_conn,
* *NOTE* this function assigns the conn->data pointer!
*/
-static CURLcode create_conn(struct SessionHandle *data,
+static CURLcode create_conn(struct Curl_easy *data,
struct connectdata **in_connect,
bool *async)
{
@@ -6093,7 +6113,7 @@ static CURLcode create_conn(struct SessionHandle *data,
strings in the session handle strings array!
Keep in mind that the pointers in the master copy are pointing to strings
- that will be freed as part of the SessionHandle struct, but all cloned
+ that will be freed as part of the Curl_easy struct, but all cloned
copies will be separately allocated.
*/
data->set.ssl.CApath = data->set.str[STRING_SSL_CAPATH];
@@ -6103,6 +6123,7 @@ static CURLcode create_conn(struct SessionHandle *data,
data->set.ssl.random_file = data->set.str[STRING_SSL_RANDOM_FILE];
data->set.ssl.egdsocket = data->set.str[STRING_SSL_EGDSOCKET];
data->set.ssl.cipher_list = data->set.str[STRING_SSL_CIPHER_LIST];
+ data->set.ssl.clientcert = data->set.str[STRING_CERT];
#ifdef USE_TLS_SRP
data->set.ssl.username = data->set.str[STRING_TLSAUTH_USERNAME];
data->set.ssl.password = data->set.str[STRING_TLSAUTH_PASSWORD];
@@ -6312,7 +6333,7 @@ CURLcode Curl_setup_conn(struct connectdata *conn,
bool *protocol_done)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
Curl_pgrsTime(data, TIMER_NAMELOOKUP);
@@ -6386,7 +6407,7 @@ CURLcode Curl_setup_conn(struct connectdata *conn,
return result;
}
-CURLcode Curl_connect(struct SessionHandle *data,
+CURLcode Curl_connect(struct Curl_easy *data,
struct connectdata **in_connect,
bool *asyncp,
bool *protocol_done)
@@ -6429,14 +6450,14 @@ CURLcode Curl_connect(struct SessionHandle *data,
/*
* Curl_init_do() inits the readwrite session. This is inited each time (in
* the DO function before the protocol-specific DO functions are invoked) for
- * a transfer, sometimes multiple times on the same SessionHandle. Make sure
+ * a transfer, sometimes multiple times on the same Curl_easy. Make sure
* nothing in here depends on stuff that are setup dynamically for the
* transfer.
*
* Allow this function to get called with 'conn' set to NULL.
*/
-CURLcode Curl_init_do(struct SessionHandle *data, struct connectdata *conn)
+CURLcode Curl_init_do(struct Curl_easy *data, struct connectdata *conn)
{
struct SingleRequest *k = &data->req;
diff --git a/lib/url.h b/lib/url.h
index 2b25731e..90d9db3c 100644
--- a/lib/url.h
+++ b/lib/url.h
@@ -27,15 +27,15 @@
* Prototypes for library-wide functions provided by url.c
*/
-CURLcode Curl_init_do(struct SessionHandle *data, struct connectdata *conn);
-CURLcode Curl_open(struct SessionHandle **curl);
+CURLcode Curl_init_do(struct Curl_easy *data, struct connectdata *conn);
+CURLcode Curl_open(struct Curl_easy **curl);
CURLcode Curl_init_userdefined(struct UserDefined *set);
-CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
+CURLcode Curl_setopt(struct Curl_easy *data, CURLoption option,
va_list arg);
-CURLcode Curl_dupset(struct SessionHandle * dst, struct SessionHandle * src);
-void Curl_freeset(struct SessionHandle * data);
-CURLcode Curl_close(struct SessionHandle *data); /* opposite of curl_open() */
-CURLcode Curl_connect(struct SessionHandle *, struct connectdata **,
+CURLcode Curl_dupset(struct Curl_easy * dst, struct Curl_easy * src);
+void Curl_freeset(struct Curl_easy * data);
+CURLcode Curl_close(struct Curl_easy *data); /* opposite of curl_open() */
+CURLcode Curl_connect(struct Curl_easy *, struct connectdata **,
bool *async, bool *protocol_connect);
CURLcode Curl_disconnect(struct connectdata *, bool dead_connection);
CURLcode Curl_protocol_connect(struct connectdata *conn, bool *done);
@@ -43,7 +43,7 @@ CURLcode Curl_protocol_connecting(struct connectdata *conn, bool *done);
CURLcode Curl_protocol_doing(struct connectdata *conn, bool *done);
CURLcode Curl_setup_conn(struct connectdata *conn,
bool *protocol_done);
-void Curl_free_request_state(struct SessionHandle *data);
+void Curl_free_request_state(struct Curl_easy *data);
int Curl_protocol_getsock(struct connectdata *conn,
curl_socket_t *socks,
@@ -52,19 +52,19 @@ int Curl_doing_getsock(struct connectdata *conn,
curl_socket_t *socks,
int numsocks);
-bool Curl_isPipeliningEnabled(const struct SessionHandle *handle);
-CURLcode Curl_addHandleToPipeline(struct SessionHandle *handle,
+bool Curl_isPipeliningEnabled(const struct Curl_easy *handle);
+CURLcode Curl_addHandleToPipeline(struct Curl_easy *handle,
struct curl_llist *pipeline);
-int Curl_removeHandleFromPipeline(struct SessionHandle *handle,
+int Curl_removeHandleFromPipeline(struct Curl_easy *handle,
struct curl_llist *pipeline);
struct connectdata *
-Curl_oldest_idle_connection(struct SessionHandle *data);
+Curl_oldest_idle_connection(struct Curl_easy *data);
/* remove the specified connection from all (possible) pipelines and related
queues */
-void Curl_getoff_all_pipelines(struct SessionHandle *data,
+void Curl_getoff_all_pipelines(struct Curl_easy *data,
struct connectdata *conn);
-void Curl_close_connections(struct SessionHandle *data);
+void Curl_close_connections(struct Curl_easy *data);
#define CURL_DEFAULT_PROXY_PORT 1080 /* default proxy port unless specified */
diff --git a/lib/urldata.h b/lib/urldata.h
index 25594d3b..3cf7ed9b 100644
--- a/lib/urldata.h
+++ b/lib/urldata.h
@@ -208,14 +208,13 @@
#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
#define GOOD_EASY_HANDLE(x) \
- ((x) && (((struct SessionHandle *)(x))->magic == CURLEASY_MAGIC_NUMBER))
+ ((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER))
/* Some convenience macros to get the larger/smaller value out of two given.
We prefix with CURL to prevent name collisions. */
#define CURLMAX(x,y) ((x)>(y)?(x):(y))
#define CURLMIN(x,y) ((x)<(y)?(x):(y))
-
#ifdef HAVE_GSSAPI
/* Types needed for krb5-ftp connections */
struct krb5buffer {
@@ -242,7 +241,6 @@ struct curl_schannel_cred {
CredHandle cred_handle;
TimeStamp time_stamp;
int refcount;
- bool cached;
};
struct curl_schannel_ctxt {
@@ -312,7 +310,7 @@ struct ssl_connect_data {
#elif defined(USE_NSS)
PRFileDesc *handle;
char *client_nickname;
- struct SessionHandle *data;
+ struct Curl_easy *data;
struct curl_llist *obj_list;
PK11GenericObject *obj_clicert;
#elif defined(USE_GSKIT)
@@ -353,6 +351,7 @@ struct ssl_config_data {
char *CAfile; /* certificate to verify peer against */
const char *CRLfile; /* CRL to check certificate revocation */
const char *issuercert;/* optional issuer certificate filename */
+ char *clientcert;
char *random_file; /* path to file containing "random" data */
char *egdsocket; /* path to file containing the EGD daemon socket */
char *cipher_list; /* list of ciphers to use */
@@ -619,9 +618,9 @@ enum upgrade101 {
};
/*
- * Request specific data in the easy handle (SessionHandle). Previously,
+ * Request specific data in the easy handle (Curl_easy). Previously,
* these members were on the connectdata struct but since a conn struct may
- * now be shared between different SessionHandles, we store connection-specific
+ * now be shared between different Curl_easys, we store connection-specific
* data here. This struct only keeps stuff that's interesting for *this*
* request, as it will be cleared between multiple ones
*/
@@ -792,7 +791,7 @@ struct Curl_handler {
/* If used, this function gets called from transfer.c:readwrite_data() to
allow the protocol to do extra reads/writes */
- CURLcode (*readwrite)(struct SessionHandle *data, struct connectdata *conn,
+ CURLcode (*readwrite)(struct Curl_easy *data, struct connectdata *conn,
ssize_t *nread, bool *readmore);
long defport; /* Default port. */
@@ -852,10 +851,10 @@ struct postponed_data {
* unique for an entire connection.
*/
struct connectdata {
- /* 'data' is the CURRENT SessionHandle using this connection -- take great
+ /* 'data' is the CURRENT Curl_easy using this connection -- take great
caution that this might very well vary between different times this
connection is used! */
- struct SessionHandle *data;
+ struct Curl_easy *data;
/* chunk is for HTTP chunked encoding, but is in the general connectdata
struct only because we can do just about any protocol through a HTTP proxy
@@ -966,7 +965,7 @@ struct connectdata {
const struct Curl_handler *handler; /* Connection's protocol handler */
const struct Curl_handler *given; /* The protocol first given */
- long ip_version; /* copied from the SessionHandle at creation time */
+ long ip_version; /* copied from the Curl_easy at creation time */
/**** curl_get() phase fields */
@@ -1209,7 +1208,7 @@ typedef enum {
/*
* Values that are generated, temporary or calculated internally for a
* "session handle" must be defined within the 'struct UrlState'. This struct
- * will be used within the SessionHandle struct. When the 'SessionHandle'
+ * will be used within the Curl_easy struct. When the 'Curl_easy'
* struct is cloned, this data MUST NOT be copied.
*
* Remember that any "state" information goes globally for the curl handle.
@@ -1348,14 +1347,14 @@ struct UrlState {
size_t drain; /* Increased when this stream has data to read, even if its
socket is not necessarily is readable. Decreased when
checked. */
- bool done; /* set to FALSE when Curl_do() is called and set to TRUE when
- Curl_done() is called, to prevent Curl_done() to get invoked
- twice when the multi interface is used. */
+ bool done; /* set to FALSE when Curl_init_do() is called and set to TRUE
+ when multi_done() is called, to prevent multi_done() to get
+ invoked twice when the multi interface is used. */
curl_read_callback fread_func; /* read callback/function */
void *in; /* CURLOPT_READDATA */
- struct SessionHandle *stream_depends_on;
+ struct Curl_easy *stream_depends_on;
bool stream_depends_e; /* set or don't set the Exclusive bit */
int stream_weight;
};
@@ -1680,7 +1679,7 @@ struct UserDefined {
new connection */
long expect_100_timeout; /* in milliseconds */
- struct SessionHandle *stream_depends_on;
+ struct Curl_easy *stream_depends_on;
bool stream_depends_e; /* set or don't set the Exclusive bit */
int stream_weight;
};
@@ -1705,10 +1704,10 @@ struct Names {
* 'struct UrlState' instead.
*/
-struct SessionHandle {
+struct Curl_easy {
/* first, two fields for the linked list of these */
- struct SessionHandle *next;
- struct SessionHandle *prev;
+ struct Curl_easy *next;
+ struct Curl_easy *prev;
struct connectdata *easy_conn; /* the "unit's" connection */
diff --git a/lib/vauth/cleartext.c b/lib/vauth/cleartext.c
index a003f51d..4e906bc0 100644
--- a/lib/vauth/cleartext.c
+++ b/lib/vauth/cleartext.c
@@ -59,7 +59,7 @@
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_auth_create_plain_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_plain_message(struct Curl_easy *data,
const char *userp,
const char *passwdp,
char **outptr, size_t *outlen)
@@ -110,7 +110,7 @@ CURLcode Curl_auth_create_plain_message(struct SessionHandle *data,
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_auth_create_login_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_login_message(struct Curl_easy *data,
const char *valuep, char **outptr,
size_t *outlen)
{
@@ -148,7 +148,7 @@ CURLcode Curl_auth_create_login_message(struct SessionHandle *data,
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_auth_create_external_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_external_message(struct Curl_easy *data,
const char *user, char **outptr,
size_t *outlen)
{
diff --git a/lib/vauth/cram.c b/lib/vauth/cram.c
index cd02e04b..3074a163 100644
--- a/lib/vauth/cram.c
+++ b/lib/vauth/cram.c
@@ -88,7 +88,7 @@ CURLcode Curl_auth_decode_cram_md5_message(const char *chlg64, char **outptr,
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_auth_create_cram_md5_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_cram_md5_message(struct Curl_easy *data,
const char *chlg,
const char *userp,
const char *passwdp,
diff --git a/lib/vauth/digest.c b/lib/vauth/digest.c
index 72cf0482..26ea7b59 100644
--- a/lib/vauth/digest.c
+++ b/lib/vauth/digest.c
@@ -324,7 +324,7 @@ static CURLcode auth_decode_digest_md5_message(const char *chlg64,
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_auth_create_digest_md5_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data,
const char *chlg64,
const char *userp,
const char *passwdp,
@@ -645,7 +645,7 @@ CURLcode Curl_auth_decode_digest_http_message(const char *chlg,
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_auth_create_digest_http_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data,
const char *userp,
const char *passwdp,
const unsigned char *request,
diff --git a/lib/vauth/digest_sspi.c b/lib/vauth/digest_sspi.c
index d13d08e5..6a7315eb 100644
--- a/lib/vauth/digest_sspi.c
+++ b/lib/vauth/digest_sspi.c
@@ -62,7 +62,7 @@
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_auth_create_digest_md5_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data,
const char *chlg64,
const char *userp,
const char *passwdp,
@@ -349,7 +349,7 @@ CURLcode Curl_auth_decode_digest_http_message(const char *chlg,
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_auth_create_digest_http_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data,
const char *userp,
const char *passwdp,
const unsigned char *request,
@@ -387,12 +387,6 @@ CURLcode Curl_auth_create_digest_http_message(struct SessionHandle *data,
/* Release the package buffer as it is not required anymore */
s_pSecFn->FreeContextBuffer(SecurityPackage);
- /* Allocate the output buffer according to the max token size as indicated
- by the security package */
- output_token = malloc(token_max);
- if(!output_token)
- return CURLE_OUT_OF_MEMORY;
-
if(userp && *userp) {
/* Populate our identity structure */
if(Curl_create_sspi_identity(userp, passwdp, &identity))
@@ -418,11 +412,21 @@ CURLcode Curl_auth_create_digest_http_message(struct SessionHandle *data,
&credentials, &expiry);
if(status != SEC_E_OK) {
Curl_sspi_free_identity(p_identity);
- free(output_token);
return CURLE_LOGIN_DENIED;
}
+ /* Allocate the output buffer according to the max token size as indicated
+ by the security package */
+ output_token = malloc(token_max);
+ if(!output_token) {
+ s_pSecFn->FreeCredentialsHandle(&credentials);
+
+ Curl_sspi_free_identity(p_identity);
+
+ return CURLE_OUT_OF_MEMORY;
+ }
+
/* Setup the challenge "input" security buffer if present */
chlg_desc.ulVersion = SECBUFFER_VERSION;
chlg_desc.cBuffers = 3;
@@ -447,6 +451,8 @@ CURLcode Curl_auth_create_digest_http_message(struct SessionHandle *data,
spn = Curl_convert_UTF8_to_tchar((char *) uripath);
if(!spn) {
+ s_pSecFn->FreeCredentialsHandle(&credentials);
+
Curl_sspi_free_identity(p_identity);
free(output_token);
diff --git a/lib/vauth/krb5_gssapi.c b/lib/vauth/krb5_gssapi.c
index 975675b5..31c8c7da 100644
--- a/lib/vauth/krb5_gssapi.c
+++ b/lib/vauth/krb5_gssapi.c
@@ -65,7 +65,7 @@
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_auth_create_gssapi_user_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_gssapi_user_message(struct Curl_easy *data,
const char *userp,
const char *passwdp,
const char *service,
@@ -190,7 +190,7 @@ CURLcode Curl_auth_create_gssapi_user_message(struct SessionHandle *data,
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_auth_create_gssapi_security_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data,
const char *chlg64,
struct kerberos5data *krb5,
char **outptr,
diff --git a/lib/vauth/krb5_sspi.c b/lib/vauth/krb5_sspi.c
index bf56a64e..08774f6c 100644
--- a/lib/vauth/krb5_sspi.c
+++ b/lib/vauth/krb5_sspi.c
@@ -62,7 +62,7 @@
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_auth_create_gssapi_user_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_gssapi_user_message(struct Curl_easy *data,
const char *userp,
const char *passwdp,
const char *service,
@@ -240,7 +240,7 @@ CURLcode Curl_auth_create_gssapi_user_message(struct SessionHandle *data,
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_auth_create_gssapi_security_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data,
const char *chlg64,
struct kerberos5data *krb5,
char **outptr,
diff --git a/lib/vauth/ntlm.c b/lib/vauth/ntlm.c
index e27f4237..c85fe429 100644
--- a/lib/vauth/ntlm.c
+++ b/lib/vauth/ntlm.c
@@ -164,7 +164,7 @@ static void ntlm_print_hex(FILE *handle, const char *buf, size_t len)
*
* Returns CURLE_OK on success.
*/
-static CURLcode ntlm_decode_type2_target(struct SessionHandle *data,
+static CURLcode ntlm_decode_type2_target(struct Curl_easy *data,
unsigned char *buffer,
size_t size,
struct ntlmdata *ntlm)
@@ -232,7 +232,7 @@ static CURLcode ntlm_decode_type2_target(struct SessionHandle *data,
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_auth_decode_ntlm_type2_message(struct SessionHandle *data,
+CURLcode Curl_auth_decode_ntlm_type2_message(struct Curl_easy *data,
const char *type2msg,
struct ntlmdata *ntlm)
{
@@ -465,7 +465,7 @@ CURLcode Curl_auth_create_ntlm_type1_message(const char *userp,
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_auth_create_ntlm_type3_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data,
const char *userp,
const char *passwdp,
struct ntlmdata *ntlm,
diff --git a/lib/vauth/ntlm_sspi.c b/lib/vauth/ntlm_sspi.c
index 532e270f..982a9d37 100644
--- a/lib/vauth/ntlm_sspi.c
+++ b/lib/vauth/ntlm_sspi.c
@@ -162,7 +162,7 @@ CURLcode Curl_auth_create_ntlm_type1_message(const char *userp,
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_auth_decode_ntlm_type2_message(struct SessionHandle *data,
+CURLcode Curl_auth_decode_ntlm_type2_message(struct Curl_easy *data,
const char *type2msg,
struct ntlmdata *ntlm)
{
@@ -214,7 +214,7 @@ CURLcode Curl_auth_decode_ntlm_type2_message(struct SessionHandle *data,
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_auth_create_ntlm_type3_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data,
const char *userp,
const char *passwdp,
struct ntlmdata *ntlm,
diff --git a/lib/vauth/oauth2.c b/lib/vauth/oauth2.c
index fccdfb86..6288f89a 100644
--- a/lib/vauth/oauth2.c
+++ b/lib/vauth/oauth2.c
@@ -55,7 +55,7 @@
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_auth_create_oauth_bearer_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_oauth_bearer_message(struct Curl_easy *data,
const char *user,
const char *host,
const long port,
diff --git a/lib/vauth/spnego_gssapi.c b/lib/vauth/spnego_gssapi.c
index 739e35b6..b256ee61 100644
--- a/lib/vauth/spnego_gssapi.c
+++ b/lib/vauth/spnego_gssapi.c
@@ -58,7 +58,7 @@
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_auth_decode_spnego_message(struct SessionHandle *data,
+CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data,
const char *user,
const char *password,
const char *service,
@@ -187,7 +187,7 @@ CURLcode Curl_auth_decode_spnego_message(struct SessionHandle *data,
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_auth_create_spnego_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_spnego_message(struct Curl_easy *data,
struct negotiatedata *nego,
char **outptr, size_t *outlen)
{
@@ -229,7 +229,7 @@ CURLcode Curl_auth_create_spnego_message(struct SessionHandle *data,
* nego [in/out] - The Negotiate data struct being cleaned up.
*
*/
-void Curl_auth_spnego_cleanup(struct negotiatedata* nego)
+void Curl_auth_spnego_cleanup(struct negotiatedata *nego)
{
OM_uint32 minor_status;
diff --git a/lib/vauth/spnego_sspi.c b/lib/vauth/spnego_sspi.c
index 79746647..b6176ece 100644
--- a/lib/vauth/spnego_sspi.c
+++ b/lib/vauth/spnego_sspi.c
@@ -57,7 +57,7 @@
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_auth_decode_spnego_message(struct SessionHandle *data,
+CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data,
const char *user,
const char *password,
const char *service,
@@ -234,7 +234,7 @@ CURLcode Curl_auth_decode_spnego_message(struct SessionHandle *data,
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_auth_create_spnego_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_spnego_message(struct Curl_easy *data,
struct negotiatedata *nego,
char **outptr, size_t *outlen)
{
@@ -265,7 +265,7 @@ CURLcode Curl_auth_create_spnego_message(struct SessionHandle *data,
* nego [in/out] - The Negotiate data struct being cleaned up.
*
*/
-void Curl_auth_spnego_cleanup(struct negotiatedata* nego)
+void Curl_auth_spnego_cleanup(struct negotiatedata *nego)
{
/* Free our security context */
if(nego->context) {
diff --git a/lib/vauth/vauth.h b/lib/vauth/vauth.h
index 2c5131c7..38806ee7 100644
--- a/lib/vauth/vauth.h
+++ b/lib/vauth/vauth.h
@@ -24,7 +24,7 @@
#include <curl/curl.h>
-struct SessionHandle;
+struct Curl_easy;
#if !defined(CURL_DISABLE_CRYPTO_AUTH)
struct digestdata;
@@ -56,18 +56,18 @@ TCHAR *Curl_auth_build_spn(const char *service, const char *host,
#endif
/* This is used to generate a base64 encoded PLAIN cleartext message */
-CURLcode Curl_auth_create_plain_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_plain_message(struct Curl_easy *data,
const char *userp,
const char *passwdp,
char **outptr, size_t *outlen);
/* This is used to generate a base64 encoded LOGIN cleartext message */
-CURLcode Curl_auth_create_login_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_login_message(struct Curl_easy *data,
const char *valuep, char **outptr,
size_t *outlen);
/* This is used to generate a base64 encoded EXTERNAL cleartext message */
-CURLcode Curl_auth_create_external_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_external_message(struct Curl_easy *data,
const char *user, char **outptr,
size_t *outlen);
@@ -77,14 +77,14 @@ CURLcode Curl_auth_decode_cram_md5_message(const char *chlg64, char **outptr,
size_t *outlen);
/* This is used to generate a CRAM-MD5 response message */
-CURLcode Curl_auth_create_cram_md5_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_cram_md5_message(struct Curl_easy *data,
const char *chlg,
const char *userp,
const char *passwdp,
char **outptr, size_t *outlen);
/* This is used to generate a base64 encoded DIGEST-MD5 response message */
-CURLcode Curl_auth_create_digest_md5_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data,
const char *chlg64,
const char *userp,
const char *passwdp,
@@ -96,7 +96,7 @@ CURLcode Curl_auth_decode_digest_http_message(const char *chlg,
struct digestdata *digest);
/* This is used to generate a HTTP DIGEST response message */
-CURLcode Curl_auth_create_digest_http_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data,
const char *userp,
const char *passwdp,
const unsigned char *request,
@@ -117,12 +117,12 @@ CURLcode Curl_auth_create_ntlm_type1_message(const char *userp,
size_t *outlen);
/* This is used to decode a base64 encoded NTLM type-2 message */
-CURLcode Curl_auth_decode_ntlm_type2_message(struct SessionHandle *data,
+CURLcode Curl_auth_decode_ntlm_type2_message(struct Curl_easy *data,
const char *type2msg,
struct ntlmdata *ntlm);
/* This is used to generate a base64 encoded NTLM type-3 message */
-CURLcode Curl_auth_create_ntlm_type3_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data,
const char *userp,
const char *passwdp,
struct ntlmdata *ntlm,
@@ -133,7 +133,7 @@ void Curl_auth_ntlm_cleanup(struct ntlmdata *ntlm);
#endif /* USE_NTLM */
/* This is used to generate a base64 encoded OAuth 2.0 message */
-CURLcode Curl_auth_create_oauth_bearer_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_oauth_bearer_message(struct Curl_easy *data,
const char *user,
const char *host,
const long port,
@@ -142,7 +142,7 @@ CURLcode Curl_auth_create_oauth_bearer_message(struct SessionHandle *data,
#if defined(USE_KERBEROS5)
/* This is used to generate a base64 encoded GSSAPI (Kerberos V5) user token
message */
-CURLcode Curl_auth_create_gssapi_user_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_gssapi_user_message(struct Curl_easy *data,
const char *userp,
const char *passwdp,
const char *service,
@@ -154,7 +154,7 @@ CURLcode Curl_auth_create_gssapi_user_message(struct SessionHandle *data,
/* This is used to generate a base64 encoded GSSAPI (Kerberos V5) security
token message */
-CURLcode Curl_auth_create_gssapi_security_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data,
const char *input,
struct kerberos5data *krb5,
char **outptr,
@@ -164,10 +164,10 @@ CURLcode Curl_auth_create_gssapi_security_message(struct SessionHandle *data,
void Curl_auth_gssapi_cleanup(struct kerberos5data *krb5);
#endif /* USE_KERBEROS5 */
-#if (defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)) && defined(USE_SPNEGO)
+#if defined(USE_SPNEGO)
/* This is used to decode a base64 encoded SPNEGO (Negotiate) challenge
message */
-CURLcode Curl_auth_decode_spnego_message(struct SessionHandle *data,
+CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data,
const char *user,
const char *passwood,
const char *service,
@@ -177,13 +177,13 @@ CURLcode Curl_auth_decode_spnego_message(struct SessionHandle *data,
/* This is used to generate a base64 encoded SPNEGO (Negotiate) response
message */
-CURLcode Curl_auth_create_spnego_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_spnego_message(struct Curl_easy *data,
struct negotiatedata *nego,
char **outptr, size_t *outlen);
/* This is used to clean up the SPNEGO specifiec data */
-void Curl_auth_spnego_cleanup(struct negotiatedata* nego);
+void Curl_auth_spnego_cleanup(struct negotiatedata *nego);
-#endif /* (HAVE_GSSAPI || USE_WINDOWS_SSPI) && USE_SPNEGO */
+#endif /* USE_SPNEGO */
#endif /* HEADER_CURL_VAUTH_H */
diff --git a/lib/vtls/axtls.c b/lib/vtls/axtls.c
index 0afcfaa5..b6c69ad5 100644
--- a/lib/vtls/axtls.c
+++ b/lib/vtls/axtls.c
@@ -137,14 +137,12 @@ static void free_ssl_structs(struct ssl_connect_data *connssl)
*/
static CURLcode connect_prep(struct connectdata *conn, int sockindex)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
SSL_CTX *ssl_ctx;
SSL *ssl = NULL;
int cert_types[] = {SSL_OBJ_X509_CERT, SSL_OBJ_PKCS12, 0};
int key_types[] = {SSL_OBJ_RSA_KEY, SSL_OBJ_PKCS8, SSL_OBJ_PKCS12, 0};
int i, ssl_fcn_return;
- const uint8_t *ssl_sessionid;
- size_t ssl_idsize;
/* Assuming users will not compile in custom key/cert to axTLS.
* Also, even for blocking connects, use axTLS non-blocking feature.
@@ -258,14 +256,22 @@ static CURLcode connect_prep(struct connectdata *conn, int sockindex)
* 2) setting up callbacks. these seem gnutls specific
*/
- /* In axTLS, handshaking happens inside ssl_client_new. */
- if(!Curl_ssl_getsessionid(conn, (void **) &ssl_sessionid, &ssl_idsize)) {
- /* we got a session id, use it! */
- infof (data, "SSL re-using session ID\n");
- ssl = ssl_client_new(ssl_ctx, conn->sock[sockindex],
- ssl_sessionid, (uint8_t)ssl_idsize);
+ if(conn->ssl_config.sessionid) {
+ const uint8_t *ssl_sessionid;
+ size_t ssl_idsize;
+
+ /* In axTLS, handshaking happens inside ssl_client_new. */
+ Curl_ssl_sessionid_lock(conn);
+ if(!Curl_ssl_getsessionid(conn, (void **) &ssl_sessionid, &ssl_idsize)) {
+ /* we got a session id, use it! */
+ infof (data, "SSL re-using session ID\n");
+ ssl = ssl_client_new(ssl_ctx, conn->sock[sockindex],
+ ssl_sessionid, (uint8_t)ssl_idsize);
+ }
+ Curl_ssl_sessionid_unlock(conn);
}
- else
+
+ if(!ssl)
ssl = ssl_client_new(ssl_ctx, conn->sock[sockindex], NULL, 0);
conn->ssl[sockindex].ssl = ssl;
@@ -278,10 +284,8 @@ static CURLcode connect_prep(struct connectdata *conn, int sockindex)
*/
static CURLcode connect_finish(struct connectdata *conn, int sockindex)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
SSL *ssl = conn->ssl[sockindex].ssl;
- const uint8_t *ssl_sessionid;
- size_t ssl_idsize;
const char *peer_CN;
uint32_t dns_altname_index;
const char *dns_altname;
@@ -379,11 +383,15 @@ static CURLcode connect_finish(struct connectdata *conn, int sockindex)
conn->send[sockindex] = axtls_send;
/* Put our freshly minted SSL session in cache */
- ssl_idsize = ssl_get_session_id_size(ssl);
- ssl_sessionid = ssl_get_session_id(ssl);
- if(Curl_ssl_addsessionid(conn, (void *) ssl_sessionid, ssl_idsize)
- != CURLE_OK)
- infof (data, "failed to add session to cache\n");
+ if(conn->ssl_config.sessionid) {
+ const uint8_t *ssl_sessionid = ssl_get_session_id_size(ssl);
+ size_t ssl_idsize = ssl_get_session_id(ssl);
+ Curl_ssl_sessionid_lock(conn);
+ if(Curl_ssl_addsessionid(conn, (void *) ssl_sessionid, ssl_idsize)
+ != CURLE_OK)
+ infof (data, "failed to add session to cache\n");
+ Curl_ssl_sessionid_unlock(conn);
+ }
return CURLE_OK;
}
@@ -464,7 +472,7 @@ Curl_axtls_connect(struct connectdata *conn,
int sockindex)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
CURLcode conn_step = connect_prep(conn, sockindex);
int ssl_fcn_return;
SSL *ssl = conn->ssl[sockindex].ssl;
@@ -493,7 +501,7 @@ Curl_axtls_connect(struct connectdata *conn,
return map_error_to_curl(ssl_fcn_return);
}
/* TODO: avoid polling */
- usleep(10000);
+ Curl_wait_ms(10);
}
infof (conn->data, "handshake completed successfully\n");
@@ -554,7 +562,7 @@ int Curl_axtls_shutdown(struct connectdata *conn, int sockindex)
*/
int retval = 0;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
uint8_t *buf;
ssize_t nread;
@@ -670,7 +678,7 @@ size_t Curl_axtls_version(char *buffer, size_t size)
return snprintf(buffer, size, "axTLS/%s", ssl_version());
}
-int Curl_axtls_random(struct SessionHandle *data,
+int Curl_axtls_random(struct Curl_easy *data,
unsigned char *entropy,
size_t length)
{
diff --git a/lib/vtls/axtls.h b/lib/vtls/axtls.h
index b9d441f1..b16d051a 100644
--- a/lib/vtls/axtls.h
+++ b/lib/vtls/axtls.h
@@ -42,7 +42,7 @@ void Curl_axtls_session_free(void *ptr);
size_t Curl_axtls_version(char *buffer, size_t size);
int Curl_axtls_shutdown(struct connectdata *conn, int sockindex);
int Curl_axtls_check_cxn(struct connectdata *conn);
-int Curl_axtls_random(struct SessionHandle *data,
+int Curl_axtls_random(struct Curl_easy *data,
unsigned char *entropy,
size_t length);
diff --git a/lib/vtls/cyassl.c b/lib/vtls/cyassl.c
index da737c72..7994b3ea 100644
--- a/lib/vtls/cyassl.c
+++ b/lib/vtls/cyassl.c
@@ -134,10 +134,9 @@ cyassl_connect_step1(struct connectdata *conn,
int sockindex)
{
char error_buffer[CYASSL_MAX_ERROR_SZ];
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ssl_connect_data* conssl = &conn->ssl[sockindex];
SSL_METHOD* req_method = NULL;
- void* ssl_sessionid = NULL;
curl_socket_t sockfd = conn->sock[sockindex];
#ifdef HAVE_SNI
bool sni = FALSE;
@@ -378,15 +377,23 @@ cyassl_connect_step1(struct connectdata *conn,
#endif /* HAVE_ALPN */
/* Check if there's a cached ID we can/should use here! */
- if(!Curl_ssl_getsessionid(conn, &ssl_sessionid, NULL)) {
- /* we got a session id, use it! */
- if(!SSL_set_session(conssl->handle, ssl_sessionid)) {
- failf(data, "SSL: SSL_set_session failed: %s",
- ERR_error_string(SSL_get_error(conssl->handle, 0), error_buffer));
- return CURLE_SSL_CONNECT_ERROR;
+ if(conn->ssl_config.sessionid) {
+ void *ssl_sessionid = NULL;
+
+ Curl_ssl_sessionid_lock(conn);
+ if(!Curl_ssl_getsessionid(conn, &ssl_sessionid, NULL)) {
+ /* we got a session id, use it! */
+ if(!SSL_set_session(conssl->handle, ssl_sessionid)) {
+ Curl_ssl_sessionid_unlock(conn);
+ failf(data, "SSL: SSL_set_session failed: %s",
+ ERR_error_string(SSL_get_error(conssl->handle, 0),
+ error_buffer));
+ return CURLE_SSL_CONNECT_ERROR;
+ }
+ /* Informational message */
+ infof (data, "SSL re-using session ID\n");
}
- /* Informational message */
- infof (data, "SSL re-using session ID\n");
+ Curl_ssl_sessionid_unlock(conn);
}
/* pass the raw socket into the SSL layer */
@@ -405,7 +412,7 @@ cyassl_connect_step2(struct connectdata *conn,
int sockindex)
{
int ret = -1;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ssl_connect_data* conssl = &conn->ssl[sockindex];
conn->recv[sockindex] = cyassl_recv;
@@ -571,32 +578,38 @@ cyassl_connect_step3(struct connectdata *conn,
int sockindex)
{
CURLcode result = CURLE_OK;
- void *old_ssl_sessionid=NULL;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
- bool incache;
- SSL_SESSION *our_ssl_sessionid;
DEBUGASSERT(ssl_connect_3 == connssl->connecting_state);
- our_ssl_sessionid = SSL_get_session(connssl->handle);
+ if(conn->ssl_config.sessionid) {
+ bool incache;
+ SSL_SESSION *our_ssl_sessionid;
+ void *old_ssl_sessionid = NULL;
- incache = !(Curl_ssl_getsessionid(conn, &old_ssl_sessionid, NULL));
- if(incache) {
- if(old_ssl_sessionid != our_ssl_sessionid) {
- infof(data, "old SSL session ID is stale, removing\n");
- Curl_ssl_delsessionid(conn, old_ssl_sessionid);
- incache = FALSE;
+ our_ssl_sessionid = SSL_get_session(connssl->handle);
+
+ Curl_ssl_sessionid_lock(conn);
+ incache = !(Curl_ssl_getsessionid(conn, &old_ssl_sessionid, NULL));
+ if(incache) {
+ if(old_ssl_sessionid != our_ssl_sessionid) {
+ infof(data, "old SSL session ID is stale, removing\n");
+ Curl_ssl_delsessionid(conn, old_ssl_sessionid);
+ incache = FALSE;
+ }
}
- }
- if(!incache) {
- result = Curl_ssl_addsessionid(conn, our_ssl_sessionid,
- 0 /* unknown size */);
- if(result) {
- failf(data, "failed to store ssl session");
- return result;
+ if(!incache) {
+ result = Curl_ssl_addsessionid(conn, our_ssl_sessionid,
+ 0 /* unknown size */);
+ if(result) {
+ Curl_ssl_sessionid_unlock(conn);
+ failf(data, "failed to store ssl session");
+ return result;
+ }
}
+ Curl_ssl_sessionid_unlock(conn);
}
connssl->connecting_state = ssl_connect_done;
@@ -741,7 +754,7 @@ cyassl_connect_common(struct connectdata *conn,
bool *done)
{
CURLcode result;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
curl_socket_t sockfd = conn->sock[sockindex];
long timeout_ms;
@@ -872,7 +885,7 @@ Curl_cyassl_connect(struct connectdata *conn,
return CURLE_OK;
}
-int Curl_cyassl_random(struct SessionHandle *data,
+int Curl_cyassl_random(struct Curl_easy *data,
unsigned char *entropy,
size_t length)
{
diff --git a/lib/vtls/cyassl.h b/lib/vtls/cyassl.h
index 11061255..508dfaaf 100644
--- a/lib/vtls/cyassl.h
+++ b/lib/vtls/cyassl.h
@@ -51,7 +51,7 @@ int Curl_cyassl_init(void);
CURLcode Curl_cyassl_connect_nonblocking(struct connectdata *conn,
int sockindex,
bool *done);
-int Curl_cyassl_random(struct SessionHandle *data,
+int Curl_cyassl_random(struct Curl_easy *data,
unsigned char *entropy,
size_t length);
void Curl_cyassl_sha256sum(const unsigned char *tmp, /* input */
diff --git a/lib/vtls/darwinssl.c b/lib/vtls/darwinssl.c
index 71d379b9..ebb9e307 100644
--- a/lib/vtls/darwinssl.c
+++ b/lib/vtls/darwinssl.c
@@ -28,7 +28,7 @@
#include "curl_setup.h"
-#include "urldata.h" /* for the SessionHandle definition */
+#include "urldata.h" /* for the Curl_easy definition */
#include "curl_base64.h"
#include "strtok.h"
@@ -999,7 +999,7 @@ CF_INLINE bool is_file(const char *filename)
static CURLcode darwinssl_connect_step1(struct connectdata *conn,
int sockindex)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
curl_socket_t sockfd = conn->sock[sockindex];
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
#ifdef ENABLE_IPV6
@@ -1009,8 +1009,6 @@ static CURLcode darwinssl_connect_step1(struct connectdata *conn,
#endif /* ENABLE_IPV6 */
size_t all_ciphers_count = 0UL, allowed_ciphers_count = 0UL, i;
SSLCipherSuite *all_ciphers = NULL, *allowed_ciphers = NULL;
- char *ssl_sessionid;
- size_t ssl_sessionid_len;
OSStatus err = noErr;
#if CURL_BUILD_MAC
int darwinver_maj = 0, darwinver_min = 0;
@@ -1474,37 +1472,46 @@ static CURLcode darwinssl_connect_step1(struct connectdata *conn,
#endif /* CURL_BUILD_MAC_10_9 || CURL_BUILD_IOS_7 */
/* Check if there's a cached ID we can/should use here! */
- if(!Curl_ssl_getsessionid(conn, (void **)&ssl_sessionid,
- &ssl_sessionid_len)) {
- /* we got a session id, use it! */
- err = SSLSetPeerID(connssl->ssl_ctx, ssl_sessionid, ssl_sessionid_len);
- if(err != noErr) {
- failf(data, "SSL: SSLSetPeerID() failed: OSStatus %d", err);
- return CURLE_SSL_CONNECT_ERROR;
- }
- /* Informational message */
- infof(data, "SSL re-using session ID\n");
- }
- /* If there isn't one, then let's make one up! This has to be done prior
- to starting the handshake. */
- else {
- CURLcode result;
- ssl_sessionid =
- aprintf("%s:%d:%d:%s:%hu", data->set.str[STRING_SSL_CAFILE],
- data->set.ssl.verifypeer, data->set.ssl.verifyhost,
- conn->host.name, conn->remote_port);
- ssl_sessionid_len = strlen(ssl_sessionid);
-
- err = SSLSetPeerID(connssl->ssl_ctx, ssl_sessionid, ssl_sessionid_len);
- if(err != noErr) {
- failf(data, "SSL: SSLSetPeerID() failed: OSStatus %d", err);
- return CURLE_SSL_CONNECT_ERROR;
+ if(conn->ssl_config.sessionid) {
+ char *ssl_sessionid;
+ size_t ssl_sessionid_len;
+
+ Curl_ssl_sessionid_lock(conn);
+ if(!Curl_ssl_getsessionid(conn, (void **)&ssl_sessionid,
+ &ssl_sessionid_len)) {
+ /* we got a session id, use it! */
+ err = SSLSetPeerID(connssl->ssl_ctx, ssl_sessionid, ssl_sessionid_len);
+ Curl_ssl_sessionid_unlock(conn);
+ if(err != noErr) {
+ failf(data, "SSL: SSLSetPeerID() failed: OSStatus %d", err);
+ return CURLE_SSL_CONNECT_ERROR;
+ }
+ /* Informational message */
+ infof(data, "SSL re-using session ID\n");
}
+ /* If there isn't one, then let's make one up! This has to be done prior
+ to starting the handshake. */
+ else {
+ CURLcode result;
+ ssl_sessionid =
+ aprintf("%s:%d:%d:%s:%hu", data->set.str[STRING_SSL_CAFILE],
+ data->set.ssl.verifypeer, data->set.ssl.verifyhost,
+ conn->host.name, conn->remote_port);
+ ssl_sessionid_len = strlen(ssl_sessionid);
+
+ err = SSLSetPeerID(connssl->ssl_ctx, ssl_sessionid, ssl_sessionid_len);
+ if(err != noErr) {
+ Curl_ssl_sessionid_unlock(conn);
+ failf(data, "SSL: SSLSetPeerID() failed: OSStatus %d", err);
+ return CURLE_SSL_CONNECT_ERROR;
+ }
- result = Curl_ssl_addsessionid(conn, ssl_sessionid, ssl_sessionid_len);
- if(result) {
- failf(data, "failed to store ssl session");
- return result;
+ result = Curl_ssl_addsessionid(conn, ssl_sessionid, ssl_sessionid_len);
+ Curl_ssl_sessionid_unlock(conn);
+ if(result) {
+ failf(data, "failed to store ssl session");
+ return result;
+ }
}
}
@@ -1626,7 +1633,7 @@ static int read_cert(const char *file, unsigned char **out, size_t *outlen)
return 0;
}
-static int sslerr_to_curlerr(struct SessionHandle *data, int err)
+static int sslerr_to_curlerr(struct Curl_easy *data, int err)
{
switch(err) {
case errSSLXCertChainInvalid:
@@ -1655,7 +1662,7 @@ static int sslerr_to_curlerr(struct SessionHandle *data, int err)
}
}
-static int append_cert_to_array(struct SessionHandle *data,
+static int append_cert_to_array(struct Curl_easy *data,
unsigned char *buf, size_t buflen,
CFMutableArrayRef array)
{
@@ -1700,7 +1707,7 @@ static int append_cert_to_array(struct SessionHandle *data,
return CURLE_OK;
}
-static int verify_cert(const char *cafile, struct SessionHandle *data,
+static int verify_cert(const char *cafile, struct Curl_easy *data,
SSLContextRef ctx)
{
int n = 0, rc;
@@ -1820,7 +1827,7 @@ static int verify_cert(const char *cafile, struct SessionHandle *data,
static CURLcode
darwinssl_connect_step2(struct connectdata *conn, int sockindex)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
OSStatus err;
SSLCipherSuite cipher;
@@ -1960,7 +1967,7 @@ static CURLcode
darwinssl_connect_step3(struct connectdata *conn,
int sockindex)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
CFStringRef server_cert_summary;
char server_cert_summary_c[128];
@@ -2084,7 +2091,7 @@ darwinssl_connect_common(struct connectdata *conn,
bool *done)
{
CURLcode result;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
curl_socket_t sockfd = conn->sock[sockindex];
long timeout_ms;
@@ -2239,7 +2246,7 @@ void Curl_darwinssl_close(struct connectdata *conn, int sockindex)
int Curl_darwinssl_shutdown(struct connectdata *conn, int sockindex)
{
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
ssize_t nread;
int what;
int rc;
@@ -2387,7 +2394,7 @@ static ssize_t darwinssl_send(struct connectdata *conn,
size_t len,
CURLcode *curlcode)
{
- /*struct SessionHandle *data = conn->data;*/
+ /*struct Curl_easy *data = conn->data;*/
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
size_t processed = 0UL;
OSStatus err;
@@ -2453,7 +2460,7 @@ static ssize_t darwinssl_recv(struct connectdata *conn,
size_t buffersize,
CURLcode *curlcode)
{
- /*struct SessionHandle *data = conn->data;*/
+ /*struct Curl_easy *data = conn->data;*/
struct ssl_connect_data *connssl = &conn->ssl[num];
size_t processed = 0UL;
OSStatus err = SSLRead(connssl->ssl_ctx, buf, buffersize, &processed);
diff --git a/lib/vtls/gskit.c b/lib/vtls/gskit.c
index a9a8a918..55a55ef5 100644
--- a/lib/vtls/gskit.c
+++ b/lib/vtls/gskit.c
@@ -163,7 +163,7 @@ static bool is_separator(char c)
}
-static CURLcode gskit_status(struct SessionHandle *data, int rc,
+static CURLcode gskit_status(struct Curl_easy *data, int rc,
const char *procname, CURLcode defcode)
{
/* Process GSKit status and map it to a CURLcode. */
@@ -206,7 +206,7 @@ static CURLcode gskit_status(struct SessionHandle *data, int rc,
}
-static CURLcode set_enum(struct SessionHandle *data, gsk_handle h,
+static CURLcode set_enum(struct Curl_easy *data, gsk_handle h,
GSK_ENUM_ID id, GSK_ENUM_VALUE value, bool unsupported_ok)
{
int rc = gsk_attribute_set_enum(h, id, value);
@@ -228,7 +228,7 @@ static CURLcode set_enum(struct SessionHandle *data, gsk_handle h,
}
-static CURLcode set_buffer(struct SessionHandle *data, gsk_handle h,
+static CURLcode set_buffer(struct Curl_easy *data, gsk_handle h,
GSK_BUF_ID id, const char *buffer, bool unsupported_ok)
{
int rc = gsk_attribute_set_buffer(h, id, buffer, 0);
@@ -250,7 +250,7 @@ static CURLcode set_buffer(struct SessionHandle *data, gsk_handle h,
}
-static CURLcode set_numeric(struct SessionHandle *data,
+static CURLcode set_numeric(struct Curl_easy *data,
gsk_handle h, GSK_NUM_ID id, int value)
{
int rc = gsk_attribute_set_numeric_value(h, id, value);
@@ -270,7 +270,7 @@ static CURLcode set_numeric(struct SessionHandle *data,
}
-static CURLcode set_callback(struct SessionHandle *data,
+static CURLcode set_callback(struct Curl_easy *data,
gsk_handle h, GSK_CALLBACK_ID id, void *info)
{
int rc = gsk_attribute_set_callback(h, id, info);
@@ -289,7 +289,7 @@ static CURLcode set_callback(struct SessionHandle *data,
}
-static CURLcode set_ciphers(struct SessionHandle *data,
+static CURLcode set_ciphers(struct Curl_easy *data,
gsk_handle h, unsigned int *protoflags)
{
const char *cipherlist = data->set.str[STRING_SSL_CIPHER_LIST];
@@ -436,7 +436,7 @@ void Curl_gskit_cleanup(void)
}
-static CURLcode init_environment(struct SessionHandle *data,
+static CURLcode init_environment(struct Curl_easy *data,
gsk_handle *envir, const char *appid,
const char *file, const char *label,
const char *password)
@@ -502,7 +502,7 @@ static void close_async_handshake(struct ssl_connect_data *connssl)
static void close_one(struct ssl_connect_data *conn,
- struct SessionHandle *data)
+ struct Curl_easy *data)
{
if(conn->handle) {
gskit_status(data, gsk_secure_soc_close(&conn->handle),
@@ -517,7 +517,7 @@ static void close_one(struct ssl_connect_data *conn,
static ssize_t gskit_send(struct connectdata *conn, int sockindex,
const void *mem, size_t len, CURLcode *curlcode)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
CURLcode cc;
int written;
@@ -536,7 +536,7 @@ static ssize_t gskit_send(struct connectdata *conn, int sockindex,
static ssize_t gskit_recv(struct connectdata *conn, int num, char *buf,
size_t buffersize, CURLcode *curlcode)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
int buffsize;
int nread;
CURLcode cc;
@@ -555,7 +555,7 @@ static ssize_t gskit_recv(struct connectdata *conn, int num, char *buf,
static CURLcode gskit_connect_step1(struct connectdata *conn, int sockindex)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
gsk_handle envir;
CURLcode result;
@@ -750,7 +750,7 @@ static CURLcode gskit_connect_step1(struct connectdata *conn, int sockindex)
static CURLcode gskit_connect_step2(struct connectdata *conn, int sockindex,
bool nonblocking)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
Qso_OverlappedIO_t cstat;
long timeout_ms;
@@ -801,7 +801,7 @@ static CURLcode gskit_connect_step2(struct connectdata *conn, int sockindex,
static CURLcode gskit_connect_step3(struct connectdata *conn, int sockindex)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
const gsk_cert_data_elem *cdev;
int cdec;
@@ -889,7 +889,7 @@ static CURLcode gskit_connect_step3(struct connectdata *conn, int sockindex)
static CURLcode gskit_connect_common(struct connectdata *conn, int sockindex,
bool nonblocking, bool *done)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
long timeout_ms;
Qso_OverlappedIO_t cstat;
@@ -976,7 +976,7 @@ CURLcode Curl_gskit_connect(struct connectdata *conn, int sockindex)
void Curl_gskit_close(struct connectdata *conn, int sockindex)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
if(connssl->use)
@@ -987,7 +987,7 @@ void Curl_gskit_close(struct connectdata *conn, int sockindex)
int Curl_gskit_shutdown(struct connectdata *conn, int sockindex)
{
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
ssize_t nread;
int what;
int rc;
diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c
index 1b5a6a4d..1c3e6b15 100644
--- a/lib/vtls/gtls.c
+++ b/lib/vtls/gtls.c
@@ -201,7 +201,7 @@ int Curl_gtls_cleanup(void)
return 1;
}
-static void showtime(struct SessionHandle *data,
+static void showtime(struct Curl_easy *data,
const char *text,
time_t stamp)
{
@@ -262,7 +262,7 @@ static CURLcode handshake(struct connectdata *conn,
bool duringconnect,
bool nonblocking)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
gnutls_session_t session = conn->ssl[sockindex].session;
curl_socket_t sockfd = conn->sock[sockindex];
@@ -367,11 +367,9 @@ static CURLcode
gtls_connect_step1(struct connectdata *conn,
int sockindex)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
gnutls_session_t session;
int rc;
- void *ssl_sessionid;
- size_t ssl_idsize;
bool sni = TRUE; /* default is SNI enabled */
#ifdef ENABLE_IPV6
struct in6_addr addr;
@@ -749,19 +747,25 @@ gtls_connect_step1(struct connectdata *conn,
/* This might be a reconnect, so we check for a session ID in the cache
to speed up things */
+ if(conn->ssl_config.sessionid) {
+ void *ssl_sessionid;
+ size_t ssl_idsize;
- if(!Curl_ssl_getsessionid(conn, &ssl_sessionid, &ssl_idsize)) {
- /* we got a session id, use it! */
- gnutls_session_set_data(session, ssl_sessionid, ssl_idsize);
+ Curl_ssl_sessionid_lock(conn);
+ if(!Curl_ssl_getsessionid(conn, &ssl_sessionid, &ssl_idsize)) {
+ /* we got a session id, use it! */
+ gnutls_session_set_data(session, ssl_sessionid, ssl_idsize);
- /* Informational message */
- infof (data, "SSL re-using session ID\n");
+ /* Informational message */
+ infof (data, "SSL re-using session ID\n");
+ }
+ Curl_ssl_sessionid_unlock(conn);
}
return CURLE_OK;
}
-static CURLcode pkp_pin_peer_pubkey(struct SessionHandle *data,
+static CURLcode pkp_pin_peer_pubkey(struct Curl_easy *data,
gnutls_x509_crt_t cert,
const char *pinnedpubkey)
{
@@ -836,11 +840,9 @@ gtls_connect_step3(struct connectdata *conn,
unsigned int bits;
time_t certclock;
const char *ptr;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
gnutls_session_t session = conn->ssl[sockindex].session;
int rc;
- bool incache;
- void *ssl_sessionid;
#ifdef HAS_ALPN
gnutls_datum_t proto;
#endif
@@ -1268,11 +1270,13 @@ gtls_connect_step3(struct connectdata *conn,
conn->recv[sockindex] = gtls_recv;
conn->send[sockindex] = gtls_send;
- {
+ if(conn->ssl_config.sessionid) {
/* we always unconditionally get the session id here, as even if we
already got it from the cache and asked to use it in the connection, it
might've been rejected and then a new one is in use now and we need to
detect that. */
+ bool incache;
+ void *ssl_sessionid;
void *connect_sessionid;
size_t connect_idsize = 0;
@@ -1284,6 +1288,7 @@ gtls_connect_step3(struct connectdata *conn,
/* extract session ID to the allocated buffer */
gnutls_session_get_data(session, connect_sessionid, &connect_idsize);
+ Curl_ssl_sessionid_lock(conn);
incache = !(Curl_ssl_getsessionid(conn, &ssl_sessionid, NULL));
if(incache) {
/* there was one before in the cache, so instead of risking that the
@@ -1293,6 +1298,7 @@ gtls_connect_step3(struct connectdata *conn,
/* store this session id */
result = Curl_ssl_addsessionid(conn, connect_sessionid, connect_idsize);
+ Curl_ssl_sessionid_unlock(conn);
if(result) {
free(connect_sessionid);
result = CURLE_OUT_OF_MEMORY;
@@ -1425,7 +1431,7 @@ int Curl_gtls_shutdown(struct connectdata *conn, int sockindex)
{
ssize_t result;
int retval = 0;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
int done = 0;
char buf[120];
@@ -1538,7 +1544,7 @@ size_t Curl_gtls_version(char *buffer, size_t size)
}
#ifndef USE_GNUTLS_NETTLE
-static int Curl_gtls_seed(struct SessionHandle *data)
+static int Curl_gtls_seed(struct Curl_easy *data)
{
/* we have the "SSL is seeded" boolean static to prevent multiple
time-consuming seedings in vain */
@@ -1562,7 +1568,7 @@ static int Curl_gtls_seed(struct SessionHandle *data)
#endif
/* data might be NULL! */
-int Curl_gtls_random(struct SessionHandle *data,
+int Curl_gtls_random(struct Curl_easy *data,
unsigned char *entropy,
size_t length)
{
diff --git a/lib/vtls/gtls.h b/lib/vtls/gtls.h
index 611a2f47..e0a95a7c 100644
--- a/lib/vtls/gtls.h
+++ b/lib/vtls/gtls.h
@@ -41,7 +41,7 @@ void Curl_gtls_close(struct connectdata *conn, int sockindex);
void Curl_gtls_session_free(void *ptr);
size_t Curl_gtls_version(char *buffer, size_t size);
int Curl_gtls_shutdown(struct connectdata *conn, int sockindex);
-int Curl_gtls_random(struct SessionHandle *data,
+int Curl_gtls_random(struct Curl_easy *data,
unsigned char *entropy,
size_t length);
void Curl_gtls_md5sum(unsigned char *tmp, /* input */
diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c
index ef0b9492..a1e7d236 100644
--- a/lib/vtls/mbedtls.c
+++ b/lib/vtls/mbedtls.c
@@ -103,12 +103,12 @@ static int entropy_func_mutex(void *data, unsigned char *output, size_t len)
static void mbed_debug(void *context, int level, const char *f_name,
int line_nb, const char *line)
{
- struct SessionHandle *data = NULL;
+ struct Curl_easy *data = NULL;
if(!context)
return;
- data = (struct SessionHandle *)context;
+ data = (struct Curl_easy *)context;
infof(data, "%s", line);
(void) level;
@@ -158,17 +158,10 @@ static CURLcode
mbed_connect_step1(struct connectdata *conn,
int sockindex)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ssl_connect_data* connssl = &conn->ssl[sockindex];
- bool sni = TRUE; /* default is SNI enabled */
int ret = -1;
-#ifdef ENABLE_IPV6
- struct in6_addr addr;
-#else
- struct in_addr addr;
-#endif
- void *old_session = NULL;
char errorbuf[128];
errorbuf[0]=0;
@@ -177,8 +170,6 @@ mbed_connect_step1(struct connectdata *conn,
failf(data, "mbedTLS does not support SSLv2");
return CURLE_SSL_CONNECT_ERROR;
}
- else if(data->set.ssl.version == CURL_SSLVERSION_SSLv3)
- sni = FALSE; /* SSLv3 has no SNI */
#ifdef THREADING_SUPPORT
entropy_init_mutex(&entropy);
@@ -373,13 +364,22 @@ mbed_connect_step1(struct connectdata *conn,
mbedtls_ssl_conf_ciphersuites(&connssl->config,
mbedtls_ssl_list_ciphersuites());
- if(!Curl_ssl_getsessionid(conn, &old_session, NULL)) {
- ret = mbedtls_ssl_set_session(&connssl->ssl, old_session);
- if(ret) {
- failf(data, "mbedtls_ssl_set_session returned -0x%x", -ret);
- return CURLE_SSL_CONNECT_ERROR;
+
+ /* Check if there's a cached ID we can/should use here! */
+ if(conn->ssl_config.sessionid) {
+ void *old_session = NULL;
+
+ Curl_ssl_sessionid_lock(conn);
+ if(!Curl_ssl_getsessionid(conn, &old_session, NULL)) {
+ ret = mbedtls_ssl_set_session(&connssl->ssl, old_session);
+ if(ret) {
+ Curl_ssl_sessionid_unlock(conn);
+ failf(data, "mbedtls_ssl_set_session returned -0x%x", -ret);
+ return CURLE_SSL_CONNECT_ERROR;
+ }
+ infof(data, "mbedTLS re-using session\n");
}
- infof(data, "mbedTLS re-using session\n");
+ Curl_ssl_sessionid_unlock(conn);
}
mbedtls_ssl_conf_ca_chain(&connssl->config,
@@ -420,7 +420,7 @@ mbed_connect_step1(struct connectdata *conn,
#endif
#ifdef MBEDTLS_DEBUG
- mbedtls_ssl_conf_dbg(&connssl->config, mbedtls_debug, data);
+ mbedtls_ssl_conf_dbg(&connssl->config, mbed_debug, data);
#endif
connssl->connecting_state = ssl_connect_2;
@@ -433,7 +433,7 @@ mbed_connect_step2(struct connectdata *conn,
int sockindex)
{
int ret;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ssl_connect_data* connssl = &conn->ssl[sockindex];
const mbedtls_x509_crt *peercert;
@@ -595,34 +595,39 @@ mbed_connect_step3(struct connectdata *conn,
{
CURLcode retcode = CURLE_OK;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
- struct SessionHandle *data = conn->data;
- void *old_ssl_sessionid = NULL;
- mbedtls_ssl_session *our_ssl_sessionid;
- int ret;
+ struct Curl_easy *data = conn->data;
DEBUGASSERT(ssl_connect_3 == connssl->connecting_state);
- our_ssl_sessionid = malloc(sizeof(mbedtls_ssl_session));
- if(!our_ssl_sessionid)
- return CURLE_OUT_OF_MEMORY;
+ if(conn->ssl_config.sessionid) {
+ int ret;
+ mbedtls_ssl_session *our_ssl_sessionid;
+ void *old_ssl_sessionid = NULL;
+
+ our_ssl_sessionid = malloc(sizeof(mbedtls_ssl_session));
+ if(!our_ssl_sessionid)
+ return CURLE_OUT_OF_MEMORY;
- mbedtls_ssl_session_init(our_ssl_sessionid);
+ mbedtls_ssl_session_init(our_ssl_sessionid);
- ret = mbedtls_ssl_get_session(&connssl->ssl, our_ssl_sessionid);
- if(ret) {
- failf(data, "mbedtls_ssl_get_session returned -0x%x", -ret);
- return CURLE_SSL_CONNECT_ERROR;
- }
+ ret = mbedtls_ssl_get_session(&connssl->ssl, our_ssl_sessionid);
+ if(ret) {
+ failf(data, "mbedtls_ssl_get_session returned -0x%x", -ret);
+ return CURLE_SSL_CONNECT_ERROR;
+ }
- /* If there's already a matching session in the cache, delete it */
- if(!Curl_ssl_getsessionid(conn, &old_ssl_sessionid, NULL))
- Curl_ssl_delsessionid(conn, old_ssl_sessionid);
+ /* If there's already a matching session in the cache, delete it */
+ Curl_ssl_sessionid_lock(conn);
+ if(!Curl_ssl_getsessionid(conn, &old_ssl_sessionid, NULL))
+ Curl_ssl_delsessionid(conn, old_ssl_sessionid);
- retcode = Curl_ssl_addsessionid(conn, our_ssl_sessionid, 0);
- if(retcode) {
- free(our_ssl_sessionid);
- failf(data, "failed to store ssl session");
- return retcode;
+ retcode = Curl_ssl_addsessionid(conn, our_ssl_sessionid, 0);
+ Curl_ssl_sessionid_unlock(conn);
+ if(retcode) {
+ free(our_ssl_sessionid);
+ failf(data, "failed to store ssl session");
+ return retcode;
+ }
}
connssl->connecting_state = ssl_connect_done;
@@ -648,7 +653,7 @@ static ssize_t mbed_send(struct connectdata *conn, int sockindex,
return ret;
}
-void Curl_mbedtls_close_all(struct SessionHandle *data)
+void Curl_mbedtls_close_all(struct Curl_easy *data)
{
(void)data;
}
@@ -712,7 +717,7 @@ mbed_connect_common(struct connectdata *conn,
bool *done)
{
CURLcode retcode;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
curl_socket_t sockfd = conn->sock[sockindex];
long timeout_ms;
diff --git a/lib/vtls/mbedtls.h b/lib/vtls/mbedtls.h
index 9117fff1..1021d546 100644
--- a/lib/vtls/mbedtls.h
+++ b/lib/vtls/mbedtls.h
@@ -41,7 +41,7 @@ CURLcode Curl_mbedtls_connect_nonblocking(struct connectdata *conn,
/* tell mbedTLS to close down all open information regarding connections (and
thus session ID caching etc) */
-void Curl_mbedtls_close_all(struct SessionHandle *data);
+void Curl_mbedtls_close_all(struct Curl_easy *data);
/* close a SSL connection */
void Curl_mbedtls_close(struct connectdata *conn, int sockindex);
diff --git a/lib/vtls/nss.c b/lib/vtls/nss.c
index 02c8727e..ad33f258 100644
--- a/lib/vtls/nss.c
+++ b/lib/vtls/nss.c
@@ -198,12 +198,12 @@ static const char* nss_error_to_name(PRErrorCode code)
return "unknown error";
}
-static void nss_print_error_message(struct SessionHandle *data, PRUint32 err)
+static void nss_print_error_message(struct Curl_easy *data, PRUint32 err)
{
failf(data, "%s", PR_ErrorToString(err, PR_LANGUAGE_I_DEFAULT));
}
-static SECStatus set_ciphers(struct SessionHandle *data, PRFileDesc * model,
+static SECStatus set_ciphers(struct Curl_easy *data, PRFileDesc * model,
char *cipher_list)
{
unsigned int i;
@@ -319,7 +319,7 @@ static int is_file(const char *filename)
* should be later deallocated using free(). If the OOM failure occurs, we
* return NULL, too.
*/
-static char* dup_nickname(struct SessionHandle *data, enum dupstring cert_kind)
+static char* dup_nickname(struct Curl_easy *data, enum dupstring cert_kind)
{
const char *str = data->set.str[cert_kind];
const char *n;
@@ -597,7 +597,7 @@ static int display_error(struct connectdata *conn, PRInt32 err,
static CURLcode cert_stuff(struct connectdata *conn, int sockindex,
char *cert_file, char *key_file)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
CURLcode result;
if(cert_file) {
@@ -736,7 +736,7 @@ static SECStatus CanFalseStartCallback(PRFileDesc *sock, void *client_data,
PRBool *canFalseStart)
{
struct connectdata *conn = client_data;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
SSLChannelInfo channelInfo;
SSLCipherSuiteInfo cipherInfo;
@@ -791,7 +791,7 @@ end:
}
#endif
-static void display_cert_info(struct SessionHandle *data,
+static void display_cert_info(struct Curl_easy *data,
CERTCertificate *cert)
{
char *subject, *issuer, *common_name;
@@ -892,7 +892,7 @@ static CURLcode display_conn_info(struct connectdata *conn, PRFileDesc *sock)
static SECStatus BadCertHandler(void *arg, PRFileDesc *sock)
{
struct connectdata *conn = (struct connectdata *)arg;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
PRErrorCode err = PR_GetError();
CERTCertificate *cert;
@@ -950,7 +950,7 @@ static CURLcode cmp_peer_pubkey(struct ssl_connect_data *connssl,
const char *pinnedpubkey)
{
CURLcode result = CURLE_SSL_PINNEDPUBKEYNOTMATCH;
- struct SessionHandle *data = connssl->data;
+ struct Curl_easy *data = connssl->data;
CERTCertificate *cert;
if(!pinnedpubkey)
@@ -1002,7 +1002,7 @@ static SECStatus SelectClientCert(void *arg, PRFileDesc *sock,
struct SECKEYPrivateKeyStr **pRetKey)
{
struct ssl_connect_data *connssl = (struct ssl_connect_data *)arg;
- struct SessionHandle *data = connssl->data;
+ struct Curl_easy *data = connssl->data;
const char *nickname = connssl->client_nickname;
if(connssl->obj_clicert) {
@@ -1134,7 +1134,7 @@ static PRStatus nspr_io_close(PRFileDesc *fd)
}
/* data might be NULL */
-static CURLcode nss_init_core(struct SessionHandle *data, const char *cert_dir)
+static CURLcode nss_init_core(struct Curl_easy *data, const char *cert_dir)
{
NSSInitParameters initparams;
@@ -1172,7 +1172,7 @@ static CURLcode nss_init_core(struct SessionHandle *data, const char *cert_dir)
}
/* data might be NULL */
-static CURLcode nss_init(struct SessionHandle *data)
+static CURLcode nss_init(struct Curl_easy *data)
{
char *cert_dir;
struct_stat st;
@@ -1251,7 +1251,7 @@ int Curl_nss_init(void)
}
/* data might be NULL */
-CURLcode Curl_nss_force_init(struct SessionHandle *data)
+CURLcode Curl_nss_force_init(struct Curl_easy *data)
{
CURLcode result;
if(!nss_initlock) {
@@ -1397,7 +1397,7 @@ static Curl_send nss_send;
static CURLcode nss_load_ca_certificates(struct connectdata *conn,
int sockindex)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
const char *cafile = data->set.ssl.CAfile;
const char *capath = data->set.ssl.CApath;
@@ -1447,7 +1447,7 @@ static CURLcode nss_load_ca_certificates(struct connectdata *conn,
}
static CURLcode nss_init_sslver(SSLVersionRange *sslver,
- struct SessionHandle *data)
+ struct Curl_easy *data)
{
switch(data->set.ssl.version) {
default:
@@ -1500,7 +1500,7 @@ static CURLcode nss_init_sslver(SSLVersionRange *sslver,
}
static CURLcode nss_fail_connect(struct ssl_connect_data *connssl,
- struct SessionHandle *data,
+ struct Curl_easy *data,
CURLcode curlerr)
{
PRErrorCode err = 0;
@@ -1527,7 +1527,7 @@ static CURLcode nss_fail_connect(struct ssl_connect_data *connssl,
/* Switch the SSL socket into non-blocking mode. */
static CURLcode nss_set_nonblock(struct ssl_connect_data *connssl,
- struct SessionHandle *data)
+ struct Curl_easy *data)
{
static PRSocketOptionData sock_opt;
sock_opt.option = PR_SockOpt_Nonblocking;
@@ -1546,7 +1546,7 @@ static CURLcode nss_setup_connect(struct connectdata *conn, int sockindex)
PRFileDesc *nspr_io_stub = NULL;
PRBool ssl_no_cache;
PRBool ssl_cbc_random_iv;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
curl_socket_t sockfd = conn->sock[sockindex];
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
CURLcode result;
@@ -1815,7 +1815,7 @@ error:
static CURLcode nss_do_connect(struct connectdata *conn, int sockindex)
{
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
CURLcode result = CURLE_SSL_CONNECT_ERROR;
PRUint32 timeout;
@@ -1878,7 +1878,7 @@ static CURLcode nss_connect_common(struct connectdata *conn, int sockindex,
bool *done)
{
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
const bool blocking = (done == NULL);
CURLcode result;
@@ -2015,14 +2015,14 @@ size_t Curl_nss_version(char *buffer, size_t size)
}
/* data might be NULL */
-int Curl_nss_seed(struct SessionHandle *data)
+int Curl_nss_seed(struct Curl_easy *data)
{
/* make sure that NSS is initialized */
return !!Curl_nss_force_init(data);
}
/* data might be NULL */
-int Curl_nss_random(struct SessionHandle *data,
+int Curl_nss_random(struct Curl_easy *data,
unsigned char *entropy,
size_t length)
{
diff --git a/lib/vtls/nssg.h b/lib/vtls/nssg.h
index e388ec0f..ac67e6ab 100644
--- a/lib/vtls/nssg.h
+++ b/lib/vtls/nssg.h
@@ -42,12 +42,12 @@ void Curl_nss_cleanup(void);
size_t Curl_nss_version(char *buffer, size_t size);
int Curl_nss_check_cxn(struct connectdata *cxn);
-int Curl_nss_seed(struct SessionHandle *data);
+int Curl_nss_seed(struct Curl_easy *data);
/* initialize NSS library if not already */
-CURLcode Curl_nss_force_init(struct SessionHandle *data);
+CURLcode Curl_nss_force_init(struct Curl_easy *data);
-int Curl_nss_random(struct SessionHandle *data,
+int Curl_nss_random(struct Curl_easy *data,
unsigned char *entropy,
size_t length);
diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
index 3a4bde5b..3027ca33 100644
--- a/lib/vtls/openssl.c
+++ b/lib/vtls/openssl.c
@@ -122,6 +122,12 @@
#define HAVE_X509_GET0_SIGNATURE 1
#endif
+#if OPENSSL_VERSION_NUMBER >= 0x10002003L && \
+ OPENSSL_VERSION_NUMBER <= 0x10002FFFL && \
+ !defined(OPENSSL_NO_COMP)
+#define HAVE_SSL_COMP_FREE_COMPRESSION_METHODS 1
+#endif
+
#if (OPENSSL_VERSION_NUMBER < 0x0090808fL)
/* not present in older OpenSSL */
#define OPENSSL_load_builtin_modules(x)
@@ -180,7 +186,7 @@ static bool rand_enough(int nread)
}
#endif
-static int ossl_seed(struct SessionHandle *data)
+static int ossl_seed(struct Curl_easy *data)
{
char *buf = data->state.buffer; /* point to the big buffer */
int nread=0;
@@ -249,7 +255,7 @@ static int ossl_seed(struct SessionHandle *data)
return nread;
}
-static void Curl_ossl_seed(struct SessionHandle *data)
+static void Curl_ossl_seed(struct Curl_easy *data)
{
/* we have the "SSL is seeded" boolean static to prevent multiple
time-consuming seedings in vain */
@@ -333,7 +339,7 @@ int cert_stuff(struct connectdata *conn,
char *key_file,
const char *key_type)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
int file_type = do_file_type(cert_type);
@@ -666,7 +672,7 @@ static int x509_name_oneline(X509_NAME *a, char *buf, size_t size)
/* Return error string for last OpenSSL error
*/
-static char *SSL_strerror(unsigned long error, char *buf, size_t size)
+static char *ossl_strerror(unsigned long error, char *buf, size_t size)
{
/* OpenSSL 0.9.6 and later has a function named
ERR_error_string_n() that takes the size of the buffer as a
@@ -748,8 +754,7 @@ void Curl_ossl_cleanup(void)
/* Free all memory allocated by all configuration modules */
CONF_modules_free();
-#if OPENSSL_VERSION_NUMBER >= 0x10002003L && \
- OPENSSL_VERSION_NUMBER <= 0x10002FFFL
+#ifdef HAVE_SSL_COMP_FREE_COMPRESSION_METHODS
SSL_COMP_free_compression_methods();
#endif
}
@@ -808,7 +813,7 @@ int Curl_ossl_check_cxn(struct connectdata *conn)
/* Selects an OpenSSL crypto engine
*/
-CURLcode Curl_ossl_set_engine(struct SessionHandle *data, const char *engine)
+CURLcode Curl_ossl_set_engine(struct Curl_easy *data, const char *engine)
{
#if defined(USE_OPENSSL) && defined(HAVE_OPENSSL_ENGINE_H)
ENGINE *e;
@@ -839,7 +844,7 @@ CURLcode Curl_ossl_set_engine(struct SessionHandle *data, const char *engine)
ENGINE_free(e);
failf(data, "Failed to initialise SSL Engine '%s':\n%s",
- engine, SSL_strerror(ERR_get_error(), buf, sizeof(buf)));
+ engine, ossl_strerror(ERR_get_error(), buf, sizeof(buf)));
return CURLE_SSL_ENGINE_INITFAILED;
}
data->state.engine = e;
@@ -853,7 +858,7 @@ CURLcode Curl_ossl_set_engine(struct SessionHandle *data, const char *engine)
/* Sets engine as default for all SSL operations
*/
-CURLcode Curl_ossl_set_engine_default(struct SessionHandle *data)
+CURLcode Curl_ossl_set_engine_default(struct Curl_easy *data)
{
#ifdef HAVE_OPENSSL_ENGINE_H
if(data->state.engine) {
@@ -875,7 +880,7 @@ CURLcode Curl_ossl_set_engine_default(struct SessionHandle *data)
/* Return list of OpenSSL crypto engine names.
*/
-struct curl_slist *Curl_ossl_engines_list(struct SessionHandle *data)
+struct curl_slist *Curl_ossl_engines_list(struct Curl_easy *data)
{
struct curl_slist *list = NULL;
#if defined(USE_OPENSSL) && defined(HAVE_OPENSSL_ENGINE_H)
@@ -924,9 +929,9 @@ int Curl_ossl_shutdown(struct connectdata *conn, int sockindex)
{
int retval = 0;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
- struct SessionHandle *data = conn->data;
- char buf[120]; /* We will use this for the OpenSSL error buffer, so it has
- to be at least 120 bytes long. */
+ struct Curl_easy *data = conn->data;
+ char buf[256]; /* We will use this for the OpenSSL error buffer, so it has
+ to be at least 256 bytes long. */
unsigned long sslerror;
ssize_t nread;
int buffsize;
@@ -975,7 +980,7 @@ int Curl_ossl_shutdown(struct connectdata *conn, int sockindex)
/* openssl/ssl.h says "look at error stack/return value/errno" */
sslerror = ERR_get_error();
failf(conn->data, OSSL_PACKAGE " SSL read: %s, errno %d",
- ERR_error_string(sslerror, buf),
+ ossl_strerror(sslerror, buf, sizeof(buf)),
SOCKERRNO);
done = 1;
break;
@@ -1027,7 +1032,7 @@ void Curl_ossl_session_free(void *ptr)
* This function is called when the 'data' struct is going away. Close
* down everything and free all resources!
*/
-void Curl_ossl_close_all(struct SessionHandle *data)
+void Curl_ossl_close_all(struct Curl_easy *data)
{
#ifdef HAVE_OPENSSL_ENGINE_H
if(data->state.engine) {
@@ -1069,7 +1074,7 @@ static CURLcode verifyhost(struct connectdata *conn, X509 *server_cert)
bool matched = FALSE;
int target = GEN_DNS; /* target type, GEN_DNS or GEN_IPADD */
size_t addrlen = 0;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
STACK_OF(GENERAL_NAME) *altnames;
#ifdef ENABLE_IPV6
struct in6_addr addr;
@@ -1077,6 +1082,7 @@ static CURLcode verifyhost(struct connectdata *conn, X509 *server_cert)
struct in_addr addr;
#endif
CURLcode result = CURLE_OK;
+ bool dNSName = FALSE; /* if a dNSName field exists in the cert */
#ifdef ENABLE_IPV6
if(conn->bits.ipv6_ip &&
@@ -1097,16 +1103,23 @@ static CURLcode verifyhost(struct connectdata *conn, X509 *server_cert)
if(altnames) {
int numalts;
int i;
+ bool dnsmatched = FALSE;
+ bool ipmatched = FALSE;
/* get amount of alternatives, RFC2459 claims there MUST be at least
one, but we don't depend on it... */
numalts = sk_GENERAL_NAME_num(altnames);
- /* loop through all alternatives while none has matched */
- for(i=0; (i<numalts) && !matched; i++) {
+ /* loop through all alternatives - until a dnsmatch */
+ for(i=0; (i < numalts) && !dnsmatched; i++) {
/* get a handle to alternative name number i */
const GENERAL_NAME *check = sk_GENERAL_NAME_value(altnames, i);
+ /* If a subjectAltName extension of type dNSName is present, that MUST
+ be used as the identity. / RFC2818 section 3.1 */
+ if(check->type == GEN_DNS)
+ dNSName = TRUE;
+
/* only check alternatives of the same type the target is */
if(check->type == target) {
/* get data and length */
@@ -1129,7 +1142,7 @@ static CURLcode verifyhost(struct connectdata *conn, X509 *server_cert)
/* if this isn't true, there was an embedded zero in the name
string and we cannot match it. */
Curl_cert_hostcheck(altptr, conn->host.name)) {
- matched = TRUE;
+ dnsmatched = TRUE;
infof(data,
" subjectAltName: host \"%s\" matched cert's \"%s\"\n",
conn->host.dispname, altptr);
@@ -1140,7 +1153,7 @@ static CURLcode verifyhost(struct connectdata *conn, X509 *server_cert)
/* compare alternative IP address if the data chunk is the same size
our server IP address is */
if((altlen == addrlen) && !memcmp(altptr, &addr, altlen)) {
- matched = TRUE;
+ ipmatched = TRUE;
infof(data,
" subjectAltName: host \"%s\" matched cert's IP address!\n",
conn->host.dispname);
@@ -1150,14 +1163,19 @@ static CURLcode verifyhost(struct connectdata *conn, X509 *server_cert)
}
}
GENERAL_NAMES_free(altnames);
+
+ if(dnsmatched || (!dNSName && ipmatched)) {
+ /* count as a match if the dnsname matched or if there was no dnsname
+ fields at all AND there was an IP field match */
+ matched = TRUE;
+ }
}
if(matched)
/* an alternative name matched */
;
- else if(altnames) {
- /* an alternative name field existed, but didn't match and then we MUST
- fail */
+ else if(dNSName) {
+ /* an dNSName field existed, but didn't match and then we MUST fail */
infof(data, " subjectAltName does not match %s\n", conn->host.dispname);
failf(data, "SSL: no alternative certificate subject name matches "
"target host name '%s'", conn->host.dispname);
@@ -1257,7 +1275,7 @@ static CURLcode verifystatus(struct connectdata *conn,
int i, ocsp_status;
const unsigned char *p;
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
OCSP_RESPONSE *rsp = NULL;
OCSP_BASICRESP *br = NULL;
@@ -1473,7 +1491,7 @@ static void ssl_tls_trace(int direction, int ssl_ver, int content_type,
const void *buf, size_t len, SSL *ssl,
void *userp)
{
- struct SessionHandle *data;
+ struct Curl_easy *data;
const char *msg_name, *tls_rt_name;
char ssl_buf[1024];
char unknown[32];
@@ -1659,9 +1677,8 @@ static CURLcode ossl_connect_step1(struct connectdata *conn, int sockindex)
{
CURLcode result = CURLE_OK;
char *ciphers;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
SSL_METHOD_QUAL SSL_METHOD *req_method = NULL;
- void *ssl_sessionid = NULL;
X509_LOOKUP *lookup = NULL;
curl_socket_t sockfd = conn->sock[sockindex];
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
@@ -2077,15 +2094,22 @@ static CURLcode ossl_connect_step1(struct connectdata *conn, int sockindex)
#endif
/* Check if there's a cached ID we can/should use here! */
- if(!Curl_ssl_getsessionid(conn, &ssl_sessionid, NULL)) {
- /* we got a session id, use it! */
- if(!SSL_set_session(connssl->handle, ssl_sessionid)) {
- failf(data, "SSL: SSL_set_session failed: %s",
- ERR_error_string(ERR_get_error(), NULL));
- return CURLE_SSL_CONNECT_ERROR;
+ if(conn->ssl_config.sessionid) {
+ void *ssl_sessionid = NULL;
+
+ Curl_ssl_sessionid_lock(conn);
+ if(!Curl_ssl_getsessionid(conn, &ssl_sessionid, NULL)) {
+ /* we got a session id, use it! */
+ if(!SSL_set_session(connssl->handle, ssl_sessionid)) {
+ Curl_ssl_sessionid_unlock(conn);
+ failf(data, "SSL: SSL_set_session failed: %s",
+ ERR_error_string(ERR_get_error(), NULL));
+ return CURLE_SSL_CONNECT_ERROR;
+ }
+ /* Informational message */
+ infof (data, "SSL re-using session ID\n");
}
- /* Informational message */
- infof (data, "SSL re-using session ID\n");
+ Curl_ssl_sessionid_unlock(conn);
}
/* pass the raw socket into the SSL layers */
@@ -2102,7 +2126,7 @@ static CURLcode ossl_connect_step1(struct connectdata *conn, int sockindex)
static CURLcode ossl_connect_step2(struct connectdata *conn, int sockindex)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
int err;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
DEBUGASSERT(ssl_connect_2 == connssl->connecting_state
@@ -2165,7 +2189,7 @@ static CURLcode ossl_connect_step2(struct connectdata *conn, int sockindex)
}
else {
result = CURLE_SSL_CONNECT_ERROR;
- SSL_strerror(errdetail, error_buffer, sizeof(error_buffer));
+ ossl_strerror(errdetail, error_buffer, sizeof(error_buffer));
}
/* detail is already set to the SSL error above */
@@ -2250,11 +2274,14 @@ do { \
break; \
} WHILE_FALSE
-static void pubkey_show(struct SessionHandle *data,
+static void pubkey_show(struct Curl_easy *data,
BIO *mem,
int num,
const char *type,
const char *name,
+#ifdef HAVE_OPAQUE_RSA_DSA_DH
+ const
+#endif
BIGNUM *bn)
{
char *ptr;
@@ -2280,7 +2307,7 @@ do { \
} WHILE_FALSE
#endif
-static int X509V3_ext(struct SessionHandle *data,
+static int X509V3_ext(struct Curl_easy *data,
int certnum,
STACK_OF(X509_EXTENSION) *exts)
{
@@ -2340,7 +2367,7 @@ static CURLcode get_cert_chain(struct connectdata *conn,
CURLcode result;
STACK_OF(X509) *sk;
int i;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
int numcerts;
BIO *mem;
@@ -2443,14 +2470,14 @@ static CURLcode get_cert_chain(struct connectdata *conn,
#ifdef HAVE_OPAQUE_RSA_DSA_DH
{
- BIGNUM *n;
- BIGNUM *e;
- BIGNUM *d;
- BIGNUM *p;
- BIGNUM *q;
- BIGNUM *dmp1;
- BIGNUM *dmq1;
- BIGNUM *iqmp;
+ const BIGNUM *n;
+ const BIGNUM *e;
+ const BIGNUM *d;
+ const BIGNUM *p;
+ const BIGNUM *q;
+ const BIGNUM *dmp1;
+ const BIGNUM *dmq1;
+ const BIGNUM *iqmp;
RSA_get0_key(rsa, &n, &e, &d);
RSA_get0_factors(rsa, &p, &q);
@@ -2491,11 +2518,11 @@ static CURLcode get_cert_chain(struct connectdata *conn,
#endif
#ifdef HAVE_OPAQUE_RSA_DSA_DH
{
- BIGNUM *p;
- BIGNUM *q;
- BIGNUM *g;
- BIGNUM *priv_key;
- BIGNUM *pub_key;
+ const BIGNUM *p;
+ const BIGNUM *q;
+ const BIGNUM *g;
+ const BIGNUM *priv_key;
+ const BIGNUM *pub_key;
DSA_get0_pqg(dsa, &p, &q, &g);
DSA_get0_key(dsa, &pub_key, &priv_key);
@@ -2525,11 +2552,11 @@ static CURLcode get_cert_chain(struct connectdata *conn,
#endif
#ifdef HAVE_OPAQUE_RSA_DSA_DH
{
- BIGNUM *p;
- BIGNUM *q;
- BIGNUM *g;
- BIGNUM *priv_key;
- BIGNUM *pub_key;
+ const BIGNUM *p;
+ const BIGNUM *q;
+ const BIGNUM *g;
+ const BIGNUM *priv_key;
+ const BIGNUM *pub_key;
DH_get0_pqg(dh, &p, &q, &g);
DH_get0_key(dh, &pub_key, &priv_key);
print_pubkey_BN(dh, p, i);
@@ -2574,7 +2601,7 @@ static CURLcode get_cert_chain(struct connectdata *conn,
* Heavily modified from:
* https://www.owasp.org/index.php/Certificate_and_Public_Key_Pinning#OpenSSL
*/
-static CURLcode pkp_pin_peer_pubkey(struct SessionHandle *data, X509* cert,
+static CURLcode pkp_pin_peer_pubkey(struct Curl_easy *data, X509* cert,
const char *pinnedpubkey)
{
/* Scratch */
@@ -2645,7 +2672,7 @@ static CURLcode servercert(struct connectdata *conn,
CURLcode result = CURLE_OK;
int rc;
long lerr, len;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
X509 *issuer;
FILE *fp;
char *buffer = data->state.buffer;
@@ -2799,43 +2826,49 @@ static CURLcode servercert(struct connectdata *conn,
static CURLcode ossl_connect_step3(struct connectdata *conn, int sockindex)
{
CURLcode result = CURLE_OK;
- void *old_ssl_sessionid = NULL;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
- bool incache;
- SSL_SESSION *our_ssl_sessionid;
DEBUGASSERT(ssl_connect_3 == connssl->connecting_state);
- our_ssl_sessionid = SSL_get1_session(connssl->handle);
+ if(conn->ssl_config.sessionid) {
+ bool incache;
+ SSL_SESSION *our_ssl_sessionid;
+ void *old_ssl_sessionid = NULL;
- /* SSL_get1_session() will increment the reference count and the session
- will stay in memory until explicitly freed with SSL_SESSION_free(3),
- regardless of its state. */
+ our_ssl_sessionid = SSL_get1_session(connssl->handle);
- incache = !(Curl_ssl_getsessionid(conn, &old_ssl_sessionid, NULL));
- if(incache) {
- if(old_ssl_sessionid != our_ssl_sessionid) {
- infof(data, "old SSL session ID is stale, removing\n");
- Curl_ssl_delsessionid(conn, old_ssl_sessionid);
- incache = FALSE;
+ /* SSL_get1_session() will increment the reference count and the session
+ will stay in memory until explicitly freed with SSL_SESSION_free(3),
+ regardless of its state. */
+
+ Curl_ssl_sessionid_lock(conn);
+ incache = !(Curl_ssl_getsessionid(conn, &old_ssl_sessionid, NULL));
+ if(incache) {
+ if(old_ssl_sessionid != our_ssl_sessionid) {
+ infof(data, "old SSL session ID is stale, removing\n");
+ Curl_ssl_delsessionid(conn, old_ssl_sessionid);
+ incache = FALSE;
+ }
}
- }
- if(!incache) {
- result = Curl_ssl_addsessionid(conn, our_ssl_sessionid,
- 0 /* unknown size */);
- if(result) {
- failf(data, "failed to store ssl session");
- return result;
+ if(!incache) {
+ result = Curl_ssl_addsessionid(conn, our_ssl_sessionid,
+ 0 /* unknown size */);
+ if(result) {
+ Curl_ssl_sessionid_unlock(conn);
+ failf(data, "failed to store ssl session");
+ return result;
+ }
}
- }
- else {
- /* Session was incache, so refcount already incremented earlier.
- * Avoid further increments with each SSL_get1_session() call.
- * This does not free the session as refcount remains > 0
- */
- SSL_SESSION_free(our_ssl_sessionid);
+ else {
+ /* Session was incache, so refcount already incremented earlier.
+ * Avoid further increments with each SSL_get1_session() call.
+ * This does not free the session as refcount remains > 0
+ */
+ SSL_SESSION_free(our_ssl_sessionid);
+ }
+ Curl_ssl_sessionid_unlock(conn);
}
/*
@@ -2863,7 +2896,7 @@ static CURLcode ossl_connect_common(struct connectdata *conn,
bool *done)
{
CURLcode result;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
curl_socket_t sockfd = conn->sock[sockindex];
long timeout_ms;
@@ -3007,7 +3040,7 @@ static ssize_t ossl_send(struct connectdata *conn,
/* SSL_write() is said to return 'int' while write() and send() returns
'size_t' */
int err;
- char error_buffer[120]; /* OpenSSL documents that this must be at least 120
+ char error_buffer[256]; /* OpenSSL documents that this must be at least 256
bytes long. */
unsigned long sslerror;
int memlen;
@@ -3039,7 +3072,7 @@ static ssize_t ossl_send(struct connectdata *conn,
The OpenSSL error queue contains more information on the error. */
sslerror = ERR_get_error();
failf(conn->data, "SSL_write() error: %s",
- ERR_error_string(sslerror, error_buffer));
+ ossl_strerror(sslerror, error_buffer, sizeof(error_buffer)));
*curlcode = CURLE_SEND_ERROR;
return -1;
}
@@ -3058,8 +3091,8 @@ static ssize_t ossl_recv(struct connectdata *conn, /* connection data */
size_t buffersize, /* max amount to read */
CURLcode *curlcode)
{
- char error_buffer[120]; /* OpenSSL documents that this must be at
- least 120 bytes long. */
+ char error_buffer[256]; /* OpenSSL documents that this must be at
+ least 256 bytes long. */
unsigned long sslerror;
ssize_t nread;
int buffsize;
@@ -3090,7 +3123,7 @@ static ssize_t ossl_recv(struct connectdata *conn, /* connection data */
/* If the return code was negative or there actually is an error in the
queue */
failf(conn->data, "SSL read: %s, errno %d",
- ERR_error_string(sslerror, error_buffer),
+ ossl_strerror(sslerror, error_buffer, sizeof(error_buffer)),
SOCKERRNO);
*curlcode = CURLE_RECV_ERROR;
return -1;
@@ -3140,7 +3173,7 @@ size_t Curl_ossl_version(char *buffer, size_t size)
}
/* can be called with data == NULL */
-int Curl_ossl_random(struct SessionHandle *data, unsigned char *entropy,
+int Curl_ossl_random(struct Curl_easy *data, unsigned char *entropy,
size_t length)
{
if(data) {
diff --git a/lib/vtls/openssl.h b/lib/vtls/openssl.h
index 74f128ed..ee18e710 100644
--- a/lib/vtls/openssl.h
+++ b/lib/vtls/openssl.h
@@ -41,20 +41,20 @@ void Curl_ossl_close(struct connectdata *conn, int sockindex);
/* tell OpenSSL to close down all open information regarding connections (and
thus session ID caching etc) */
-void Curl_ossl_close_all(struct SessionHandle *data);
+void Curl_ossl_close_all(struct Curl_easy *data);
/* Sets an OpenSSL engine */
-CURLcode Curl_ossl_set_engine(struct SessionHandle *data, const char *engine);
+CURLcode Curl_ossl_set_engine(struct Curl_easy *data, const char *engine);
/* function provided for the generic SSL-layer, called when a session id
should be freed */
void Curl_ossl_session_free(void *ptr);
/* Sets engine as default for all SSL operations */
-CURLcode Curl_ossl_set_engine_default(struct SessionHandle *data);
+CURLcode Curl_ossl_set_engine_default(struct Curl_easy *data);
/* Build list of OpenSSL engines */
-struct curl_slist *Curl_ossl_engines_list(struct SessionHandle *data);
+struct curl_slist *Curl_ossl_engines_list(struct Curl_easy *data);
int Curl_ossl_init(void);
void Curl_ossl_cleanup(void);
@@ -66,7 +66,7 @@ bool Curl_ossl_data_pending(const struct connectdata *conn,
int connindex);
/* return 0 if a find random is filled in */
-int Curl_ossl_random(struct SessionHandle *data, unsigned char *entropy,
+int Curl_ossl_random(struct Curl_easy *data, unsigned char *entropy,
size_t length);
void Curl_ossl_md5sum(unsigned char *tmp, /* input */
size_t tmplen,
diff --git a/lib/vtls/polarssl.c b/lib/vtls/polarssl.c
index 0e8b0f50..d33f5480 100644
--- a/lib/vtls/polarssl.c
+++ b/lib/vtls/polarssl.c
@@ -114,12 +114,12 @@ static int entropy_func_mutex(void *data, unsigned char *output, size_t len)
#ifdef POLARSSL_DEBUG
static void polarssl_debug(void *context, int level, const char *line)
{
- struct SessionHandle *data = NULL;
+ struct Curl_easy *data = NULL;
if(!context)
return;
- data = (struct SessionHandle *)context;
+ data = (struct Curl_easy *)context;
infof(data, "%s", line);
(void) level;
@@ -140,7 +140,7 @@ static CURLcode
polarssl_connect_step1(struct connectdata *conn,
int sockindex)
{
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ssl_connect_data* connssl = &conn->ssl[sockindex];
bool sni = TRUE; /* default is SNI enabled */
@@ -150,7 +150,6 @@ polarssl_connect_step1(struct connectdata *conn,
#else
struct in_addr addr;
#endif
- void *old_session = NULL;
char errorbuf[128];
errorbuf[0]=0;
@@ -337,13 +336,21 @@ polarssl_connect_step1(struct connectdata *conn,
net_send, &conn->sock[sockindex]);
ssl_set_ciphersuites(&connssl->ssl, ssl_list_ciphersuites());
- if(!Curl_ssl_getsessionid(conn, &old_session, NULL)) {
- ret = ssl_set_session(&connssl->ssl, old_session);
- if(ret) {
- failf(data, "ssl_set_session returned -0x%x", -ret);
- return CURLE_SSL_CONNECT_ERROR;
+
+ /* Check if there's a cached ID we can/should use here! */
+ if(conn->ssl_config.sessionid) {
+ void *old_session = NULL;
+
+ Curl_ssl_sessionid_lock(conn);
+ if(!Curl_ssl_getsessionid(conn, &old_session, NULL)) {
+ ret = ssl_set_session(&connssl->ssl, old_session);
+ Curl_ssl_sessionid_unlock(conn);
+ if(ret) {
+ failf(data, "ssl_set_session returned -0x%x", -ret);
+ return CURLE_SSL_CONNECT_ERROR;
+ }
+ infof(data, "PolarSSL re-using session\n");
}
- infof(data, "PolarSSL re-using session\n");
}
ssl_set_ca_chain(&connssl->ssl,
@@ -397,7 +404,7 @@ polarssl_connect_step2(struct connectdata *conn,
int sockindex)
{
int ret;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ssl_connect_data* connssl = &conn->ssl[sockindex];
char buffer[1024];
@@ -552,34 +559,39 @@ polarssl_connect_step3(struct connectdata *conn,
{
CURLcode retcode = CURLE_OK;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
- struct SessionHandle *data = conn->data;
- void *old_ssl_sessionid = NULL;
- ssl_session *our_ssl_sessionid;
- int ret;
+ struct Curl_easy *data = conn->data;
DEBUGASSERT(ssl_connect_3 == connssl->connecting_state);
- our_ssl_sessionid = malloc(sizeof(ssl_session));
- if(!our_ssl_sessionid)
- return CURLE_OUT_OF_MEMORY;
+ if(conn->ssl_config.sessionid) {
+ int ret;
+ ssl_session *our_ssl_sessionid;
+ void *old_ssl_sessionid = NULL;
- ssl_session_init(our_ssl_sessionid);
+ our_ssl_sessionid = malloc(sizeof(ssl_session));
+ if(!our_ssl_sessionid)
+ return CURLE_OUT_OF_MEMORY;
- ret = ssl_get_session(&connssl->ssl, our_ssl_sessionid);
- if(ret) {
- failf(data, "ssl_get_session returned -0x%x", -ret);
- return CURLE_SSL_CONNECT_ERROR;
- }
+ ssl_session_init(our_ssl_sessionid);
- /* If there's already a matching session in the cache, delete it */
- if(!Curl_ssl_getsessionid(conn, &old_ssl_sessionid, NULL))
- Curl_ssl_delsessionid(conn, old_ssl_sessionid);
+ ret = ssl_get_session(&connssl->ssl, our_ssl_sessionid);
+ if(ret) {
+ failf(data, "ssl_get_session returned -0x%x", -ret);
+ return CURLE_SSL_CONNECT_ERROR;
+ }
- retcode = Curl_ssl_addsessionid(conn, our_ssl_sessionid, 0);
- if(retcode) {
- free(our_ssl_sessionid);
- failf(data, "failed to store ssl session");
- return retcode;
+ /* If there's already a matching session in the cache, delete it */
+ Curl_ssl_sessionid_lock(conn);
+ if(!Curl_ssl_getsessionid(conn, &old_ssl_sessionid, NULL))
+ Curl_ssl_delsessionid(conn, old_ssl_sessionid);
+
+ retcode = Curl_ssl_addsessionid(conn, our_ssl_sessionid, 0);
+ Curl_ssl_sessionid_unlock(conn);
+ if(retcode) {
+ free(our_ssl_sessionid);
+ failf(data, "failed to store ssl session");
+ return retcode;
+ }
}
connssl->connecting_state = ssl_connect_done;
@@ -666,7 +678,7 @@ polarssl_connect_common(struct connectdata *conn,
bool *done)
{
CURLcode result;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
curl_socket_t sockfd = conn->sock[sockindex];
long timeout_ms;
diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c
index b2e92656..f991ec90 100644
--- a/lib/vtls/schannel.c
+++ b/lib/vtls/schannel.c
@@ -56,13 +56,19 @@
#include "inet_pton.h" /* for IP addr SNI check */
#include "curl_multibyte.h"
#include "warnless.h"
+#include "x509asn1.h"
#include "curl_printf.h"
+#include "system_win32.h"
+
+ /* The last #include file should be: */
#include "curl_memory.h"
-/* The last #include file should be: */
#include "memdebug.h"
-/* ALPN requires version 8.1 of the Windows SDK, which was
- shipped with Visual Studio 2013, aka _MSC_VER 1800*/
+/* ALPN requires version 8.1 of the Windows SDK, which was
+ shipped with Visual Studio 2013, aka _MSC_VER 1800:
+
+ https://technet.microsoft.com/en-us/library/hh831771%28v=ws.11%29.aspx
+*/
#if defined(_MSC_VER) && (_MSC_VER >= 1800) && !defined(_USING_V110_SDK71_)
# define HAS_ALPN 1
#endif
@@ -99,7 +105,7 @@ static CURLcode
schannel_connect_step1(struct connectdata *conn, int sockindex)
{
ssize_t written = -1;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
SecBuffer outbuf;
SecBufferDesc outbuf_desc;
@@ -121,12 +127,24 @@ schannel_connect_step1(struct connectdata *conn, int sockindex)
infof(data, "schannel: SSL/TLS connection with %s port %hu (step 1/3)\n",
conn->host.name, conn->remote_port);
+ connssl->cred = NULL;
+
/* check for an existing re-usable credential handle */
- if(!Curl_ssl_getsessionid(conn, (void **)&old_cred, NULL)) {
- connssl->cred = old_cred;
- infof(data, "schannel: re-using existing credential handle\n");
+ if(conn->ssl_config.sessionid) {
+ Curl_ssl_sessionid_lock(conn);
+ if(!Curl_ssl_getsessionid(conn, (void **)&old_cred, NULL)) {
+ connssl->cred = old_cred;
+ infof(data, "schannel: re-using existing credential handle\n");
+
+ /* increment the reference counter of the credential/session handle */
+ connssl->cred->refcount++;
+ infof(data, "schannel: incremented credential handle refcount = %d\n",
+ connssl->cred->refcount);
+ }
+ Curl_ssl_sessionid_unlock(conn);
}
- else {
+
+ if(!connssl->cred) {
/* setup Schannel API options */
memset(&schannel_cred, 0, sizeof(schannel_cred));
schannel_cred.dwVersion = SCHANNEL_CRED_VERSION;
@@ -199,6 +217,7 @@ schannel_connect_step1(struct connectdata *conn, int sockindex)
return CURLE_OUT_OF_MEMORY;
}
memset(connssl->cred, 0, sizeof(struct curl_schannel_cred));
+ connssl->cred->refcount = 1;
/* https://msdn.microsoft.com/en-us/library/windows/desktop/aa374716.aspx
*/
@@ -231,7 +250,10 @@ schannel_connect_step1(struct connectdata *conn, int sockindex)
}
#ifdef HAS_ALPN
- if(conn->bits.tls_enable_alpn) {
+ /* ALPN is only supported on Windows 8.1 / Server 2012 R2 and above */
+ if(conn->bits.tls_enable_alpn &&
+ Curl_verify_windows_version(6, 3, PLATFORM_WINNT,
+ VERSION_GREATER_THAN_EQUAL)) {
int cur = 0;
int list_start_index = 0;
unsigned int* extension_len = NULL;
@@ -357,7 +379,7 @@ schannel_connect_step2(struct connectdata *conn, int sockindex)
{
int i;
ssize_t nread = -1, written = -1;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
unsigned char *reallocated_buffer;
size_t reallocated_length;
@@ -597,14 +619,13 @@ static CURLcode
schannel_connect_step3(struct connectdata *conn, int sockindex)
{
CURLcode result = CURLE_OK;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
- struct curl_schannel_cred *old_cred = NULL;
-#ifdef HAS_ALPN
SECURITY_STATUS sspi_status = SEC_E_OK;
+ CERT_CONTEXT *ccert_context = NULL;
+#ifdef HAS_ALPN
SecPkgContext_ApplicationProtocol alpn_result;
#endif
- bool incache;
DEBUGASSERT(ssl_connect_3 == connssl->connecting_state);
@@ -630,7 +651,10 @@ schannel_connect_step3(struct connectdata *conn, int sockindex)
}
#ifdef HAS_ALPN
- if(conn->bits.tls_enable_alpn) {
+ /* ALPN is only supported on Windows 8.1 / Server 2012 R2 and above */
+ if(conn->bits.tls_enable_alpn &&
+ Curl_verify_windows_version(6, 3, PLATFORM_WINNT,
+ VERSION_GREATER_THAN_EQUAL)) {
sspi_status = s_pSecFn->QueryContextAttributes(&connssl->ctxt->ctxt_handle,
SECPKG_ATTR_APPLICATION_PROTOCOL, &alpn_result);
@@ -664,34 +688,60 @@ schannel_connect_step3(struct connectdata *conn, int sockindex)
}
#endif
- /* increment the reference counter of the credential/session handle */
- if(connssl->cred && connssl->ctxt) {
- connssl->cred->refcount++;
- infof(data, "schannel: incremented credential handle refcount = %d\n",
- connssl->cred->refcount);
- }
-
/* save the current session data for possible re-use */
- incache = !(Curl_ssl_getsessionid(conn, (void **)&old_cred, NULL));
- if(incache) {
- if(old_cred != connssl->cred) {
- infof(data, "schannel: old credential handle is stale, removing\n");
- Curl_ssl_delsessionid(conn, (void *)old_cred);
- incache = FALSE;
+ if(conn->ssl_config.sessionid) {
+ bool incache;
+ struct curl_schannel_cred *old_cred = NULL;
+
+ Curl_ssl_sessionid_lock(conn);
+ incache = !(Curl_ssl_getsessionid(conn, (void **)&old_cred, NULL));
+ if(incache) {
+ if(old_cred != connssl->cred) {
+ infof(data, "schannel: old credential handle is stale, removing\n");
+ /* we're not taking old_cred ownership here, no refcount++ is needed */
+ Curl_ssl_delsessionid(conn, (void *)old_cred);
+ incache = FALSE;
+ }
+ }
+ if(!incache) {
+ result = Curl_ssl_addsessionid(conn, (void *)connssl->cred,
+ sizeof(struct curl_schannel_cred));
+ if(result) {
+ Curl_ssl_sessionid_unlock(conn);
+ failf(data, "schannel: failed to store credential handle");
+ return result;
+ }
+ else {
+ /* this cred session is now also referenced by sessionid cache */
+ connssl->cred->refcount++;
+ infof(data, "schannel: stored credential handle in session cache\n");
+ }
}
+ Curl_ssl_sessionid_unlock(conn);
}
- if(!incache) {
- result = Curl_ssl_addsessionid(conn, (void *)connssl->cred,
- sizeof(struct curl_schannel_cred));
- if(result) {
- failf(data, "schannel: failed to store credential handle");
- return result;
+ if(data->set.ssl.certinfo) {
+ sspi_status = s_pSecFn->QueryContextAttributes(&connssl->ctxt->ctxt_handle,
+ SECPKG_ATTR_REMOTE_CERT_CONTEXT, &ccert_context);
+
+ if((sspi_status != SEC_E_OK) || (ccert_context == NULL)) {
+ failf(data, "schannel: failed to retrieve remote cert context");
+ return CURLE_SSL_CONNECT_ERROR;
}
- else {
- connssl->cred->cached = TRUE;
- infof(data, "schannel: stored credential handle in session cache\n");
+
+ result = Curl_ssl_init_certinfo(data, 1);
+ if(!result) {
+ if(((ccert_context->dwCertEncodingType & X509_ASN_ENCODING) != 0) &&
+ (ccert_context->cbCertEncoded > 0)) {
+
+ const char *beg = (const char *) ccert_context->pbCertEncoded;
+ const char *end = beg + ccert_context->cbCertEncoded;
+ result = Curl_extract_certinfo(conn, 0, beg, end);
+ }
}
+ CertFreeCertificateContext(ccert_context);
+ if(result)
+ return result;
}
connssl->connecting_state = ssl_connect_done;
@@ -704,7 +754,7 @@ schannel_connect_common(struct connectdata *conn, int sockindex,
bool nonblocking, bool *done)
{
CURLcode result;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
curl_socket_t sockfd = conn->sock[sockindex];
long timeout_ms;
@@ -963,7 +1013,7 @@ schannel_recv(struct connectdata *conn, int sockindex,
{
size_t size = 0;
ssize_t nread = -1;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
unsigned char *reallocated_buffer;
size_t reallocated_length;
@@ -1226,39 +1276,8 @@ cleanup:
*/
if(len && !connssl->decdata_offset && connssl->recv_connection_closed &&
!connssl->recv_sspi_close_notify) {
- bool isWin2k = FALSE;
-
-#if !defined(_WIN32_WINNT) || !defined(_WIN32_WINNT_WIN2K) || \
- (_WIN32_WINNT < _WIN32_WINNT_WIN2K)
- OSVERSIONINFO osver;
-
- memset(&osver, 0, sizeof(osver));
- osver.dwOSVersionInfoSize = sizeof(osver);
-
- /* Find out the Windows version */
- if(GetVersionEx(&osver)) {
- /* Verify the version number is 5.0 */
- if(osver.dwMajorVersion == 5 && osver.dwMinorVersion == 0)
- isWin2k = TRUE;
- }
-#else
- ULONGLONG cm;
- OSVERSIONINFOEX osver;
-
- memset(&osver, 0, sizeof(osver));
- osver.dwOSVersionInfoSize = sizeof(osver);
- osver.dwMajorVersion = 5;
-
- cm = VerSetConditionMask(0, VER_MAJORVERSION, VER_EQUAL);
- cm = VerSetConditionMask(cm, VER_MINORVERSION, VER_EQUAL);
- cm = VerSetConditionMask(cm, VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL);
- cm = VerSetConditionMask(cm, VER_SERVICEPACKMINOR, VER_GREATER_EQUAL);
-
- if(VerifyVersionInfo(&osver, (VER_MAJORVERSION | VER_MINORVERSION |
- VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR),
- cm))
- isWin2k = TRUE;
-#endif
+ bool isWin2k = Curl_verify_windows_version(5, 0, PLATFORM_WINNT,
+ VERSION_EQUAL);
if(isWin2k && sspi_status == SEC_E_OK)
connssl->recv_sspi_close_notify = true;
@@ -1343,7 +1362,7 @@ int Curl_schannel_shutdown(struct connectdata *conn, int sockindex)
/* See https://msdn.microsoft.com/en-us/library/windows/desktop/aa380138.aspx
* Shutting Down an Schannel Connection
*/
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
infof(data, "schannel: shutting down SSL/TLS connection with %s port %hu\n",
@@ -1416,19 +1435,10 @@ int Curl_schannel_shutdown(struct connectdata *conn, int sockindex)
/* free SSPI Schannel API credential handle */
if(connssl->cred) {
- /* decrement the reference counter of the credential/session handle */
- if(connssl->cred->refcount > 0) {
- connssl->cred->refcount--;
- infof(data, "schannel: decremented credential handle refcount = %d\n",
- connssl->cred->refcount);
- }
-
- /* if the handle was not cached and the refcount is zero */
- if(!connssl->cred->cached && connssl->cred->refcount == 0) {
- infof(data, "schannel: clear credential handle\n");
- s_pSecFn->FreeCredentialsHandle(&connssl->cred->cred_handle);
- Curl_safefree(connssl->cred);
- }
+ Curl_ssl_sessionid_lock(conn);
+ Curl_schannel_session_free(connssl->cred);
+ Curl_ssl_sessionid_unlock(conn);
+ connssl->cred = NULL;
}
/* free internal buffer for received encrypted data */
@@ -1450,16 +1460,13 @@ int Curl_schannel_shutdown(struct connectdata *conn, int sockindex)
void Curl_schannel_session_free(void *ptr)
{
+ /* this is expected to be called under sessionid lock */
struct curl_schannel_cred *cred = ptr;
- if(cred && cred->cached) {
- if(cred->refcount == 0) {
- s_pSecFn->FreeCredentialsHandle(&cred->cred_handle);
- Curl_safefree(cred);
- }
- else {
- cred->cached = FALSE;
- }
+ cred->refcount--;
+ if(cred->refcount == 0) {
+ s_pSecFn->FreeCredentialsHandle(&cred->cred_handle);
+ Curl_safefree(cred);
}
}
@@ -1501,7 +1508,7 @@ int Curl_schannel_random(unsigned char *entropy, size_t length)
static CURLcode verify_certificate(struct connectdata *conn, int sockindex)
{
SECURITY_STATUS status;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
CURLcode result = CURLE_OK;
CERT_CONTEXT *pCertContextServer = NULL;
diff --git a/lib/vtls/schannel.h b/lib/vtls/schannel.h
index a314b34f..8a4991ec 100644
--- a/lib/vtls/schannel.h
+++ b/lib/vtls/schannel.h
@@ -97,6 +97,9 @@ int Curl_schannel_random(unsigned char *entropy, size_t length);
/* Set the API backend definition to Schannel */
#define CURL_SSL_BACKEND CURLSSLBACKEND_SCHANNEL
+/* this backend supports CURLOPT_CERTINFO */
+#define have_curlssl_certinfo 1
+
/* API setup for Schannel */
#define curlssl_init Curl_schannel_init
#define curlssl_cleanup Curl_schannel_cleanup
diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c
index ca505a71..38637771 100644
--- a/lib/vtls/vtls.c
+++ b/lib/vtls/vtls.c
@@ -99,6 +99,7 @@ Curl_ssl_config_matches(struct ssl_config_data* data,
(data->verifyhost == needle->verifyhost) &&
safe_strequal(data->CApath, needle->CApath) &&
safe_strequal(data->CAfile, needle->CAfile) &&
+ safe_strequal(data->clientcert, needle->clientcert) &&
safe_strequal(data->random_file, needle->random_file) &&
safe_strequal(data->egdsocket, needle->egdsocket) &&
safe_strequal(data->cipher_list, needle->cipher_list))
@@ -156,6 +157,15 @@ Curl_clone_ssl_config(struct ssl_config_data *source,
else
dest->random_file = NULL;
+ if(source->clientcert) {
+ dest->clientcert = strdup(source->clientcert);
+ if(!dest->clientcert)
+ return FALSE;
+ dest->sessionid = FALSE;
+ }
+ else
+ dest->clientcert = NULL;
+
return TRUE;
}
@@ -166,6 +176,7 @@ void Curl_free_ssl_config(struct ssl_config_data* sslc)
Curl_safefree(sslc->cipher_list);
Curl_safefree(sslc->egdsocket);
Curl_safefree(sslc->random_file);
+ Curl_safefree(sslc->clientcert);
}
@@ -181,7 +192,7 @@ void Curl_free_ssl_config(struct ssl_config_data* sslc)
*
*/
-unsigned int Curl_rand(struct SessionHandle *data)
+unsigned int Curl_rand(struct Curl_easy *data)
{
unsigned int r = 0;
static unsigned int randseed;
@@ -276,7 +287,7 @@ void Curl_ssl_cleanup(void)
}
}
-static bool ssl_prefs_check(struct SessionHandle *data)
+static bool ssl_prefs_check(struct Curl_easy *data)
{
/* check for CURLOPT_SSLVERSION invalid parameter value */
if((data->set.ssl.version < 0)
@@ -330,6 +341,25 @@ Curl_ssl_connect_nonblocking(struct connectdata *conn, int sockindex,
}
/*
+ * Lock shared SSL session data
+ */
+void Curl_ssl_sessionid_lock(struct connectdata *conn)
+{
+ if(SSLSESSION_SHARED(conn->data))
+ Curl_share_lock(conn->data,
+ CURL_LOCK_DATA_SSL_SESSION, CURL_LOCK_ACCESS_SINGLE);
+}
+
+/*
+ * Unlock shared SSL session data
+ */
+void Curl_ssl_sessionid_unlock(struct connectdata *conn)
+{
+ if(SSLSESSION_SHARED(conn->data))
+ Curl_share_unlock(conn->data, CURL_LOCK_DATA_SSL_SESSION);
+}
+
+/*
* Check if there's a session ID for the given connection in the cache, and if
* there's one suitable, it is provided. Returns TRUE when no entry matched.
*/
@@ -338,22 +368,22 @@ bool Curl_ssl_getsessionid(struct connectdata *conn,
size_t *idsize) /* set 0 if unknown */
{
struct curl_ssl_session *check;
- struct SessionHandle *data = conn->data;
+ struct Curl_easy *data = conn->data;
size_t i;
long *general_age;
bool no_match = TRUE;
*ssl_sessionid = NULL;
+ DEBUGASSERT(conn->ssl_config.sessionid);
+
if(!conn->ssl_config.sessionid)
/* session ID re-use is disabled */
return TRUE;
/* Lock if shared */
- if(SSLSESSION_SHARED(data)) {
- Curl_share_lock(data, CURL_LOCK_DATA_SSL_SESSION, CURL_LOCK_ACCESS_SINGLE);
+ if(SSLSESSION_SHARED(data))
general_age = &data->share->sessionage;
- }
else
general_age = &data->state.sessionage;
@@ -382,10 +412,6 @@ bool Curl_ssl_getsessionid(struct connectdata *conn,
}
}
- /* Unlock */
- if(SSLSESSION_SHARED(data))
- Curl_share_unlock(data, CURL_LOCK_DATA_SSL_SESSION);
-
return no_match;
}
@@ -416,10 +442,7 @@ void Curl_ssl_kill_session(struct curl_ssl_session *session)
void Curl_ssl_delsessionid(struct connectdata *conn, void *ssl_sessionid)
{
size_t i;
- struct SessionHandle *data=conn->data;
-
- if(SSLSESSION_SHARED(data))
- Curl_share_lock(data, CURL_LOCK_DATA_SSL_SESSION, CURL_LOCK_ACCESS_SINGLE);
+ struct Curl_easy *data=conn->data;
for(i = 0; i < data->set.ssl.max_ssl_sessions; i++) {
struct curl_ssl_session *check = &data->state.session[i];
@@ -429,9 +452,6 @@ void Curl_ssl_delsessionid(struct connectdata *conn, void *ssl_sessionid)
break;
}
}
-
- if(SSLSESSION_SHARED(data))
- Curl_share_unlock(data, CURL_LOCK_DATA_SSL_SESSION);
}
/*
@@ -445,7 +465,7 @@ CURLcode Curl_ssl_addsessionid(struct connectdata *conn,
size_t idsize)
{
size_t i;
- struct SessionHandle *data=conn->data; /* the mother of all structs */
+ struct Curl_easy *data=conn->data; /* the mother of all structs */
struct curl_ssl_session *store = &data->state.session[0];
long oldest_age=data->state.session[0].age; /* zero if unused */
char *clone_host;
@@ -453,9 +473,7 @@ CURLcode Curl_ssl_addsessionid(struct connectdata *conn,
int conn_to_port;
long *general_age;
- /* Even though session ID re-use might be disabled, that only disables USING
- IT. We still store it here in case the re-using is again enabled for an
- upcoming transfer */
+ DEBUGASSERT(conn->ssl_config.sessionid);
clone_host = strdup(conn->host.name);
if(!clone_host)
@@ -481,7 +499,6 @@ CURLcode Curl_ssl_addsessionid(struct connectdata *conn,
/* If using shared SSL session, lock! */
if(SSLSESSION_SHARED(data)) {
- Curl_share_lock(data, CURL_LOCK_DATA_SSL_SESSION, CURL_LOCK_ACCESS_SINGLE);
general_age = &data->share->sessionage;
}
else {
@@ -514,10 +531,6 @@ CURLcode Curl_ssl_addsessionid(struct connectdata *conn,
store->conn_to_port = conn_to_port; /* connect to port number */
store->remote_port = conn->remote_port; /* port number */
- /* Unlock */
- if(SSLSESSION_SHARED(data))
- Curl_share_unlock(data, CURL_LOCK_DATA_SSL_SESSION);
-
if(!Curl_clone_ssl_config(&conn->ssl_config, &store->ssl_config)) {
store->sessionid = NULL; /* let caller free sessionid */
free(clone_host);
@@ -529,7 +542,7 @@ CURLcode Curl_ssl_addsessionid(struct connectdata *conn,
}
-void Curl_ssl_close_all(struct SessionHandle *data)
+void Curl_ssl_close_all(struct Curl_easy *data)
{
size_t i;
/* kill the session ID cache if not shared */
@@ -567,20 +580,20 @@ CURLcode Curl_ssl_shutdown(struct connectdata *conn, int sockindex)
/* Selects an SSL crypto engine
*/
-CURLcode Curl_ssl_set_engine(struct SessionHandle *data, const char *engine)
+CURLcode Curl_ssl_set_engine(struct Curl_easy *data, const char *engine)
{
return curlssl_set_engine(data, engine);
}
/* Selects the default SSL crypto engine
*/
-CURLcode Curl_ssl_set_engine_default(struct SessionHandle *data)
+CURLcode Curl_ssl_set_engine_default(struct Curl_easy *data)
{
return curlssl_set_engine_default(data);
}
/* Return list of OpenSSL crypto engine names. */
-struct curl_slist *Curl_ssl_engines_list(struct SessionHandle *data)
+struct curl_slist *Curl_ssl_engines_list(struct Curl_easy *data)
{
return curlssl_engines_list(data);
}
@@ -589,7 +602,7 @@ struct curl_slist *Curl_ssl_engines_list(struct SessionHandle *data)
* This sets up a session ID cache to the specified size. Make sure this code
* is agnostic to what underlying SSL technology we use.
*/
-CURLcode Curl_ssl_initsessions(struct SessionHandle *data, size_t amount)
+CURLcode Curl_ssl_initsessions(struct Curl_easy *data, size_t amount)
{
struct curl_ssl_session *session;
@@ -632,7 +645,7 @@ bool Curl_ssl_data_pending(const struct connectdata *conn,
return curlssl_data_pending(conn, connindex);
}
-void Curl_ssl_free_certinfo(struct SessionHandle *data)
+void Curl_ssl_free_certinfo(struct Curl_easy *data)
{
int i;
struct curl_certinfo *ci = &data->info.certs;
@@ -650,7 +663,7 @@ void Curl_ssl_free_certinfo(struct SessionHandle *data)
}
}
-CURLcode Curl_ssl_init_certinfo(struct SessionHandle *data, int num)
+CURLcode Curl_ssl_init_certinfo(struct Curl_easy *data, int num)
{
struct curl_certinfo *ci = &data->info.certs;
struct curl_slist **table;
@@ -672,7 +685,7 @@ CURLcode Curl_ssl_init_certinfo(struct SessionHandle *data, int num)
/*
* 'value' is NOT a zero terminated string
*/
-CURLcode Curl_ssl_push_certinfo_len(struct SessionHandle *data,
+CURLcode Curl_ssl_push_certinfo_len(struct Curl_easy *data,
int certnum,
const char *label,
const char *value,
@@ -713,7 +726,7 @@ CURLcode Curl_ssl_push_certinfo_len(struct SessionHandle *data,
* This is a convenience function for push_certinfo_len that takes a zero
* terminated value.
*/
-CURLcode Curl_ssl_push_certinfo(struct SessionHandle *data,
+CURLcode Curl_ssl_push_certinfo(struct Curl_easy *data,
int certnum,
const char *label,
const char *value)
@@ -723,7 +736,7 @@ CURLcode Curl_ssl_push_certinfo(struct SessionHandle *data,
return Curl_ssl_push_certinfo_len(data, certnum, label, value, valuelen);
}
-int Curl_ssl_random(struct SessionHandle *data,
+int Curl_ssl_random(struct Curl_easy *data,
unsigned char *entropy,
size_t length)
{
@@ -792,7 +805,7 @@ static CURLcode pubkey_pem_to_der(const char *pem,
* Generic pinned public key check.
*/
-CURLcode Curl_pin_peer_pubkey(struct SessionHandle *data,
+CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data,
const char *pinnedpubkey,
const unsigned char *pubkey, size_t pubkeylen)
{
diff --git a/lib/vtls/vtls.h b/lib/vtls/vtls.h
index 31ba9fc5..a41ecc32 100644
--- a/lib/vtls/vtls.h
+++ b/lib/vtls/vtls.h
@@ -56,7 +56,7 @@ bool Curl_clone_ssl_config(struct ssl_config_data* source,
struct ssl_config_data* dest);
void Curl_free_ssl_config(struct ssl_config_data* sslc);
-unsigned int Curl_rand(struct SessionHandle *);
+unsigned int Curl_rand(struct Curl_easy *);
int Curl_ssl_backend(void);
@@ -69,16 +69,16 @@ CURLcode Curl_ssl_connect_nonblocking(struct connectdata *conn,
bool *done);
/* tell the SSL stuff to close down all open information regarding
connections (and thus session ID caching etc) */
-void Curl_ssl_close_all(struct SessionHandle *data);
+void Curl_ssl_close_all(struct Curl_easy *data);
void Curl_ssl_close(struct connectdata *conn, int sockindex);
CURLcode Curl_ssl_shutdown(struct connectdata *conn, int sockindex);
-CURLcode Curl_ssl_set_engine(struct SessionHandle *data, const char *engine);
+CURLcode Curl_ssl_set_engine(struct Curl_easy *data, const char *engine);
/* Sets engine as default for all SSL operations */
-CURLcode Curl_ssl_set_engine_default(struct SessionHandle *data);
-struct curl_slist *Curl_ssl_engines_list(struct SessionHandle *data);
+CURLcode Curl_ssl_set_engine_default(struct Curl_easy *data);
+struct curl_slist *Curl_ssl_engines_list(struct Curl_easy *data);
/* init the SSL session ID cache */
-CURLcode Curl_ssl_initsessions(struct SessionHandle *, size_t);
+CURLcode Curl_ssl_initsessions(struct Curl_easy *, size_t);
size_t Curl_ssl_version(char *buffer, size_t size);
bool Curl_ssl_data_pending(const struct connectdata *conn,
int connindex);
@@ -86,39 +86,70 @@ int Curl_ssl_check_cxn(struct connectdata *conn);
/* Certificate information list handling. */
-void Curl_ssl_free_certinfo(struct SessionHandle *data);
-CURLcode Curl_ssl_init_certinfo(struct SessionHandle * data, int num);
-CURLcode Curl_ssl_push_certinfo_len(struct SessionHandle * data, int certnum,
+void Curl_ssl_free_certinfo(struct Curl_easy *data);
+CURLcode Curl_ssl_init_certinfo(struct Curl_easy * data, int num);
+CURLcode Curl_ssl_push_certinfo_len(struct Curl_easy * data, int certnum,
const char * label, const char * value,
size_t valuelen);
-CURLcode Curl_ssl_push_certinfo(struct SessionHandle * data, int certnum,
+CURLcode Curl_ssl_push_certinfo(struct Curl_easy * data, int certnum,
const char * label, const char * value);
/* Functions to be used by SSL library adaptation functions */
-/* extract a session ID */
+/* Lock session cache mutex.
+ * Call this before calling other Curl_ssl_*session* functions
+ * Caller should unlock this mutex as soon as possible, as it may block
+ * other SSL connection from making progress.
+ * The purpose of explicitly locking SSL session cache data is to allow
+ * individual SSL engines to manage session lifetime in their specific way.
+ */
+void Curl_ssl_sessionid_lock(struct connectdata *conn);
+
+/* Unlock session cache mutex */
+void Curl_ssl_sessionid_unlock(struct connectdata *conn);
+
+/* extract a session ID
+ * Sessionid mutex must be locked (see Curl_ssl_sessionid_lock).
+ * Caller must make sure that the ownership of returned sessionid object
+ * is properly taken (e.g. its refcount is incremented
+ * under sessionid mutex).
+ */
bool Curl_ssl_getsessionid(struct connectdata *conn,
void **ssl_sessionid,
size_t *idsize); /* set 0 if unknown */
-/* add a new session ID */
+/* add a new session ID
+ * Sessionid mutex must be locked (see Curl_ssl_sessionid_lock).
+ * Caller must ensure that it has properly shared ownership of this sessionid
+ * object with cache (e.g. incrementing refcount on success)
+ */
CURLcode Curl_ssl_addsessionid(struct connectdata *conn,
void *ssl_sessionid,
size_t idsize);
-/* Kill a single session ID entry in the cache */
+/* Kill a single session ID entry in the cache
+ * Sessionid mutex must be locked (see Curl_ssl_sessionid_lock).
+ * This will call engine-specific curlssl_session_free function, which must
+ * take sessionid object ownership from sessionid cache
+ * (e.g. decrement refcount).
+ */
void Curl_ssl_kill_session(struct curl_ssl_session *session);
-/* delete a session from the cache */
+/* delete a session from the cache
+ * Sessionid mutex must be locked (see Curl_ssl_sessionid_lock).
+ * This will call engine-specific curlssl_session_free function, which must
+ * take sessionid object ownership from sessionid cache
+ * (e.g. decrement refcount).
+ */
void Curl_ssl_delsessionid(struct connectdata *conn, void *ssl_sessionid);
/* get N random bytes into the buffer, return 0 if a find random is filled
in */
-int Curl_ssl_random(struct SessionHandle *data, unsigned char *buffer,
+int Curl_ssl_random(struct Curl_easy *data, unsigned char *buffer,
size_t length);
CURLcode Curl_ssl_md5sum(unsigned char *tmp, /* input */
size_t tmplen,
unsigned char *md5sum, /* output */
size_t md5len);
/* Check pinned public key. */
-CURLcode Curl_pin_peer_pubkey(struct SessionHandle *data,
+CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data,
const char *pinnedpubkey,
const unsigned char *pubkey, size_t pubkeylen);
diff --git a/lib/wildcard.h b/lib/wildcard.h
index 7d66992b..7f61cd17 100644
--- a/lib/wildcard.h
+++ b/lib/wildcard.h
@@ -53,6 +53,6 @@ struct WildcardData {
CURLcode Curl_wildcard_init(struct WildcardData *wc);
void Curl_wildcard_dtor(struct WildcardData *wc);
-struct SessionHandle;
+struct Curl_easy;
#endif /* HEADER_CURL_WILDCARD_H */
diff --git a/lib/x509asn1.c b/lib/x509asn1.c
index c221ba07..e17bcd92 100644
--- a/lib/x509asn1.c
+++ b/lib/x509asn1.c
@@ -23,7 +23,7 @@
#include "curl_setup.h"
#if defined(USE_GSKIT) || defined(USE_NSS) || defined(USE_GNUTLS) || \
- defined(USE_CYASSL)
+ defined(USE_CYASSL) || defined(USE_SCHANNEL)
#include <curl/curl.h>
#include "urldata.h"
@@ -784,7 +784,7 @@ static const char * dumpAlgo(curl_asn1Element * param,
return OID2str(oid.beg, oid.end, TRUE);
}
-static void do_pubkey_field(struct SessionHandle * data, int certnum,
+static void do_pubkey_field(struct Curl_easy * data, int certnum,
const char * label, curl_asn1Element * elem)
{
const char * output;
@@ -801,7 +801,7 @@ static void do_pubkey_field(struct SessionHandle * data, int certnum,
}
}
-static void do_pubkey(struct SessionHandle * data, int certnum,
+static void do_pubkey(struct Curl_easy * data, int certnum,
const char * algo, curl_asn1Element * param,
curl_asn1Element * pubkey)
{
@@ -871,7 +871,7 @@ CURLcode Curl_extract_certinfo(struct connectdata * conn,
const char * end)
{
curl_X509certificate cert;
- struct SessionHandle * data = conn->data;
+ struct Curl_easy * data = conn->data;
curl_asn1Element param;
const char * ccp;
char * cp1;
@@ -1025,7 +1025,7 @@ CURLcode Curl_extract_certinfo(struct connectdata * conn,
return CURLE_OK;
}
-#endif /* USE_GSKIT or USE_NSS or USE_GNUTLS or USE_CYASSL */
+#endif /* USE_GSKIT or USE_NSS or USE_GNUTLS or USE_CYASSL or USE_SCHANNEL */
#if defined(USE_GSKIT)
@@ -1056,7 +1056,7 @@ static const char * checkOID(const char * beg, const char * end,
CURLcode Curl_verifyhost(struct connectdata * conn,
const char * beg, const char * end)
{
- struct SessionHandle * data = conn->data;
+ struct Curl_easy * data = conn->data;
curl_X509certificate cert;
curl_asn1Element dn;
curl_asn1Element elem;
diff --git a/lib/x509asn1.h b/lib/x509asn1.h
index e6a1e244..0f2b9304 100644
--- a/lib/x509asn1.h
+++ b/lib/x509asn1.h
@@ -26,7 +26,7 @@
#include "curl_setup.h"
#if defined(USE_GSKIT) || defined(USE_NSS) || defined(USE_GNUTLS) || \
- defined(USE_CYASSL)
+ defined(USE_CYASSL) || defined(USE_SCHANNEL)
#include "urldata.h"
@@ -128,5 +128,5 @@ CURLcode Curl_extract_certinfo(struct connectdata * conn, int certnum,
CURLcode Curl_verifyhost(struct connectdata * conn,
const char * beg, const char * end);
-#endif /* USE_GSKIT or USE_NSS or USE_GNUTLS or USE_CYASSL */
+#endif /* USE_GSKIT or USE_NSS or USE_GNUTLS or USE_CYASSL or USE_SCHANNEL */
#endif /* HEADER_CURL_X509ASN1_H */
diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4
index 085c6ff6..6ecd3237 100644
--- a/m4/curl-compilers.m4
+++ b/m4/curl-compilers.m4
@@ -21,7 +21,7 @@
#***************************************************************************
# File version for 'aclocal' use. Keep it a single number.
-# serial 66
+# serial 67
dnl CURL_CHECK_COMPILER
@@ -1374,7 +1374,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_SYMBOL_HIDING], [
GNU_C)
dnl Only gcc 3.4 or later
if test "$compiler_num" -ge "304"; then
- if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then
+ if $CC --help --verbose 2>/dev/null | grep fvisibility= >/dev/null ; then
tmp_EXTERN="__attribute__ ((__visibility__ (\"default\")))"
tmp_CFLAGS="-fvisibility=hidden"
supports_symbol_hiding="yes"
diff --git a/packages/OS400/ccsidcurl.c b/packages/OS400/ccsidcurl.c
index 75b7570e..3b08bef7 100644
--- a/packages/OS400/ccsidcurl.c
+++ b/packages/OS400/ccsidcurl.c
@@ -610,7 +610,7 @@ curl_easy_getinfo_ccsid(CURL * curl, CURLINFO info, ...)
CURLcode ret;
unsigned int ccsid;
char * * cpp;
- struct SessionHandle * data;
+ struct Curl_easy * data;
struct curl_slist * * slp;
struct curl_certinfo * cipf;
struct curl_certinfo * cipt;
@@ -618,7 +618,7 @@ curl_easy_getinfo_ccsid(CURL * curl, CURLINFO info, ...)
/* WARNING: unlike curl_easy_get_info(), the strings returned by this
procedure have to be free'ed. */
- data = (struct SessionHandle *) curl;
+ data = (struct Curl_easy *) curl;
va_start(arg, info);
paramp = va_arg(arg, void *);
ret = Curl_getinfo(data, info, paramp);
@@ -1108,7 +1108,7 @@ curl_easy_setopt_ccsid(CURL * curl, CURLoption tag, ...)
{
CURLcode result;
va_list arg;
- struct SessionHandle * data;
+ struct Curl_easy * data;
char * s;
char * cp;
unsigned int ccsid;
@@ -1130,7 +1130,7 @@ curl_easy_setopt_ccsid(CURL * curl, CURLoption tag, ...)
"*** WARNING: curl_easy_setopt_ccsid() should be reworked ***\n");
}
- data = (struct SessionHandle *) curl;
+ data = (struct Curl_easy *) curl;
va_start(arg, tag);
switch (tag) {
diff --git a/packages/OS400/curl.inc.in b/packages/OS400/curl.inc.in
index 2ae76d43..1e8a93dd 100644
--- a/packages/OS400/curl.inc.in
+++ b/packages/OS400/curl.inc.in
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -1436,6 +1436,8 @@
d c X'0050002C'
d CURLINFO_TLS_SSL_PTR... CURLINFO_SLIST + 45
d c X'0040002D'
+ d CURLINFO_HTTP_VERSION... CURLINFO_LONG + 46
+ d c X'0020002E'
*
d CURLINFO_HTTP_CODE... Old ...RESPONSE_CODE
d c X'00200002'
@@ -1466,6 +1468,13 @@
d c 10
d CURLSSLBACKEND_MBEDTLS...
d c 11
+ * Aliases for clones.
+ d CURLSSLBACKEND_LIBRESSL...
+ d c 1
+ d CURLSSLBACKEND_BORINGSSL...
+ d c 1
+ d CURLSSLBACKEND_WOLFSSL...
+ d c 6
*
d curl_closepolicy...
d s 10i 0 based(######ptr######) Enum
diff --git a/packages/OS400/initscript.sh b/packages/OS400/initscript.sh
index 8d66b606..a13d651b 100644
--- a/packages/OS400/initscript.sh
+++ b/packages/OS400/initscript.sh
@@ -50,7 +50,7 @@ setenv TGTCCSID '500' # Target CCSID of objects.
setenv DEBUG '*ALL' # Debug level.
setenv OPTIMIZE '10' # Optimisation level
setenv OUTPUT '*NONE' # Compilation output option.
-setenv TGTRLS 'V5R3M0' # Target OS release.
+setenv TGTRLS 'V6R1M0' # Target OS release.
setenv IFSDIR '/curl' # Installation IFS directory.
# Define ZLIB availability and locations.
@@ -188,7 +188,7 @@ make_module()
CMD="CRTCMOD MODULE(${TARGETLIB}/${1}) SRCSTMF('__tmpsrcf.c')"
# CMD="${CMD} SYSIFCOPT(*IFS64IO) OPTION(*INCDIRFIRST *SHOWINC *SHOWSYS)"
CMD="${CMD} SYSIFCOPT(*IFS64IO) OPTION(*INCDIRFIRST)"
- CMD="${CMD} LOCALETYPE(*LOCALE)"
+ CMD="${CMD} LOCALETYPE(*LOCALE) FLAG(10)"
CMD="${CMD} INCDIR('/qibm/proddata/qadrt/include'"
CMD="${CMD} '${TOPDIR}/include/curl' '${TOPDIR}/include' '${SRCDIR}'"
CMD="${CMD} '${TOPDIR}/packages/OS400'"
@@ -207,7 +207,7 @@ make_module()
CMD="${CMD} OPTIMIZE(${OPTIMIZE})"
CMD="${CMD} DBGVIEW(${DEBUG})"
- DEFINES="${3}"
+ DEFINES="${3} BUILDING_LIBCURL"
if [ "${WITH_ZLIB}" != "0" ]
then DEFINES="${DEFINES} HAVE_LIBZ HAVE_ZLIB_H"
diff --git a/packages/OS400/make-lib.sh b/packages/OS400/make-lib.sh
index 526ec035..410bef05 100644
--- a/packages/OS400/make-lib.sh
+++ b/packages/OS400/make-lib.sh
@@ -20,7 +20,7 @@ fi
echo '#pragma comment(user, "libcurl version '"${LIBCURL_VERSION}"'")' > os400.c
echo '#pragma comment(user, __DATE__)' >> os400.c
echo '#pragma comment(user, __TIME__)' >> os400.c
-echo '#pragma comment(copyright, "Copyright (C) 1998-2014 Daniel Stenberg et al. OS/400 version by P. Monnerat")' >> os400.c
+echo '#pragma comment(copyright, "Copyright (C) 1998-2016 Daniel Stenberg et al. OS/400 version by P. Monnerat")' >> os400.c
make_module OS400 os400.c
LINK= # No need to rebuild service program yet.
MODULES=
diff --git a/projects/README b/projects/README
index e5fd019d..f6314379 100644
--- a/projects/README
+++ b/projects/README
@@ -27,8 +27,8 @@ Dependencies
============
The projects files also support build configurations that require third
- party dependencies such as OpenSSL and SSH2. If you wish to support these,
- you will also need to download and compile those libraries as well.
+ party dependencies such as OpenSSL, wolfSSL and SSH2. If you wish to support
+ these, you will also need to download and compile those libraries as well.
To support compilation of these libraries using different versions of
compilers, the following directory structure has been used for both the
@@ -55,9 +55,10 @@ Dependencies
|_VC <version>
|_<configuration>
- As OpenSSL doesn't support side-by-side compilation when using different
- versions of Visual Studio a build helper batch file has been provided to
- assist with this. Please run "build-openssl -help" for usage details.
+ As OpenSSL and wolfSSL don't support side-by-side compilation when using
+ different versions of Visual Studio, build helper batch files have been
+ provided to assist with this. Please run "build-openssl -help" and/or
+ "build-wolfssl -help" for usage details.
Building with Visual C++
========================
diff --git a/projects/Windows/VC10/lib/libcurl.tmpl b/projects/Windows/VC10/lib/libcurl.tmpl
index c83aa66a..3e6131ff 100644
--- a/projects/Windows/VC10/lib/libcurl.tmpl
+++ b/projects/Windows/VC10/lib/libcurl.tmpl
@@ -1440,7 +1440,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ManifestFile>$(IntDir)$(TargetFileName).intermediate.manifest</ManifestFile>
@@ -1474,7 +1474,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ManifestFile>$(IntDir)$(TargetFileName).intermediate.manifest</ManifestFile>
@@ -1508,7 +1508,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -1541,7 +1541,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -1574,7 +1574,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ManifestFile>$(IntDir)$(TargetFileName).intermediate.manifest</ManifestFile>
@@ -1606,7 +1606,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ManifestFile>$(IntDir)$(TargetFileName).intermediate.manifest</ManifestFile>
@@ -1638,7 +1638,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>
@@ -1669,7 +1669,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>
diff --git a/projects/Windows/VC10/src/curl.tmpl b/projects/Windows/VC10/src/curl.tmpl
index 62e71008..55178131 100644
--- a/projects/Windows/VC10/src/curl.tmpl
+++ b/projects/Windows/VC10/src/curl.tmpl
@@ -2404,7 +2404,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win32\VC10\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -2435,7 +2435,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win32\VC10\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -2467,7 +2467,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win64\VC10\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -2499,7 +2499,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win64\VC10\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -2530,7 +2530,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win32\VC10\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
@@ -2559,7 +2559,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win32\VC10\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
@@ -2589,7 +2589,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win64\VC10\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
@@ -2619,7 +2619,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win64\VC10\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
diff --git a/projects/Windows/VC11/lib/libcurl.tmpl b/projects/Windows/VC11/lib/libcurl.tmpl
index 99ea9816..f1cfef89 100644
--- a/projects/Windows/VC11/lib/libcurl.tmpl
+++ b/projects/Windows/VC11/lib/libcurl.tmpl
@@ -1496,7 +1496,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ManifestFile>$(IntDir)$(TargetFileName).intermediate.manifest</ManifestFile>
@@ -1530,7 +1530,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ManifestFile>$(IntDir)$(TargetFileName).intermediate.manifest</ManifestFile>
@@ -1564,7 +1564,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -1597,7 +1597,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -1630,7 +1630,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ManifestFile>$(IntDir)$(TargetFileName).intermediate.manifest</ManifestFile>
@@ -1662,7 +1662,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ManifestFile>$(IntDir)$(TargetFileName).intermediate.manifest</ManifestFile>
@@ -1694,7 +1694,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>
@@ -1725,7 +1725,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>
diff --git a/projects/Windows/VC11/src/curl.tmpl b/projects/Windows/VC11/src/curl.tmpl
index ed0318dc..2005310e 100644
--- a/projects/Windows/VC11/src/curl.tmpl
+++ b/projects/Windows/VC11/src/curl.tmpl
@@ -2460,7 +2460,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win32\VC11\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -2491,7 +2491,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win32\VC11\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -2523,7 +2523,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win64\VC11\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -2555,7 +2555,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win64\VC11\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -2586,7 +2586,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win32\VC11\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
@@ -2615,7 +2615,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win32\VC11\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
@@ -2645,7 +2645,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win64\VC11\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
@@ -2675,7 +2675,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win64\VC11\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
diff --git a/projects/Windows/VC12/lib/libcurl.tmpl b/projects/Windows/VC12/lib/libcurl.tmpl
index d3aaf45c..7fe5aa09 100644
--- a/projects/Windows/VC12/lib/libcurl.tmpl
+++ b/projects/Windows/VC12/lib/libcurl.tmpl
@@ -1496,7 +1496,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ManifestFile>$(IntDir)$(TargetFileName).intermediate.manifest</ManifestFile>
@@ -1530,7 +1530,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ManifestFile>$(IntDir)$(TargetFileName).intermediate.manifest</ManifestFile>
@@ -1564,7 +1564,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -1597,7 +1597,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -1630,7 +1630,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ManifestFile>$(IntDir)$(TargetFileName).intermediate.manifest</ManifestFile>
@@ -1662,7 +1662,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ManifestFile>$(IntDir)$(TargetFileName).intermediate.manifest</ManifestFile>
@@ -1694,7 +1694,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>
@@ -1725,7 +1725,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>
diff --git a/projects/Windows/VC12/src/curl.tmpl b/projects/Windows/VC12/src/curl.tmpl
index 7894becd..455fad51 100644
--- a/projects/Windows/VC12/src/curl.tmpl
+++ b/projects/Windows/VC12/src/curl.tmpl
@@ -2460,7 +2460,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win32\VC12\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -2491,7 +2491,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win32\VC12\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -2523,7 +2523,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win64\VC12\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -2555,7 +2555,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win64\VC12\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -2586,7 +2586,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win32\VC12\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
@@ -2615,7 +2615,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win32\VC12\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
@@ -2645,7 +2645,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win64\VC12\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
@@ -2675,7 +2675,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win64\VC12\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
diff --git a/projects/Windows/VC14/lib/libcurl.tmpl b/projects/Windows/VC14/lib/libcurl.tmpl
index ada48e9c..ab984aa0 100644
--- a/projects/Windows/VC14/lib/libcurl.tmpl
+++ b/projects/Windows/VC14/lib/libcurl.tmpl
@@ -1496,7 +1496,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ManifestFile>$(IntDir)$(TargetFileName).intermediate.manifest</ManifestFile>
@@ -1530,7 +1530,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ManifestFile>$(IntDir)$(TargetFileName).intermediate.manifest</ManifestFile>
@@ -1564,7 +1564,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -1597,7 +1597,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -1630,7 +1630,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ManifestFile>$(IntDir)$(TargetFileName).intermediate.manifest</ManifestFile>
@@ -1662,7 +1662,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ManifestFile>$(IntDir)$(TargetFileName).intermediate.manifest</ManifestFile>
@@ -1694,7 +1694,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>
@@ -1725,7 +1725,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>
diff --git a/projects/Windows/VC14/src/curl.tmpl b/projects/Windows/VC14/src/curl.tmpl
index 4da1b7f1..56f7c21a 100644
--- a/projects/Windows/VC14/src/curl.tmpl
+++ b/projects/Windows/VC14/src/curl.tmpl
@@ -2460,7 +2460,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win32\VC14\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -2491,7 +2491,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win32\VC14\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -2523,7 +2523,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win64\VC14\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -2555,7 +2555,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurld.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win64\VC14\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -2586,7 +2586,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win32\VC14\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
@@ -2615,7 +2615,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win32\VC14\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
@@ -2645,7 +2645,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win64\VC14\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
@@ -2675,7 +2675,7 @@
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wldap32.lib;normaliz.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wldap32.lib;crypt32.lib;normaliz.lib;libcurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\..\..\build\Win64\VC14\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
diff --git a/projects/Windows/VC6/lib/libcurl.tmpl b/projects/Windows/VC6/lib/libcurl.tmpl
index c76ec789..26cc2abb 100644
--- a/projects/Windows/VC6/lib/libcurl.tmpl
+++ b/projects/Windows/VC6/lib/libcurl.tmpl
@@ -165,8 +165,8 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
-# ADD BASE LINK32 advapi32.lib wldap32.lib ws2_32.lib /nologo /dll /incremental:no /debug /machine:I386 /out:"..\..\..\..\build\Win32\VC6\DLL Debug - DLL Windows SSPI\libcurld.dll" /pdbtype:con /fixed:no
-# ADD LINK32 advapi32.lib wldap32.lib ws2_32.lib /nologo /dll /incremental:no /debug /machine:I386 /out:"..\..\..\..\build\Win32\VC6\DLL Debug - DLL Windows SSPI\libcurld.dll" /pdbtype:con /fixed:no
+# ADD BASE LINK32 advapi32.lib wldap32.lib ws2_32.lib crypt32.lib /nologo /dll /incremental:no /debug /machine:I386 /out:"..\..\..\..\build\Win32\VC6\DLL Debug - DLL Windows SSPI\libcurld.dll" /pdbtype:con /fixed:no
+# ADD LINK32 advapi32.lib wldap32.lib ws2_32.lib crypt32.lib /nologo /dll /incremental:no /debug /machine:I386 /out:"..\..\..\..\build\Win32\VC6\DLL Debug - DLL Windows SSPI\libcurld.dll" /pdbtype:con /fixed:no
!ELSEIF "$(CFG)" == "libcurl - Win32 DLL Debug DLL Windows SSPI DLL WinIDN"
@@ -195,8 +195,8 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
-# ADD BASE LINK32 advapi32.lib normaliz.lib wldap32.lib ws2_32.lib /nologo /dll /incremental:no /debug /machine:I386 /out:"..\..\..\..\build\Win32\VC6\DLL Debug - DLL Windows SSPI - DLL WinIDN\libcurld.dll" /pdbtype:con /fixed:no
-# ADD LINK32 advapi32.lib normaliz.lib wldap32.lib ws2_32.lib /nologo /dll /incremental:no /debug /machine:I386 /out:"..\..\..\..\build\Win32\VC6\DLL Debug - DLL Windows SSPI - DLL WinIDN\libcurld.dll" /pdbtype:con /fixed:no
+# ADD BASE LINK32 advapi32.lib normaliz.lib wldap32.lib ws2_32.lib crypt32.lib /nologo /dll /incremental:no /debug /machine:I386 /out:"..\..\..\..\build\Win32\VC6\DLL Debug - DLL Windows SSPI - DLL WinIDN\libcurld.dll" /pdbtype:con /fixed:no
+# ADD LINK32 advapi32.lib normaliz.lib wldap32.lib ws2_32.lib crypt32.lib /nologo /dll /incremental:no /debug /machine:I386 /out:"..\..\..\..\build\Win32\VC6\DLL Debug - DLL Windows SSPI - DLL WinIDN\libcurld.dll" /pdbtype:con /fixed:no
!ELSEIF "$(CFG)" == "libcurl - Win32 DLL Release"
@@ -314,8 +314,8 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
-# ADD BASE LINK32 advapi32.lib wldap32.lib ws2_32.lib /nologo /dll /pdb:none /machine:I386 /fixed:no /release
-# ADD LINK32 advapi32.lib wldap32.lib ws2_32.lib /nologo /dll /pdb:none /machine:I386 /fixed:no /release
+# ADD BASE LINK32 advapi32.lib wldap32.lib ws2_32.lib crypt32.lib /nologo /dll /pdb:none /machine:I386 /fixed:no /release
+# ADD LINK32 advapi32.lib wldap32.lib ws2_32.lib crypt32.lib /nologo /dll /pdb:none /machine:I386 /fixed:no /release
!ELSEIF "$(CFG)" == "libcurl - Win32 DLL Release DLL Windows SSPI DLL WinIDN"
@@ -344,8 +344,8 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
-# ADD BASE LINK32 advapi32.lib normaliz.lib wldap32.lib ws2_32.lib /nologo /dll /pdb:none /machine:I386 /fixed:no /release
-# ADD LINK32 advapi32.lib normaliz.lib wldap32.lib ws2_32.lib /nologo /dll /pdb:none /machine:I386 /fixed:no /release
+# ADD BASE LINK32 advapi32.lib normaliz.lib wldap32.lib ws2_32.lib crypt32.lib /nologo /dll /pdb:none /machine:I386 /fixed:no /release
+# ADD LINK32 advapi32.lib normaliz.lib wldap32.lib ws2_32.lib crypt32.lib /nologo /dll /pdb:none /machine:I386 /fixed:no /release
!ELSEIF "$(CFG)" == "libcurl - Win32 LIB Debug"
diff --git a/projects/Windows/VC6/src/curl.tmpl b/projects/Windows/VC6/src/curl.tmpl
index 5c09110d..edd41be2 100644
--- a/projects/Windows/VC6/src/curl.tmpl
+++ b/projects/Windows/VC6/src/curl.tmpl
@@ -394,8 +394,8 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
-# ADD BASE LINK32 advapi32.lib wldap32.lib ws2_32.lib libcurld.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"..\..\..\..\build\Win32\VC6\LIB Debug - DLL Windows SSPI\curld.exe" /pdbtype:con /libpath:"..\..\..\..\build\Win32\VC6\LIB Debug - DLL Windows SSPI" /fixed:no
-# ADD LINK32 advapi32.lib wldap32.lib ws2_32.lib libcurld.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"..\..\..\..\build\Win32\VC6\LIB Debug - DLL Windows SSPI\curld.exe" /pdbtype:con /libpath:"..\..\..\..\build\Win32\VC6\LIB Debug - DLL Windows SSPI" /fixed:no
+# ADD BASE LINK32 advapi32.lib wldap32.lib ws2_32.lib crypt32.lib libcurld.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"..\..\..\..\build\Win32\VC6\LIB Debug - DLL Windows SSPI\curld.exe" /pdbtype:con /libpath:"..\..\..\..\build\Win32\VC6\LIB Debug - DLL Windows SSPI" /fixed:no
+# ADD LINK32 advapi32.lib wldap32.lib ws2_32.lib crypt32.lib libcurld.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"..\..\..\..\build\Win32\VC6\LIB Debug - DLL Windows SSPI\curld.exe" /pdbtype:con /libpath:"..\..\..\..\build\Win32\VC6\LIB Debug - DLL Windows SSPI" /fixed:no
!ELSEIF "$(CFG)" == "curl - Win32 LIB Debug DLL Windows SSPI DLL WinIDN"
@@ -419,8 +419,8 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
-# ADD BASE LINK32 advapi32.lib normaliz.lib wldap32.lib ws2_32.lib libcurld.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"..\..\..\..\build\Win32\VC6\LIB Debug - DLL Windows SSPI - DLL WinIDN\curld.exe" /pdbtype:con /libpath:"..\..\..\..\build\Win32\VC6\LIB Debug - DLL Windows SSPI - DLL WinIDN" /fixed:no
-# ADD LINK32 advapi32.lib normaliz.lib wldap32.lib ws2_32.lib libcurld.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"..\..\..\..\build\Win32\VC6\LIB Debug - DLL Windows SSPI - DLL WinIDN\curld.exe" /pdbtype:con /libpath:"..\..\..\..\build\Win32\VC6\LIB Debug - DLL Windows SSPI - DLL WinIDN" /fixed:no
+# ADD BASE LINK32 advapi32.lib normaliz.lib wldap32.lib ws2_32.lib crypt32.lib libcurld.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"..\..\..\..\build\Win32\VC6\LIB Debug - DLL Windows SSPI - DLL WinIDN\curld.exe" /pdbtype:con /libpath:"..\..\..\..\build\Win32\VC6\LIB Debug - DLL Windows SSPI - DLL WinIDN" /fixed:no
+# ADD LINK32 advapi32.lib normaliz.lib wldap32.lib ws2_32.lib crypt32.lib libcurld.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"..\..\..\..\build\Win32\VC6\LIB Debug - DLL Windows SSPI - DLL WinIDN\curld.exe" /pdbtype:con /libpath:"..\..\..\..\build\Win32\VC6\LIB Debug - DLL Windows SSPI - DLL WinIDN" /fixed:no
!ELSEIF "$(CFG)" == "curl - Win32 LIB Debug LIB OpenSSL"
@@ -568,8 +568,8 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
-# ADD BASE LINK32 advapi32.lib wldap32.lib ws2_32.lib libcurl.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"..\..\..\..\build\Win32\VC6\LIB Release - DLL Windows SSPI\curl.exe" /libpath:"..\..\..\..\build\Win32\VC6\LIB Release - DLL Windows SSPI" /fixed:no
-# ADD LINK32 advapi32.lib wldap32.lib ws2_32.lib libcurl.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"..\..\..\..\build\Win32\VC6\LIB Release - DLL Windows SSPI\curl.exe" /libpath:"..\..\..\..\build\Win32\VC6\LIB Release - DLL Windows SSPI" /fixed:no
+# ADD BASE LINK32 advapi32.lib wldap32.lib ws2_32.lib crypt32.lib libcurl.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"..\..\..\..\build\Win32\VC6\LIB Release - DLL Windows SSPI\curl.exe" /libpath:"..\..\..\..\build\Win32\VC6\LIB Release - DLL Windows SSPI" /fixed:no
+# ADD LINK32 advapi32.lib wldap32.lib ws2_32.lib crypt32.lib libcurl.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"..\..\..\..\build\Win32\VC6\LIB Release - DLL Windows SSPI\curl.exe" /libpath:"..\..\..\..\build\Win32\VC6\LIB Release - DLL Windows SSPI" /fixed:no
!ELSEIF "$(CFG)" == "curl - Win32 LIB Release DLL Windows SSPI DLL WinIDN"
@@ -593,8 +593,8 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
-# ADD BASE LINK32 advapi32.lib normaliz.lib wldap32.lib ws2_32.lib libcurl.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"..\..\..\..\build\Win32\VC6\LIB Release - DLL Windows SSPI - DLL WinIDN\curl.exe" /libpath:"..\..\..\..\build\Win32\VC6\LIB Release - DLL Windows SSPI - DLL WinIDN" /fixed:no
-# ADD LINK32 advapi32.lib normaliz.lib wldap32.lib ws2_32.lib libcurl.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"..\..\..\..\build\Win32\VC6\LIB Release - DLL Windows SSPI - DLL WinIDN\curl.exe" /libpath:"..\..\..\..\build\Win32\VC6\LIB Release - DLL Windows SSPI - DLL WinIDN" /fixed:no
+# ADD BASE LINK32 advapi32.lib normaliz.lib wldap32.lib ws2_32.lib crypt32.lib libcurl.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"..\..\..\..\build\Win32\VC6\LIB Release - DLL Windows SSPI - DLL WinIDN\curl.exe" /libpath:"..\..\..\..\build\Win32\VC6\LIB Release - DLL Windows SSPI - DLL WinIDN" /fixed:no
+# ADD LINK32 advapi32.lib normaliz.lib wldap32.lib ws2_32.lib crypt32.lib libcurl.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"..\..\..\..\build\Win32\VC6\LIB Release - DLL Windows SSPI - DLL WinIDN\curl.exe" /libpath:"..\..\..\..\build\Win32\VC6\LIB Release - DLL Windows SSPI - DLL WinIDN" /fixed:no
!ELSEIF "$(CFG)" == "curl - Win32 LIB Release LIB OpenSSL"
diff --git a/projects/Windows/VC7.1/lib/libcurl.tmpl b/projects/Windows/VC7.1/lib/libcurl.tmpl
index ee17b4b7..ca12c018 100644
--- a/projects/Windows/VC7.1/lib/libcurl.tmpl
+++ b/projects/Windows/VC7.1/lib/libcurl.tmpl
@@ -502,7 +502,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386 /FIXED:NO"
- AdditionalDependencies="wldap32.lib ws2_32.lib"
+ AdditionalDependencies="wldap32.lib ws2_32.lib crypt32.lib"
OutputFile="$(OutDir)\$(ProjectName).dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
@@ -559,7 +559,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386 /FIXED:NO"
- AdditionalDependencies="wldap32.lib ws2_32.lib"
+ AdditionalDependencies="wldap32.lib ws2_32.lib crypt32.lib"
OutputFile="$(OutDir)\$(ProjectName)d.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
@@ -1063,7 +1063,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386 /FIXED:NO"
- AdditionalDependencies="normaliz.lib wldap32.lib ws2_32.lib"
+ AdditionalDependencies="normaliz.lib wldap32.lib ws2_32.lib crypt32.lib"
OutputFile="$(OutDir)\$(ProjectName)d.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
@@ -1121,7 +1121,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386 /FIXED:NO"
- AdditionalDependencies="normaliz.lib wldap32.lib ws2_32.lib"
+ AdditionalDependencies="normaliz.lib wldap32.lib ws2_32.lib crypt32.lib"
OutputFile="$(OutDir)\$(ProjectName).dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
diff --git a/projects/Windows/VC7.1/src/curl.tmpl b/projects/Windows/VC7.1/src/curl.tmpl
index 98c08125..9b40086b 100644
--- a/projects/Windows/VC7.1/src/curl.tmpl
+++ b/projects/Windows/VC7.1/src/curl.tmpl
@@ -144,7 +144,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386 /FIXED:NO"
- AdditionalDependencies="wldap32.lib ws2_32.lib libcurl.lib"
+ AdditionalDependencies="wldap32.lib ws2_32.lib libcurl.lib crypt32.lib"
OutputFile="$(OutDir)\$(ProjectName).exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
@@ -985,7 +985,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386 /FIXED:NO"
- AdditionalDependencies="wldap32.lib ws2_32.lib libcurld.lib"
+ AdditionalDependencies="wldap32.lib ws2_32.lib libcurld.lib crypt32.lib"
OutputFile="$(OutDir)\$(ProjectName)d.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
@@ -1266,7 +1266,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386 /FIXED:NO"
- AdditionalDependencies="normaliz.lib wldap32.lib ws2_32.lib libcurld.lib"
+ AdditionalDependencies="normaliz.lib wldap32.lib ws2_32.lib crypt32.lib libcurld.lib"
OutputFile="$(OutDir)\$(ProjectName)d.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
@@ -1323,7 +1323,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386 /FIXED:NO"
- AdditionalDependencies="normaliz.lib wldap32.lib ws2_32.lib libcurl.lib"
+ AdditionalDependencies="normaliz.lib wldap32.lib ws2_32.lib crypt32.lib libcurl.lib"
OutputFile="$(OutDir)\$(ProjectName).exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
diff --git a/projects/Windows/VC7/lib/libcurl.tmpl b/projects/Windows/VC7/lib/libcurl.tmpl
index 6a57d122..0fdc25f7 100644
--- a/projects/Windows/VC7/lib/libcurl.tmpl
+++ b/projects/Windows/VC7/lib/libcurl.tmpl
@@ -448,7 +448,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386 /FIXED:NO"
- AdditionalDependencies="wldap32.lib ws2_32.lib"
+ AdditionalDependencies="wldap32.lib ws2_32.lib crypt32.lib"
OutputFile="$(OutDir)\$(ProjectName).dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
@@ -499,7 +499,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386 /FIXED:NO"
- AdditionalDependencies="wldap32.lib ws2_32.lib"
+ AdditionalDependencies="wldap32.lib ws2_32.lib crypt32.lib"
OutputFile="$(OutDir)\$(ProjectName)d.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
@@ -943,7 +943,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386 /FIXED:NO"
- AdditionalDependencies="normaliz.lib wldap32.lib ws2_32.lib"
+ AdditionalDependencies="normaliz.lib wldap32.lib ws2_32.lib crypt32.lib"
OutputFile="$(OutDir)\$(ProjectName)d.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
@@ -995,7 +995,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386 /FIXED:NO"
- AdditionalDependencies="normaliz.lib wldap32.lib ws2_32.lib"
+ AdditionalDependencies="normaliz.lib wldap32.lib ws2_32.lib crypt32.lib"
OutputFile="$(OutDir)\$(ProjectName).dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
diff --git a/projects/Windows/VC7/src/curl.tmpl b/projects/Windows/VC7/src/curl.tmpl
index 9be85dbb..fb0a3dff 100644
--- a/projects/Windows/VC7/src/curl.tmpl
+++ b/projects/Windows/VC7/src/curl.tmpl
@@ -132,7 +132,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386 /FIXED:NO"
- AdditionalDependencies="wldap32.lib ws2_32.lib libcurl.lib"
+ AdditionalDependencies="wldap32.lib ws2_32.lib crypt32.lib libcurl.lib"
OutputFile="$(OutDir)\$(ProjectName).exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
@@ -883,7 +883,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386 /FIXED:NO"
- AdditionalDependencies="wldap32.lib ws2_32.lib libcurld.lib"
+ AdditionalDependencies="wldap32.lib ws2_32.lib crypt32.lib libcurld.lib"
OutputFile="$(OutDir)\$(ProjectName)d.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
@@ -1134,7 +1134,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386 /FIXED:NO"
- AdditionalDependencies="normaliz.lib wldap32.lib ws2_32.lib libcurld.lib"
+ AdditionalDependencies="normaliz.lib wldap32.lib ws2_32.lib crypt32.lib libcurld.lib"
OutputFile="$(OutDir)\$(ProjectName)d.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
@@ -1185,7 +1185,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386 /FIXED:NO"
- AdditionalDependencies="normaliz.lib wldap32.lib ws2_32.lib libcurl.lib"
+ AdditionalDependencies="normaliz.lib wldap32.lib ws2_32.lib crypt32.lib libcurl.lib"
OutputFile="$(OutDir)\$(ProjectName).exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
diff --git a/projects/Windows/VC8/lib/libcurl.tmpl b/projects/Windows/VC8/lib/libcurl.tmpl
index 65d750d8..417333b5 100644
--- a/projects/Windows/VC8/lib/libcurl.tmpl
+++ b/projects/Windows/VC8/lib/libcurl.tmpl
@@ -1028,7 +1028,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib"
OutputFile="$(OutDir)\$(ProjectName)d.dll"
LinkIncremental="1"
AdditionalLibraryDirectories=""
@@ -1116,7 +1116,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib"
OutputFile="$(OutDir)\$(ProjectName)d.dll"
LinkIncremental="1"
AdditionalLibraryDirectories=""
@@ -1203,7 +1203,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib"
OutputFile="$(OutDir)\$(ProjectName).dll"
LinkIncremental="1"
AdditionalLibraryDirectories=""
@@ -1289,7 +1289,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib"
OutputFile="$(OutDir)\$(ProjectName).dll"
LinkIncremental="1"
AdditionalLibraryDirectories=""
@@ -3050,7 +3050,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib normaliz.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib normaliz.lib"
OutputFile="$(OutDir)\$(ProjectName)d.dll"
LinkIncremental="1"
AdditionalLibraryDirectories=""
@@ -3138,7 +3138,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib normaliz.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib normaliz.lib"
OutputFile="$(OutDir)\$(ProjectName)d.dll"
LinkIncremental="1"
AdditionalLibraryDirectories=""
@@ -3225,7 +3225,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib normaliz.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib normaliz.lib"
OutputFile="$(OutDir)\$(ProjectName).dll"
LinkIncremental="1"
AdditionalLibraryDirectories=""
@@ -3311,7 +3311,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib normaliz.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib normaliz.lib"
OutputFile="$(OutDir)\$(ProjectName).dll"
LinkIncremental="1"
AdditionalLibraryDirectories=""
diff --git a/projects/Windows/VC8/src/curl.tmpl b/projects/Windows/VC8/src/curl.tmpl
index 27892db3..3c74c565 100644
--- a/projects/Windows/VC8/src/curl.tmpl
+++ b/projects/Windows/VC8/src/curl.tmpl
@@ -3110,7 +3110,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib libcurld.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib libcurld.lib"
OutputFile="$(OutDir)\$(ProjectName)d.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\..\..\build\Win32\VC8\$(ConfigurationName)"
@@ -3196,7 +3196,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib libcurld.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib libcurld.lib"
OutputFile="$(OutDir)\$(ProjectName)d.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\..\..\build\Win64\VC8\$(ConfigurationName)"
@@ -3281,7 +3281,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib libcurl.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib libcurl.lib"
OutputFile="$(OutDir)\$(ProjectName).exe"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\..\..\build\Win32\VC8\$(ConfigurationName)"
@@ -3365,7 +3365,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib libcurl.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib libcurl.lib"
OutputFile="$(OutDir)\$(ProjectName).exe"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\..\..\build\Win64\VC8\$(ConfigurationName)"
@@ -3786,7 +3786,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib normaliz.lib libcurld.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib normaliz.lib libcurld.lib"
OutputFile="$(OutDir)\$(ProjectName)d.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\..\..\build\Win32\VC8\$(ConfigurationName)"
@@ -3872,7 +3872,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib normaliz.lib libcurld.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib normaliz.lib libcurld.lib"
OutputFile="$(OutDir)\$(ProjectName)d.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\..\..\build\Win64\VC8\$(ConfigurationName)"
@@ -3957,7 +3957,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib normaliz.lib libcurl.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib normaliz.lib libcurl.lib"
OutputFile="$(OutDir)\$(ProjectName).exe"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\..\..\build\Win32\VC8\$(ConfigurationName)"
@@ -4041,7 +4041,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib normaliz.lib libcurl.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib normaliz.lib libcurl.lib"
OutputFile="$(OutDir)\$(ProjectName).exe"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\..\..\build\Win64\VC8\$(ConfigurationName)"
diff --git a/projects/Windows/VC9/lib/libcurl.tmpl b/projects/Windows/VC9/lib/libcurl.tmpl
index f56b31cb..4e5f1b80 100644
--- a/projects/Windows/VC9/lib/libcurl.tmpl
+++ b/projects/Windows/VC9/lib/libcurl.tmpl
@@ -1005,7 +1005,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib"
OutputFile="$(OutDir)\$(ProjectName)d.dll"
LinkIncremental="1"
AdditionalLibraryDirectories=""
@@ -1090,7 +1090,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib"
OutputFile="$(OutDir)\$(ProjectName)d.dll"
LinkIncremental="1"
AdditionalLibraryDirectories=""
@@ -1174,7 +1174,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib"
OutputFile="$(OutDir)\$(ProjectName).dll"
LinkIncremental="1"
AdditionalLibraryDirectories=""
@@ -1257,7 +1257,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib"
OutputFile="$(OutDir)\$(ProjectName).dll"
LinkIncremental="1"
AdditionalLibraryDirectories=""
@@ -3003,7 +3003,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib normaliz.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib normaliz.lib"
OutputFile="$(OutDir)\$(ProjectName)d.dll"
LinkIncremental="1"
AdditionalLibraryDirectories=""
@@ -3088,7 +3088,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib normaliz.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib normaliz.lib"
OutputFile="$(OutDir)\$(ProjectName)d.dll"
LinkIncremental="1"
AdditionalLibraryDirectories=""
@@ -3172,7 +3172,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib normaliz.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib normaliz.lib"
OutputFile="$(OutDir)\$(ProjectName).dll"
LinkIncremental="1"
AdditionalLibraryDirectories=""
@@ -3255,7 +3255,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib normaliz.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib normaliz.lib"
OutputFile="$(OutDir)\$(ProjectName).dll"
LinkIncremental="1"
AdditionalLibraryDirectories=""
diff --git a/projects/Windows/VC9/src/curl.tmpl b/projects/Windows/VC9/src/curl.tmpl
index daf3bdd6..a5846253 100644
--- a/projects/Windows/VC9/src/curl.tmpl
+++ b/projects/Windows/VC9/src/curl.tmpl
@@ -3003,7 +3003,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib libcurld.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib libcurld.lib"
OutputFile="$(OutDir)\$(ProjectName)d.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\..\..\build\Win32\VC9\$(ConfigurationName)"
@@ -3086,7 +3086,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib libcurld.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib libcurld.lib"
OutputFile="$(OutDir)\$(ProjectName)d.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\..\..\build\Win64\VC9\$(ConfigurationName)"
@@ -3168,7 +3168,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib libcurl.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib libcurl.lib"
OutputFile="$(OutDir)\$(ProjectName).exe"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\..\..\build\Win32\VC9\$(ConfigurationName)"
@@ -3249,7 +3249,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib libcurl.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib libcurl.lib"
OutputFile="$(OutDir)\$(ProjectName).exe"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\..\..\build\Win64\VC9\$(ConfigurationName)"
@@ -3655,7 +3655,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib normaliz.lib libcurld.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib normaliz.lib libcurld.lib"
OutputFile="$(OutDir)\$(ProjectName)d.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\..\..\build\Win32\VC9\$(ConfigurationName)"
@@ -3738,7 +3738,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib normaliz.lib libcurld.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib normaliz.lib libcurld.lib"
OutputFile="$(OutDir)\$(ProjectName)d.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\..\..\build\Win64\VC9\$(ConfigurationName)"
@@ -3820,7 +3820,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib normaliz.lib libcurl.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib normaliz.lib libcurl.lib"
OutputFile="$(OutDir)\$(ProjectName).exe"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\..\..\build\Win32\VC9\$(ConfigurationName)"
@@ -3901,7 +3901,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib wldap32.lib normaliz.lib libcurl.lib"
+ AdditionalDependencies="ws2_32.lib wldap32.lib crypt32.lib normaliz.lib libcurl.lib"
OutputFile="$(OutDir)\$(ProjectName).exe"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\..\..\build\Win64\VC9\$(ConfigurationName)"
diff --git a/src/Makefile.m32 b/src/Makefile.m32
index 076fc5e3..40852e57 100644
--- a/src/Makefile.m32
+++ b/src/Makefile.m32
@@ -274,6 +274,10 @@ ifdef SSL
INCLUDES += -I"$(OPENSSL_INCLUDE)"
CFLAGS += -DUSE_OPENSSL
curl_LDADD += -L"$(OPENSSL_LIBPATH)" $(OPENSSL_LIBS)
+else
+ifdef WINSSL
+ curl_LDADD += -lcrypt32
+endif
endif
ifdef ZLIB
INCLUDES += -I"$(ZLIB_PATH)"
diff --git a/src/tool_operate.c b/src/tool_operate.c
index 5f49efb7..2b53c9a8 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -1842,7 +1842,7 @@ CURLcode operate(struct GlobalConfig *config, int argc, argv_item_t argv[])
/* Parse .curlrc if necessary */
if((argc == 1) ||
- (!curlx_strequal(argv[1], "-q") ||
+ (!curlx_strequal(argv[1], "-q") &&
!curlx_strequal(argv[1], "--disable"))) {
parseconfig(NULL, config); /* ignore possible failure */
diff --git a/src/tool_urlglob.c b/src/tool_urlglob.c
index 70d17fed..a357b8b5 100644
--- a/src/tool_urlglob.c
+++ b/src/tool_urlglob.c
@@ -401,7 +401,7 @@ static CURLcode glob_parse(URLGlob *glob, char *pattern,
}
}
- if(++glob->size > GLOB_PATTERN_NUM)
+ if(++glob->size >= GLOB_PATTERN_NUM)
return GLOBERROR("too many globs", pos, CURLE_URL_MALFORMAT);
}
return res;
diff --git a/src/tool_writeout.c b/src/tool_writeout.c
index 414fcbea..6e94afe4 100644
--- a/src/tool_writeout.c
+++ b/src/tool_writeout.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -57,6 +57,7 @@ typedef enum {
VAR_PRIMARY_PORT,
VAR_LOCAL_IP,
VAR_LOCAL_PORT,
+ VAR_HTTP_VERSION,
VAR_NUM_OF_VARS /* must be the last */
} replaceid;
@@ -95,6 +96,7 @@ static const struct variable replacements[]={
{"remote_port", VAR_PRIMARY_PORT},
{"local_ip", VAR_LOCAL_IP},
{"local_port", VAR_LOCAL_PORT},
+ {"http_version", VAR_HTTP_VERSION},
{NULL, VAR_NONE}
};
@@ -278,6 +280,26 @@ void ourWriteOut(CURL *curl, struct OutStruct *outs, const char *writeinfo)
&longinfo))
fprintf(stream, "%ld", longinfo);
break;
+ case VAR_HTTP_VERSION:
+ if(CURLE_OK ==
+ curl_easy_getinfo(curl, CURLINFO_HTTP_VERSION,
+ &longinfo)) {
+ const char *version = "0";
+ switch (longinfo) {
+ case CURL_HTTP_VERSION_1_0:
+ version = "1.0";
+ break;
+ case CURL_HTTP_VERSION_1_1:
+ version = "1.1";
+ break;
+ case CURL_HTTP_VERSION_2_0:
+ version = "2";
+ break;
+ }
+
+ fprintf(stream, version);
+ }
+ break;
default:
break;
}
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index acd9caa0..63b4cda0 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,3 +1,4 @@
add_subdirectory(data)
add_subdirectory(libtest)
add_subdirectory(server)
+add_subdirectory(unit)
diff --git a/tests/FILEFORMAT b/tests/FILEFORMAT
index a8e74b31..04a6daeb 100644
--- a/tests/FILEFORMAT
+++ b/tests/FILEFORMAT
@@ -181,6 +181,7 @@ http-unix
https
httptls+srp
httptls+srp-ipv6
+http/2
imap
none
pop3
@@ -426,8 +427,9 @@ have a text/binary difference.
Variables are substituted as in the <command> section.
</file>
<stripfile>
-One perl op per line that operates on the file before being compared. This is
-pretty advanced. Example: "s/^EPRT .*/EPRT stripped/"
+One perl op per line that operates on the output file or stdout before being
+compared with what is stored in the test file. This is pretty
+advanced. Example: "s/^EPRT .*/EPRT stripped/"
</stripfile>
<upload>
the contents of the upload data curl should have sent
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 36e92ac6..585d0171 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -29,7 +29,7 @@ EXTRA_DIST = ftpserver.pl httpserver.pl secureserver.pl runtests.pl getpart.pm \
$(HTMLPAGES) $(PDFPAGES) \
serverhelp.pm tftpserver.pl rtspserver.pl directories.pm symbol-scan.pl \
CMakeLists.txt mem-include-scan.pl valgrind.supp http_pipe.py extern-scan.pl \
- manpage-scan.pl nroff-scan.pl
+ manpage-scan.pl nroff-scan.pl http2-server.pl
DISTCLEANFILES = configurehelp.pm
diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc
index e3b5a880..9c50673c 100644
--- a/tests/data/Makefile.inc
+++ b/tests/data/Makefile.inc
@@ -119,7 +119,7 @@ test1104 test1105 test1106 test1107 test1108 test1109 test1110 test1111 \
test1112 test1113 test1114 test1115 test1116 test1117 test1118 test1119 \
test1120 test1121 test1122 test1123 test1124 test1125 test1126 test1127 \
test1128 test1129 test1130 test1131 test1132 test1133 test1134 test1135 \
-test1136 test1137 test1138 test1139 test1140 \
+test1136 test1137 test1138 test1139 test1140 test1141 test1142 test1143 \
\
test1200 test1201 test1202 test1203 test1204 test1205 test1206 test1207 \
test1208 test1209 test1210 test1211 test1212 test1213 test1214 test1215 \
@@ -127,6 +127,7 @@ test1216 test1217 test1218 test1219 \
test1220 test1221 test1222 test1223 test1224 test1225 test1226 test1227 \
test1228 test1229 test1230 test1231 test1232 test1233 test1234 test1235 \
test1236 test1237 test1238 test1239 test1240 test1241 test1242 test1243 \
+test1244 \
\
test1300 test1301 test1302 test1303 test1304 test1305 test1306 test1307 \
test1308 test1309 test1310 test1311 test1312 test1313 test1314 test1315 \
@@ -159,6 +160,8 @@ test1525 test1526 test1527 test1528 test1529 test1530 test1531 \
\
test1600 test1601 test1602 test1603 test1604 \
\
+test1700 test1701 test1702 \
+\
test1800 test1801 \
\
test1900 test1901 test1902 test1903 \
diff --git a/tests/data/test1141 b/tests/data/test1141
new file mode 100644
index 00000000..b0ff038c
--- /dev/null
+++ b/tests/data/test1141
@@ -0,0 +1,68 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+followlocation
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 302 This is a weirdo text message
+Connection: close
+Location: http:///foo.example.com/want/11410001
+
+This server reply is for testing
+</data>
+<data1>
+HTTP/1.1 200 hello
+Connection: close
+Content-Length: 4
+
+hej
+</data1>
+<datacheck>
+HTTP/1.1 302 This is a weirdo text message
+Connection: close
+Location: http:///foo.example.com/want/11410001
+
+HTTP/1.1 200 hello
+Connection: close
+Content-Length: 4
+
+hej
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP redirect to http:/// (three slashes!)
+ </name>
+ <command>
+%HOSTIP:%HTTPPORT/want/1141 -L -x http://%HOSTIP:%HTTPPORT
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://%HOSTIP:%HTTPPORT/want/1141 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET http://foo.example.com/want/11410001 HTTP/1.1
+Host: foo.example.com
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1142 b/tests/data/test1142
new file mode 100644
index 00000000..0ecfbd3c
--- /dev/null
+++ b/tests/data/test1142
@@ -0,0 +1,63 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+followlocation
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 302 This is a weirdo text message
+Connection: close
+Location: http:////foo.example.com/want/11420001
+
+This server reply is for testing
+</data>
+<data1>
+HTTP/1.1 200 hello
+Connection: close
+Content-Length: 4
+
+hej
+</data1>
+<datacheck>
+HTTP/1.1 302 This is a weirdo text message
+Connection: close
+Location: http:////foo.example.com/want/11420001
+
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP redirect to http://// (four slashes!)
+ </name>
+ <command>
+%HOSTIP:%HTTPPORT/want/1142 -L -x http://%HOSTIP:%HTTPPORT
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://%HOSTIP:%HTTPPORT/want/1142 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+# 3, CURLE_URL_MALFORMAT for the four slashes
+<errorcode>
+3
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test1143 b/tests/data/test1143
new file mode 100644
index 00000000..4f2f4435
--- /dev/null
+++ b/tests/data/test1143
@@ -0,0 +1,45 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+followlocation
+</keywords>
+</info>
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 hello
+Connection: close
+Content-Length: 4
+
+hej
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP URL with http:/ (one slash!)
+ </name>
+ <command>
+http:/%HOSTIP:%HTTPPORT/want/1143
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /want/1143 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1244 b/tests/data/test1244
new file mode 100644
index 00000000..7912b4ef
--- /dev/null
+++ b/tests/data/test1244
@@ -0,0 +1,60 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP proxy
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Server: test-server/fake
+Content-Length: 5
+
+bing
+</data>
+<data1>
+HTTP/1.1 200 OK
+Server: test-server/fake
+Content-Length: 6
+
+wrong
+</data1>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+https
+</server>
+ <name>
+HTTP GET same URL - different proxy ports
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1244 -x %HOSTIP:%HTTPPORT --next http://%HOSTIP:%HTTPPORT/124400001 -x %HOSTIP:%HTTPSPORT
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+# the second request meant to fail
+<errorcode>
+56
+</errorcode>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET http://%HOSTIP:%HTTPPORT/1244 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1700 b/tests/data/test1700
new file mode 100644
index 00000000..9ab46c9c
--- /dev/null
+++ b/tests/data/test1700
@@ -0,0 +1,101 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+HTTP/2
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data>
+<data1>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+
+-maa-
+</data1>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+http/2
+</server>
+ <name>
+HTTP/2 GET with Upgrade:
+ </name>
+ <command>
+http://%HOSTIP:%HTTP2PORT/1700 --http2 http://%HOSTIP:%HTTP2PORT/17000001
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+^X-Forwarded-Proto:.*
+^Via:.*
+</strip>
+<protocol>
+GET /1700 HTTP/1.1
+Host: %HOSTIP:%HTTP2PORT
+Accept: */*
+
+GET /17000001 HTTP/1.1
+Host: %HOSTIP:%HTTP2PORT
+Accept: */*
+
+</protocol>
+<stdout>
+HTTP/1.1 101 Switching Protocols
+Connection: Upgrade
+Upgrade: h2c
+
+HTTP/2 200
+date: Thu, 09 Nov 2010 14:49:00 GMT
+last-modified: Tue, 13 Jun 2000 12:10:00 GMT
+etag: "21025-dc7-39462498"
+accept-ranges: bytes
+content-length: 6
+content-type: text/html
+funny-head: yesyes
+server: cut-out
+via: 1.1 nghttpx
+
+-foo-
+HTTP/2 200
+date: Thu, 09 Nov 2010 14:49:00 GMT
+content-length: 6
+content-type: text/html
+server: cut-out
+via: 1.1 nghttpx
+
+-maa-
+</stdout>
+<stripfile>
+s/^server:.*/server: cut-out /
+</stripfile>
+</verify>
+</testcase>
diff --git a/tests/data/test1701 b/tests/data/test1701
new file mode 100644
index 00000000..49432887
--- /dev/null
+++ b/tests/data/test1701
@@ -0,0 +1,83 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP POST
+HTTP/2
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+http/2
+</server>
+ <name>
+HTTP/2 POST with Upgrade:
+ </name>
+ <command>
+http://%HOSTIP:%HTTP2PORT/1701 --http2 -d "datatosend"
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+^X-Forwarded-Proto:.*
+^Via:.*
+</strip>
+<protocol nonewline="yes">
+POST /1701 HTTP/1.1
+Host: %HOSTIP:%HTTP2PORT
+Accept: */*
+Content-Length: 10
+Content-Type: application/x-www-form-urlencoded
+
+datatosend
+</protocol>
+<stdout>
+HTTP/1.1 101 Switching Protocols
+Connection: Upgrade
+Upgrade: h2c
+
+HTTP/2 200
+date: Thu, 09 Nov 2010 14:49:00 GMT
+last-modified: Tue, 13 Jun 2000 12:10:00 GMT
+etag: "21025-dc7-39462498"
+accept-ranges: bytes
+content-length: 6
+content-type: text/html
+funny-head: yesyes
+server: cut-out
+via: 1.1 nghttpx
+
+-foo-
+</stdout>
+<stripfile>
+s/^server:.*/server: cut-out /
+</stripfile>
+</verify>
+</testcase>
diff --git a/tests/data/test1702 b/tests/data/test1702
new file mode 100644
index 00000000..903a737c
--- /dev/null
+++ b/tests/data/test1702
@@ -0,0 +1,78 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP HEAD
+HTTP/2
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+http/2
+</server>
+ <name>
+HTTP/2 HEAD with Upgrade:
+ </name>
+ <command>
+http://%HOSTIP:%HTTP2PORT/1702 --http2 --head
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+^X-Forwarded-Proto:.*
+^Via:.*
+</strip>
+<protocol>
+HEAD /1702 HTTP/1.1
+Host: %HOSTIP:%HTTP2PORT
+Accept: */*
+
+</protocol>
+<stdout>
+HTTP/1.1 101 Switching Protocols
+Connection: Upgrade
+Upgrade: h2c
+
+HTTP/2 200
+date: Thu, 09 Nov 2010 14:49:00 GMT
+last-modified: Tue, 13 Jun 2000 12:10:00 GMT
+etag: "21025-dc7-39462498"
+accept-ranges: bytes
+content-length: 6
+content-type: text/html
+funny-head: yesyes
+server: cut-out
+via: 1.1 nghttpx
+
+</stdout>
+<stripfile>
+s/^server:.*/server: cut-out /
+</stripfile>
+</verify>
+</testcase>
diff --git a/tests/data/test1800 b/tests/data/test1800
index b7d534ed..96a6c146 100644
--- a/tests/data/test1800
+++ b/tests/data/test1800
@@ -2,7 +2,7 @@
<info>
<keywords>
HTTP
-http2
+HTTP/2
</keywords>
</info>
@@ -27,7 +27,7 @@ Content-Type: text/html
http
</server>
<features>
-http2
+http/2
</features>
<name>
HTTP/2 upgrade refused
diff --git a/tests/data/test1801 b/tests/data/test1801
index 0aedfed5..16ee12d4 100644
--- a/tests/data/test1801
+++ b/tests/data/test1801
@@ -2,7 +2,7 @@
<info>
<keywords>
HTTP
-http2
+HTTP/2
</keywords>
</info>
@@ -37,7 +37,7 @@ upgrade
http
</server>
<features>
-http2
+http/2
</features>
<name>
HTTP/2 upgrade with lying server
diff --git a/tests/data/test558 b/tests/data/test558
index 7a9ba706..a1ac7d47 100644
--- a/tests/data/test558
+++ b/tests/data/test558
@@ -17,6 +17,7 @@ none
</server>
<features>
TrackMemory
+ipv6
</features>
# tool is what to use instead of 'curl'
<tool>
@@ -35,6 +36,8 @@ nothing
# Verify data after the test has been "shot"
<verify>
<file name="log/memdump">
+FD hostip6.c: socket()
+FD connect.c: sclose()
MEM lib558.c: malloc()
MEM lib558.c: free()
MEM escape.c: malloc()
@@ -46,7 +49,7 @@ MEM escape.c: free()
s/ =.*//
s/\(.*\)/()/
s/:\d+/:/
-s:^(MEM )(.*/)(.*):$1$3:
+s:^(MEM |FD )(.*/)(.*):$1$3:
</stripfile>
</verify>
diff --git a/tests/http2-server.pl b/tests/http2-server.pl
new file mode 100755
index 00000000..72ed12e8
--- /dev/null
+++ b/tests/http2-server.pl
@@ -0,0 +1,75 @@
+#!/usr/bin/env perl
+#***************************************************************************
+# _ _ ____ _
+# Project ___| | | | _ \| |
+# / __| | | | |_) | |
+# | (__| |_| | _ <| |___
+# \___|\___/|_| \_\_____|
+#
+# Copyright (C) 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+#
+# This software is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at https://curl.haxx.se/docs/copyright.html.
+#
+# You may opt to use, copy, modify, merge, publish, distribute and/or sell
+# copies of the Software, and permit persons to whom the Software is
+# furnished to do so, under the terms of the COPYING file.
+#
+# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+# KIND, either express or implied.
+#
+#***************************************************************************
+
+# This script invokes nghttpx properly to have it serve HTTP/2 for us.
+# nghttpx runs as a proxy in front of our "actual" HTTP/1 server.
+
+my $pidfile = "log/nghttpx.pid";
+my $logfile = "log/http2.log";
+my $nghttpx = "nghttpx";
+my $listenport = 9015;
+
+#***************************************************************************
+# Process command line options
+#
+while(@ARGV) {
+ if($ARGV[0] eq '--verbose') {
+ $verbose = 1;
+ }
+ elsif($ARGV[0] eq '--pidfile') {
+ if($ARGV[1]) {
+ $pidfile = $ARGV[1];
+ shift @ARGV;
+ }
+ }
+ elsif($ARGV[0] eq '--nghttpx') {
+ if($ARGV[1]) {
+ $nghttpx = $ARGV[1];
+ shift @ARGV;
+ }
+ }
+ elsif($ARGV[0] eq '--port') {
+ if($ARGV[1]) {
+ $listenport = $ARGV[1];
+ shift @ARGV;
+ }
+ }
+ elsif($ARGV[0] eq '--logfile') {
+ if($ARGV[1]) {
+ $logfile = $ARGV[1];
+ shift @ARGV;
+ }
+ }
+ else {
+ print STDERR "\nWarning: http2-server.pl unknown parameter: $ARGV[0]\n";
+ }
+ shift @ARGV;
+}
+
+my $cmdline="$nghttpx --backend=127.0.0.1,8990 ".
+ "--frontend=\"*,$listenport;no-tls\" ".
+ "--log-level=INFO ".
+ "--pid-file=$pidfile ".
+ "--errorlog-file=$logfile";
+print "RUN: $cmdline\n" if($verbose);
+system("$cmdline 2>/dev/null");
diff --git a/tests/runtests.pl b/tests/runtests.pl
index 5d13fc83..b8497f9c 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -6,7 +6,7 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
-# Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+# Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
@@ -144,6 +144,7 @@ my $HTTPTLS6PORT; # HTTP TLS (non-stunnel) IPv6 server port
my $HTTPPROXYPORT; # HTTP proxy port, when using CONNECT
my $HTTPPIPEPORT; # HTTP pipelining port
my $HTTPUNIXPATH; # HTTP server Unix domain socket path
+my $HTTP2PORT; # HTTP/2 server port
my $srcdir = $ENV{'srcdir'} || '.';
my $CURL="../src/curl".exe_ext(); # what curl executable to run on the tests
@@ -366,7 +367,7 @@ delete $ENV{'CURL_CA_BUNDLE'} if($ENV{'CURL_CA_BUNDLE'});
# Load serverpidfile hash with pidfile names for all possible servers.
#
sub init_serverpidfile_hash {
- for my $proto (('ftp', 'http', 'imap', 'pop3', 'smtp')) {
+ for my $proto (('ftp', 'http', 'imap', 'pop3', 'smtp', 'http/2')) {
for my $ssl (('', 's')) {
for my $ipvnum ((4, 6)) {
for my $idnum ((1, 2, 3)) {
@@ -386,7 +387,7 @@ sub init_serverpidfile_hash {
}
}
}
- for my $proto (('http', 'imap', 'pop3', 'smtp')) {
+ for my $proto (('http', 'imap', 'pop3', 'smtp', 'http/2')) {
for my $ssl (('', 's')) {
my $serv = servername_id("$proto$ssl", "unix", 1);
my $pidf = server_pidfilename("$proto$ssl", "unix", 1);
@@ -1190,6 +1191,63 @@ sub responsiveserver {
}
#######################################################################
+# start the http2 server
+#
+sub runhttp2server {
+ my ($verbose, $port) = @_;
+ my $server;
+ my $srvrname;
+ my $pidfile;
+ my $logfile;
+ my $flags = "";
+ my $proto="http/2";
+ my $ipvnum = 4;
+ my $idnum = 0;
+ my $exe = "$perl $srcdir/http2-server.pl";
+ my $verbose_flag = "--verbose ";
+
+ $server = servername_id($proto, $ipvnum, $idnum);
+
+ $pidfile = $serverpidfile{$server};
+
+ # don't retry if the server doesn't work
+ if ($doesntrun{$pidfile}) {
+ return (0,0);
+ }
+
+ my $pid = processexists($pidfile);
+ if($pid > 0) {
+ stopserver($server, "$pid");
+ }
+ unlink($pidfile) if(-f $pidfile);
+
+ $srvrname = servername_str($proto, $ipvnum, $idnum);
+
+ $logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
+
+ $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
+ $flags .= "--port $HTTP2PORT ";
+ $flags .= $verbose_flag if($debugprotocol);
+
+ my $cmd = "$exe $flags";
+ my ($http2pid, $pid2) = startnew($cmd, $pidfile, 15, 0);
+
+ if($http2pid <= 0 || !pidexists($http2pid)) {
+ # it is NOT alive
+ logmsg "RUN: failed to start the $srvrname server\n";
+ stopserver($server, "$pid2");
+ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+ if($verbose) {
+ logmsg "RUN: $srvrname server is now running PID $http2pid\n";
+ }
+
+ return ($http2pid, $pid2);
+}
+
+#######################################################################
# start the http server
#
sub runhttpserver {
@@ -2484,6 +2542,8 @@ sub checksystem {
if($feat =~ /HTTP2/) {
# http2 enabled
$has_http2=1;
+
+ push @protocols, 'http/2';
}
}
#
@@ -2677,6 +2737,7 @@ sub subVariables {
$$thing =~ s/%HTTPTLSPORT/$HTTPTLSPORT/g;
$$thing =~ s/%HTTP6PORT/$HTTP6PORT/g;
$$thing =~ s/%HTTPSPORT/$HTTPSPORT/g;
+ $$thing =~ s/%HTTP2PORT/$HTTP2PORT/g;
$$thing =~ s/%HTTPPORT/$HTTPPORT/g;
$$thing =~ s/%HTTPPIPEPORT/$HTTPPIPEPORT/g;
$$thing =~ s/%PROXYPORT/$HTTPPROXYPORT/g;
@@ -2971,7 +3032,7 @@ sub singletest {
next;
}
}
- elsif($1 eq "http2") {
+ elsif($1 eq "http/2") {
if($has_http2) {
next;
}
@@ -3779,6 +3840,23 @@ sub singletest {
# verify redirected stdout
my @actual = loadarray($STDOUT);
+ # what parts to cut off from stdout
+ my @stripfile = getpart("verify", "stripfile");
+
+ foreach my $strip (@stripfile) {
+ chomp $strip;
+ my @newgen;
+ for(@actual) {
+ eval $strip;
+ if($_) {
+ push @newgen, $_;
+ }
+ }
+ # this is to get rid of array entries that vanished (zero
+ # length) because of replacements
+ @actual = @newgen;
+ }
+
# variable-replace in the stdout we have from the test case file
@validstdout = fixarray(@validstdout);
@@ -4177,7 +4255,7 @@ sub startservers {
for(@what) {
my (@whatlist) = split(/\s+/,$_);
my $what = lc($whatlist[0]);
- $what =~ s/[^a-z0-9-]//g;
+ $what =~ s/[^a-z0-9\/-]//g;
my $certfile;
if($what =~ /^(ftp|http|imap|pop3|smtp)s((\d*)(-ipv6|-unix|))$/) {
@@ -4263,6 +4341,17 @@ sub startservers {
$run{'gopher-ipv6'}="$pid $pid2";
}
}
+ elsif($what eq "http/2") {
+ if(!$run{'http/2'}) {
+ ($pid, $pid2) = runhttp2server($verbose, $HTTP2PORT);
+ if($pid <= 0) {
+ return "failed starting HTTP/2 server";
+ }
+ logmsg sprintf ("* pid http/2 => %d %d\n", $pid, $pid2)
+ if($verbose);
+ $run{'http/2'}="$pid $pid2";
+ }
+ }
elsif($what eq "http") {
if($torture && $run{'http'} &&
!responsive_http_server("http", $verbose, 0, $HTTPPORT)) {
@@ -5003,6 +5092,7 @@ $HTTPTLSPORT = $base++; # HTTP TLS (non-stunnel) server port
$HTTPTLS6PORT = $base++; # HTTP TLS (non-stunnel) IPv6 server port
$HTTPPROXYPORT = $base++; # HTTP proxy port, when using CONNECT
$HTTPPIPEPORT = $base++; # HTTP pipelining port
+$HTTP2PORT = $base++; # HTTP/2 port
$HTTPUNIXPATH = 'http.sock'; # HTTP server Unix domain socket path
#######################################################################
diff --git a/tests/server/getpart.c b/tests/server/getpart.c
index 960fbaa5..1952fbbe 100644
--- a/tests/server/getpart.c
+++ b/tests/server/getpart.c
@@ -29,7 +29,7 @@
#include "curlx.h" /* from the private lib dir */
/* just to please curl_base64.h we create a fake struct */
-struct SessionHandle {
+struct Curl_easy {
int fake;
};
diff --git a/tests/serverhelp.pm b/tests/serverhelp.pm
index 8b2779d1..d6a06508 100644
--- a/tests/serverhelp.pm
+++ b/tests/serverhelp.pm
@@ -5,7 +5,7 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
-# Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+# Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
@@ -105,7 +105,7 @@ sub servername_str {
$proto = uc($proto) if($proto);
die "unsupported protocol: '$proto'" unless($proto &&
- ($proto =~ /^(((FTP|HTTP|IMAP|POP3|SMTP|HTTP-PIPE)S?)|(TFTP|SFTP|SOCKS|SSH|RTSP|GOPHER|HTTPTLS))$/));
+ ($proto =~ /^(((FTP|HTTP|HTTP\/2|IMAP|POP3|SMTP|HTTP-PIPE)S?)|(TFTP|SFTP|SOCKS|SSH|RTSP|GOPHER|HTTPTLS))$/));
$ipver = (not $ipver) ? 'ipv4' : lc($ipver);
die "unsupported IP version: '$ipver'" unless($ipver &&
@@ -137,6 +137,7 @@ sub servername_canon {
my ($proto, $ipver, $idnum) = @_;
my $string = lc(servername_str($proto, $ipver, $idnum));
$string =~ tr/-/_/;
+ $string =~ s/\//_v/;
return $string;
}
diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt
new file mode 100644
index 00000000..e6667988
--- /dev/null
+++ b/tests/unit/CMakeLists.txt
@@ -0,0 +1,46 @@
+
+set(UT_SRC
+ unit1300.c
+ unit1301.c
+ unit1302.c
+ unit1303.c
+ unit1304.c
+ unit1305.c
+ unit1307.c
+ unit1308.c
+ unit1309.c
+ unit1330.c
+# Broken link on Linux
+# unit1394.c
+ unit1395.c
+ unit1396.c
+ unit1397.c
+ unit1398.c
+ unit1600.c
+ unit1601.c
+ unit1603.c
+# Broken link on Linux
+# unit1604.c
+ )
+
+set(UT_COMMON_FILES ../libtest/first.c ../libtest/test.h curlcheck.h)
+include_directories(
+ ${CURL_SOURCE_DIR}/lib # To be able to reach "curl_setup_once.h"
+ ${CURL_SOURCE_DIR}/tests/libtest
+ ${CURL_SOURCE_DIR}/src
+ ${CURL_BINARY_DIR}/lib # To be able to reach "curl_config.h"
+ ${CURL_BINARY_DIR}/include # To be able to reach "curl/curlbuild.h"
+)
+
+foreach(_testfile ${UT_SRC})
+
+ get_filename_component(_testname ${_testfile} NAME_WE)
+ add_executable(${_testname} ${_testfile} ${UT_COMMON_FILES})
+ target_link_libraries(${_testname} libcurl ${CURL_LIBS})
+ set_target_properties(${_testname}
+ PROPERTIES COMPILE_DEFINITIONS "UNITTESTS")
+
+ add_test(NAME ${_testname}
+ COMMAND ${_testname} "http://www.google.com"
+ )
+endforeach()
diff --git a/tests/unit/unit1302.c b/tests/unit/unit1302.c
index 66054da5..8dae5aad 100644
--- a/tests/unit/unit1302.c
+++ b/tests/unit/unit1302.c
@@ -26,7 +26,7 @@
#include "curl_base64.h"
#include "memdebug.h" /* LAST include file */
-static struct SessionHandle *data;
+static struct Curl_easy *data;
static CURLcode unit_setup(void)
{
diff --git a/tests/unit/unit1303.c b/tests/unit/unit1303.c
index 7c0731a4..a4bd5982 100644
--- a/tests/unit/unit1303.c
+++ b/tests/unit/unit1303.c
@@ -25,7 +25,7 @@
#include "connect.h"
#include "memdebug.h" /* LAST include file */
-static struct SessionHandle *data;
+static struct Curl_easy *data;
static CURLcode unit_setup(void)
{
diff --git a/tests/unit/unit1305.c b/tests/unit/unit1305.c
index 95cfe2b5..ad270f56 100644
--- a/tests/unit/unit1305.c
+++ b/tests/unit/unit1305.c
@@ -39,7 +39,7 @@
#include "memdebug.h" /* LAST include file */
-static struct SessionHandle *data;
+static struct Curl_easy *data;
static struct curl_hash hp;
static char *data_key;
static struct Curl_dns_entry *data_node;
diff --git a/winbuild/MakefileBuild.vc b/winbuild/MakefileBuild.vc
index d631204f..62a5719a 100644
--- a/winbuild/MakefileBuild.vc
+++ b/winbuild/MakefileBuild.vc
@@ -224,6 +224,7 @@ USE_WINSSL = true
!ERROR cannot build with WinSSL without SSPI
!ENDIF
SSPI_CFLAGS = $(SSPI_CFLAGS) /DUSE_SCHANNEL
+WIN_LIBS = $(WIN_LIBS) Crypt32.lib
!ENDIF
@@ -232,7 +233,7 @@ GEN_PDB = true
!ENDIF
-!IFDEF EMBEND_MANIFEST
+!IFDEF EMBED_MANIFEST
MANIFESTTOOL = mt -manifest $(DIRDIST)\$(PROGRAM_NAME).manifest -outputresource:$(DIRDIST)\$(PROGRAM_NAME);1
!ENDIF