Compare commits
No commits in common. "main" and "curl-7_39_0" have entirely different histories.
main
...
curl-7_39_
@ -1,10 +0,0 @@
|
||||
;;; Directory Local Variables
|
||||
;;; See Info node `(emacs) Directory Variables' for more information.
|
||||
|
||||
((nil . ((indent-tabs-mode . nil)
|
||||
(show-trailing-whitespace . t)))
|
||||
(c-mode . ((c-basic-offset . 2)
|
||||
))
|
||||
(c++-mode . ((c-basic-offset . 2)
|
||||
))
|
||||
)
|
23
.github/CONTRIBUTING.md
vendored
23
.github/CONTRIBUTING.md
vendored
@ -1,23 +0,0 @@
|
||||
How to contribute to curl
|
||||
=========================
|
||||
|
||||
Join the community
|
||||
------------------
|
||||
|
||||
1. Click 'watch' on the github repo
|
||||
|
||||
2. Subscribe to the suitable [mailing lists](https://curl.haxx.se/mail/)
|
||||
|
||||
Read [CONTRIBUTE](../docs/CONTRIBUTE)
|
||||
---------------------------------------
|
||||
|
||||
Send your suggestions using one of these methods:
|
||||
-------------------------------------------------
|
||||
|
||||
1. in a mail to the mailing list
|
||||
|
||||
2. as a [pull request](https://github.com/curl/curl/pulls)
|
||||
|
||||
3. as an [issue](https://github.com/curl/curl/issues)
|
||||
|
||||
/ The cURL team!
|
9
.github/ISSUE_TEMPLATE
vendored
9
.github/ISSUE_TEMPLATE
vendored
@ -1,9 +0,0 @@
|
||||
### I did this
|
||||
|
||||
### I expected the following
|
||||
|
||||
### curl/libcurl version
|
||||
|
||||
[curl -V output perhaps?]
|
||||
|
||||
### operating system
|
59
.gitignore
vendored
59
.gitignore
vendored
@ -1,52 +1,49 @@
|
||||
*.asc
|
||||
.deps
|
||||
.libs
|
||||
*.lib
|
||||
*.pdb
|
||||
*.dll
|
||||
*.exe
|
||||
*.exp
|
||||
*.la
|
||||
*.lib
|
||||
*.lo
|
||||
*.o
|
||||
*.obj
|
||||
*.pdb
|
||||
*~
|
||||
*.asc
|
||||
.*.swp
|
||||
.cproject
|
||||
.deps
|
||||
.dirstamp
|
||||
.libs
|
||||
.project
|
||||
.settings
|
||||
/build/
|
||||
/builds/
|
||||
CHANGES.dist
|
||||
Debug
|
||||
INSTALL
|
||||
Release
|
||||
*.exp
|
||||
Makefile
|
||||
Makefile.in
|
||||
Release
|
||||
TAGS
|
||||
aclocal.m4
|
||||
aclocal.m4.bak
|
||||
autom4te.cache
|
||||
compile
|
||||
config.cache
|
||||
config.guess
|
||||
config.log
|
||||
config.status
|
||||
config.sub
|
||||
configure
|
||||
curl-*.tar.bz2
|
||||
curl-*.tar.gz
|
||||
curl-*.tar.lzma
|
||||
curl-*.zip
|
||||
curl-config
|
||||
depcomp
|
||||
install-sh
|
||||
libcurl.pc
|
||||
libtool
|
||||
ltmain.sh
|
||||
compile
|
||||
curl-config
|
||||
libcurl.pc
|
||||
missing
|
||||
curl-*.tar.gz
|
||||
curl-*.tar.bz2
|
||||
curl-*.tar.lzma
|
||||
curl-*.zip
|
||||
INSTALL
|
||||
install-sh
|
||||
*.o
|
||||
*.lo
|
||||
*.la
|
||||
mkinstalldirs
|
||||
tags
|
||||
test-driver
|
||||
scripts/_curl
|
||||
TAGS
|
||||
*~
|
||||
aclocal.m4.bak
|
||||
CHANGES.dist
|
||||
.project
|
||||
.cproject
|
||||
.settings
|
||||
/[0-9]*.patch
|
||||
.dirstamp
|
||||
|
12
.travis.yml
12
.travis.yml
@ -1,20 +1,8 @@
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
|
||||
sudo: false
|
||||
|
||||
language: c
|
||||
|
||||
install:
|
||||
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update > /dev/null; fi
|
||||
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install openssl libidn rtmpdump libssh2 c-ares libmetalink libressl nghttp2; fi
|
||||
|
||||
before_script:
|
||||
- ./buildconf
|
||||
|
||||
script: ./configure --enable-debug && make && make test-full
|
||||
|
||||
compiler:
|
||||
- clang
|
||||
- gcc
|
||||
|
14
CHANGES
14
CHANGES
@ -1,7 +1,15 @@
|
||||
See https://curl.haxx.se/changes.html for the edited and human readable online
|
||||
version of what has changed over the years in different curl releases.
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
| (__| |_| | _ <| |___
|
||||
\___|\___/|_| \_\_____|
|
||||
|
||||
Generate a CHANGES file like the one present in evey release like this:
|
||||
Changelog
|
||||
|
||||
This file no longer holds the changelog. Now you can generate it yourself
|
||||
like this:
|
||||
|
||||
$ git log --pretty=fuller --no-color --date=short --decorate=full | \
|
||||
./log2changes.pl
|
||||
|
||||
The older, manually edited, changelog is found in git named CHANGES.0
|
||||
|
@ -9,7 +9,7 @@
|
||||
*
|
||||
* 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.
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@ -139,7 +139,7 @@ int main(void)
|
||||
rc = gethostbyname_r(address, &h, &hdata);
|
||||
#elif defined(HAVE_GETHOSTBYNAME_R_5) || \
|
||||
defined(HAVE_GETHOSTBYNAME_R_5_REENTRANT)
|
||||
rc = gethostbyname_r(address, &h, buffer, 8192, &h_errnop);
|
||||
rc = gethostbyname_r(address, &h, buffer, 8192, 0, &h_errnop);
|
||||
(void)hp; /* not used for test */
|
||||
#elif defined(HAVE_GETHOSTBYNAME_R_6) || \
|
||||
defined(HAVE_GETHOSTBYNAME_R_6_REENTRANT)
|
||||
|
@ -155,7 +155,7 @@ message(STATUS "LDFLAGS: ${_GSS_LIB_FLAGS}")
|
||||
set(GSS_FLAVOUR "MIT")
|
||||
else()
|
||||
# prevent compiling the header - just check if we can include it
|
||||
set(CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D__ROKEN_H__")
|
||||
set(CMAKE_REQUIRED_DEFINITIONS "-D__ROKEN_H__")
|
||||
check_include_file( "roken.h" _GSS_HAVE_ROKEN_H)
|
||||
|
||||
check_include_file( "heimdal/roken.h" _GSS_HAVE_HEIMDAL_ROKEN_H)
|
||||
|
@ -1,24 +1,18 @@
|
||||
#File defines convenience macros for available feature testing
|
||||
|
||||
# This macro checks if the symbol exists in the library and if it
|
||||
# does, it prepends library to the list. It is intended to be called
|
||||
# multiple times with a sequence of possibly dependent libraries in
|
||||
# order of least-to-most-dependent. Some libraries depend on others
|
||||
# to link correctly.
|
||||
# does, it appends library to the list.
|
||||
macro(CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE)
|
||||
check_library_exists("${LIBRARY};${CURL_LIBS}" ${SYMBOL} "${CMAKE_LIBRARY_PATH}"
|
||||
check_library_exists("${CURL_LIBS};${LIBRARY}" ${SYMBOL} "${CMAKE_LIBRARY_PATH}"
|
||||
${VARIABLE})
|
||||
if(${VARIABLE})
|
||||
set(CURL_LIBS ${LIBRARY} ${CURL_LIBS})
|
||||
list(APPEND CURL_LIBS ${LIBRARY})
|
||||
endif(${VARIABLE})
|
||||
endmacro(CHECK_LIBRARY_EXISTS_CONCAT)
|
||||
|
||||
# Check if header file exists and add it to the list.
|
||||
# This macro is intended to be called multiple times with a sequence of
|
||||
# possibly dependent header files. Some headers depend on others to be
|
||||
# compiled correctly.
|
||||
macro(CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE)
|
||||
check_include_files("${CURL_INCLUDES};${FILE}" ${VARIABLE})
|
||||
check_include_file("${FILE}" ${VARIABLE})
|
||||
if(${VARIABLE})
|
||||
set(CURL_INCLUDES ${CURL_INCLUDES} ${FILE})
|
||||
set(CURL_TEST_DEFINES "${CURL_TEST_DEFINES} -D${VARIABLE}")
|
||||
@ -27,7 +21,7 @@ endmacro(CHECK_INCLUDE_FILE_CONCAT)
|
||||
|
||||
# For other curl specific tests, use this macro.
|
||||
macro(CURL_INTERNAL_TEST CURL_TEST)
|
||||
if(NOT DEFINED "${CURL_TEST}")
|
||||
if("${CURL_TEST}" MATCHES "^${CURL_TEST}$")
|
||||
set(MACRO_CHECK_FUNCTION_DEFINITIONS
|
||||
"-D${CURL_TEST} ${CURL_TEST_DEFINES} ${CMAKE_REQUIRED_FLAGS}")
|
||||
if(CMAKE_REQUIRED_LIBRARIES)
|
||||
@ -55,11 +49,11 @@ macro(CURL_INTERNAL_TEST CURL_TEST)
|
||||
"Performing Curl Test ${CURL_TEST} failed with the following output:\n"
|
||||
"${OUTPUT}\n")
|
||||
endif(${CURL_TEST})
|
||||
endif()
|
||||
endif("${CURL_TEST}" MATCHES "^${CURL_TEST}$")
|
||||
endmacro(CURL_INTERNAL_TEST)
|
||||
|
||||
macro(CURL_INTERNAL_TEST_RUN CURL_TEST)
|
||||
if(NOT DEFINED "${CURL_TEST}_COMPILE")
|
||||
if("${CURL_TEST}_COMPILE" MATCHES "^${CURL_TEST}_COMPILE$")
|
||||
set(MACRO_CHECK_FUNCTION_DEFINITIONS
|
||||
"-D${CURL_TEST} ${CMAKE_REQUIRED_FLAGS}")
|
||||
if(CMAKE_REQUIRED_LIBRARIES)
|
||||
@ -91,5 +85,5 @@ macro(CURL_INTERNAL_TEST_RUN CURL_TEST)
|
||||
file(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log"
|
||||
"\n\n")
|
||||
endif(${CURL_TEST}_COMPILE AND NOT ${CURL_TEST})
|
||||
endif()
|
||||
endif("${CURL_TEST}_COMPILE" MATCHES "^${CURL_TEST}_COMPILE$")
|
||||
endmacro(CURL_INTERNAL_TEST_RUN)
|
||||
|
@ -10,8 +10,8 @@ endmacro(add_header_include)
|
||||
|
||||
set(signature_call_conv)
|
||||
if(HAVE_WINDOWS_H)
|
||||
add_header_include(HAVE_WINSOCK2_H "winsock2.h")
|
||||
add_header_include(HAVE_WINDOWS_H "windows.h")
|
||||
add_header_include(HAVE_WINSOCK2_H "winsock2.h")
|
||||
add_header_include(HAVE_WINSOCK_H "winsock.h")
|
||||
set(_source_epilogue
|
||||
"${_source_epilogue}\n#ifndef WIN32_LEAN_AND_MEAN\n#define WIN32_LEAN_AND_MEAN\n#endif")
|
||||
|
@ -5,7 +5,6 @@ if(NOT UNIX)
|
||||
set(HAVE_LIBSOCKET 0)
|
||||
set(NOT_NEED_LIBNSL 0)
|
||||
set(HAVE_LIBNSL 0)
|
||||
set(HAVE_GETHOSTNAME 1)
|
||||
set(HAVE_LIBZ 0)
|
||||
set(HAVE_LIBCRYPTO 0)
|
||||
|
||||
|
169
CMakeLists.txt
169
CMakeLists.txt
@ -5,11 +5,11 @@
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
# Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
# are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
@ -64,7 +64,7 @@ message(STATUS "curl version=[${CURL_VERSION}]")
|
||||
# SET(PACKAGE_NAME "curl")
|
||||
# SET(PACKAGE_VERSION "-")
|
||||
# SET(PACKAGE_STRING "curl-")
|
||||
# SET(PACKAGE_BUGREPORT "a suitable curl mailing list => https://curl.haxx.se/mail/")
|
||||
# SET(PACKAGE_BUGREPORT "a suitable curl mailing list => http://curl.haxx.se/mail/")
|
||||
set(OPERATING_SYSTEM "${CMAKE_SYSTEM_NAME}")
|
||||
set(OS "\"${CMAKE_SYSTEM_NAME}\"")
|
||||
|
||||
@ -74,35 +74,12 @@ 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)
|
||||
|
||||
option(ENABLE_DEBUG "Set to ON to enable curl debug features" OFF)
|
||||
option(ENABLE_CURLDEBUG "Set to ON to build with TrackMemory feature enabled" OFF)
|
||||
|
||||
if (ENABLE_DEBUG)
|
||||
# DEBUGBUILD will be defined only for Debug builds
|
||||
if(NOT CMAKE_VERSION VERSION_LESS 3.0)
|
||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:DEBUGBUILD>)
|
||||
else()
|
||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG DEBUGBUILD)
|
||||
endif()
|
||||
set(ENABLE_CURLDEBUG ON)
|
||||
endif()
|
||||
|
||||
if (ENABLE_CURLDEBUG)
|
||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS CURLDEBUG)
|
||||
endif()
|
||||
|
||||
option(CURL_USE_ARES "Set to ON to enable c-ares support" OFF)
|
||||
# initialize CURL_LIBS
|
||||
set(CURL_LIBS "")
|
||||
|
||||
if(ENABLE_THREADED_RESOLVER AND ENABLE_ARES)
|
||||
message(FATAL_ERROR "Options ENABLE_THREADED_RESOLVER and ENABLE_ARES are mutually exclusive")
|
||||
endif()
|
||||
|
||||
if(ENABLE_ARES)
|
||||
set(USE_ARES 1)
|
||||
if(CURL_USE_ARES)
|
||||
set(USE_ARES ${CURL_USE_ARES})
|
||||
find_package(CARES REQUIRED)
|
||||
list(APPEND CURL_LIBS ${CARES_LIBRARY} )
|
||||
set(CURL_LIBS ${CURL_LIBS} ${CARES_LIBRARY})
|
||||
@ -122,6 +99,11 @@ endif()
|
||||
option(CURL_HIDDEN_SYMBOLS "Set to ON to hide libcurl internal symbols (=hide all symbols that aren't officially external)." ON)
|
||||
mark_as_advanced(CURL_HIDDEN_SYMBOLS)
|
||||
|
||||
# IF(WIN32)
|
||||
# OPTION(CURL_WINDOWS_SSPI "Use windows libraries to allow NTLM authentication without openssl" ON)
|
||||
# MARK_AS_ADVANCED(CURL_WINDOWS_SSPI)
|
||||
# ENDIF()
|
||||
|
||||
option(HTTP_ONLY "disables all protocols except HTTP (This overrides all CURL_DISABLE_* options)" OFF)
|
||||
mark_as_advanced(HTTP_ONLY)
|
||||
option(CURL_DISABLE_FTP "disables FTP" OFF)
|
||||
@ -181,7 +163,7 @@ option(DISABLED_THREADSAFE "Set to explicitly specify we don't want to use threa
|
||||
mark_as_advanced(DISABLED_THREADSAFE)
|
||||
option(ENABLE_IPV6 "Define if you want to enable IPv6 support" ON)
|
||||
mark_as_advanced(ENABLE_IPV6)
|
||||
if(ENABLE_IPV6 AND NOT WIN32)
|
||||
if(ENABLE_IPV6)
|
||||
include(CheckStructHasMember)
|
||||
check_struct_has_member("struct sockaddr_in6" sin6_addr "netinet/in.h"
|
||||
HAVE_SOCKADDR_IN6_SIN6_ADDR)
|
||||
@ -248,26 +230,12 @@ include (CheckLibraryExists)
|
||||
include (CheckSymbolExists)
|
||||
include (CheckTypeSize)
|
||||
include (CheckCSourceCompiles)
|
||||
include (CMakeDependentOption)
|
||||
|
||||
# On windows preload settings
|
||||
if(WIN32)
|
||||
set(CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_WINSOCKAPI_")
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/CMake/Platforms/WindowsCache.cmake)
|
||||
endif(WIN32)
|
||||
|
||||
if(ENABLE_THREADED_RESOLVER)
|
||||
check_include_file_concat("pthread.h" HAVE_PTHREAD_H)
|
||||
if(HAVE_PTHREAD_H)
|
||||
set(CMAKE_THREAD_PREFER_PTHREAD 1)
|
||||
find_package(Threads)
|
||||
if(CMAKE_USE_PTHREADS_INIT)
|
||||
set(CURL_LIBS ${CURL_LIBS} ${CMAKE_THREAD_LIBS_INIT})
|
||||
set(USE_THREADS_POSIX 1)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Check for all needed libraries
|
||||
check_library_exists_concat("dl" dlopen HAVE_LIBDL)
|
||||
check_library_exists_concat("socket" connect HAVE_LIBSOCKET)
|
||||
@ -284,24 +252,15 @@ if(NOT NOT_NEED_LIBNSL)
|
||||
check_library_exists_concat("nsl" gethostbyname HAVE_LIBNSL)
|
||||
endif(NOT NOT_NEED_LIBNSL)
|
||||
|
||||
check_function_exists(gethostname HAVE_GETHOSTNAME)
|
||||
|
||||
set(OPENSSL_DEFAULT ON)
|
||||
if(WIN32)
|
||||
set(OPENSSL_DEFAULT OFF)
|
||||
check_library_exists_concat("ws2_32" getch HAVE_LIBWS2_32)
|
||||
check_library_exists_concat("winmm" getch HAVE_LIBWINMM)
|
||||
endif()
|
||||
|
||||
option(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" ${OPENSSL_DEFAULT})
|
||||
option(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" ON)
|
||||
mark_as_advanced(CMAKE_USE_OPENSSL)
|
||||
|
||||
if(WIN32)
|
||||
CMAKE_DEPENDENT_OPTION(CURL_WINDOWS_SSPI "Use windows libraries to allow NTLM authentication without openssl" ON
|
||||
"NOT CMAKE_USE_OPENSSL" OFF)
|
||||
mark_as_advanced(CURL_WINDOWS_SSPI)
|
||||
endif()
|
||||
|
||||
set(USE_SSLEAY OFF)
|
||||
set(USE_OPENSSL OFF)
|
||||
set(HAVE_LIBCRYPTO OFF)
|
||||
set(HAVE_LIBSSL OFF)
|
||||
@ -310,33 +269,32 @@ if(CMAKE_USE_OPENSSL)
|
||||
find_package(OpenSSL)
|
||||
if(OPENSSL_FOUND)
|
||||
list(APPEND CURL_LIBS ${OPENSSL_LIBRARIES})
|
||||
set(USE_SSLEAY ON)
|
||||
set(USE_OPENSSL ON)
|
||||
set(HAVE_LIBCRYPTO ON)
|
||||
set(HAVE_LIBSSL ON)
|
||||
include_directories(${OPENSSL_INCLUDE_DIR})
|
||||
set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
|
||||
check_include_file("openssl/crypto.h" HAVE_OPENSSL_CRYPTO_H)
|
||||
check_include_file("openssl/engine.h" HAVE_OPENSSL_ENGINE_H)
|
||||
check_include_file("openssl/err.h" HAVE_OPENSSL_ERR_H)
|
||||
check_include_file("openssl/pem.h" HAVE_OPENSSL_PEM_H)
|
||||
check_include_file("openssl/pkcs12.h" HAVE_OPENSSL_PKCS12_H)
|
||||
check_include_file("openssl/rsa.h" HAVE_OPENSSL_RSA_H)
|
||||
check_include_file("openssl/ssl.h" HAVE_OPENSSL_SSL_H)
|
||||
check_include_file("openssl/x509.h" HAVE_OPENSSL_X509_H)
|
||||
check_include_file("openssl/rand.h" HAVE_OPENSSL_RAND_H)
|
||||
elseif(WIN32)
|
||||
set(CURL_WINDOWS_SSPI ON)
|
||||
check_include_file_concat("openssl/crypto.h" HAVE_OPENSSL_CRYPTO_H)
|
||||
check_include_file_concat("openssl/engine.h" HAVE_OPENSSL_ENGINE_H)
|
||||
check_include_file_concat("openssl/err.h" HAVE_OPENSSL_ERR_H)
|
||||
check_include_file_concat("openssl/pem.h" HAVE_OPENSSL_PEM_H)
|
||||
check_include_file_concat("openssl/pkcs12.h" HAVE_OPENSSL_PKCS12_H)
|
||||
check_include_file_concat("openssl/rsa.h" HAVE_OPENSSL_RSA_H)
|
||||
check_include_file_concat("openssl/ssl.h" HAVE_OPENSSL_SSL_H)
|
||||
check_include_file_concat("openssl/x509.h" HAVE_OPENSSL_X509_H)
|
||||
check_include_file_concat("openssl/rand.h" HAVE_OPENSSL_RAND_H)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT CURL_DISABLE_LDAP)
|
||||
|
||||
if(WIN32)
|
||||
option(USE_WIN32_LDAP "Use Windows LDAP implementation" ON)
|
||||
if(USE_WIN32_LDAP)
|
||||
option(CURL_LDAP_WIN "Use Windows LDAP implementation" ON)
|
||||
if(CURL_LDAP_WIN)
|
||||
check_library_exists("wldap32" cldap_open "" HAVE_WLDAP32)
|
||||
if(NOT HAVE_WLDAP32)
|
||||
set(USE_WIN32_LDAP OFF)
|
||||
set(CURL_LDAP_WIN OFF)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
@ -346,12 +304,12 @@ if(NOT CURL_DISABLE_LDAP)
|
||||
set(CMAKE_LDAP_LIB "ldap" CACHE STRING "Name or full path to ldap library")
|
||||
set(CMAKE_LBER_LIB "lber" CACHE STRING "Name or full path to lber library")
|
||||
|
||||
if(CMAKE_USE_OPENLDAP AND USE_WIN32_LDAP)
|
||||
message(FATAL_ERROR "Cannot use USE_WIN32_LDAP and CMAKE_USE_OPENLDAP at the same time")
|
||||
if(CMAKE_USE_OPENLDAP AND CURL_LDAP_WIN)
|
||||
message(FATAL_ERROR "Cannot use CURL_LDAP_WIN 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(NOT CURL_LDAP_WIN)
|
||||
# Check for LDAP
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES})
|
||||
check_library_exists_concat(${CMAKE_LDAP_LIB} ldap_init HAVE_LIBLDAP)
|
||||
@ -361,10 +319,9 @@ if(NOT CURL_DISABLE_LDAP)
|
||||
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})
|
||||
set(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)
|
||||
@ -372,11 +329,9 @@ if(NOT CURL_DISABLE_LDAP)
|
||||
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)
|
||||
@ -410,7 +365,7 @@ if(NOT CURL_DISABLE_LDAP)
|
||||
return 0;
|
||||
}"
|
||||
)
|
||||
set(CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -DLDAP_DEPRECATED=1")
|
||||
set(CMAKE_REQUIRED_DEFINITIONS "-DLDAP_DEPRECATED=1" "-DWIN32_LEAN_AND_MEAN")
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_LDAP_LIB})
|
||||
if(HAVE_LIBLBER)
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_LBER_LIB})
|
||||
@ -457,7 +412,6 @@ if(CURL_ZLIB)
|
||||
set(HAVE_LIBZ ON)
|
||||
list(APPEND CURL_LIBS ${ZLIB_LIBRARIES})
|
||||
include_directories(${ZLIB_INCLUDE_DIRS})
|
||||
list(APPEND CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIRS})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@ -473,7 +427,7 @@ if(CMAKE_USE_LIBSSH2)
|
||||
if(LIBSSH2_FOUND)
|
||||
list(APPEND CURL_LIBS ${LIBSSH2_LIBRARY})
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${LIBSSH2_LIBRARY})
|
||||
list(APPEND CMAKE_REQUIRED_INCLUDES "${LIBSSH2_INCLUDE_DIR}")
|
||||
set(CMAKE_REQUIRED_INCLUDES "${LIBSSH2_INCLUDE_DIR}")
|
||||
include_directories("${LIBSSH2_INCLUDE_DIR}")
|
||||
set(HAVE_LIBSSH2 ON)
|
||||
set(USE_LIBSSH2 ON)
|
||||
@ -501,12 +455,12 @@ mark_as_advanced(CMAKE_USE_GSSAPI)
|
||||
if(CMAKE_USE_GSSAPI)
|
||||
find_package(GSS)
|
||||
|
||||
set(HAVE_GSSAPI ${GSS_FOUND})
|
||||
set(HAVE_GSS_API ${GSS_FOUND})
|
||||
if(GSS_FOUND)
|
||||
|
||||
message(STATUS "Found ${GSS_FLAVOUR} GSSAPI version: \"${GSS_VERSION}\"")
|
||||
|
||||
list(APPEND CMAKE_REQUIRED_INCLUDES ${GSS_INCLUDE_DIRECTORIES})
|
||||
set(CMAKE_REQUIRED_INCLUDES ${GSS_INCLUDE_DIR})
|
||||
check_include_file_concat("gssapi/gssapi.h" HAVE_GSSAPI_GSSAPI_H)
|
||||
check_include_file_concat("gssapi/gssapi_generic.h" HAVE_GSSAPI_GSSAPI_GENERIC_H)
|
||||
check_include_file_concat("gssapi/gssapi_krb5.h" HAVE_GSSAPI_GSSAPI_KRB5_H)
|
||||
@ -542,7 +496,7 @@ if(CMAKE_USE_GSSAPI)
|
||||
|
||||
endif()
|
||||
|
||||
include_directories(${GSS_INCLUDE_DIRECTORIES})
|
||||
include_directories(${GSS_INCLUDE_DIR})
|
||||
link_directories(${GSS_LINK_DIRECTORIES})
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GSS_COMPILER_FLAGS}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${GSS_LINKER_FLAGS}")
|
||||
@ -554,36 +508,17 @@ if(CMAKE_USE_GSSAPI)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(ENABLE_UNIX_SOCKETS "Define if you want Unix domain sockets support" ON)
|
||||
if(ENABLE_UNIX_SOCKETS)
|
||||
include(CheckStructHasMember)
|
||||
check_struct_has_member("struct sockaddr_un" sun_path "sys/un.h" USE_UNIX_SOCKETS)
|
||||
else()
|
||||
unset(USE_UNIX_SOCKETS CACHE)
|
||||
endif()
|
||||
|
||||
|
||||
# Check for header files
|
||||
if(NOT UNIX)
|
||||
check_include_file_concat("ws2tcpip.h" HAVE_WS2TCPIP_H)
|
||||
check_include_file_concat("winsock2.h" HAVE_WINSOCK2_H)
|
||||
endif(NOT UNIX)
|
||||
check_include_file_concat("stdio.h" HAVE_STDIO_H)
|
||||
if(NOT UNIX)
|
||||
check_include_file_concat("windows.h" HAVE_WINDOWS_H)
|
||||
check_include_file_concat("winsock.h" HAVE_WINSOCK_H)
|
||||
check_include_file_concat("ws2tcpip.h" HAVE_WS2TCPIP_H)
|
||||
check_include_file_concat("winsock2.h" HAVE_WINSOCK2_H)
|
||||
if(CURL_WINDOWS_SSPI)
|
||||
set(CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -DSECURITY_WIN32")
|
||||
check_include_file_concat("sspi.h" HAVE_SSPI_H)
|
||||
if(HAVE_SSPI_H)
|
||||
check_include_file_concat("schannel.h" HAVE_SCHANNEL_H)
|
||||
set(USE_WINDOWS_SSPI ON)
|
||||
if(HAVE_SCHANNEL_H)
|
||||
set(USE_SCHANNEL ON)
|
||||
set(SSL_ENABLED ON)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif(NOT UNIX)
|
||||
|
||||
check_include_file_concat("stdio.h" HAVE_STDIO_H)
|
||||
check_include_file_concat("inttypes.h" HAVE_INTTYPES_H)
|
||||
check_include_file_concat("sys/filio.h" HAVE_SYS_FILIO_H)
|
||||
check_include_file_concat("sys/ioctl.h" HAVE_SYS_IOCTL_H)
|
||||
@ -775,6 +710,7 @@ if(CMAKE_USE_OPENSSL)
|
||||
HAVE_CRYPTO_CLEANUP_ALL_EX_DATA)
|
||||
if(HAVE_LIBCRYPTO AND HAVE_LIBSSL)
|
||||
set(USE_OPENSSL 1)
|
||||
set(USE_SSLEAY 1)
|
||||
endif(HAVE_LIBCRYPTO AND HAVE_LIBSSL)
|
||||
endif(CMAKE_USE_OPENSSL)
|
||||
check_symbol_exists(gmtime_r "${CURL_INCLUDES}" HAVE_GMTIME_R)
|
||||
@ -1061,28 +997,27 @@ endfunction()
|
||||
|
||||
# Clear list and try to detect available features
|
||||
set(_items)
|
||||
_add_if("WinSSL" SSL_ENABLED AND USE_WINDOWS_SSPI)
|
||||
_add_if("OpenSSL" SSL_ENABLED AND USE_OPENSSL)
|
||||
_add_if("SSL" SSL_ENABLED)
|
||||
_add_if("IPv6" ENABLE_IPV6)
|
||||
_add_if("unix-sockets" USE_UNIX_SOCKETS)
|
||||
_add_if("libz" HAVE_LIBZ)
|
||||
_add_if("AsynchDNS" USE_ARES OR USE_THREADS_POSIX)
|
||||
find_package(Threads)
|
||||
# AsynchDNS depends or USE_ARES or pthreads (mutually exclusive)
|
||||
_add_if("AsynchDNS" USE_ARES OR CMAKE_USE_PTHREADS_INIT)
|
||||
_add_if("IDN" HAVE_LIBIDN)
|
||||
# TODO SSP1 (WinSSL) check is missing
|
||||
_add_if("SSPI" USE_WINDOWS_SSPI)
|
||||
_add_if("GSS-API" HAVE_GSSAPI)
|
||||
_add_if("GSS-API" HAVE_GSS_API)
|
||||
# TODO SSP1 missing for SPNEGO
|
||||
_add_if("SPNEGO" NOT CURL_DISABLE_CRYPTO_AUTH AND
|
||||
(HAVE_GSSAPI OR USE_WINDOWS_SSPI))
|
||||
_add_if("Kerberos" NOT CURL_DISABLE_CRYPTO_AUTH AND
|
||||
(HAVE_GSSAPI OR USE_WINDOWS_SSPI))
|
||||
(HAVE_GSS_API OR USE_WINDOWS_SSPI))
|
||||
# NTLM support requires crypto function adaptions from various SSL libs
|
||||
# TODO alternative SSL libs tests for SSP1, GNUTLS, NSS, DARWINSSL
|
||||
if(NOT CURL_DISABLE_CRYPTO_AUTH AND (USE_OPENSSL OR
|
||||
if(NOT CURL_DISABLE_HTTP AND NOT CURL_DISABLE_CRYPTO_AUTH AND (USE_OPENSSL OR
|
||||
USE_WINDOWS_SSPI OR GNUTLS_ENABLED OR NSS_ENABLED OR DARWINSSL_ENABLED))
|
||||
_add_if("NTLM" 1)
|
||||
# TODO missing option (autoconf: --enable-ntlm-wb)
|
||||
_add_if("NTLM_WB" NOT CURL_DISABLE_HTTP AND NTLM_WB_ENABLED)
|
||||
_add_if("NTLM_WB" NTLM_WB_ENABLED)
|
||||
endif()
|
||||
# TODO missing option (--enable-tls-srp), depends on GNUTLS_SRP/OPENSSL_SRP
|
||||
_add_if("TLS-SRP" USE_TLS_SRP)
|
||||
@ -1160,7 +1095,7 @@ set(VERSIONNUM "${CURL_VERSION_NUM}")
|
||||
# Finally generate a "curl-config" matching this config
|
||||
configure_file("${CURL_SOURCE_DIR}/curl-config.in"
|
||||
"${CURL_BINARY_DIR}/curl-config" @ONLY)
|
||||
install(FILES "${CURL_BINARY_DIR}/curl-config"
|
||||
install(FILES "${CMAKE_BINARY_DIR}/curl-config"
|
||||
DESTINATION bin
|
||||
PERMISSIONS
|
||||
OWNER_READ OWNER_WRITE OWNER_EXECUTE
|
||||
@ -1170,7 +1105,7 @@ install(FILES "${CURL_BINARY_DIR}/curl-config"
|
||||
# Finally generate a pkg-config file matching this config
|
||||
configure_file("${CURL_SOURCE_DIR}/libcurl.pc.in"
|
||||
"${CURL_BINARY_DIR}/libcurl.pc" @ONLY)
|
||||
install(FILES "${CURL_BINARY_DIR}/libcurl.pc"
|
||||
install(FILES "${CMAKE_BINARY_DIR}/libcurl.pc"
|
||||
DESTINATION lib/pkgconfig)
|
||||
|
||||
# This needs to be run very last so other parts of the scripts can take advantage of this.
|
||||
|
3
COPYING
3
COPYING
@ -1,7 +1,6 @@
|
||||
COPYRIGHT AND PERMISSION NOTICE
|
||||
|
||||
Copyright (c) 1996 - 2016, Daniel Stenberg, <daniel@haxx.se>, and many
|
||||
contributors, see the THANKS file.
|
||||
Copyright (c) 1996 - 2014, Daniel Stenberg, <daniel@haxx.se>.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
@ -65,7 +65,7 @@ else
|
||||
ARCHES64='-arch x86_64'
|
||||
#We "know" that 10.4 and earlier do not support 64bit
|
||||
OLD_SDK64=`ls $SDK_PATH|egrep -v "10.[0-4]"|head -1`
|
||||
NEW_SDK64=`ls -r $SDK_PATH|egrep -v "10.[0-4][^0-9]" | head -1`
|
||||
NEW_SDK64=`ls -r $SDK_PATH|egrep -v "10.[0-4]"|head -1`
|
||||
if test $USE_OLD -gt 0
|
||||
then
|
||||
SDK64=$OLD_SDK64
|
||||
@ -94,7 +94,7 @@ if test ! -z $SDK32; then
|
||||
rm -r libcurl.framework
|
||||
mkdir -p libcurl.framework/${FRAMEWORK_VERSION}/Resources
|
||||
cp lib/.libs/libcurl.dylib libcurl.framework/${FRAMEWORK_VERSION}/libcurl
|
||||
install_name_tool -id @rpath/libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl
|
||||
install_name_tool -id @executable_path/../Frameworks/libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl
|
||||
/usr/bin/sed -e "s/7\.12\.3/$VERSION/" lib/libcurl.plist >libcurl.framework/${FRAMEWORK_VERSION}/Resources/Info.plist
|
||||
mkdir -p libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl
|
||||
cp include/curl/*.h libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl
|
||||
@ -121,7 +121,7 @@ if test ! -z $SDK32; then
|
||||
|
||||
echo "----Appending 64 bit framework to 32 bit framework..."
|
||||
cp lib/.libs/libcurl.dylib libcurl.framework/${FRAMEWORK_VERSION}/libcurl64
|
||||
install_name_tool -id @rpath/libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl64
|
||||
install_name_tool -id @executable_path/../Frameworks/libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl64
|
||||
cp libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl32
|
||||
pwd
|
||||
lipo libcurl.framework/${FRAMEWORK_VERSION}/libcurl32 libcurl.framework/${FRAMEWORK_VERSION}/libcurl64 -create -output libcurl.framework/${FRAMEWORK_VERSION}/libcurl
|
||||
|
166
Makefile.am
166
Makefile.am
@ -5,11 +5,11 @@
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
# Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
# are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
@ -30,126 +30,105 @@ CMAKE_DIST = CMakeLists.txt CMake/CMakeConfigurableFile.in \
|
||||
include/curl/curlbuild.h.cmake CMake/Macros.cmake
|
||||
|
||||
VC6_LIBTMPL = projects/Windows/VC6/lib/libcurl.tmpl
|
||||
VC6_LIBDSP = projects/Windows/VC6/lib/libcurl.dsp.dist
|
||||
VC6_LIBDSP = projects/Windows/VC6/lib/libcurl.dsp
|
||||
VC6_LIBDSP_DEPS = $(VC6_LIBTMPL) Makefile.am lib/Makefile.inc
|
||||
VC6_SRCTMPL = projects/Windows/VC6/src/curl.tmpl
|
||||
VC6_SRCDSP = projects/Windows/VC6/src/curl.dsp.dist
|
||||
VC6_SRCTMPL = projects/Windows/VC6/src/curlsrc.tmpl
|
||||
VC6_SRCDSP = projects/Windows/VC6/src/curlsrc.dsp
|
||||
VC6_SRCDSP_DEPS = $(VC6_SRCTMPL) Makefile.am src/Makefile.inc
|
||||
|
||||
VC7_LIBTMPL = projects/Windows/VC7/lib/libcurl.tmpl
|
||||
VC7_LIBVCPROJ = projects/Windows/VC7/lib/libcurl.vcproj.dist
|
||||
VC7_LIBVCPROJ = projects/Windows/VC7/lib/libcurl.vcproj
|
||||
VC7_LIBVCPROJ_DEPS = $(VC7_LIBTMPL) Makefile.am lib/Makefile.inc
|
||||
VC7_SRCTMPL = projects/Windows/VC7/src/curl.tmpl
|
||||
VC7_SRCVCPROJ = projects/Windows/VC7/src/curl.vcproj.dist
|
||||
VC7_SRCTMPL = projects/Windows/VC7/src/curlsrc.tmpl
|
||||
VC7_SRCVCPROJ = projects/Windows/VC7/src/curlsrc.vcproj
|
||||
VC7_SRCVCPROJ_DEPS = $(VC7_SRCTMPL) Makefile.am src/Makefile.inc
|
||||
|
||||
VC71_LIBTMPL = projects/Windows/VC7.1/lib/libcurl.tmpl
|
||||
VC71_LIBVCPROJ = projects/Windows/VC7.1/lib/libcurl.vcproj.dist
|
||||
VC71_LIBVCPROJ = projects/Windows/VC7.1/lib/libcurl.vcproj
|
||||
VC71_LIBVCPROJ_DEPS = $(VC71_LIBTMPL) Makefile.am lib/Makefile.inc
|
||||
VC71_SRCTMPL = projects/Windows/VC7.1/src/curl.tmpl
|
||||
VC71_SRCVCPROJ = projects/Windows/VC7.1/src/curl.vcproj.dist
|
||||
VC71_SRCTMPL = projects/Windows/VC7.1/src/curlsrc.tmpl
|
||||
VC71_SRCVCPROJ = projects/Windows/VC7.1/src/curlsrc.vcproj
|
||||
VC71_SRCVCPROJ_DEPS = $(VC71_SRCTMPL) Makefile.am src/Makefile.inc
|
||||
|
||||
VC8_LIBTMPL = projects/Windows/VC8/lib/libcurl.tmpl
|
||||
VC8_LIBVCPROJ = projects/Windows/VC8/lib/libcurl.vcproj.dist
|
||||
VC8_LIBVCPROJ = projects/Windows/VC8/lib/libcurl.vcproj
|
||||
VC8_LIBVCPROJ_DEPS = $(VC8_LIBTMPL) Makefile.am lib/Makefile.inc
|
||||
VC8_SRCTMPL = projects/Windows/VC8/src/curl.tmpl
|
||||
VC8_SRCVCPROJ = projects/Windows/VC8/src/curl.vcproj.dist
|
||||
VC8_SRCTMPL = projects/Windows/VC8/src/curlsrc.tmpl
|
||||
VC8_SRCVCPROJ = projects/Windows/VC8/src/curlsrc.vcproj
|
||||
VC8_SRCVCPROJ_DEPS = $(VC8_SRCTMPL) Makefile.am src/Makefile.inc
|
||||
|
||||
VC9_LIBTMPL = projects/Windows/VC9/lib/libcurl.tmpl
|
||||
VC9_LIBVCPROJ = projects/Windows/VC9/lib/libcurl.vcproj.dist
|
||||
VC9_LIBVCPROJ = projects/Windows/VC9/lib/libcurl.vcproj
|
||||
VC9_LIBVCPROJ_DEPS = $(VC9_LIBTMPL) Makefile.am lib/Makefile.inc
|
||||
VC9_SRCTMPL = projects/Windows/VC9/src/curl.tmpl
|
||||
VC9_SRCVCPROJ = projects/Windows/VC9/src/curl.vcproj.dist
|
||||
VC9_SRCTMPL = projects/Windows/VC9/src/curlsrc.tmpl
|
||||
VC9_SRCVCPROJ = projects/Windows/VC9/src/curlsrc.vcproj
|
||||
VC9_SRCVCPROJ_DEPS = $(VC9_SRCTMPL) Makefile.am src/Makefile.inc
|
||||
|
||||
VC10_LIBTMPL = projects/Windows/VC10/lib/libcurl.tmpl
|
||||
VC10_LIBVCXPROJ = projects/Windows/VC10/lib/libcurl.vcxproj.dist
|
||||
VC10_LIBVCXPROJ = projects/Windows/VC10/lib/libcurl.vcxproj
|
||||
VC10_LIBVCXPROJ_DEPS = $(VC10_LIBTMPL) Makefile.am lib/Makefile.inc
|
||||
VC10_SRCTMPL = projects/Windows/VC10/src/curl.tmpl
|
||||
VC10_SRCVCXPROJ = projects/Windows/VC10/src/curl.vcxproj.dist
|
||||
VC10_SRCTMPL = projects/Windows/VC10/src/curlsrc.tmpl
|
||||
VC10_SRCVCXPROJ = projects/Windows/VC10/src/curlsrc.vcxproj
|
||||
VC10_SRCVCXPROJ_DEPS = $(VC10_SRCTMPL) Makefile.am src/Makefile.inc
|
||||
|
||||
VC11_LIBTMPL = projects/Windows/VC11/lib/libcurl.tmpl
|
||||
VC11_LIBVCXPROJ = projects/Windows/VC11/lib/libcurl.vcxproj.dist
|
||||
VC11_LIBVCXPROJ = projects/Windows/VC11/lib/libcurl.vcxproj
|
||||
VC11_LIBVCXPROJ_DEPS = $(VC11_LIBTMPL) Makefile.am lib/Makefile.inc
|
||||
VC11_SRCTMPL = projects/Windows/VC11/src/curl.tmpl
|
||||
VC11_SRCVCXPROJ = projects/Windows/VC11/src/curl.vcxproj.dist
|
||||
VC11_SRCTMPL = projects/Windows/VC11/src/curlsrc.tmpl
|
||||
VC11_SRCVCXPROJ = projects/Windows/VC11/src/curlsrc.vcxproj
|
||||
VC11_SRCVCXPROJ_DEPS = $(VC11_SRCTMPL) Makefile.am src/Makefile.inc
|
||||
|
||||
VC12_LIBTMPL = projects/Windows/VC12/lib/libcurl.tmpl
|
||||
VC12_LIBVCXPROJ = projects/Windows/VC12/lib/libcurl.vcxproj.dist
|
||||
VC12_LIBVCXPROJ = projects/Windows/VC12/lib/libcurl.vcxproj
|
||||
VC12_LIBVCXPROJ_DEPS = $(VC12_LIBTMPL) Makefile.am lib/Makefile.inc
|
||||
VC12_SRCTMPL = projects/Windows/VC12/src/curl.tmpl
|
||||
VC12_SRCVCXPROJ = projects/Windows/VC12/src/curl.vcxproj.dist
|
||||
VC12_SRCTMPL = projects/Windows/VC12/src/curlsrc.tmpl
|
||||
VC12_SRCVCXPROJ = projects/Windows/VC12/src/curlsrc.vcxproj
|
||||
VC12_SRCVCXPROJ_DEPS = $(VC12_SRCTMPL) Makefile.am src/Makefile.inc
|
||||
|
||||
VC14_LIBTMPL = projects/Windows/VC14/lib/libcurl.tmpl
|
||||
VC14_LIBVCXPROJ = projects/Windows/VC14/lib/libcurl.vcxproj.dist
|
||||
VC14_LIBVCXPROJ_DEPS = $(VC14_LIBTMPL) Makefile.am lib/Makefile.inc
|
||||
VC14_SRCTMPL = projects/Windows/VC14/src/curl.tmpl
|
||||
VC14_SRCVCXPROJ = projects/Windows/VC14/src/curl.vcxproj.dist
|
||||
VC14_SRCVCXPROJ_DEPS = $(VC14_SRCTMPL) Makefile.am src/Makefile.inc
|
||||
|
||||
VC_DIST = projects/README \
|
||||
projects/build-openssl.bat \
|
||||
projects/build-wolfssl.bat \
|
||||
projects/checksrc.bat \
|
||||
projects/Windows/VC6/curl-all.dsw \
|
||||
projects/Windows/VC6/lib/libcurl.dsw \
|
||||
projects/Windows/VC6/src/curl.dsw \
|
||||
projects/Windows/VC7/curl-all.sln \
|
||||
projects/Windows/VC7/lib/libcurl.sln \
|
||||
projects/Windows/VC7/src/curl.sln \
|
||||
projects/Windows/VC7.1/curl-all.sln \
|
||||
projects/Windows/VC7.1/lib/libcurl.sln \
|
||||
projects/Windows/VC7.1/src/curl.sln \
|
||||
projects/Windows/VC8/curl-all.sln \
|
||||
projects/Windows/VC8/lib/libcurl.sln \
|
||||
projects/Windows/VC8/src/curl.sln \
|
||||
projects/Windows/VC9/curl-all.sln \
|
||||
projects/Windows/VC9/lib/libcurl.sln \
|
||||
projects/Windows/VC9/src/curl.sln \
|
||||
projects/Windows/VC10/curl-all.sln \
|
||||
projects/Windows/VC10/lib/libcurl.sln \
|
||||
projects/Windows/VC10/lib/libcurl.vcxproj.filters \
|
||||
projects/Windows/VC10/src/curl.sln \
|
||||
projects/Windows/VC10/src/curl.vcxproj.filters \
|
||||
projects/Windows/VC11/curl-all.sln \
|
||||
projects/Windows/VC11/lib/libcurl.sln \
|
||||
projects/Windows/VC11/lib/libcurl.vcxproj.filters \
|
||||
projects/Windows/VC11/src/curl.sln \
|
||||
projects/Windows/VC11/src/curl.vcxproj.filters \
|
||||
projects/Windows/VC12/curl-all.sln \
|
||||
projects/Windows/VC12/lib/libcurl.sln \
|
||||
projects/Windows/VC12/lib/libcurl.vcxproj.filters \
|
||||
projects/Windows/VC12/src/curl.sln \
|
||||
projects/Windows/VC12/src/curl.vcxproj.filters \
|
||||
projects/Windows/VC14/curl-all.sln \
|
||||
projects/Windows/VC14/lib/libcurl.sln \
|
||||
projects/Windows/VC14/lib/libcurl.vcxproj.filters \
|
||||
projects/Windows/VC14/src/curl.sln \
|
||||
projects/Windows/VC14/src/curl.vcxproj.filters
|
||||
VC_DIST = projects/README \
|
||||
projects/build-openssl.bat \
|
||||
projects/checksrc.bat \
|
||||
projects/Windows/VC6/curl.dsw \
|
||||
projects/Windows/VC6/lib/libcurl.dsw $(VC6_LIBDSP) \
|
||||
projects/Windows/VC6/src/curlsrc.dsw $(VC6_SRCDSP) \
|
||||
projects/Windows/VC7/curl.sln \
|
||||
projects/Windows/VC7/lib/libcurl.sln $(VC7_LIBVCPROJ) \
|
||||
projects/Windows/VC7/src/curlsrc.sln $(VC7_SRCVCPROJ) \
|
||||
projects/Windows/VC7.1/curl.sln \
|
||||
projects/Windows/VC7.1/lib/libcurl.sln $(VC71_LIBVCPROJ) \
|
||||
projects/Windows/VC7.1/src/curlsrc.sln $(VC71_SRCVCPROJ) \
|
||||
projects/Windows/VC8/curl.sln \
|
||||
projects/Windows/VC8/lib/libcurl.sln $(VC8_LIBVCPROJ) \
|
||||
projects/Windows/VC8/src/curlsrc.sln $(VC8_SRCVCPROJ) \
|
||||
projects/Windows/VC9/curl.sln \
|
||||
projects/Windows/VC9/lib/libcurl.sln $(VC9_LIBVCPROJ) \
|
||||
projects/Windows/VC9/src/curlsrc.sln $(VC9_SRCVCPROJ) \
|
||||
projects/Windows/VC10/curl.sln \
|
||||
projects/Windows/VC10/lib/libcurl.sln $(VC10_LIBVCXPROJ) \
|
||||
projects/Windows/VC10/src/curlsrc.sln $(VC10_SRCVCXPROJ) \
|
||||
projects/Windows/VC11/curl.sln \
|
||||
projects/Windows/VC11/lib/libcurl.sln $(VC11_LIBVCXPROJ) \
|
||||
projects/Windows/VC11/src/curlsrc.sln $(VC11_SRCVCXPROJ) \
|
||||
projects/Windows/VC12/curl.sln \
|
||||
projects/Windows/VC12/lib/libcurl.sln $(VC12_LIBVCXPROJ) \
|
||||
projects/Windows/VC12/src/curlsrc.sln $(VC12_SRCVCXPROJ)
|
||||
|
||||
WINBUILD_DIST = winbuild/BUILD.WINDOWS.txt winbuild/gen_resp_file.bat \
|
||||
winbuild/MakefileBuild.vc winbuild/Makefile.vc \
|
||||
winbuild/Makefile.msvc.names
|
||||
|
||||
EXTRA_DIST = CHANGES COPYING maketgz Makefile.dist curl-config.in \
|
||||
RELEASE-NOTES buildconf libcurl.pc.in MacOSX-Framework scripts/zsh.pl \
|
||||
$(CMAKE_DIST) $(VC_DIST) $(WINBUILD_DIST) lib/libcurl.vers.in \
|
||||
buildconf.bat
|
||||
RELEASE-NOTES buildconf libcurl.pc.in MacOSX-Framework \
|
||||
$(CMAKE_DIST) $(VC_DIST) $(WINBUILD_DIST) lib/libcurl.vers.in
|
||||
|
||||
CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP) $(VC7_LIBVCPROJ) $(VC7_SRCVCPROJ) \
|
||||
$(VC71_LIBVCPROJ) $(VC71_SRCVCPROJ) $(VC8_LIBVCPROJ) $(VC8_SRCVCPROJ) \
|
||||
$(VC9_LIBVCPROJ) $(VC9_SRCVCPROJ) $(VC10_LIBVCXPROJ) $(VC10_SRCVCXPROJ) \
|
||||
$(VC11_LIBVCXPROJ) $(VC11_SRCVCXPROJ) $(VC12_LIBVCXPROJ) $(VC12_SRCVCXPROJ) \
|
||||
$(VC14_LIBVCXPROJ) $(VC14_SRCVCXPROJ)
|
||||
$(VC11_LIBVCXPROJ) $(VC11_SRCVCXPROJ) $(VC12_LIBVCXPROJ) $(VC12_SRCVCXPROJ)
|
||||
|
||||
bin_SCRIPTS = curl-config
|
||||
|
||||
SUBDIRS = lib src include scripts
|
||||
SUBDIRS = lib src include
|
||||
DIST_SUBDIRS = $(SUBDIRS) tests packages docs
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
@ -169,12 +148,12 @@ dist-hook:
|
||||
done)
|
||||
|
||||
html:
|
||||
cd docs && make html
|
||||
cd docs; make html
|
||||
|
||||
pdf:
|
||||
cd docs && make pdf
|
||||
cd docs; make pdf
|
||||
|
||||
check: test examples check-docs
|
||||
check: test examples
|
||||
|
||||
if CROSSCOMPILING
|
||||
test-full: test
|
||||
@ -202,9 +181,6 @@ endif
|
||||
examples:
|
||||
@(cd docs/examples; $(MAKE) check)
|
||||
|
||||
check-docs:
|
||||
@(cd docs/libcurl; $(MAKE) check)
|
||||
|
||||
# This is a hook to have 'make clean' also clean up the docs and the tests
|
||||
# dir. The extra check for the Makefiles being present is necessary because
|
||||
# 'make distcheck' will make clean first in these directories _before_ it runs
|
||||
@ -290,7 +266,7 @@ vc-ide: $(VC6_LIBDSP_DEPS) $(VC6_SRCDSP_DEPS) $(VC7_LIBVCPROJ_DEPS) \
|
||||
$(VC8_LIBVCPROJ_DEPS) $(VC8_SRCVCPROJ_DEPS) $(VC9_LIBVCPROJ_DEPS) \
|
||||
$(VC9_SRCVCPROJ_DEPS) $(VC10_LIBVCXPROJ_DEPS) $(VC10_SRCVCXPROJ_DEPS) \
|
||||
$(VC11_LIBVCXPROJ_DEPS) $(VC11_SRCVCXPROJ_DEPS) $(VC12_LIBVCXPROJ_DEPS) \
|
||||
$(VC12_SRCVCXPROJ_DEPS) $(VC14_LIBVCXPROJ_DEPS) $(VC14_SRCVCXPROJ_DEPS)
|
||||
$(VC12_SRCVCXPROJ_DEPS)
|
||||
@(win32_lib_srcs='$(LIB_CFILES)'; \
|
||||
win32_lib_hdrs='$(LIB_HFILES) config-win32.h'; \
|
||||
win32_lib_rc='$(LIB_RCFILES)'; \
|
||||
@ -551,22 +527,4 @@ function gen_element(type, dir, file)\
|
||||
-v src_rc="$$win32_src_rc" \
|
||||
-v src_x_srcs="$$sorted_src_x_srcs" \
|
||||
-v src_x_hdrs="$$sorted_src_x_hdrs" \
|
||||
"$$awk_code" $(srcdir)/$(VC12_SRCTMPL) > $(VC12_SRCVCXPROJ) || { exit 1; }; \
|
||||
\
|
||||
echo "generating '$(VC14_LIBVCXPROJ)'"; \
|
||||
awk -v proj_type=vcxproj \
|
||||
-v lib_srcs="$$sorted_lib_srcs" \
|
||||
-v lib_hdrs="$$sorted_lib_hdrs" \
|
||||
-v lib_rc="$$win32_lib_rc" \
|
||||
-v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \
|
||||
-v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \
|
||||
"$$awk_code" $(srcdir)/$(VC14_LIBTMPL) > $(VC14_LIBVCXPROJ) || { exit 1; }; \
|
||||
\
|
||||
echo "generating '$(VC14_SRCVCXPROJ)'"; \
|
||||
awk -v proj_type=vcxproj \
|
||||
-v src_srcs="$$sorted_src_srcs" \
|
||||
-v src_hdrs="$$sorted_src_hdrs" \
|
||||
-v src_rc="$$win32_src_rc" \
|
||||
-v src_x_srcs="$$sorted_src_x_srcs" \
|
||||
-v src_x_hdrs="$$sorted_src_x_hdrs" \
|
||||
"$$awk_code" $(srcdir)/$(VC14_SRCTMPL) > $(VC14_SRCVCXPROJ) || { exit 1; };)
|
||||
"$$awk_code" $(srcdir)/$(VC12_SRCTMPL) > $(VC12_SRCVCXPROJ) || { exit 1; };)
|
||||
|
281
Makefile.dist
281
Makefile.dist
@ -5,11 +5,11 @@
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
# Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
# are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
@ -130,42 +130,6 @@ vc-x64: $(VC)
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release
|
||||
|
||||
vc-sspi: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) cfg=release WINDOWS_SSPI=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) cfg=release WINDOWS_SSPI=1
|
||||
|
||||
vc-x64-sspi: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release WINDOWS_SSPI=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release WINDOWS_SSPI=1
|
||||
|
||||
vc-idn: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) cfg=release USE_IDN=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) cfg=release USE_IDN=1
|
||||
|
||||
vc-x64-idn: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release USE_IDN=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release USE_IDN=1
|
||||
|
||||
vc-idn-sspi: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) cfg=release USE_IDN=1 WINDOWS_SSPI=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) cfg=release USE_IDN=1 WINDOWS_SSPI=1
|
||||
|
||||
vc-x64-idn-sspi: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release USE_IDN=1 WINDOWS_SSPI=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release USE_IDN=1 WINDOWS_SSPI=1
|
||||
|
||||
vc-zlib: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) cfg=release-zlib
|
||||
@ -178,233 +142,65 @@ vc-x64-zlib: $(VC)
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-zlib
|
||||
|
||||
vc-zlib-sspi: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) cfg=release-zlib WINDOWS_SSPI=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) cfg=release-zlib WINDOWS_SSPI=1
|
||||
|
||||
vc-x64-zlib-sspi: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-zlib WINDOWS_SSPI=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-zlib WINDOWS_SSPI=1
|
||||
|
||||
vc-zlib-idn: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) cfg=release-zlib USE_IDN=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) cfg=release-zlib USE_IDN=1
|
||||
|
||||
vc-x64-zlib-idn: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-zlib USE_IDN=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-zlib USE_IDN=1
|
||||
|
||||
vc-zlib-idn-sspi: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) cfg=release-zlib USE_IDN=1 WINDOWS_SSPI=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) cfg=release-zlib USE_IDN=1 WINDOWS_SSPI=1
|
||||
|
||||
vc-x64-zlib-idn-sspi: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-zlib USE_IDN=1 WINDOWS_SSPI=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-zlib USE_IDN=1 WINDOWS_SSPI=1
|
||||
|
||||
vc-ssl: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) cfg=release-ssl
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) cfg=release-ssl
|
||||
|
||||
vc-x64-ssl: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl
|
||||
|
||||
vc-ssl-sspi: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) cfg=release-ssl WINDOWS_SSPI=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) cfg=release-ssl WINDOWS_SSPI=1
|
||||
|
||||
vc-x64-ssl-sspi: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl WINDOWS_SSPI=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl WINDOWS_SSPI=1
|
||||
|
||||
vc-ssl-idn: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) cfg=release-ssl USE_IDN=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) cfg=release-ssl USE_IDN=1
|
||||
|
||||
vc-x64-ssl-idn: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl USE_IDN=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl USE_IDN=1
|
||||
|
||||
vc-ssl-idn-sspi: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) cfg=release-ssl USE_IDN=1 WINDOWS_SSPI=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) cfg=release-ssl USE_IDN=1 WINDOWS_SSPI=1
|
||||
|
||||
vc-x64-ssl-idn-sspi: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl USE_IDN=1 WINDOWS_SSPI=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl USE_IDN=1 WINDOWS_SSPI=1
|
||||
|
||||
vc-ssl-zlib: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) cfg=release-ssl-zlib
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) cfg=release-ssl-zlib
|
||||
|
||||
vc-x64-ssl-zlib: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl-zlib
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl-zlib
|
||||
|
||||
vc-ssl-zlib-sspi: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) cfg=release-ssl-zlib WINDOWS_SSPI=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) cfg=release-ssl-zlib WINDOWS_SSPI=1
|
||||
|
||||
vc-x64-ssl-zlib-sspi: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl-zlib WINDOWS_SSPI=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl-zlib WINDOWS_SSPI=1
|
||||
|
||||
vc-ssl-zlib-idn: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) cfg=release-ssl-zlib USE_IDN=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) cfg=release-ssl-zlib USE_IDN=1
|
||||
|
||||
vc-x64-ssl-zlib-idn: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl-zlib USE_IDN=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl-zlib USE_IDN=1
|
||||
|
||||
vc-ssl-zlib-idn-sspi: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) cfg=release-ssl-zlib USE_IDN=1 WINDOWS_SSPI=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) cfg=release-ssl-zlib USE_IDN=1 WINDOWS_SSPI=1
|
||||
|
||||
vc-x64-ssl-zlib-idn-sspi: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl-zlib USE_IDN=1 WINDOWS_SSPI=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl-zlib USE_IDN=1 WINDOWS_SSPI=1
|
||||
|
||||
vc-ssl-ssh2-zlib: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) cfg=release-ssl-ssh2-zlib
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) cfg=release-ssl-ssh2-zlib
|
||||
|
||||
vc-x64-ssl-ssh2-zlib: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl-ssh2-zlib
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl-ssh2-zlib
|
||||
|
||||
vc-ssl-ssh2-zlib-sspi: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) cfg=release-ssl-ssh2-zlib WINDOWS_SSPI=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) cfg=release-ssl-ssh2-zlib WINDOWS_SSPI=1
|
||||
|
||||
vc-x64-ssl-ssh2-zlib-sspi: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl-ssh2-zlib WINDOWS_SSPI=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl-ssh2-zlib WINDOWS_SSPI=1
|
||||
|
||||
vc-ssl-ssh2-zlib-idn: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) cfg=release-ssl-ssh2-zlib USE_IDN=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) cfg=release-ssl-ssh2-zlib USE_IDN=1
|
||||
|
||||
vc-x64-ssl-ssh2-zlib-idn: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl-ssh2-zlib USE_IDN=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl-ssh2-zlib USE_IDN=1
|
||||
|
||||
vc-ssl-ssh2-zlib-idn-sspi: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) cfg=release-ssl-ssh2-zlib USE_IDN=1 WINDOWS_SSPI=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) cfg=release-ssl-ssh2-zlib USE_IDN=1 WINDOWS_SSPI=1
|
||||
|
||||
vc-x64-ssl-ssh2-zlib-idn-sspi: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl-ssh2-zlib USE_IDN=1 WINDOWS_SSPI=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl-ssh2-zlib USE_IDN=1 WINDOWS_SSPI=1
|
||||
|
||||
vc-winssl: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) cfg=release-winssl WINDOWS_SSPI=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) cfg=release-winssl WINDOWS_SSPI=1
|
||||
|
||||
vc-x64-ssl: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl
|
||||
|
||||
vc-x64-winssl: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-winssl WINDOWS_SSPI=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-winssl WINDOWS_SSPI=1
|
||||
|
||||
vc-winssl-idn: $(VC)
|
||||
vc-ssl-zlib: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) cfg=release-winssl USE_IDN=1 WINDOWS_SSPI=1
|
||||
nmake /f Makefile.$(VC) cfg=release-ssl-zlib
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) cfg=release-winssl USE_IDN=1 WINDOWS_SSPI=1
|
||||
nmake /f Makefile.$(VC) cfg=release-ssl-zlib
|
||||
|
||||
vc-x64-winssl-idn: $(VC)
|
||||
vc-ssl-ssh2-zlib: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-winssl USE_IDN=1 WINDOWS_SSPI=1
|
||||
nmake /f Makefile.$(VC) cfg=release-ssl-ssh2-zlib
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-winssl USE_IDN=1 WINDOWS_SSPI=1
|
||||
nmake /f Makefile.$(VC) cfg=release-ssl-ssh2-zlib
|
||||
|
||||
vc-winssl-zlib: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) cfg=release-winssl-zlib WINDOWS_SSPI=1
|
||||
nmake /f Makefile.$(VC) cfg=release-winssl-zlib
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) cfg=release-winssl-zlib WINDOWS_SSPI=1
|
||||
nmake /f Makefile.$(VC) cfg=release-winssl-zlib
|
||||
|
||||
vc-x64-ssl-zlib: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl-zlib
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl-zlib
|
||||
|
||||
vc-x64-ssl-ssh2-zlib: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl-ssh2-zlib
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl-ssh2-zlib
|
||||
|
||||
vc-x64-winssl-zlib: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-winssl-zlib WINDOWS_SSPI=1
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-winssl-zlib
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-winssl-zlib WINDOWS_SSPI=1
|
||||
|
||||
vc-winssl-zlib-idn: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) cfg=release-winssl-zlib USE_IDN=1 WINDOWS_SSPI=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) cfg=release-winssl-zlib USE_IDN=1 WINDOWS_SSPI=1
|
||||
|
||||
vc-x64-winssl-zlib-idn: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-winssl-zlib USE_IDN=1 WINDOWS_SSPI=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-winssl-zlib USE_IDN=1 WINDOWS_SSPI=1
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-winssl-zlib
|
||||
|
||||
vc-ssl-dll: $(VC)
|
||||
cd lib
|
||||
@ -448,6 +244,12 @@ vc-zlib-dll: $(VC)
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) cfg=release-zlib-dll
|
||||
|
||||
vc-sspi: $(VC)
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) cfg=release WINDOWS_SSPI=1
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) cfg=release WINDOWS_SSPI=1
|
||||
|
||||
djgpp:
|
||||
$(MAKE) -C lib -f Makefile.dj
|
||||
$(MAKE) -C src -f Makefile.dj
|
||||
@ -566,17 +368,6 @@ src/Makefile.vc12: src/Makefile.vc6
|
||||
@echo "generate $@"
|
||||
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/ws2_32.lib/ws2_32.lib/g" -e "s/vc6/vc12/g" -e "s/VC6/VC12/g" src/Makefile.vc6 > src/Makefile.vc12
|
||||
|
||||
# VC14 makefiles are for use with VS2015
|
||||
vc14: lib/Makefile.vc14 src/Makefile.vc14
|
||||
|
||||
lib/Makefile.vc14: lib/Makefile.vc6
|
||||
@echo "generate $@"
|
||||
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/ws2_32.lib/ws2_32.lib/g" -e "s/vc6/vc14/g" -e "s/VC6/VC14/g" lib/Makefile.vc6 > lib/Makefile.vc14
|
||||
|
||||
src/Makefile.vc14: src/Makefile.vc6
|
||||
@echo "generate $@"
|
||||
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/ws2_32.lib/ws2_32.lib/g" -e "s/vc6/vc14/g" -e "s/VC6/VC14/g" src/Makefile.vc6 > src/Makefile.vc14
|
||||
|
||||
ca-bundle: lib/mk-ca-bundle.pl
|
||||
@echo "generate a fresh ca-bundle.crt"
|
||||
@perl $< -b -l -u lib/ca-bundle.crt
|
||||
|
8
README
8
README
@ -24,7 +24,7 @@ README
|
||||
CONTACT
|
||||
|
||||
If you have problems, questions, ideas or suggestions, please contact us
|
||||
by posting to a suitable mailing list. See https://curl.haxx.se/mail/
|
||||
by posting to a suitable mailing list. See http://curl.haxx.se/mail/
|
||||
|
||||
All contributors to the project are listed in the THANKS document.
|
||||
|
||||
@ -32,18 +32,18 @@ WEB SITE
|
||||
|
||||
Visit the curl web site for the latest news and downloads:
|
||||
|
||||
https://curl.haxx.se/
|
||||
http://curl.haxx.se/
|
||||
|
||||
GIT
|
||||
|
||||
To download the very latest source off the GIT server do this:
|
||||
|
||||
git clone https://github.com/curl/curl.git
|
||||
git clone git://github.com/bagder/curl.git
|
||||
|
||||
(you'll get a directory named curl created, filled with the source code)
|
||||
|
||||
NOTICE
|
||||
|
||||
Curl contains pieces of source code that is Copyright (c) 1998, 1999
|
||||
Kungliga Tekniska Högskolan. This notice is included here to comply with the
|
||||
Kungliga Tekniska Högskolan. This notice is included here to comply with the
|
||||
distribution terms.
|
||||
|
45
README.md
45
README.md
@ -1,45 +0,0 @@
|
||||
|
||||
Curl is a command line tool for transferring data specified with URL
|
||||
syntax. Find out how to use curl by reading [the curl.1 man
|
||||
page](https://curl.haxx.se/docs/manpage.html) or [the MANUAL
|
||||
document](https://curl.haxx.se/docs/manual.html). Find out how to install Curl
|
||||
by reading [the INSTALL document](https://curl.haxx.se/docs/install.html).
|
||||
|
||||
libcurl is the library curl is using to do its job. It is readily available to
|
||||
be used by your software. Read [the libcurl.3 man
|
||||
page](https://curl.haxx.se/libcurl/c/libcurl.html) to learn how!
|
||||
|
||||
You find answers to the most frequent questions we get in [the FAQ
|
||||
document](https://curl.haxx.se/docs/faq.html).
|
||||
|
||||
Study [the COPYING file](https://curl.haxx.se/docs/copyright.html) for
|
||||
distribution terms and similar. If you distribute curl binaries or other
|
||||
binaries that involve libcurl, you might enjoy [the LICENSE-MIXING
|
||||
document](https://curl.haxx.se/legal/licmix.html).
|
||||
|
||||
## CONTACT
|
||||
|
||||
If you have problems, questions, ideas or suggestions, please contact us by
|
||||
posting to a suitable [mailing list](https://curl.haxx.se/mail/).
|
||||
|
||||
All contributors to the project are listed in [the THANKS
|
||||
document](https://curl.haxx.se/docs/thanks.html).
|
||||
|
||||
## WEB SITE
|
||||
|
||||
Visit the [curl web site](https://curl.haxx.se/) for the latest news and
|
||||
downloads.
|
||||
|
||||
## GIT
|
||||
|
||||
To download the very latest source off the GIT server do this:
|
||||
|
||||
git clone https://github.com/curl/curl.git
|
||||
|
||||
(you'll get a directory named curl created, filled with the source code)
|
||||
|
||||
## NOTICE
|
||||
|
||||
Curl contains pieces of source code that is Copyright (c) 1998, 1999 Kungliga
|
||||
Tekniska Högskolan. This notice is included here to comply with the
|
||||
distribution terms.
|
237
RELEASE-NOTES
237
RELEASE-NOTES
@ -1,159 +1,116 @@
|
||||
Curl and libcurl 7.48.0
|
||||
Curl and libcurl 7.39.0
|
||||
|
||||
Public curl releases: 153
|
||||
Command line options: 179
|
||||
curl_easy_setopt() options: 221
|
||||
Public functions in libcurl: 61
|
||||
Contributors: 1364
|
||||
Public curl releases: 142
|
||||
Command line options: 162
|
||||
curl_easy_setopt() options: 208
|
||||
Public functions in libcurl: 58
|
||||
Contributors: 1216
|
||||
|
||||
This release includes the following changes:
|
||||
|
||||
o configure: --with-ca-fallback: use built-in TLS CA fallback [2]
|
||||
o TFTP: add --tftp-no-options to expose CURLOPT_TFTP_NO_OPTIONS [22]
|
||||
o getinfo: CURLINFO_TLS_SSL_PTR supersedes CURLINFO_TLS_SESSION [25]
|
||||
o added CODE_STYLE.md [47]
|
||||
o SSLv3 is disabled by default
|
||||
o CURLOPT_COOKIELIST: Added "RELOAD" command [5]
|
||||
o build: Added WinIDN build configuration options to Visual Studio projects
|
||||
o ssh: improve key file search
|
||||
o SSL: public key pinning. Use CURLOPT_PINNEDPUBLICKEY and --pinnedpubkey
|
||||
o vtls: remove QsoSSL support, use gskit!
|
||||
o mk-ca-bundle: added SHA-384 signature algorithm
|
||||
o docs: added many examples for libcurl opts and other doc improvements
|
||||
o build: Added VC ssh2 target to main Makefile
|
||||
o MinGW: Added support to build with nghttp2
|
||||
o NetWare: Added support to build with nghttp2
|
||||
o build: added Watcom support to build with WinSSL
|
||||
o build: Added optional specific version generation of VC project files
|
||||
|
||||
This release includes the following bugfixes:
|
||||
|
||||
o Proxy-Connection: stop sending this header by default [1]
|
||||
o os400: sync ILE/RPG definitions with latest public header files
|
||||
o cookies: allow spaces in cookie names, cut of trailing spaces [3]
|
||||
o tool_urlglob: Allow reserved dos device names (Windows) [4]
|
||||
o openssl: remove most BoringSSL #ifdefs [5]
|
||||
o tool_doswin: Support for literal path prefix \\?\
|
||||
o mbedtls: fix ALPN usage segfault [6]
|
||||
o mbedtls: fix memory leak when destroying SSL connection data [7]
|
||||
o nss: do not count enabled cipher-suites
|
||||
o examples/cookie_interface.c: add cleanup call
|
||||
o examples: adhere to curl code style
|
||||
o curlx_tvdiff: handle 32bit time_t overflows [8]
|
||||
o dist: ship buildconf.bat too
|
||||
o curl.1: --disable-{eprt,epsv} are ignored for IPv6 hosts [9]
|
||||
o generate.bat: Fix comment bug by removing old comments [10]
|
||||
o test1604: Add to Makefile.inc so it gets run
|
||||
o gtls: fix for builds lacking encrypted key file support [11]
|
||||
o SCP: use libssh2_scp_recv2 to support > 2GB files on windows [12]
|
||||
o CURLOPT_CONNECTTIMEOUT_MS.3: Fix example to use milliseconds option [13]
|
||||
o cookie: do not refuse cookies to localhost [14]
|
||||
o openssl: avoid direct PKEY access with OpenSSL 1.1.0 [15]
|
||||
o http: Don't break the header into chunks if HTTP/2 [16]
|
||||
o http2: don't decompress gzip decoding automatically [17]
|
||||
o curlx.c: i2s_ASN1_IA5STRING() clashes with an openssl function
|
||||
o curl.1: add a missing dash
|
||||
o curl.1: HTTP headers for --cookie must be Set-Cookie style [18]
|
||||
o CURLOPT_COOKIEFILE.3: HTTP headers must be Set-Cookie style [18]
|
||||
o curl_sasl: Fix memory leak in digest parser [19]
|
||||
o src/Makefile.m32: add CURL_{LD,C}FLAGS_EXTRAS support [20]
|
||||
o CURLOPT_DEBUGFUNCTION.3: Fix example
|
||||
o runtests: Fixed usage of %PWD on MinGW64 [21]
|
||||
o tests/sshserver.pl: use RSA instead of DSA for host auth [23]
|
||||
o multi_remove_handle: keep the timeout list until after disconnect [24]
|
||||
o Curl_read: check for activated HTTP/1 pipelining, not only requested
|
||||
o configure: warn on invalid ca bundle or path [26]
|
||||
o file: try reading from files with no size [27]
|
||||
o getinfo: Add support for mbedTLS TLS session info
|
||||
o formpost: fix memory leaks in AddFormData error branches [28]
|
||||
o makefile.m32: allow to pass .dll/.exe-specific LDFLAGS [29]
|
||||
o url: if Curl_done is premature then pipeline not in use [30]
|
||||
o cookie: remove redundant check [31]
|
||||
o cookie: Don't expire session cookies in remove_expired [32]
|
||||
o makefile.m32: fix to allow -ssh2-winssl combination [33]
|
||||
o checksrc.bat: Fixed cannot find perl if installed but not in path
|
||||
o build-openssl.bat: Fixed cannot find perl if installed but not in path
|
||||
o mbedtls: fix user-specified SSL protocol version
|
||||
o makefile.m32: add missing libs for static -winssl-ssh2 builds [34]
|
||||
o test46: change cookie expiry date [35]
|
||||
o pipeline: Sanity check pipeline pointer before accessing it [36]
|
||||
o openssl: use the correct OpenSSL/BoringSSL/LibreSSL in messages
|
||||
o ftp_done: clear tunnel_state when secondary socket closes [37]
|
||||
o opt-docs: fix heading macros [38]
|
||||
o imap/pop3/smtp: Fixed connections upgraded with TLS are not reused [39]
|
||||
o curl_multi_wait: never return -1 in 'numfds' [40]
|
||||
o url.c: fix clang warning: no newline at end of file
|
||||
o krb5: improved type handling to avoid clang compiler warnings
|
||||
o cookies: first n/v pair in Set-Cookie: is the cookie, then parameters [41]
|
||||
o multi: avoid blocking during CURLM_STATE_WAITPROXYCONNECT [42]
|
||||
o multi hash: ensure modulo performed on curl_socket_t [43]
|
||||
o curl: glob_range: no need to check unsigned variable for negative
|
||||
o easy: add check to malloc() when running event-based
|
||||
o CURLOPT_SSLENGINE.3: Only for OpenSSL built with engine support [44]
|
||||
o version: thread safety
|
||||
o openssl: verbose: show matching SAN pattern
|
||||
o openssl: adapt to OpenSSL 1.1.0 API breakage in ERR_remove_thread_state()
|
||||
o formdata.c: Fixed compilation warning
|
||||
o configure: use cpp -P when needed [45]
|
||||
o imap.c: Fixed compilation warning with /Wall enabled
|
||||
o config-w32.h: Fixed compilation warning when /Wall enabled
|
||||
o ftp/imap/pop3/smtp: Fixed compilation warning when /Wall enabled
|
||||
o build: Added missing Visual Studio filter files for VC10 onwards
|
||||
o easy: Remove poll failure check in easy_transfer
|
||||
o mbedtls: fix compiler warning
|
||||
o build-wolfssl: Update VS properties for wolfSSL v3.9.0
|
||||
o Fixed various compilation warnings when verbose strings disabled
|
||||
o curl_easy_duphandle: CURLOPT_COPYPOSTFIELDS read out of bounds [9]
|
||||
o openssl: build fix for versions < 0.9.8e [1]
|
||||
o newlines: fix mixed newlines to LF-only [2]
|
||||
o ntlm: Fixed HTTP proxy authentication when using Windows SSPI [3]
|
||||
o sasl_sspi: Fixed Unicode build [4]
|
||||
o file: reject paths using embedded %00
|
||||
o threaded-resolver: revert Curl_expire_latest() switch [6]
|
||||
o configure: allow --with-ca-path with PolarSSL too
|
||||
o HTTP/2: Fix busy loop when EOF is encountered
|
||||
o CURLOPT_CAPATH: return failure if set without backend support
|
||||
o nss: do not fail if a CRL is already cached
|
||||
o smtp: Fixed intermittent "SSL3_WRITE_PENDING: bad write retry" error
|
||||
o fixed 20+ nits/memory leaks identified by Coverity scans
|
||||
o curl_schannel.c: Fixed possible memory or handle leak
|
||||
o multi-uv.c: call curl_multi_info_read() better
|
||||
o Cmake: Check for OpenSSL before OpenLDAP
|
||||
o Cmake: Fix library list provided to cURL tests
|
||||
o Cmake: Avoid cycle directory dependencies
|
||||
o Cmake: Build with GSS-API libraries (MIT or Heimdal)
|
||||
o vtls: provide backend defines for internal source code
|
||||
o nss: fix a connection failure when FTPS handle is reused
|
||||
o tests/http_pipe.py: Python 3 support
|
||||
o cmake: build tool_hugehelp (ENABLE_MANUAL)
|
||||
o cmake: enable IPv6 by default if available
|
||||
o tests: move TESTCASES to Makefile.inc, add show for cmake
|
||||
o ntlm: Avoid unnecessary buffer allocation for SSPI based type-2 token
|
||||
o ntlm: Fixed empty/bad base-64 decoded buffer return codes
|
||||
o ntlm: Fixed empty type-2 decoded message info text
|
||||
o cmake: add CMake/Macros.cmake to the release tarball
|
||||
o cmake: add SUPPORT_FEATURES and SUPPORT_PROTOCOLS
|
||||
o cmake: use LIBCURL_VERSION from curlver.h
|
||||
o cmake: generate pkg-config and curl-config
|
||||
o fixed several superfluous variable assignements identified by cppcheck
|
||||
o cleanup of 'CURLcode result' return code
|
||||
o pipelining: only output "is not blacklisted" in debug builds
|
||||
o SSL: Remove SSLv3 from SSL default due to POODLE attack
|
||||
o gskit.c: remove SSLv3 from SSL default
|
||||
o darwinssl: detect possible future removal of SSLv3 from the framework
|
||||
o ntlm: Only define ntlm data structure when USE_NTLM is defined
|
||||
o ntlm: Return CURLcode from Curl_ntlm_core_mk_lm_hash()
|
||||
o ntlm: Return all errors from Curl_ntlm_core_mk_nt_hash()
|
||||
o sspi: Only call CompleteAuthToken() when complete is needed
|
||||
o http_negotiate: Fixed missing check for USE_SPNEGO
|
||||
o HTTP: return larger than 3 digit response codes too [7]
|
||||
o openssl: Check for NPN / ALPN via OpenSSL version number
|
||||
o openssl: enable NPN separately from ALPN
|
||||
o sasl_sspi: Allow DIGEST-MD5 to use current windows credentials
|
||||
o sspi: Return CURLE_LOGIN_DENIED on AcquireCredentialsHandle() failure
|
||||
o resume: consider a resume from [content-length] to be OK [8]
|
||||
o sasl: Fixed Kerberos V5 inclusion when CURL_DISABLE_CRYPTO_AUTH is used
|
||||
o build-openssl.bat: Fix x64 release build
|
||||
o cmake: drop _BSD_SOURCE macro usage
|
||||
o cmake: fix gethostby{addr,name}_r in CurlTests
|
||||
o cmake: clean OtherTests, fixing -Werror
|
||||
o cmake: fix struct sockaddr_storage check
|
||||
o Curl_single_getsock: fix hold/pause sock handling
|
||||
o SSL: PolarSSL default min SSL version TLS 1.0
|
||||
o cmake: fix ZLIB_INCLUDE_DIRS use [10]
|
||||
o buildconf: stop checking for libtool
|
||||
|
||||
This release includes the following known bugs:
|
||||
|
||||
o see docs/KNOWN_BUGS (https://curl.haxx.se/docs/knownbugs.html)
|
||||
o see docs/KNOWN_BUGS (http://curl.haxx.se/docs/knownbugs.html)
|
||||
|
||||
This release would not have looked like this without help, code, reports and
|
||||
advice from friends like these:
|
||||
|
||||
Anders Bakken, Brad Fitzpatrick, Clint Clayton, Dan Fandrich,
|
||||
Daniel Stenberg, David Benjamin, David Byron, Emil Lerner, Eric S. Raymond,
|
||||
Gisle Vanem, Jaime Fullaondo, Jeffrey Walton, Jesse Tan, Justin Ehlert,
|
||||
Kamil Dudka, Kazuho Oku, Ludwig Nussel, Maksim Kuzevanov, Michael König,
|
||||
Oliver Graute, Patrick Monnerat, Rafael Antonio, Ray Satiro, Seth Mos,
|
||||
Shine Fan, Steve Holme, Tatsuhiro Tsujikawa, Timotej Lazar, Tim Rühsen,
|
||||
Viktor Szakáts,
|
||||
(30 contributors)
|
||||
Askar Safin, Balaji Salunke, Bill Nagel, Bruno Thomsen, Carlo Wood,
|
||||
Catalin Patulea, Dan Fandrich, Daniel Stenberg, Dimitar Boevski, Fabian Keil,
|
||||
Guenter Knauf, Jakub Zakrzewski, Jeremy Lin, Jonathan Cardoso Machado,
|
||||
Kamil Dudka, K. R. Walker, Luan Cestari, Lucas Pardue, Marcel Raad,
|
||||
Marc Hoersken, Michael Wallner, Nick Zitzmann, Patrick Monnerat,
|
||||
Paul Howarth, Peter Wu, Ray Satiro, Steve Holme, Symeon Paraschoudis,
|
||||
Tatsuhiro Tsujikawa, Ulrich Telle, Viktor Szakáts, Waldek Kozba,
|
||||
Yousuke Kimoto,
|
||||
|
||||
Thanks! (and sorry if I forgot to mention someone)
|
||||
|
||||
References to bug reports and discussions on issues:
|
||||
|
||||
[1] = https://curl.haxx.se/bug/?i=633
|
||||
[2] = https://curl.haxx.se/bug/?i=569
|
||||
[3] = https://curl.haxx.se/bug/?i=639
|
||||
[4] = https://github.com/curl/curl/commit/4520534#commitcomment-15954863
|
||||
[5] = https://curl.haxx.se/bug/?i=640
|
||||
[6] = https://curl.haxx.se/bug/?i=642
|
||||
[7] = https://curl.haxx.se/bug/?i=626
|
||||
[8] = https://curl.haxx.se/bug/?i=646
|
||||
[9] = https://bugzilla.redhat.com/1305970
|
||||
[10] = https://curl.haxx.se/bug/?i=649
|
||||
[11] = https://curl.haxx.se/bug/?i=651
|
||||
[12] = https://curl.haxx.se/bug/?i=451
|
||||
[13] = https://curl.haxx.se/bug/?i=653
|
||||
[14] = https://curl.haxx.se/bug/?i=658
|
||||
[15] = https://curl.haxx.se/bug/?i=650
|
||||
[16] = https://curl.haxx.se/bug/?i=659
|
||||
[17] = https://curl.haxx.se/bug/?i=661
|
||||
[18] = https://curl.haxx.se/bug/?i=666
|
||||
[19] = https://curl.haxx.se/bug/?i=667
|
||||
[20] = https://curl.haxx.se/bug/?i=670
|
||||
[21] = https://curl.haxx.se/bug/?i=672
|
||||
[22] = https://curl.haxx.se/bug/?i=481
|
||||
[23] = https://curl.haxx.se/bug/?i=676
|
||||
[24] = https://curl.haxx.se/mail/lib-2016-02/0097.html
|
||||
[25] = https://curl.haxx.se/libcurl/c/CURLINFO_TLS_SSL_PTR.html
|
||||
[26] = https://curl.haxx.se/bug/?i=404
|
||||
[27] = https://curl.haxx.se/bug/?i=681
|
||||
[28] = https://curl.haxx.se/bug/?i=688
|
||||
[29] = https://curl.haxx.se/bug/?i=689
|
||||
[30] = https://curl.haxx.se/bug/?i=690
|
||||
[31] = https://curl.haxx.se/bug/?i=695
|
||||
[32] = https://curl.haxx.se/bug/?i=697
|
||||
[33] = https://curl.haxx.se/bug/?i=692
|
||||
[34] = https://curl.haxx.se/bug/?i=693
|
||||
[35] = https://curl.haxx.se/bug/?i=697
|
||||
[36] = https://curl.haxx.se/bug/?i=704
|
||||
[37] = https://curl.haxx.se/bug/?i=701
|
||||
[38] = https://curl.haxx.se/bug/?i=705
|
||||
[39] = https://curl.haxx.se/bug/?i=422
|
||||
[40] = https://curl.haxx.se/bug/?i=707
|
||||
[41] = https://curl.haxx.se/bug/?i=709
|
||||
[42] = https://curl.haxx.se/bug/?i=703
|
||||
[43] = https://curl.haxx.se/bug/?i=712
|
||||
[44] = https://curl.haxx.se/mail/lib-2016-03/0150.html
|
||||
[45] = https://curl.haxx.se/bug/?i=719
|
||||
[47] = https://curl.haxx.se/dev/code-style.html
|
||||
[1] = http://curl.haxx.se/mail/lib-2014-09/0064.html
|
||||
[2] = http://curl.haxx.se/mail/lib-2014-09/0075.html
|
||||
[3] = http://curl.haxx.se/mail/lib-2014-08/0273.html
|
||||
[4] = http://curl.haxx.se/bug/view.cgi?id=1422
|
||||
[5] = http://curl.haxx.se/libcurl/c/CURLOPT_COOKIELIST.html
|
||||
[6] = http://curl.haxx.se/bug/view.cgi?id=1426
|
||||
[7] = http://curl.haxx.se/bug/view.cgi?id=1441
|
||||
[8] = http://curl.haxx.se/bug/view.cgi?id=1443
|
||||
[9] = http://curl.haxx.se/docs/adv_20141105.html
|
||||
[10] = https://github.com/bagder/curl/pull/123
|
||||
|
4
TODO-RELEASE
Normal file
4
TODO-RELEASE
Normal file
@ -0,0 +1,4 @@
|
||||
To be addressed in ...
|
||||
=======================
|
||||
|
||||
327 -
|
203
acinclude.m4
203
acinclude.m4
@ -5,11 +5,11 @@
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
# Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
# are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
@ -20,6 +20,7 @@
|
||||
#
|
||||
#***************************************************************************
|
||||
|
||||
|
||||
dnl CURL_CHECK_DEF (SYMBOL, [INCLUDES], [SILENT])
|
||||
dnl -------------------------------------------------
|
||||
dnl Use the C preprocessor to find out if the given object-style symbol
|
||||
@ -30,10 +31,6 @@ dnl result in a set of double-quoted strings the returned expansion will
|
||||
dnl actually be a single double-quoted string concatenating all them.
|
||||
|
||||
AC_DEFUN([CURL_CHECK_DEF], [
|
||||
AC_REQUIRE([CURL_CPP_P])dnl
|
||||
OLDCPPFLAGS=$CPPFLAGS
|
||||
# CPPPFLAGS comes from CURL_CPP_P
|
||||
CPPFLAGS="$CPPPFLAGS"
|
||||
AS_VAR_PUSHDEF([ac_HaveDef], [curl_cv_have_def_$1])dnl
|
||||
AS_VAR_PUSHDEF([ac_Def], [curl_cv_def_$1])dnl
|
||||
if test -z "$SED"; then
|
||||
@ -70,7 +67,6 @@ CURL_DEF_TOKEN $1
|
||||
fi
|
||||
AS_VAR_POPDEF([ac_Def])dnl
|
||||
AS_VAR_POPDEF([ac_HaveDef])dnl
|
||||
CPPFLAGS=$OLDCPPFLAGS
|
||||
])
|
||||
|
||||
|
||||
@ -1855,10 +1851,8 @@ AC_DEFUN([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC], [
|
||||
AC_REQUIRE([AC_HEADER_TIME])dnl
|
||||
AC_CHECK_HEADERS(sys/types.h sys/time.h time.h)
|
||||
AC_MSG_CHECKING([for monotonic clock_gettime])
|
||||
#
|
||||
if test "x$dontwant_rt" == "xno" ; then
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
@ -1872,18 +1866,17 @@ AC_DEFUN([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC], [
|
||||
#include <time.h>
|
||||
#endif
|
||||
#endif
|
||||
]],[[
|
||||
struct timespec ts;
|
||||
(void)clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
ac_cv_func_clock_gettime="yes"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
ac_cv_func_clock_gettime="no"
|
||||
])
|
||||
fi
|
||||
]],[[
|
||||
struct timespec ts;
|
||||
(void)clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
ac_cv_func_clock_gettime="yes"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
ac_cv_func_clock_gettime="no"
|
||||
])
|
||||
dnl Definition of HAVE_CLOCK_GETTIME_MONOTONIC is intentionally postponed
|
||||
dnl until library linking and run-time checks for clock_gettime succeed.
|
||||
])
|
||||
@ -2459,6 +2452,23 @@ AC_DEFUN([CURL_CHECK_FUNC_SELECT], [
|
||||
])
|
||||
|
||||
|
||||
# This is only a temporary fix. This macro is here to replace the broken one
|
||||
# delivered by the automake project (including the 1.9.6 release). As soon as
|
||||
# they ship a working version we SHOULD remove this work-around.
|
||||
|
||||
AC_DEFUN([AM_MISSING_HAS_RUN],
|
||||
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
test x"${MISSING+set}" = xset || MISSING="\${SHELL} \"$am_aux_dir/missing\""
|
||||
# Use eval to expand $SHELL
|
||||
if eval "$MISSING --run true"; then
|
||||
am_missing_run="$MISSING --run "
|
||||
else
|
||||
am_missing_run=
|
||||
AC_MSG_WARN([`missing' script is too old or missing])
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
dnl CURL_VERIFY_RUNTIMELIBS
|
||||
dnl -------------------------------------------------
|
||||
dnl Verify that the shared libs found so far can be used when running
|
||||
@ -2574,8 +2584,7 @@ AC_DEFUN([CURL_CHECK_CA_BUNDLE], [
|
||||
AC_MSG_CHECKING([default CA cert bundle/path])
|
||||
|
||||
AC_ARG_WITH(ca-bundle,
|
||||
AC_HELP_STRING([--with-ca-bundle=FILE],
|
||||
[Path to a file containing CA certificates (example: /etc/ca-bundle.crt)])
|
||||
AC_HELP_STRING([--with-ca-bundle=FILE], [File name to use as CA bundle])
|
||||
AC_HELP_STRING([--without-ca-bundle], [Don't use a default CA bundle]),
|
||||
[
|
||||
want_ca="$withval"
|
||||
@ -2585,11 +2594,7 @@ AC_HELP_STRING([--without-ca-bundle], [Don't use a default CA bundle]),
|
||||
],
|
||||
[ want_ca="unset" ])
|
||||
AC_ARG_WITH(ca-path,
|
||||
AC_HELP_STRING([--with-ca-path=DIRECTORY],
|
||||
[Path to a directory containing CA certificates stored individually, with \
|
||||
their filenames in a hash format. This option can be used with OpenSSL, \
|
||||
GnuTLS and PolarSSL backends. Refer to OpenSSL c_rehash for details. \
|
||||
(example: /etc/certificates)])
|
||||
AC_HELP_STRING([--with-ca-path=DIRECTORY], [Directory to use as CA path])
|
||||
AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]),
|
||||
[
|
||||
want_capath="$withval"
|
||||
@ -2599,23 +2604,18 @@ AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]),
|
||||
],
|
||||
[ want_capath="unset"])
|
||||
|
||||
ca_warning=" (warning: certs not found)"
|
||||
capath_warning=" (warning: certs not found)"
|
||||
check_capath=""
|
||||
|
||||
if test "x$want_ca" != "xno" -a "x$want_ca" != "xunset" -a \
|
||||
"x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then
|
||||
dnl both given
|
||||
ca="$want_ca"
|
||||
capath="$want_capath"
|
||||
AC_MSG_ERROR([Can't specify both --with-ca-bundle and --with-ca-path.])
|
||||
elif test "x$want_ca" != "xno" -a "x$want_ca" != "xunset"; then
|
||||
dnl --with-ca-bundle given
|
||||
ca="$want_ca"
|
||||
capath="no"
|
||||
elif test "x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then
|
||||
dnl --with-ca-path given
|
||||
if test "x$OPENSSL_ENABLED" != "x1" -a "x$GNUTLS_ENABLED" != "x1" -a "x$POLARSSL_ENABLED" != "x1"; then
|
||||
AC_MSG_ERROR([--with-ca-path only works with OpenSSL, GnuTLS or PolarSSL])
|
||||
if test "x$OPENSSL_ENABLED" != "x1" -a "x$POLARSSL_ENABLED" != "x1"; then
|
||||
AC_MSG_ERROR([--with-ca-path only works with openSSL or PolarSSL])
|
||||
fi
|
||||
capath="$want_capath"
|
||||
ca="no"
|
||||
@ -2651,7 +2651,12 @@ AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]),
|
||||
fi
|
||||
if test "x$want_capath" = "xunset" -a "x$ca" = "xno" -a \
|
||||
"x$OPENSSL_ENABLED" = "x1"; then
|
||||
check_capath="/etc/ssl/certs/"
|
||||
for a in /etc/ssl/certs/; do
|
||||
if test -d "$a" && ls "$a"/[[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]].0 >/dev/null 2>/dev/null; then
|
||||
capath="$a"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
else
|
||||
dnl no option given and cross-compiling
|
||||
@ -2659,62 +2664,18 @@ AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]),
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$ca" = "xno" || test -f "$ca"; then
|
||||
ca_warning=""
|
||||
fi
|
||||
|
||||
if test "x$capath" != "xno"; then
|
||||
check_capath="$capath"
|
||||
fi
|
||||
|
||||
if test ! -z "$check_capath"; then
|
||||
for a in "$check_capath"; do
|
||||
if test -d "$a" && ls "$a"/[[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]].0 >/dev/null 2>/dev/null; then
|
||||
if test "x$capath" = "xno"; then
|
||||
capath="$a"
|
||||
fi
|
||||
capath_warning=""
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if test "x$capath" = "xno"; then
|
||||
capath_warning=""
|
||||
fi
|
||||
|
||||
if test "x$ca" != "xno"; then
|
||||
CURL_CA_BUNDLE='"'$ca'"'
|
||||
AC_DEFINE_UNQUOTED(CURL_CA_BUNDLE, "$ca", [Location of default ca bundle])
|
||||
AC_SUBST(CURL_CA_BUNDLE)
|
||||
AC_MSG_RESULT([$ca])
|
||||
fi
|
||||
if test "x$capath" != "xno"; then
|
||||
elif test "x$capath" != "xno"; then
|
||||
CURL_CA_PATH="\"$capath\""
|
||||
AC_DEFINE_UNQUOTED(CURL_CA_PATH, "$capath", [Location of default ca path])
|
||||
AC_MSG_RESULT([$capath (capath)])
|
||||
fi
|
||||
if test "x$ca" = "xno" && test "x$capath" = "xno"; then
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([whether to use builtin CA store of SSL library])
|
||||
AC_ARG_WITH(ca-fallback,
|
||||
AC_HELP_STRING([--with-ca-fallback], [Use the built in CA store of the SSL library])
|
||||
AC_HELP_STRING([--without-ca-fallback], [Don't use the built in CA store of the SSL library]),
|
||||
[
|
||||
if test "x$with_ca_fallback" != "xyes" -a "x$with_ca_fallback" != "xno"; then
|
||||
AC_MSG_ERROR([--with-ca-fallback only allows yes or no as parameter])
|
||||
fi
|
||||
],
|
||||
[ with_ca_fallback="no"])
|
||||
AC_MSG_RESULT([$with_ca_fallback])
|
||||
if test "x$with_ca_fallback" = "xyes"; then
|
||||
if test "x$OPENSSL_ENABLED" != "x1" -a "x$GNUTLS_ENABLED" != "x1"; then
|
||||
AC_MSG_ERROR([--with-ca-fallback only works with OpenSSL or GnuTLS])
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED(CURL_CA_FALLBACK, 1, [define "1" to use built in CA store of SSL library ])
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
@ -2887,6 +2848,7 @@ AC_DEFUN([CURL_CONFIGURE_CURL_OFF_T], [
|
||||
#
|
||||
x_LP64_long=""
|
||||
x_LP32_long=""
|
||||
x_LP16_long=""
|
||||
#
|
||||
if test "$ac_cv_sizeof_long" -eq "8" &&
|
||||
test "$ac_cv_sizeof_voidp" -ge "8"; then
|
||||
@ -2894,6 +2856,9 @@ AC_DEFUN([CURL_CONFIGURE_CURL_OFF_T], [
|
||||
elif test "$ac_cv_sizeof_long" -eq "4" &&
|
||||
test "$ac_cv_sizeof_voidp" -ge "4"; then
|
||||
x_LP32_long="long"
|
||||
elif test "$ac_cv_sizeof_long" -eq "2" &&
|
||||
test "$ac_cv_sizeof_voidp" -ge "2"; then
|
||||
x_LP16_long="long"
|
||||
fi
|
||||
#
|
||||
dnl DO_CURL_OFF_T_CHECK results are stored in next 3 vars
|
||||
@ -2927,6 +2892,17 @@ AC_DEFUN([CURL_CONFIGURE_CURL_OFF_T], [
|
||||
done
|
||||
AC_MSG_RESULT([$curl_typeof_curl_off_t])
|
||||
fi
|
||||
if test "$curl_typeof_curl_off_t" = "unknown"; then
|
||||
AC_MSG_CHECKING([for 16-bit curl_off_t data type])
|
||||
for t2 in \
|
||||
"$x_LP16_long" \
|
||||
'int16_t' \
|
||||
'__int16' \
|
||||
'int' ; do
|
||||
DO_CURL_OFF_T_CHECK([$t2], [2])
|
||||
done
|
||||
AC_MSG_RESULT([$curl_typeof_curl_off_t])
|
||||
fi
|
||||
if test "$curl_typeof_curl_off_t" = "unknown"; then
|
||||
AC_MSG_ERROR([cannot find data type for curl_off_t.])
|
||||
fi
|
||||
@ -3087,14 +3063,12 @@ dnl Optionally PKG_CONFIG_LIBDIR may be given as $pcdir.
|
||||
dnl
|
||||
|
||||
AC_DEFUN([CURL_CHECK_PKGCONFIG], [
|
||||
if test -n "$PKG_CONFIG"; then
|
||||
PKGCONFIG="$PKG_CONFIG"
|
||||
else
|
||||
AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no],
|
||||
[$PATH:/usr/bin:/usr/local/bin])
|
||||
fi
|
||||
|
||||
if test "x$PKGCONFIG" != "xno"; then
|
||||
PKGCONFIG="no"
|
||||
|
||||
AC_PATH_TOOL( PKGCONFIG, pkg-config, no, $PATH:/usr/bin:/usr/local/bin)
|
||||
|
||||
if test x$PKGCONFIG != xno; then
|
||||
AC_MSG_CHECKING([for $1 options with pkg-config])
|
||||
dnl ask pkg-config about $1
|
||||
itexists=`CURL_EXPORT_PCDIR([$2]) dnl
|
||||
@ -3151,48 +3125,3 @@ use vars qw(
|
||||
1;
|
||||
_EOF
|
||||
])
|
||||
|
||||
dnl CURL_CPP_P
|
||||
dnl
|
||||
dnl Check if $cpp -P should be used for extract define values due to gcc 5
|
||||
dnl splitting up strings and defines between line outputs. gcc by default
|
||||
dnl (without -P) will show TEST EINVAL TEST as
|
||||
dnl
|
||||
dnl # 13 "conftest.c"
|
||||
dnl TEST
|
||||
dnl # 13 "conftest.c" 3 4
|
||||
dnl 22
|
||||
dnl # 13 "conftest.c"
|
||||
dnl TEST
|
||||
|
||||
AC_DEFUN([CURL_CPP_P], [
|
||||
AC_MSG_CHECKING([if cpp -P is needed])
|
||||
AC_EGREP_CPP([TEST.*TEST], [
|
||||
#include <errno.h>
|
||||
TEST EINVAL TEST
|
||||
], [cpp=no], [cpp=yes])
|
||||
AC_MSG_RESULT([$cpp])
|
||||
|
||||
dnl we need cpp -P so check if it works then
|
||||
if test "x$cpp" = "xyes"; then
|
||||
AC_MSG_CHECKING([if cpp -P works])
|
||||
OLDCPPFLAGS=$CPPFLAGS
|
||||
CPPFLAGS="$CPPFLAGS -P"
|
||||
AC_EGREP_CPP([TEST.*TEST], [
|
||||
#include <errno.h>
|
||||
TEST EINVAL TEST
|
||||
], [cpp_p=yes], [cpp_p=no])
|
||||
AC_MSG_RESULT([$cpp_p])
|
||||
|
||||
if test "x$cpp_p" = "xno"; then
|
||||
AC_MSG_WARN([failed to figure out cpp -P alternative])
|
||||
# without -P
|
||||
CPPPFLAGS=$OLDCPPFLAGS
|
||||
else
|
||||
# with -P
|
||||
CPPPFLAGS=$CPPFLAGS
|
||||
fi
|
||||
dnl restore CPPFLAGS
|
||||
CPPFLAGS=$OLDCPPFLAGS
|
||||
fi
|
||||
])
|
||||
|
35
appveyor.yml
35
appveyor.yml
@ -1,35 +0,0 @@
|
||||
version: 7.47.0.{build}
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- PRJ_GEN: "Visual Studio 11 2012 Win64"
|
||||
BDIR: msvc2012
|
||||
PRJ_CFG: Release
|
||||
OPENSSL: OFF
|
||||
- PRJ_GEN: "Visual Studio 12 2013 Win64"
|
||||
BDIR: msvc2013
|
||||
PRJ_CFG: Release
|
||||
OPENSSL: OFF
|
||||
- PRJ_GEN: "Visual Studio 14 2015 Win64"
|
||||
BDIR: msvc2015
|
||||
PRJ_CFG: Release
|
||||
OPENSSL: OFF
|
||||
- PRJ_GEN: "Visual Studio 11 2012 Win64"
|
||||
BDIR: msvc2012
|
||||
PRJ_CFG: Release
|
||||
OPENSSL: ON
|
||||
- PRJ_GEN: "Visual Studio 12 2013 Win64"
|
||||
BDIR: msvc2013
|
||||
PRJ_CFG: Release
|
||||
OPENSSL: ON
|
||||
- PRJ_GEN: "Visual Studio 14 2015 Win64"
|
||||
BDIR: msvc2015
|
||||
PRJ_CFG: Release
|
||||
OPENSSL: ON
|
||||
|
||||
|
||||
build_script:
|
||||
- mkdir build.%BDIR%
|
||||
- cd build.%BDIR%
|
||||
- cmake .. -G"%PRJ_GEN%" -DCMAKE_USE_OPENSSL=%OPENSSL%
|
||||
- cmake --build . --config %PRJ_CFG% --clean-first
|
@ -10,7 +10,7 @@
|
||||
#
|
||||
# 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.
|
||||
# are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
@ -318,8 +318,6 @@ for fname in .deps \
|
||||
ltsugar.m4 \
|
||||
ltversion.m4 \
|
||||
lt~obsolete.m4 \
|
||||
missing \
|
||||
install-sh \
|
||||
stamp-h1 \
|
||||
stamp-h2 \
|
||||
stamp-h3 ; do
|
||||
@ -331,7 +329,7 @@ done
|
||||
#
|
||||
|
||||
echo "buildconf: running libtoolize"
|
||||
${libtoolize} --copy --force || die "libtoolize command failed"
|
||||
${libtoolize} --copy --automake --force || die "libtoolize command failed"
|
||||
|
||||
# When using libtool 1.5.X (X < 26) we copy libtool.m4 to our local m4
|
||||
# subdirectory and this local copy is patched to fix some warnings that
|
||||
|
372
buildconf.bat
372
buildconf.bat
@ -1,350 +1,38 @@
|
||||
@echo off
|
||||
rem ***************************************************************************
|
||||
rem * _ _ ____ _
|
||||
rem * Project ___| | | | _ \| |
|
||||
rem * / __| | | | |_) | |
|
||||
rem * | (__| |_| | _ <| |___
|
||||
rem * \___|\___/|_| \_\_____|
|
||||
rem *
|
||||
rem * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
rem *
|
||||
rem * This software is licensed as described in the file COPYING, which
|
||||
rem * you should have received as part of this distribution. The terms
|
||||
rem * are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
rem *
|
||||
rem * You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
rem * copies of the Software, and permit persons to whom the Software is
|
||||
rem * furnished to do so, under the terms of the COPYING file.
|
||||
rem *
|
||||
rem * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
rem * KIND, either express or implied.
|
||||
rem *
|
||||
rem ***************************************************************************
|
||||
REM
|
||||
REM
|
||||
REM This batch file must be used to set up a git tree to build on
|
||||
REM systems where there is no autotools support (i.e. Microsoft).
|
||||
REM
|
||||
REM This file is not included nor needed for curl's release
|
||||
REM archives, neither for curl's daily snapshot archives.
|
||||
|
||||
rem NOTES
|
||||
rem
|
||||
rem This batch file must be used to set up a git tree to build on systems where
|
||||
rem there is no autotools support (i.e. DOS and Windows).
|
||||
rem
|
||||
if exist GIT-INFO goto start_doing
|
||||
ECHO ERROR: This file shall only be used with a curl git tree checkout.
|
||||
goto end_all
|
||||
:start_doing
|
||||
|
||||
:begin
|
||||
rem Set our variables
|
||||
if "%OS%" == "Windows_NT" setlocal
|
||||
set MODE=GENERATE
|
||||
REM create tool_hugehelp.c
|
||||
if not exist src\tool_hugehelp.c.cvs goto end_hugehelp_c
|
||||
copy /Y src\tool_hugehelp.c.cvs src\tool_hugehelp.c
|
||||
:end_hugehelp_c
|
||||
|
||||
rem Switch to this batch file's directory
|
||||
cd /d "%~0\.." 1>NUL 2>&1
|
||||
REM create Makefile
|
||||
if not exist Makefile.dist goto end_makefile
|
||||
copy /Y Makefile.dist Makefile
|
||||
:end_makefile
|
||||
|
||||
rem Check we are running from a curl git repository
|
||||
if not exist GIT-INFO goto norepo
|
||||
REM create curlbuild.h
|
||||
if not exist include\curl\curlbuild.h.dist goto end_curlbuild_h
|
||||
copy /Y include\curl\curlbuild.h.dist include\curl\curlbuild.h
|
||||
:end_curlbuild_h
|
||||
|
||||
rem Detect programs. HAVE_<PROGNAME>
|
||||
rem When not found the variable is set undefined. The undefined pattern
|
||||
rem allows for statements like "if not defined HAVE_PERL (command)"
|
||||
groff --version <NUL 1>NUL 2>&1
|
||||
if errorlevel 1 (set HAVE_GROFF=) else (set HAVE_GROFF=Y)
|
||||
nroff --version <NUL 1>NUL 2>&1
|
||||
if errorlevel 1 (set HAVE_NROFF=) else (set HAVE_NROFF=Y)
|
||||
perl --version <NUL 1>NUL 2>&1
|
||||
if errorlevel 1 (set HAVE_PERL=) else (set HAVE_PERL=Y)
|
||||
gzip --version <NUL 1>NUL 2>&1
|
||||
if errorlevel 1 (set HAVE_GZIP=) else (set HAVE_GZIP=Y)
|
||||
REM setup c-ares git tree
|
||||
if not exist ares\buildconf.bat goto end_c_ares
|
||||
cd ares
|
||||
call buildconf.bat
|
||||
cd ..
|
||||
:end_c_ares
|
||||
|
||||
:parseArgs
|
||||
if "%~1" == "" goto start
|
||||
:end_all
|
||||
|
||||
if /i "%~1" == "-clean" (
|
||||
set MODE=CLEAN
|
||||
) else if /i "%~1" == "-?" (
|
||||
goto syntax
|
||||
) else if /i "%~1" == "-h" (
|
||||
goto syntax
|
||||
) else if /i "%~1" == "-help" (
|
||||
goto syntax
|
||||
) else (
|
||||
goto unknown
|
||||
)
|
||||
|
||||
shift & goto parseArgs
|
||||
|
||||
:start
|
||||
if "%MODE%" == "GENERATE" (
|
||||
echo.
|
||||
echo Generating prerequisite files
|
||||
|
||||
call :generate
|
||||
if errorlevel 4 goto nogencurlbuild
|
||||
if errorlevel 3 goto nogenhugehelp
|
||||
if errorlevel 2 goto nogenmakefile
|
||||
if errorlevel 1 goto warning
|
||||
|
||||
) else (
|
||||
echo.
|
||||
echo Removing prerequisite files
|
||||
|
||||
call :clean
|
||||
if errorlevel 3 goto nocleancurlbuild
|
||||
if errorlevel 2 goto nocleanhugehelp
|
||||
if errorlevel 1 goto nocleanmakefile
|
||||
)
|
||||
|
||||
goto success
|
||||
|
||||
rem Main generate function.
|
||||
rem
|
||||
rem Returns:
|
||||
rem
|
||||
rem 0 - success
|
||||
rem 1 - success with simplified tool_hugehelp.c
|
||||
rem 2 - failed to generate Makefile
|
||||
rem 3 - failed to generate tool_hugehelp.c
|
||||
rem 4 - failed to generate curlbuild.h
|
||||
rem
|
||||
:generate
|
||||
if "%OS%" == "Windows_NT" setlocal
|
||||
set BASIC_HUGEHELP=0
|
||||
|
||||
rem Create Makefile
|
||||
echo * %CD%\Makefile
|
||||
if exist Makefile.dist (
|
||||
copy /Y Makefile.dist Makefile 1>NUL 2>&1
|
||||
if errorlevel 1 (
|
||||
if "%OS%" == "Windows_NT" endlocal
|
||||
exit /B 2
|
||||
)
|
||||
)
|
||||
|
||||
rem Create tool_hugehelp.c
|
||||
echo * %CD%\src\tool_hugehelp.c
|
||||
call :genHugeHelp
|
||||
if errorlevel 2 (
|
||||
if "%OS%" == "Windows_NT" endlocal
|
||||
exit /B 3
|
||||
)
|
||||
if errorlevel 1 (
|
||||
set BASIC_HUGEHELP=1
|
||||
)
|
||||
cmd /c exit 0
|
||||
|
||||
rem Create curlbuild.h
|
||||
echo * %CD%\include\curl\curlbuild.h
|
||||
if exist include\curl\curlbuild.h.dist (
|
||||
copy /Y include\curl\curlbuild.h.dist include\curl\curlbuild.h 1>NUL 2>&1
|
||||
if errorlevel 1 (
|
||||
if "%OS%" == "Windows_NT" endlocal
|
||||
exit /B 4
|
||||
)
|
||||
)
|
||||
|
||||
rem Setup c-ares git tree
|
||||
if exist ares\buildconf.bat (
|
||||
echo.
|
||||
echo Configuring c-ares build environment
|
||||
cd ares
|
||||
call buildconf.bat
|
||||
cd ..
|
||||
)
|
||||
|
||||
if "%BASIC_HUGEHELP%" == "1" (
|
||||
if "%OS%" == "Windows_NT" endlocal
|
||||
exit /B 1
|
||||
)
|
||||
|
||||
if "%OS%" == "Windows_NT" endlocal
|
||||
exit /B 0
|
||||
|
||||
rem Main clean function.
|
||||
rem
|
||||
rem Returns:
|
||||
rem
|
||||
rem 0 - success
|
||||
rem 1 - failed to clean Makefile
|
||||
rem 2 - failed to clean tool_hugehelp.c
|
||||
rem 3 - failed to clean curlbuild.h
|
||||
rem
|
||||
:clean
|
||||
rem Remove Makefile
|
||||
echo * %CD%\Makefile
|
||||
if exist Makefile (
|
||||
del Makefile 2>NUL
|
||||
if exist Makefile (
|
||||
exit /B 1
|
||||
)
|
||||
)
|
||||
|
||||
rem Remove tool_hugehelp.c
|
||||
echo * %CD%\src\tool_hugehelp.c
|
||||
if exist src\tool_hugehelp.c (
|
||||
del src\tool_hugehelp.c 2>NUL
|
||||
if exist src\tool_hugehelp.c (
|
||||
exit /B 2
|
||||
)
|
||||
)
|
||||
|
||||
rem Remove curlbuild.h
|
||||
echo * %CD%\include\curl\curlbuild.h
|
||||
if exist include\curl\curlbuild.h (
|
||||
del include\curl\curlbuild.h 2>NUL
|
||||
if exist include\curl\curlbuild.h (
|
||||
exit /B 3
|
||||
)
|
||||
)
|
||||
|
||||
exit /B
|
||||
|
||||
rem Function to generate src\tool_hugehelp.c
|
||||
rem
|
||||
rem Returns:
|
||||
rem
|
||||
rem 0 - full tool_hugehelp.c generated
|
||||
rem 1 - simplified tool_hugehelp.c
|
||||
rem 2 - failure
|
||||
rem
|
||||
:genHugeHelp
|
||||
if "%OS%" == "Windows_NT" setlocal
|
||||
set LC_ALL=C
|
||||
set ROFFCMD=
|
||||
set BASIC=1
|
||||
|
||||
if defined HAVE_PERL (
|
||||
if defined HAVE_GROFF (
|
||||
set ROFFCMD=groff -mtty-char -Tascii -P-c -man
|
||||
) else if defined HAVE_NROFF (
|
||||
set ROFFCMD=nroff -c -Tascii -man
|
||||
)
|
||||
)
|
||||
|
||||
if defined ROFFCMD (
|
||||
echo #include "tool_setup.h"> src\tool_hugehelp.c
|
||||
echo #include "tool_hugehelp.h">> src\tool_hugehelp.c
|
||||
|
||||
if defined HAVE_GZIP (
|
||||
echo #ifndef HAVE_LIBZ>> src\tool_hugehelp.c
|
||||
)
|
||||
|
||||
%ROFFCMD% docs\curl.1 2>NUL | perl src\mkhelp.pl docs\MANUAL >> src\tool_hugehelp.c
|
||||
if defined HAVE_GZIP (
|
||||
echo #else>> src\tool_hugehelp.c
|
||||
%ROFFCMD% docs\curl.1 2>NUL | perl src\mkhelp.pl -c docs\MANUAL >> src\tool_hugehelp.c
|
||||
echo #endif /^* HAVE_LIBZ ^*/>> src\tool_hugehelp.c
|
||||
)
|
||||
|
||||
set BASIC=0
|
||||
) else (
|
||||
if exist src\tool_hugehelp.c.cvs (
|
||||
copy /Y src\tool_hugehelp.c.cvs src\tool_hugehelp.c 1>NUL 2>&1
|
||||
) else (
|
||||
echo #include "tool_setup.h"> src\tool_hugehelp.c
|
||||
echo #include "tool_hugehelp.hd">> src\tool_hugehelp.c
|
||||
echo.>> src\tool_hugehelp.c
|
||||
echo void hugehelp(void^)>> src\tool_hugehelp.c
|
||||
echo {>> src\tool_hugehelp.c
|
||||
echo #ifdef USE_MANUAL>> src\tool_hugehelp.c
|
||||
echo fputs("Built-in manual not included\n", stdout^);>> src\tool_hugehelp.c
|
||||
echo #endif>> src\tool_hugehelp.c
|
||||
echo }>> src\tool_hugehelp.c
|
||||
)
|
||||
)
|
||||
|
||||
findstr "/C:void hugehelp(void)" src\tool_hugehelp.c 1>NUL 2>&1
|
||||
if errorlevel 1 (
|
||||
if "%OS%" == "Windows_NT" endlocal
|
||||
exit /B 2
|
||||
)
|
||||
|
||||
if "%BASIC%" == "1" (
|
||||
if "%OS%" == "Windows_NT" endlocal
|
||||
exit /B 1
|
||||
)
|
||||
|
||||
if "%OS%" == "Windows_NT" endlocal
|
||||
exit /B 0
|
||||
|
||||
rem Function to clean-up local variables under DOS, Windows 3.x and
|
||||
rem Windows 9x as setlocal isn't available until Windows NT
|
||||
rem
|
||||
:dosCleanup
|
||||
set MODE=
|
||||
set HAVE_GROFF=
|
||||
set HAVE_NROFF=
|
||||
set HAVE_PERL=
|
||||
set HAVE_GZIP=
|
||||
set BASIC_HUGEHELP=
|
||||
set LC_ALL
|
||||
set ROFFCMD=
|
||||
set BASIC=
|
||||
|
||||
exit /B
|
||||
|
||||
:syntax
|
||||
rem Display the help
|
||||
echo.
|
||||
echo Usage: buildconf [-clean]
|
||||
echo.
|
||||
echo -clean - Removes the files
|
||||
goto error
|
||||
|
||||
:unknown
|
||||
echo.
|
||||
echo Error: Unknown argument '%1'
|
||||
goto error
|
||||
|
||||
:norepo
|
||||
echo.
|
||||
echo Error: This batch file should only be used with a curl git repository
|
||||
goto error
|
||||
|
||||
:nogenmakefile
|
||||
echo.
|
||||
echo Error: Unable to generate Makefile
|
||||
goto error
|
||||
|
||||
:nogenhugehelp
|
||||
echo.
|
||||
echo Error: Unable to generate src\tool_hugehelp.c
|
||||
goto error
|
||||
|
||||
:nogencurlbuild
|
||||
echo.
|
||||
echo Error: Unable to generate include\curl\curlbuild.h
|
||||
goto error
|
||||
|
||||
:nocleanmakefile
|
||||
echo.
|
||||
echo Error: Unable to clean Makefile
|
||||
goto error
|
||||
|
||||
:nocleanhugehelp
|
||||
echo.
|
||||
echo Error: Unable to clean src\tool_hugehelp.c
|
||||
goto error
|
||||
|
||||
:nocleancurlbuild
|
||||
echo.
|
||||
echo Error: Unable to clean include\curl\curlbuild.h
|
||||
goto error
|
||||
|
||||
:warning
|
||||
echo.
|
||||
echo Warning: The curl manual could not be integrated in the source. This means when
|
||||
echo you build curl the manual will not be available (curl --man^). Integration of
|
||||
echo the manual is not required and a summary of the options will still be available
|
||||
echo (curl --help^). To integrate the manual your PATH is required to have
|
||||
echo groff/nroff, perl and optionally gzip for compression.
|
||||
goto success
|
||||
|
||||
:error
|
||||
if "%OS%" == "Windows_NT" (
|
||||
endlocal
|
||||
) else (
|
||||
call :dosCleanup
|
||||
)
|
||||
exit /B 1
|
||||
|
||||
:success
|
||||
if "%OS%" == "Windows_NT" (
|
||||
endlocal
|
||||
) else (
|
||||
call :dosCleanup
|
||||
)
|
||||
exit /B 0
|
||||
|
604
configure.ac
604
configure.ac
@ -5,11 +5,11 @@
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
# Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
# are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
@ -24,14 +24,14 @@ dnl Process this file with autoconf to produce a configure script.
|
||||
AC_PREREQ(2.57)
|
||||
|
||||
dnl We don't know the version number "statically" so we use a dash here
|
||||
AC_INIT([curl], [-], [a suitable curl mailing list: https://curl.haxx.se/mail/])
|
||||
AC_INIT([curl], [-], [a suitable curl mailing list: http://curl.haxx.se/mail/])
|
||||
|
||||
XC_OVR_ZZ50
|
||||
XC_OVR_ZZ60
|
||||
CURL_OVERRIDE_AUTOCONF
|
||||
|
||||
dnl configure script copyright
|
||||
AC_COPYRIGHT([Copyright (c) 1998 - 2016 Daniel Stenberg, <daniel@haxx.se>
|
||||
AC_COPYRIGHT([Copyright (c) 1998 - 2014 Daniel Stenberg, <daniel@haxx.se>
|
||||
This configure script may be copied, distributed and modified under the
|
||||
terms of the curl license; see COPYING for more details])
|
||||
|
||||
@ -39,7 +39,6 @@ AC_CONFIG_SRCDIR([lib/urldata.h])
|
||||
AC_CONFIG_HEADERS(lib/curl_config.h include/curl/curlbuild.h)
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AM_MAINTAINER_MODE
|
||||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
||||
|
||||
CURL_CHECK_OPTION_DEBUG
|
||||
CURL_CHECK_OPTION_OPTIMIZE
|
||||
@ -48,7 +47,6 @@ CURL_CHECK_OPTION_WERROR
|
||||
CURL_CHECK_OPTION_CURLDEBUG
|
||||
CURL_CHECK_OPTION_SYMBOL_HIDING
|
||||
CURL_CHECK_OPTION_ARES
|
||||
CURL_CHECK_OPTION_RT
|
||||
|
||||
XC_CHECK_PATH_SEPARATOR
|
||||
|
||||
@ -149,14 +147,13 @@ AC_SUBST(PKGADD_VENDOR)
|
||||
|
||||
dnl
|
||||
dnl initialize all the info variables
|
||||
curl_ssl_msg="no (--with-{ssl,gnutls,nss,polarssl,mbedtls,cyassl,axtls,winssl,darwinssl} )"
|
||||
curl_ssl_msg="no (--with-{ssl,gnutls,nss,polarssl,cyassl,axtls,winssl,darwinssl} )"
|
||||
curl_ssh_msg="no (--with-libssh2)"
|
||||
curl_zlib_msg="no (--with-zlib)"
|
||||
curl_gss_msg="no (--with-gssapi)"
|
||||
curl_tls_srp_msg="no (--enable-tls-srp)"
|
||||
curl_res_msg="default (--enable-ares / --enable-threaded-resolver)"
|
||||
curl_ipv6_msg="no (--enable-ipv6)"
|
||||
curl_unix_sockets_msg="no (--enable-unix-sockets)"
|
||||
curl_idn_msg="no (--with-{libidn,winidn})"
|
||||
curl_manual_msg="no (--enable-manual)"
|
||||
curl_libcurl_msg="enabled (--disable-libcurl-option)"
|
||||
@ -167,7 +164,6 @@ curl_verbose_msg="enabled (--disable-verbose)"
|
||||
curl_rtsp_msg="no (--enable-rtsp)"
|
||||
curl_rtmp_msg="no (--with-librtmp)"
|
||||
curl_mtlnk_msg="no (--with-libmetalink)"
|
||||
curl_psl_msg="no (--with-libpsl)"
|
||||
|
||||
init_ssl_msg=${curl_ssl_msg}
|
||||
|
||||
@ -578,22 +574,6 @@ AC_HELP_STRING([--disable-imap],[Disable IMAP support]),
|
||||
)
|
||||
|
||||
|
||||
AC_MSG_CHECKING([whether to support smb])
|
||||
AC_ARG_ENABLE(smb,
|
||||
AC_HELP_STRING([--enable-smb],[Enable SMB/CIFS support])
|
||||
AC_HELP_STRING([--disable-smb],[Disable SMB/CIFS support]),
|
||||
[ case "$enableval" in
|
||||
no)
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(CURL_DISABLE_SMB, 1, [to disable SMB/CIFS])
|
||||
AC_SUBST(CURL_DISABLE_SMB, [1])
|
||||
;;
|
||||
*) AC_MSG_RESULT(yes)
|
||||
;;
|
||||
esac ],
|
||||
AC_MSG_RESULT(yes)
|
||||
)
|
||||
|
||||
AC_MSG_CHECKING([whether to support smtp])
|
||||
AC_ARG_ENABLE(smtp,
|
||||
AC_HELP_STRING([--enable-smtp],[Enable SMTP support])
|
||||
@ -1049,7 +1029,7 @@ if test x$CURL_DISABLE_LDAP != x1 ; then
|
||||
|
||||
if test "$LDAPLIBNAME" = "wldap32"; then
|
||||
curl_ldap_msg="enabled (winldap)"
|
||||
AC_DEFINE(USE_WIN32_LDAP, 1, [Use Windows LDAP implementation])
|
||||
AC_DEFINE(CURL_LDAP_WIN, 1, [Use Windows LDAP implementation])
|
||||
else
|
||||
curl_ldap_msg="enabled (OpenLDAP)"
|
||||
if test "x$ac_cv_func_ldap_init_fd" = "xyes"; then
|
||||
@ -1067,10 +1047,10 @@ dnl **********************************************************************
|
||||
dnl Checks for IPv6
|
||||
dnl **********************************************************************
|
||||
|
||||
AC_MSG_CHECKING([whether to enable IPv6])
|
||||
AC_MSG_CHECKING([whether to enable ipv6])
|
||||
AC_ARG_ENABLE(ipv6,
|
||||
AC_HELP_STRING([--enable-ipv6],[Enable IPv6 (with IPv4) support])
|
||||
AC_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
|
||||
AC_HELP_STRING([--enable-ipv6],[Enable ipv6 (with ipv4) support])
|
||||
AC_HELP_STRING([--disable-ipv6],[Disable ipv6 support]),
|
||||
[ case "$enableval" in
|
||||
no)
|
||||
AC_MSG_RESULT(no)
|
||||
@ -1083,11 +1063,7 @@ AC_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
|
||||
|
||||
AC_TRY_RUN([ /* is AF_INET6 available? */
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#include <stdlib.h> /* for exit() */
|
||||
main()
|
||||
{
|
||||
@ -1101,8 +1077,8 @@ main()
|
||||
ipv6=yes,
|
||||
AC_MSG_RESULT(no)
|
||||
ipv6=no,
|
||||
AC_MSG_RESULT(yes)
|
||||
ipv6=yes
|
||||
AC_MSG_RESULT(no)
|
||||
ipv6=no
|
||||
))
|
||||
|
||||
if test "$ipv6" = "yes"; then
|
||||
@ -1114,12 +1090,7 @@ if test "$ipv6" = yes; then
|
||||
AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member])
|
||||
AC_TRY_COMPILE([
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#else
|
||||
#include <netinet/in.h>
|
||||
#endif] ,
|
||||
#include <netinet/in.h>] ,
|
||||
struct sockaddr_in6 s; s.sin6_scope_id = 0; , have_sin6_scope_id=yes)
|
||||
if test "$have_sin6_scope_id" = yes; then
|
||||
AC_MSG_RESULT([yes])
|
||||
@ -1196,8 +1167,6 @@ AC_ARG_WITH(gssapi,
|
||||
fi
|
||||
])
|
||||
|
||||
: ${KRB5CONFIG:="$GSSAPI_ROOT/bin/krb5-config"}
|
||||
|
||||
save_CPPFLAGS="$CPPFLAGS"
|
||||
AC_MSG_CHECKING([if GSS-API support is requested])
|
||||
if test x"$want_gss" = xyes; then
|
||||
@ -1206,8 +1175,8 @@ if test x"$want_gss" = xyes; then
|
||||
if test -z "$GSSAPI_INCS"; then
|
||||
if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
|
||||
GSSAPI_INCS=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --cflags gssapi`
|
||||
elif test -f "$KRB5CONFIG"; then
|
||||
GSSAPI_INCS=`$KRB5CONFIG --cflags gssapi`
|
||||
elif test -f "$GSSAPI_ROOT/bin/krb5-config"; then
|
||||
GSSAPI_INCS=`$GSSAPI_ROOT/bin/krb5-config --cflags gssapi`
|
||||
elif test "$GSSAPI_ROOT" != "yes"; then
|
||||
GSSAPI_INCS="-I$GSSAPI_ROOT/include"
|
||||
fi
|
||||
@ -1297,10 +1266,10 @@ if test x"$want_gss" = xyes; then
|
||||
dnl into LIBS
|
||||
gss_libs=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --libs gssapi`
|
||||
LIBS="$gss_libs $LIBS"
|
||||
elif test -f "$KRB5CONFIG"; then
|
||||
elif test -f "$GSSAPI_ROOT/bin/krb5-config"; then
|
||||
dnl krb5-config doesn't have --libs-only-L or similar, put everything
|
||||
dnl into LIBS
|
||||
gss_libs=`$KRB5CONFIG --libs gssapi`
|
||||
gss_libs=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
|
||||
LIBS="$gss_libs $LIBS"
|
||||
else
|
||||
case $host in
|
||||
@ -1408,24 +1377,6 @@ if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
|
||||
CLEANCPPFLAGS="$CPPFLAGS"
|
||||
CLEANLIBS="$LIBS"
|
||||
|
||||
dnl This is for Msys/Mingw
|
||||
case $host in
|
||||
*-*-msys* | *-*-mingw*)
|
||||
AC_MSG_CHECKING([for gdi32])
|
||||
my_ac_save_LIBS=$LIBS
|
||||
LIBS="-lgdi32 $LIBS"
|
||||
AC_TRY_LINK([#include <windef.h>
|
||||
#include <wingdi.h>],
|
||||
[GdiFlush();],
|
||||
[ dnl worked!
|
||||
AC_MSG_RESULT([yes])],
|
||||
[ dnl failed, restore LIBS
|
||||
LIBS=$my_ac_save_LIBS
|
||||
AC_MSG_RESULT(no)]
|
||||
)
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$OPT_SSL" in
|
||||
yes)
|
||||
dnl --with-ssl (without path) used
|
||||
@ -1483,7 +1434,6 @@ if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
|
||||
SSL_CPPFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
|
||||
$PKGCONFIG --cflags-only-I openssl 2>/dev/null`
|
||||
|
||||
AC_SUBST(SSL_LIBS)
|
||||
AC_MSG_NOTICE([pkg-config: SSL_LIBS: "$SSL_LIBS"])
|
||||
AC_MSG_NOTICE([pkg-config: SSL_LDFLAGS: "$SSL_LDFLAGS"])
|
||||
AC_MSG_NOTICE([pkg-config: SSL_CPPFLAGS: "$SSL_CPPFLAGS"])
|
||||
@ -1504,13 +1454,31 @@ if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
|
||||
CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
|
||||
LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
|
||||
|
||||
AC_CHECK_LIB(crypto, HMAC_Update,[
|
||||
dnl This is for Msys/Mingw
|
||||
case $host in
|
||||
*-*-msys* | *-*-mingw*)
|
||||
AC_MSG_CHECKING([for gdi32])
|
||||
my_ac_save_LIBS=$LIBS
|
||||
LIBS="-lgdi32 $LIBS"
|
||||
AC_TRY_LINK([#include <windef.h>
|
||||
#include <wingdi.h>],
|
||||
[GdiFlush();],
|
||||
[ dnl worked!
|
||||
AC_MSG_RESULT([yes])],
|
||||
[ dnl failed, restore LIBS
|
||||
LIBS=$my_ac_save_LIBS
|
||||
AC_MSG_RESULT(no)]
|
||||
)
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_CHECK_LIB(crypto, CRYPTO_lock,[
|
||||
HAVECRYPTO="yes"
|
||||
LIBS="-lcrypto $LIBS"
|
||||
],[
|
||||
LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL"
|
||||
CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include"
|
||||
AC_CHECK_LIB(crypto, HMAC_Init_ex,[
|
||||
AC_CHECK_LIB(crypto, CRYPTO_add_lock,[
|
||||
HAVECRYPTO="yes"
|
||||
LIBS="-lcrypto $LIBS"], [
|
||||
LDFLAGS="$CLEANLDFLAGS"
|
||||
@ -1520,46 +1488,6 @@ if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
|
||||
])
|
||||
|
||||
|
||||
if test X"$HAVECRYPTO" = X"yes"; then
|
||||
AC_MSG_CHECKING([OpenSSL linking without -ldl])
|
||||
saved_libs=$LIBS
|
||||
AC_TRY_LINK(
|
||||
[
|
||||
#include <openssl/evp.h>
|
||||
],
|
||||
[
|
||||
SSLeay_add_all_algorithms();
|
||||
],
|
||||
[
|
||||
AC_MSG_RESULT(yes)
|
||||
LIBS="$saved_libs"
|
||||
],
|
||||
[
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_CHECKING([OpenSSL linking with -ldl])
|
||||
LIBS="-ldl $LIBS"
|
||||
AC_TRY_LINK(
|
||||
[
|
||||
#include <openssl/evp.h>
|
||||
],
|
||||
[
|
||||
SSLeay_add_all_algorithms();
|
||||
],
|
||||
[
|
||||
AC_MSG_RESULT(yes)
|
||||
LIBS="$saved_libs -ldl"
|
||||
],
|
||||
[
|
||||
AC_MSG_RESULT(no)
|
||||
LIBS="$saved_libs"
|
||||
]
|
||||
)
|
||||
|
||||
]
|
||||
)
|
||||
|
||||
fi
|
||||
|
||||
if test X"$HAVECRYPTO" = X"yes"; then
|
||||
dnl This is only reasonable to do if crypto actually is there: check for
|
||||
dnl SSL libs NOTE: it is important to do this AFTER the crypto lib
|
||||
@ -1582,7 +1510,7 @@ if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
|
||||
|
||||
else
|
||||
|
||||
dnl Have the libraries--check for OpenSSL headers
|
||||
dnl Have the libraries--check for SSLeay/OpenSSL headers
|
||||
AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
|
||||
openssl/pem.h openssl/ssl.h openssl/err.h,
|
||||
curl_ssl_msg="enabled (OpenSSL)"
|
||||
@ -1606,11 +1534,17 @@ if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
|
||||
fi
|
||||
|
||||
if test X"$OPENSSL_ENABLED" = X"1"; then
|
||||
AC_DEFINE(USE_SSLEAY, 1, [if SSL is enabled])
|
||||
|
||||
dnl is there a pkcs12.h header present?
|
||||
AC_CHECK_HEADERS(openssl/pkcs12.h)
|
||||
else
|
||||
LIBS="$CLEANLIBS"
|
||||
fi
|
||||
dnl USE_SSLEAY is the historical name for what configure calls
|
||||
dnl OPENSSL_ENABLED; the names should really be unified
|
||||
USE_SSLEAY="$OPENSSL_ENABLED"
|
||||
AC_SUBST(USE_SSLEAY)
|
||||
|
||||
if test X"$OPT_SSL" != Xoff &&
|
||||
test "$OPENSSL_ENABLED" != "1"; then
|
||||
@ -1627,10 +1561,8 @@ if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
|
||||
AC_CHECK_FUNCS( ENGINE_load_builtin_engines )
|
||||
])
|
||||
|
||||
dnl These can only exist if OpenSSL exists
|
||||
dnl Older versions of Cyassl (some time before 2.9.4) don't have
|
||||
dnl SSL_get_shutdown (but this check won't actually detect it there
|
||||
dnl as it's a macro that needs the header files be included)
|
||||
dnl these can only exist if openssl exists
|
||||
dnl yassl doesn't have SSL_get_shutdown
|
||||
|
||||
AC_CHECK_FUNCS( RAND_status \
|
||||
RAND_screen \
|
||||
@ -1640,36 +1572,26 @@ if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
|
||||
SSL_get_shutdown \
|
||||
SSLv2_client_method )
|
||||
|
||||
AC_MSG_CHECKING([for BoringSSL])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#include <openssl/base.h>
|
||||
]],[[
|
||||
#ifndef OPENSSL_IS_BORINGSSL
|
||||
#error not boringssl
|
||||
#endif
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE_UNQUOTED(HAVE_BORINGSSL, 1,
|
||||
[Define to 1 if using BoringSSL.])
|
||||
curl_ssl_msg="enabled (BoringSSL)"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
dnl Make an attempt to detect if this is actually yassl's headers and
|
||||
dnl OpenSSL emulation layer. We still leave everything else believing
|
||||
dnl and acting like OpenSSL.
|
||||
|
||||
AC_MSG_CHECKING([for libressl])
|
||||
AC_MSG_CHECKING([for yaSSL using OpenSSL compatibility mode])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#include <openssl/opensslv.h>
|
||||
#include <openssl/ssl.h>
|
||||
]],[[
|
||||
int dummy = LIBRESSL_VERSION_NUMBER;
|
||||
#if defined(YASSL_VERSION) && defined(OPENSSL_VERSION_NUMBER)
|
||||
int dummy = SSL_ERROR_NONE;
|
||||
#else
|
||||
Not the yaSSL OpenSSL compatibility header.
|
||||
#endif
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE_UNQUOTED(HAVE_LIBRESSL, 1,
|
||||
[Define to 1 if using libressl.])
|
||||
curl_ssl_msg="enabled (libressl)"
|
||||
AC_DEFINE_UNQUOTED(USE_YASSLEMUL, 1,
|
||||
[Define to 1 if using yaSSL in OpenSSL compatibility mode.])
|
||||
curl_ssl_msg="enabled (OpenSSL emulation by yaSSL)"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
@ -1733,8 +1655,8 @@ dnl ---
|
||||
if test "$OPENSSL_ENABLED" = "1"; then
|
||||
AC_CHECK_LIB(crypto, SRP_Calc_client_key,
|
||||
[
|
||||
AC_DEFINE(HAVE_OPENSSL_SRP, 1, [if you have the function SRP_Calc_client_key])
|
||||
AC_SUBST(HAVE_OPENSSL_SRP, [1])
|
||||
AC_DEFINE(HAVE_SSLEAY_SRP, 1, [if you have the function SRP_Calc_client_key])
|
||||
AC_SUBST(HAVE_SSLEAY_SRP, [1])
|
||||
])
|
||||
fi
|
||||
|
||||
@ -1845,7 +1767,6 @@ if test "$curl_ssl_msg" = "$init_ssl_msg"; then
|
||||
AC_MSG_NOTICE([Added $gtlslib to LD_LIBRARY_PATH])
|
||||
fi
|
||||
fi
|
||||
AC_CHECK_FUNCS(gnutls_certificate_set_x509_key_file2)
|
||||
fi
|
||||
|
||||
fi
|
||||
@ -1983,93 +1904,6 @@ if test "$curl_ssl_msg" = "$init_ssl_msg"; then
|
||||
|
||||
fi
|
||||
|
||||
dnl ----------------------------------------------------
|
||||
dnl check for mbedTLS
|
||||
dnl ----------------------------------------------------
|
||||
|
||||
OPT_MBEDTLS=no
|
||||
|
||||
_cppflags=$CPPFLAGS
|
||||
_ldflags=$LDFLAGS
|
||||
AC_ARG_WITH(mbedtls,dnl
|
||||
AC_HELP_STRING([--with-mbedtls=PATH],[where to look for mbedTLS, PATH points to the installation root])
|
||||
AC_HELP_STRING([--without-mbedtls], [disable mbedTLS detection]),
|
||||
OPT_MBEDTLS=$withval)
|
||||
|
||||
if test "$curl_ssl_msg" = "$init_ssl_msg"; then
|
||||
|
||||
if test X"$OPT_MBEDTLS" != Xno; then
|
||||
|
||||
if test "$OPT_MBEDTLS" = "yes"; then
|
||||
OPT_MBEDTLS=""
|
||||
fi
|
||||
|
||||
if test -z "$OPT_MBEDTLS" ; then
|
||||
dnl check for lib first without setting any new path
|
||||
|
||||
AC_CHECK_LIB(mbedtls, mbedtls_havege_init,
|
||||
dnl libmbedtls found, set the variable
|
||||
[
|
||||
AC_DEFINE(USE_MBEDTLS, 1, [if mbedTLS is enabled])
|
||||
AC_SUBST(USE_MBEDTLS, [1])
|
||||
MBEDTLS_ENABLED=1
|
||||
USE_MBEDTLS="yes"
|
||||
curl_ssl_msg="enabled (mbedTLS)"
|
||||
], [], -lmbedx509 -lmbedcrypto)
|
||||
fi
|
||||
|
||||
addld=""
|
||||
addlib=""
|
||||
addcflags=""
|
||||
mbedtlslib=""
|
||||
|
||||
if test "x$USE_MBEDTLS" != "xyes"; then
|
||||
dnl add the path and test again
|
||||
addld=-L$OPT_MBEDTLS/lib$libsuff
|
||||
addcflags=-I$OPT_MBEDTLS/include
|
||||
mbedtlslib=$OPT_MBEDTLS/lib$libsuff
|
||||
|
||||
LDFLAGS="$LDFLAGS $addld"
|
||||
if test "$addcflags" != "-I/usr/include"; then
|
||||
CPPFLAGS="$CPPFLAGS $addcflags"
|
||||
fi
|
||||
|
||||
AC_CHECK_LIB(mbedtls, mbedtls_ssl_init,
|
||||
[
|
||||
AC_DEFINE(USE_MBEDTLS, 1, [if mbedTLS is enabled])
|
||||
AC_SUBST(USE_MBEDTLS, [1])
|
||||
MBEDTLS_ENABLED=1
|
||||
USE_MBEDTLS="yes"
|
||||
curl_ssl_msg="enabled (mbedTLS)"
|
||||
],
|
||||
[
|
||||
CPPFLAGS=$_cppflags
|
||||
LDFLAGS=$_ldflags
|
||||
], -lmbedx509 -lmbedcrypto)
|
||||
fi
|
||||
|
||||
if test "x$USE_MBEDTLS" = "xyes"; then
|
||||
AC_MSG_NOTICE([detected mbedTLS])
|
||||
|
||||
LIBS="-lmbedtls -lmbedx509 -lmbedcrypto $LIBS"
|
||||
|
||||
if test -n "$mbedtlslib"; then
|
||||
dnl when shared libs were found in a path that the run-time
|
||||
dnl linker doesn't search through, we need to add it to
|
||||
dnl LD_LIBRARY_PATH to prevent further configure tests to fail
|
||||
dnl due to this
|
||||
if test "x$cross_compiling" != "xyes"; then
|
||||
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$mbedtlslib"
|
||||
export LD_LIBRARY_PATH
|
||||
AC_MSG_NOTICE([Added $mbedtlslib to LD_LIBRARY_PATH])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
fi dnl mbedTLS not disabled
|
||||
|
||||
fi
|
||||
|
||||
dnl ----------------------------------------------------
|
||||
dnl check for CyaSSL
|
||||
dnl ----------------------------------------------------
|
||||
@ -2092,10 +1926,6 @@ if test "$curl_ssl_msg" = "$init_ssl_msg"; then
|
||||
OPT_CYASSL=""
|
||||
fi
|
||||
|
||||
dnl This should be reworked to use pkg-config instead
|
||||
|
||||
cyassllibname=cyassl
|
||||
|
||||
if test -z "$OPT_CYASSL" ; then
|
||||
dnl check for lib in system default first
|
||||
|
||||
@ -2137,80 +1967,19 @@ if test "$curl_ssl_msg" = "$init_ssl_msg"; then
|
||||
[
|
||||
CPPFLAGS=$_cppflags
|
||||
LDFLAGS=$_ldflags
|
||||
cyassllib=""
|
||||
])
|
||||
fi
|
||||
|
||||
addld=""
|
||||
addlib=""
|
||||
addcflags=""
|
||||
|
||||
if test "x$USE_CYASSL" != "xyes"; then
|
||||
dnl libcyassl renamed to libwolfssl as of 3.4.0
|
||||
addld=-L$OPT_CYASSL/lib$libsuff
|
||||
addcflags=-I$OPT_CYASSL/include
|
||||
cyassllib=$OPT_CYASSL/lib$libsuff
|
||||
|
||||
LDFLAGS="$LDFLAGS $addld"
|
||||
if test "$addcflags" != "-I/usr/include"; then
|
||||
CPPFLAGS="$CPPFLAGS $addcflags"
|
||||
fi
|
||||
|
||||
cyassllibname=wolfssl
|
||||
my_ac_save_LIBS="$LIBS"
|
||||
LIBS="-l$cyassllibname -lm $LIBS"
|
||||
|
||||
AC_MSG_CHECKING([for CyaSSL_Init in -lwolfssl])
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
/* These aren't needed for detection and confuse WolfSSL.
|
||||
They are set up properly later if it is detected. */
|
||||
#undef SIZEOF_LONG
|
||||
#undef SIZEOF_LONG_LONG
|
||||
#include <cyassl/ssl.h>
|
||||
]],[[
|
||||
return CyaSSL_Init();
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(USE_CYASSL, 1, [if CyaSSL/WolfSSL is enabled])
|
||||
AC_SUBST(USE_CYASSL, [1])
|
||||
CYASSL_ENABLED=1
|
||||
USE_CYASSL="yes"
|
||||
curl_ssl_msg="enabled (WolfSSL)"
|
||||
],
|
||||
[
|
||||
AC_MSG_RESULT(no)
|
||||
CPPFLAGS=$_cppflags
|
||||
LDFLAGS=$_ldflags
|
||||
cyassllib=""
|
||||
])
|
||||
LIBS="$my_ac_save_LIBS"
|
||||
fi
|
||||
|
||||
if test "x$USE_CYASSL" = "xyes"; then
|
||||
AC_MSG_NOTICE([detected $cyassllibname])
|
||||
AC_MSG_NOTICE([detected CyaSSL])
|
||||
|
||||
dnl cyassl/ctaocrypt/types.h needs SIZEOF_LONG_LONG defined!
|
||||
AC_CHECK_SIZEOF(long long)
|
||||
|
||||
dnl Versions since at least 2.6.0 may have options.h
|
||||
AC_CHECK_HEADERS(cyassl/options.h)
|
||||
|
||||
dnl Versions since at least 2.9.4 renamed error.h to error-ssl.h
|
||||
AC_CHECK_HEADERS(cyassl/error-ssl.h)
|
||||
|
||||
LIBS="-l$cyassllibname -lm $LIBS"
|
||||
|
||||
if test "x$cyassllibname" = "xwolfssl"; then
|
||||
dnl Recent WolfSSL versions build without SSLv3 by default
|
||||
dnl WolfSSL needs configure --enable-opensslextra to have *get_peer*
|
||||
AC_CHECK_FUNCS(wolfSSLv3_client_method \
|
||||
wolfSSL_get_peer_certificate)
|
||||
else
|
||||
dnl Cyassl needs configure --enable-opensslextra to have *get_peer*
|
||||
AC_CHECK_FUNCS(CyaSSL_get_peer_certificate)
|
||||
fi
|
||||
LIBS="-lcyassl -lm $LIBS"
|
||||
|
||||
if test -n "$cyassllib"; then
|
||||
dnl when shared libs were found in a path that the run-time
|
||||
@ -2277,73 +2046,57 @@ if test "$curl_ssl_msg" = "$init_ssl_msg"; then
|
||||
fi
|
||||
fi
|
||||
else
|
||||
NSS_PCDIR="$OPT_NSS/lib/pkgconfig"
|
||||
if test -f "$NSS_PCDIR/nss.pc"; then
|
||||
CURL_CHECK_PKGCONFIG(nss, [$NSS_PCDIR])
|
||||
if test "$PKGCONFIG" != "no" ; then
|
||||
addld=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --libs-only-L nss`
|
||||
addlib=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --libs-only-l nss`
|
||||
addcflags=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --cflags nss`
|
||||
version=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --modversion nss`
|
||||
nssprefix=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --variable=prefix nss`
|
||||
# Without pkg-config, we'll kludge in some defaults
|
||||
addlib="-L$OPT_NSS/lib -lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl"
|
||||
addcflags="-I$OPT_NSS/include"
|
||||
version="unknown"
|
||||
nssprefix=$OPT_NSS
|
||||
fi
|
||||
|
||||
if test -n "$addlib"; then
|
||||
|
||||
CLEANLIBS="$LIBS"
|
||||
CLEANCPPFLAGS="$CPPFLAGS"
|
||||
|
||||
LIBS="$addlib $LIBS"
|
||||
if test "$addcflags" != "-I/usr/include"; then
|
||||
CPPFLAGS="$CPPFLAGS $addcflags"
|
||||
fi
|
||||
|
||||
dnl The function SSL_VersionRangeSet() is needed to enable TLS > 1.0
|
||||
AC_CHECK_LIB(nss3, SSL_VersionRangeSet,
|
||||
[
|
||||
AC_DEFINE(USE_NSS, 1, [if NSS is enabled])
|
||||
AC_SUBST(USE_NSS, [1])
|
||||
USE_NSS="yes"
|
||||
NSS_ENABLED=1
|
||||
curl_ssl_msg="enabled (NSS)"
|
||||
],
|
||||
[
|
||||
LIBS="$CLEANLIBS"
|
||||
CPPFLAGS="$CLEANCPPFLAGS"
|
||||
])
|
||||
|
||||
if test "x$USE_NSS" = "xyes"; then
|
||||
AC_MSG_NOTICE([detected NSS version $version])
|
||||
|
||||
dnl needed when linking the curl tool without USE_EXPLICIT_LIB_DEPS
|
||||
NSS_LIBS=$addlib
|
||||
AC_SUBST([NSS_LIBS])
|
||||
|
||||
dnl when shared libs were found in a path that the run-time
|
||||
dnl linker doesn't search through, we need to add it to
|
||||
dnl LD_LIBRARY_PATH to prevent further configure tests to fail
|
||||
dnl due to this
|
||||
if test "x$cross_compiling" != "xyes"; then
|
||||
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$nssprefix/lib$libsuff"
|
||||
export LD_LIBRARY_PATH
|
||||
AC_MSG_NOTICE([Added $nssprefix/lib$libsuff to LD_LIBRARY_PATH])
|
||||
fi
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
if test -z "$addlib"; then
|
||||
# Without pkg-config, we'll kludge in some defaults
|
||||
AC_MSG_WARN([Using hard-wired libraries and compilation flags for NSS.])
|
||||
addld="-L$OPT_NSS/lib"
|
||||
addlib="-lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4"
|
||||
addcflags="-I$OPT_NSS/include"
|
||||
version="unknown"
|
||||
nssprefix=$OPT_NSS
|
||||
fi
|
||||
|
||||
CLEANLDFLAGS="$LDFLAGS"
|
||||
CLEANLIBS="$LIBS"
|
||||
CLEANCPPFLAGS="$CPPFLAGS"
|
||||
|
||||
LDFLAGS="$addld $LDFLAGS"
|
||||
LIBS="$addlib $LIBS"
|
||||
if test "$addcflags" != "-I/usr/include"; then
|
||||
CPPFLAGS="$CPPFLAGS $addcflags"
|
||||
fi
|
||||
|
||||
dnl The function SSL_VersionRangeSet() is needed to enable TLS > 1.0
|
||||
AC_CHECK_LIB(nss3, SSL_VersionRangeSet,
|
||||
[
|
||||
AC_DEFINE(USE_NSS, 1, [if NSS is enabled])
|
||||
AC_SUBST(USE_NSS, [1])
|
||||
USE_NSS="yes"
|
||||
NSS_ENABLED=1
|
||||
curl_ssl_msg="enabled (NSS)"
|
||||
],
|
||||
[
|
||||
LDFLAGS="$CLEANLDFLAGS"
|
||||
LIBS="$CLEANLIBS"
|
||||
CPPFLAGS="$CLEANCPPFLAGS"
|
||||
])
|
||||
|
||||
if test "x$USE_NSS" = "xyes"; then
|
||||
AC_MSG_NOTICE([detected NSS version $version])
|
||||
|
||||
dnl needed when linking the curl tool without USE_EXPLICIT_LIB_DEPS
|
||||
NSS_LIBS=$addlib
|
||||
AC_SUBST([NSS_LIBS])
|
||||
|
||||
dnl when shared libs were found in a path that the run-time
|
||||
dnl linker doesn't search through, we need to add it to
|
||||
dnl LD_LIBRARY_PATH to prevent further configure tests to fail
|
||||
dnl due to this
|
||||
if test "x$cross_compiling" != "xyes"; then
|
||||
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$nssprefix/lib$libsuff"
|
||||
export LD_LIBRARY_PATH
|
||||
AC_MSG_NOTICE([Added $nssprefix/lib$libsuff to LD_LIBRARY_PATH])
|
||||
fi
|
||||
|
||||
fi dnl NSS found
|
||||
|
||||
fi dnl NSS not disabled
|
||||
|
||||
fi dnl curl_ssl_msg = init_ssl_msg
|
||||
@ -2404,7 +2157,7 @@ if test "$curl_ssl_msg" = "$init_ssl_msg"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$POLARSSL_ENABLED$MBEDTLS_ENABLED$AXTLS_ENABLED$CYASSL_ENABLED$WINSSL_ENABLED$DARWINSSL_ENABLED" = "x"; then
|
||||
if test "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$POLARSSL_ENABLED$AXTLS_ENABLED$CYASSL_ENABLED$WINSSL_ENABLED$DARWINSSL_ENABLED" = "x"; then
|
||||
AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.])
|
||||
AC_MSG_WARN([Use --with-ssl, --with-gnutls, --with-polarssl, --with-cyassl, --with-nss, --with-axtls, --with-winssl, or --with-darwinssl to address this.])
|
||||
else
|
||||
@ -2419,27 +2172,6 @@ dnl **********************************************************************
|
||||
|
||||
CURL_CHECK_CA_BUNDLE
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Check for libpsl
|
||||
dnl **********************************************************************
|
||||
|
||||
AC_ARG_WITH(libpsl,
|
||||
AS_HELP_STRING([--without-libpsl],
|
||||
[disable support for libpsl cookie checking]),
|
||||
with_libpsl=$withval,
|
||||
with_libpsl=yes)
|
||||
if test $with_libpsl != "no"; then
|
||||
AC_SEARCH_LIBS(psl_builtin, psl,
|
||||
[curl_psl_msg="yes";
|
||||
AC_DEFINE([USE_LIBPSL], [1], [PSL support enabled])
|
||||
],
|
||||
[curl_psl_msg="no (libpsl not found)";
|
||||
AC_MSG_WARN([libpsl was not found])
|
||||
]
|
||||
)
|
||||
fi
|
||||
AM_CONDITIONAL([USE_LIBPSL], [test "$curl_psl_msg" = "yes"])
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Check for libmetalink
|
||||
dnl **********************************************************************
|
||||
@ -2600,6 +2332,12 @@ if test X"$OPT_LIBSSH2" != Xno; then
|
||||
dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH
|
||||
dnl to prevent further configure tests to fail due to this
|
||||
|
||||
dnl libssh2_version is a post 1.0 addition
|
||||
dnl libssh2_init and libssh2_exit were added in 1.2.5
|
||||
dnl libssh2_scp_send64 was added in 1.2.6
|
||||
dnl libssh2_session_handshake was added in 1.2.8
|
||||
AC_CHECK_FUNCS( libssh2_version libssh2_init libssh2_exit \
|
||||
libssh2_scp_send64 libssh2_session_handshake)
|
||||
if test "x$cross_compiling" != "xyes"; then
|
||||
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DIR_SSH2"
|
||||
export LD_LIBRARY_PATH
|
||||
@ -3019,9 +2757,7 @@ if test X"$want_h2" != Xno; then
|
||||
CPPFLAGS="$CPPFLAGS $CPP_H2"
|
||||
LIBS="$LIB_H2 $LIBS"
|
||||
|
||||
# use nghttp2_option_set_no_recv_client_magic to require nghttp2
|
||||
# >= 1.0.0
|
||||
AC_CHECK_LIB(nghttp2, nghttp2_option_set_no_recv_client_magic,
|
||||
AC_CHECK_LIB(nghttp2, nghttp2_session_callbacks_set_send_callback,
|
||||
[
|
||||
AC_CHECK_HEADERS(nghttp2/nghttp2.h,
|
||||
curl_h2_msg="enabled (nghttp2)"
|
||||
@ -3047,31 +2783,6 @@ if test X"$want_h2" != Xno; then
|
||||
|
||||
fi
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Check for zsh completion path
|
||||
dnl **********************************************************************
|
||||
|
||||
OPT_ZSH_FPATH=default
|
||||
AC_ARG_WITH(zsh-functions-dir,
|
||||
AC_HELP_STRING([--with-zsh-functions-dir=PATH],[Install zsh completions to PATH])
|
||||
AC_HELP_STRING([--without-zsh-functions-dir],[Do not install zsh completions]),
|
||||
[OPT_ZSH_FPATH=$withval])
|
||||
case "$OPT_ZSH_FPATH" in
|
||||
no)
|
||||
dnl --without-zsh-functions-dir option used
|
||||
;;
|
||||
default|yes)
|
||||
dnl --with-zsh-functions-dir option used without path
|
||||
ZSH_FUNCTIONS_DIR="$datarootdir/zsh/site-functions"
|
||||
AC_SUBST(ZSH_FUNCTIONS_DIR)
|
||||
;;
|
||||
*)
|
||||
dnl --with-zsh-functions-dir option used with path
|
||||
ZSH_FUNCTIONS_DIR="$withval"
|
||||
AC_SUBST(ZSH_FUNCTIONS_DIR)
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Back to "normal" configuring
|
||||
dnl **********************************************************************
|
||||
@ -3420,7 +3131,7 @@ if test "x$want_thres" = xyes && test "x$want_ares" = xyes; then
|
||||
[Options --enable-threaded-resolver and --enable-ares are mutually exclusive])
|
||||
fi
|
||||
|
||||
if test "$want_thres" = "yes" && test "$dontwant_rt" = "no"; then
|
||||
if test "$want_thres" = "yes"; then
|
||||
AC_CHECK_HEADER(pthread.h,
|
||||
[ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have <pthread.h>])
|
||||
save_CFLAGS="$CFLAGS"
|
||||
@ -3546,45 +3257,12 @@ AC_HELP_STRING([--disable-tls-srp],[Disable TLS-SRP authentication]),
|
||||
want_tls_srp=yes
|
||||
)
|
||||
|
||||
if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_OPENSSL_SRP" = "x1") ; then
|
||||
if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_SSLEAY_SRP" = "x1") ; then
|
||||
AC_DEFINE(USE_TLS_SRP, 1, [Use TLS-SRP authentication])
|
||||
USE_TLS_SRP=1
|
||||
curl_tls_srp_msg="enabled"
|
||||
fi
|
||||
|
||||
dnl ************************************************************
|
||||
dnl disable Unix domain sockets support
|
||||
dnl
|
||||
AC_MSG_CHECKING([whether to enable Unix domain sockets])
|
||||
AC_ARG_ENABLE(unix-sockets,
|
||||
AC_HELP_STRING([--enable-unix-sockets],[Enable Unix domain sockets])
|
||||
AC_HELP_STRING([--disable-unix-sockets],[Disable Unix domain sockets]),
|
||||
[ case "$enableval" in
|
||||
no) AC_MSG_RESULT(no)
|
||||
want_unix_sockets=no
|
||||
;;
|
||||
*) AC_MSG_RESULT(yes)
|
||||
want_unix_sockets=yes
|
||||
;;
|
||||
esac ], [
|
||||
AC_MSG_RESULT(auto)
|
||||
want_unix_sockets=auto
|
||||
]
|
||||
)
|
||||
if test "x$want_unix_sockets" != "xno"; then
|
||||
AC_CHECK_MEMBER([struct sockaddr_un.sun_path], [
|
||||
AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets])
|
||||
AC_SUBST(USE_UNIX_SOCKETS, [1])
|
||||
curl_unix_sockets_msg="enabled"
|
||||
], [
|
||||
if test "x$want_unix_sockets" = "xyes"; then
|
||||
AC_MSG_ERROR([--enable-unix-sockets is not available on this platform!])
|
||||
fi
|
||||
], [
|
||||
#include <sys/un.h>
|
||||
])
|
||||
fi
|
||||
|
||||
dnl ************************************************************
|
||||
dnl disable cookies support
|
||||
dnl
|
||||
@ -3660,7 +3338,7 @@ dnl For keeping supported features and protocols also in pkg-config file
|
||||
dnl since it is more cross-compile friendly than curl-config
|
||||
dnl
|
||||
|
||||
if test "x$OPENSSL_ENABLED" = "x1"; then
|
||||
if test "x$USE_SSLEAY" = "x1"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
|
||||
elif test -n "$SSL_ENABLED"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
|
||||
@ -3668,9 +3346,6 @@ fi
|
||||
if test "x$IPV6_ENABLED" = "x1"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6"
|
||||
fi
|
||||
if test "x$USE_UNIX_SOCKETS" = "x1"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES UnixSockets"
|
||||
fi
|
||||
if test "x$HAVE_LIBZ" = "x1"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES libz"
|
||||
fi
|
||||
@ -3688,33 +3363,22 @@ if test "x$HAVE_GSSAPI" = "x1"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES GSS-API"
|
||||
fi
|
||||
|
||||
if test "x$curl_psl_msg" = "xyes"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES PSL"
|
||||
fi
|
||||
|
||||
if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
|
||||
\( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES SPNEGO"
|
||||
fi
|
||||
|
||||
if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
|
||||
\( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES Kerberos"
|
||||
fi
|
||||
|
||||
if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1"; then
|
||||
if test "x$OPENSSL_ENABLED" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \
|
||||
if test "x$CURL_DISABLE_HTTP" != "x1" -a \
|
||||
"x$CURL_DISABLE_CRYPTO_AUTH" != "x1"; then
|
||||
if test "x$USE_SSLEAY" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \
|
||||
-o "x$GNUTLS_ENABLED" = "x1" -o "x$NSS_ENABLED" = "x1" \
|
||||
-o "x$DARWINSSL_ENABLED" = "x1"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
|
||||
|
||||
if test "x$CURL_DISABLE_HTTP" != "x1" -a \
|
||||
"x$NTLM_WB_ENABLED" = "x1"; then
|
||||
if test "x$NTLM_WB_ENABLED" = "x1"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM_WB"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$USE_TLS_SRP" = "x1"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES TLS-SRP"
|
||||
fi
|
||||
@ -3774,16 +3438,6 @@ if test "x$CURL_DISABLE_IMAP" != "x1"; then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAPS"
|
||||
fi
|
||||
fi
|
||||
if test "x$CURL_DISABLE_SMB" != "x1" \
|
||||
-a "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" \
|
||||
-a \( "x$OPENSSL_ENABLED" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \
|
||||
-o "x$GNUTLS_ENABLED" = "x1" -o "x$NSS_ENABLED" = "x1" \
|
||||
-o "x$DARWINSSL_ENABLED" = "x1" \); then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMB"
|
||||
if test "x$SSL_ENABLED" = "x1"; then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMBS"
|
||||
fi
|
||||
fi
|
||||
if test "x$CURL_DISABLE_SMTP" != "x1"; then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTP"
|
||||
if test "x$SSL_ENABLED" = "x1"; then
|
||||
@ -3839,7 +3493,6 @@ AC_CONFIG_FILES([Makefile \
|
||||
include/curl/Makefile \
|
||||
src/Makefile \
|
||||
lib/Makefile \
|
||||
scripts/Makefile \
|
||||
lib/libcurl.vers \
|
||||
tests/Makefile \
|
||||
tests/certs/Makefile \
|
||||
@ -3883,23 +3536,20 @@ AC_MSG_NOTICE([Configured to build curl/libcurl:
|
||||
GSS-API support: ${curl_gss_msg}
|
||||
TLS-SRP support: ${curl_tls_srp_msg}
|
||||
resolver: ${curl_res_msg}
|
||||
IPv6 support: ${curl_ipv6_msg}
|
||||
Unix sockets support: ${curl_unix_sockets_msg}
|
||||
ipv6 support: ${curl_ipv6_msg}
|
||||
IDN support: ${curl_idn_msg}
|
||||
Build libcurl: Shared=${enable_shared}, Static=${enable_static}
|
||||
Built-in manual: ${curl_manual_msg}
|
||||
--libcurl option: ${curl_libcurl_msg}
|
||||
Verbose errors: ${curl_verbose_msg}
|
||||
SSPI support: ${curl_sspi_msg}
|
||||
ca cert bundle: ${ca}${ca_warning}
|
||||
ca cert path: ${capath}${capath_warning}
|
||||
ca fallback: ${with_ca_fallback}
|
||||
ca cert bundle: ${ca}
|
||||
ca cert path: ${capath}
|
||||
LDAP support: ${curl_ldap_msg}
|
||||
LDAPS support: ${curl_ldaps_msg}
|
||||
RTSP support: ${curl_rtsp_msg}
|
||||
RTMP support: ${curl_rtmp_msg}
|
||||
metalink support: ${curl_mtlnk_msg}
|
||||
PSL support: ${curl_psl_msg}
|
||||
HTTP2 support: ${curl_h2_msg}
|
||||
Protocols: ${SUPPORT_PROTOCOLS}
|
||||
])
|
||||
|
@ -6,11 +6,11 @@
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 2013-2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
# Copyright (C) 2013-2014, 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.
|
||||
# are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
@ -25,54 +25,33 @@
|
||||
# This script shows all mentioned contributors from <hash> until HEAD. To aid
|
||||
# when writing RELEASE-NOTES and THANKS.
|
||||
#
|
||||
# Use --releasenotes to also include the names from the existing RELEASE-NOTES
|
||||
# file, which is handy when we've added names manually in there that should be
|
||||
# included in an updated list.
|
||||
#
|
||||
|
||||
start=$1
|
||||
|
||||
if test -z "$start"; then
|
||||
echo "Usage: $0 <since this tag/hash> [--releasenotes]"
|
||||
exit
|
||||
echo "Usage: $0 <since this tag/hash>"
|
||||
fi
|
||||
|
||||
# filter out Author:, Commit: and *by: lines
|
||||
# cut off the email parts
|
||||
# split list of names at comma
|
||||
# split list of names at " and "
|
||||
# cut off spaces first and last on the line
|
||||
# filter alternatives through THANKS-filter
|
||||
# only count names with a space (ie more than one word)
|
||||
# sort all unique names
|
||||
# awk them into RELEASE-NOTES format
|
||||
(
|
||||
git log $start..HEAD | \
|
||||
egrep -i '(Author|Commit|by):' | \
|
||||
cut -d: -f2- | \
|
||||
cut '-d<' -f1 | \
|
||||
tr , '\012' | \
|
||||
sed 's/ and /\n/' | \
|
||||
sed -e 's/^ //' -e 's/ $//g'
|
||||
|
||||
if echo "$*" | grep -qw -- '--releasenotes';then
|
||||
# if --releasenotes was used
|
||||
# grep out the list of names from RELEASE-NOTES
|
||||
# split on ", "
|
||||
# remove leading white spaces
|
||||
grep "^ [^ \(]" RELEASE-NOTES| \
|
||||
sed 's/, */\n/g'| \
|
||||
sed 's/^ *//'
|
||||
fi
|
||||
)| \
|
||||
sed -f ./docs/THANKS-filter | \
|
||||
sed -e 's/^ //' -e 's/ $//g' | \
|
||||
grep ' ' | \
|
||||
sort -fu | \
|
||||
sort -fu |
|
||||
awk '{
|
||||
num++;
|
||||
n = sprintf("%s%s%s,", n, length(n)?" ":"", $0);
|
||||
#print n;
|
||||
if(length(n) > 77) {
|
||||
if(length(n) > 78) {
|
||||
printf(" %s\n", p);
|
||||
n=sprintf("%s,", $0);
|
||||
}
|
@ -10,7 +10,7 @@
|
||||
#
|
||||
# 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.
|
||||
# are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
@ -71,7 +71,7 @@ while test $# -gt 0; do
|
||||
;;
|
||||
|
||||
--ca)
|
||||
echo @CURL_CA_BUNDLE@
|
||||
echo "@CURL_CA_BUNDLE@"
|
||||
;;
|
||||
|
||||
--cc)
|
||||
|
@ -27,7 +27,7 @@ Basic
|
||||
|
||||
C
|
||||
libcurl is a C library in itself!
|
||||
https://curl.haxx.se/libcurl/
|
||||
http://curl.haxx.se/libcurl/
|
||||
|
||||
C++
|
||||
|
||||
@ -50,7 +50,7 @@ Cocoa
|
||||
D
|
||||
|
||||
Written by Kenneth Bogert
|
||||
http://dlang.org/library/std/net/curl.html
|
||||
http://curl.haxx.se/libcurl/d/
|
||||
|
||||
Dylan
|
||||
|
||||
@ -60,7 +60,7 @@ Dylan
|
||||
Eiffel
|
||||
|
||||
Written by Eiffel Software
|
||||
https://room.eiffel.com/library/curl
|
||||
http://curl.haxx.se/libcurl/eiffel/
|
||||
|
||||
Euphoria
|
||||
|
||||
@ -78,7 +78,7 @@ Ferite
|
||||
|
||||
Gambas
|
||||
|
||||
http://gambas.sourceforge.net/
|
||||
http://gambas.sourceforge.net
|
||||
|
||||
glib/GTK+
|
||||
|
||||
@ -90,11 +90,6 @@ Guile:
|
||||
Written by Michael L. Gran
|
||||
http://www.lonelycactus.com/guile-curl.html
|
||||
|
||||
Harbour
|
||||
|
||||
Written by Viktor Szakáts
|
||||
https://github.com/vszakats/harbour-core/tree/master/contrib/hbcurl
|
||||
|
||||
Haskell
|
||||
|
||||
Written by Galois, Inc
|
||||
@ -102,7 +97,8 @@ Haskell
|
||||
|
||||
Java
|
||||
|
||||
https://github.com/pjlegato/curl-java
|
||||
Maintained by [blank]
|
||||
http://curl.haxx.se/libcurl/java/
|
||||
|
||||
Julia
|
||||
|
||||
@ -119,7 +115,7 @@ Lua
|
||||
luacurl by Alexander Marinov
|
||||
http://luacurl.luaforge.net/
|
||||
|
||||
Lua-cURL by Jürgen Hötzel
|
||||
Lua-cURL by Jürgen Hötzel
|
||||
http://luaforge.net/projects/lua-curl/
|
||||
|
||||
Mono
|
||||
@ -130,7 +126,7 @@ Mono
|
||||
.NET
|
||||
|
||||
libcurl-net by Jeffrey Phillips
|
||||
https://sourceforge.net/projects/libcurl-net/
|
||||
http://sourceforge.net/projects/libcurl-net/
|
||||
|
||||
node.js
|
||||
|
||||
@ -145,7 +141,7 @@ Object-Pascal
|
||||
O'Caml
|
||||
|
||||
Written by Lars Nilsson
|
||||
https://sourceforge.net/projects/ocurl/
|
||||
http://sourceforge.net/projects/ocurl/
|
||||
|
||||
Pascal
|
||||
|
||||
@ -154,13 +150,13 @@ Pascal
|
||||
|
||||
Perl
|
||||
|
||||
Maintained by Cris Bailiff and Bálint Szilakszi
|
||||
https://github.com/szbalint/WWW--Curl
|
||||
Maintained by Cris Bailiff
|
||||
http://curl.haxx.se/libcurl/perl/
|
||||
|
||||
PHP
|
||||
|
||||
Written by Sterling Hughes
|
||||
https://php.net/curl
|
||||
http://curl.haxx.se/libcurl/php/
|
||||
|
||||
PostgreSQL
|
||||
|
||||
@ -174,7 +170,8 @@ Python
|
||||
|
||||
R
|
||||
|
||||
http://cran.r-project.org/package=curl
|
||||
RCurl by Duncan Temple Lang
|
||||
http://www.omegahat.org/RCurl/
|
||||
|
||||
Rexx
|
||||
|
||||
@ -184,7 +181,7 @@ Rexx
|
||||
RPG
|
||||
|
||||
Support for ILE/RPG on OS/400 is included in source distribution
|
||||
https://curl.haxx.se/libcurl/
|
||||
http://curl.haxx.se/libcurl/
|
||||
See packages/OS400/README.OS400 and packages/OS400/curl.inc.in
|
||||
|
||||
Ruby
|
||||
@ -195,15 +192,10 @@ Ruby
|
||||
ruby-curl-multi - written by Kristjan Petursson and Keith Rarick
|
||||
http://curl-multi.rubyforge.org/
|
||||
|
||||
Rust
|
||||
|
||||
curl-rust - by Carl Lerche
|
||||
https://github.com/carllerche/curl-rust
|
||||
|
||||
Scheme
|
||||
|
||||
Bigloo binding by Kirill Lisovsky
|
||||
http://www.metapaper.net/lisovsky/web/curl/
|
||||
http://curl.haxx.se/libcurl/scheme/
|
||||
|
||||
S-Lang
|
||||
|
||||
@ -227,13 +219,13 @@ SPL
|
||||
|
||||
Tcl
|
||||
|
||||
Tclcurl by Andrés García
|
||||
http://mirror.yellow5.com/tclcurl/
|
||||
Tclcurl by Andrés García
|
||||
http://personal1.iddeo.es/andresgarci/tclcurl/english/docs.html
|
||||
|
||||
Visual Basic
|
||||
|
||||
libcurl-vb by Jeffrey Phillips
|
||||
https://sourceforge.net/projects/libcurl-vb/
|
||||
http://sourceforge.net/projects/libcurl-vb/
|
||||
|
||||
Visual Foxpro
|
||||
|
||||
@ -253,8 +245,3 @@ XBLite
|
||||
|
||||
Written by David Szafranski
|
||||
http://perso.wanadoo.fr/xblite/libraries.html
|
||||
|
||||
Xojo
|
||||
|
||||
Written by Andrew Lambert
|
||||
https://github.com/charonn0/RB-libcURL
|
||||
|
@ -35,12 +35,14 @@ BUGS
|
||||
have a go at a solution. You can optionally also post your bug/problem at
|
||||
curl's bug tracking system over at
|
||||
|
||||
https://github.com/curl/curl/issues
|
||||
https://sourceforge.net/p/curl/bugs/
|
||||
|
||||
Please read the rest of this document below first before doing that!
|
||||
Please read the rest of this document below first before doing that! Also,
|
||||
you need to login to your sourceforge account before being able to submit a
|
||||
bug report (necessary evil done to avoid spam).
|
||||
|
||||
If you feel you need to ask around first, find a suitable mailing list and
|
||||
post there. The lists are available on https://curl.haxx.se/mail/
|
||||
post there. The lists are available on http://curl.haxx.se/mail/
|
||||
|
||||
1.3 What to report
|
||||
|
||||
|
@ -1,32 +0,0 @@
|
||||
Contributor Code of Conduct
|
||||
===========================
|
||||
|
||||
As contributors and maintainers of this project, we pledge to respect all
|
||||
people who contribute through reporting issues, posting feature requests,
|
||||
updating documentation, submitting pull requests or patches, and other
|
||||
activities.
|
||||
|
||||
We are committed to making participation in this project a harassment-free
|
||||
experience for everyone, regardless of level of experience, gender, gender
|
||||
identity and expression, sexual orientation, disability, personal appearance,
|
||||
body size, race, ethnicity, age, or religion.
|
||||
|
||||
Examples of unacceptable behavior by participants include the use of sexual
|
||||
language or imagery, derogatory comments or personal attacks, trolling, public
|
||||
or private harassment, insults, or other unprofessional conduct.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct. Project maintainers who do not
|
||||
follow the Code of Conduct may be removed from the project team.
|
||||
|
||||
This code of conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community.
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by opening an issue or contacting one or more of the project
|
||||
maintainers.
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor
|
||||
Covenant](http://contributor-covenant.org), version 1.1.0, available at
|
||||
[http://contributor-covenant.org/version/1/1/0/](http://contributor-covenant.org/version/1/1/0/)
|
@ -1,185 +0,0 @@
|
||||
# cURL C code style
|
||||
|
||||
Source code that has a common style is easier to read than code that uses
|
||||
different styles in different places. It helps making the code feel like one
|
||||
single code base. Easy-to-read is a very important property of code and helps
|
||||
making it easier to review when new things are added and it helps debugging
|
||||
code when developers are trying to figure out why things go wrong. A unified
|
||||
style is more important than individual contributors having their own personal
|
||||
tastes satisfied.
|
||||
|
||||
Our C code has a few style rules. Most of them are verified and upheld by the
|
||||
lib/checksrc.pl script. Invoked with `make checksrc` or even by default by the
|
||||
build system when built after `./configure --enable-debug` has been used.
|
||||
|
||||
It is normally not a problem for anyone to follow the guidelines, as you just
|
||||
need to copy the style already used in the source code and there are no
|
||||
particularly unusual rules in our set of rules.
|
||||
|
||||
We also work hard on writing code that are warning-free on all the major
|
||||
platforms and in general on as many platforms as possible. Code that obviously
|
||||
will cause warnings will not be accepted as-is.
|
||||
|
||||
## Naming
|
||||
|
||||
Try using a non-confusing naming scheme for your new functions and variable
|
||||
names. It doesn't necessarily have to mean that you should use the same as in
|
||||
other places of the code, just that the names should be logical,
|
||||
understandable and be named according to what they're used for. File-local
|
||||
functions should be made static. We like lower case names.
|
||||
|
||||
See the INTERNALS document on how we name non-exported library-global symbols.
|
||||
|
||||
## Indenting
|
||||
|
||||
We use only spaces for indentation, never TABs. We use two spaces for each new
|
||||
open brace.
|
||||
|
||||
if(something_is_true) {
|
||||
while(second_statement == fine) {
|
||||
moo();
|
||||
}
|
||||
}
|
||||
|
||||
## Comments
|
||||
|
||||
Since we write C89 code, `//` comments are not allowed. They weren't
|
||||
introduced in the C standard until C99. We use only `/*` and `*/` comments:
|
||||
|
||||
/* this is a comment */
|
||||
|
||||
## Long lines
|
||||
|
||||
Source code in curl may never be wider than 80 columns and there are two
|
||||
reasons for maintaining this even in the modern era of very large and high
|
||||
resolution screens:
|
||||
|
||||
1. Narrower columns are easier to read than very wide ones. There's a reason
|
||||
newspapers have used columns for decades or centuries.
|
||||
|
||||
2. Narrower columns allow developers to easier show multiple pieces of code
|
||||
next to each other in different windows. I often have two or three source
|
||||
code windows next to each other on the same screen - as well as multiple
|
||||
terminal and debugging windows.
|
||||
|
||||
## Braces
|
||||
|
||||
In if/while/do/for expressions, we write the open brace on the same line as
|
||||
the keyword and we then set the closing brace on the same indentation level as
|
||||
the initial keyword. Like this:
|
||||
|
||||
if(age < 40) {
|
||||
/* clearly a youngster */
|
||||
}
|
||||
|
||||
When we write functions however, the opening brace should be in the first
|
||||
column of the first line:
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
## 'else' on the following line
|
||||
|
||||
When adding an `else` clause to a conditional expression using braces, we add
|
||||
it on a new line after the closing brace. Like this:
|
||||
|
||||
if(age < 40) {
|
||||
/* clearly a youngster */
|
||||
}
|
||||
else {
|
||||
/* probably grumpy */
|
||||
}
|
||||
|
||||
## No space before parentheses
|
||||
|
||||
When writing expressions using if/while/do/for, there shall be no space
|
||||
between the keyword and the open parenthesis. Like this:
|
||||
|
||||
while(1) {
|
||||
/* loop forever */
|
||||
}
|
||||
|
||||
## Use boolean conditions
|
||||
|
||||
Rather than test a conditional value such as a bool against TRUE or FALSE, a
|
||||
pointer against NULL or != NULL and an int against zero or not zero in
|
||||
if/while conditions we prefer:
|
||||
|
||||
result = do_something();
|
||||
if(!result) {
|
||||
/* something went wrong */
|
||||
return result;
|
||||
}
|
||||
|
||||
## No assignments in conditions
|
||||
|
||||
To increase readability and reduce complexity of conditionals, we avoid
|
||||
assigning variables within if/while conditions. We frown upon this style:
|
||||
|
||||
if((ptr = malloc(100)) == NULL)
|
||||
return NULL;
|
||||
|
||||
and instead we encourage the above version to be spelled out more clearly:
|
||||
|
||||
ptr = malloc(100);
|
||||
if(!ptr)
|
||||
return NULL;
|
||||
|
||||
## New block on a new line
|
||||
|
||||
We never write multiple statements on the same source line, even for very
|
||||
short if() conditions.
|
||||
|
||||
if(a)
|
||||
return TRUE;
|
||||
else if(b)
|
||||
return FALSE;
|
||||
|
||||
and NEVER:
|
||||
|
||||
if(a) return TRUE;
|
||||
else if(b) return FALSE;
|
||||
|
||||
## Space around operators
|
||||
|
||||
Please use spaces on both sides of operators in C expressions. Postfix `(),
|
||||
[], ->, ., ++, --` and Unary `+, - !, ~, &` operators excluded they should
|
||||
have no space.
|
||||
|
||||
Examples:
|
||||
|
||||
bla = func();
|
||||
who = name[0];
|
||||
age += 1;
|
||||
true = !false;
|
||||
size += -2 + 3 * (a + b);
|
||||
ptr->member = a++;
|
||||
struct.field = b--;
|
||||
ptr = &address;
|
||||
contents = *pointer;
|
||||
complement = ~bits;
|
||||
|
||||
## Platform dependent code
|
||||
|
||||
Use `#ifdef HAVE_FEATURE` to do conditional code. We avoid checking for
|
||||
particular operating systems or hardware in the #ifdef lines. The HAVE_FEATURE
|
||||
shall be generated by the configure script for unix-like systems and they are
|
||||
hard-coded in the config-[system].h files for the others.
|
||||
|
||||
We also encourage use of macros/functions that possibly are empty or defined
|
||||
to constants when libcurl is built without that feature, to make the code
|
||||
seamless. Like this style where the `magic()` function works differently
|
||||
depending on a build-time conditional:
|
||||
|
||||
#ifdef HAVE_MAGIC
|
||||
void magic(int a)
|
||||
{
|
||||
return a + 2;
|
||||
}
|
||||
#else
|
||||
#define magic(x) 1
|
||||
#endif
|
||||
|
||||
int content = magic(3);
|
131
docs/CONTRIBUTE
131
docs/CONTRIBUTE
@ -15,13 +15,18 @@
|
||||
1.2 License
|
||||
1.3 What To Read
|
||||
|
||||
2. Write a good patch
|
||||
2.1 Follow code style
|
||||
2.2 Non-clobbering All Over
|
||||
2.3 Write Separate Patches
|
||||
2.4 Patch Against Recent Sources
|
||||
2.5 Document
|
||||
2.6 Test Cases
|
||||
2. cURL Coding Standards
|
||||
2.1 Naming
|
||||
2.2 Indenting
|
||||
2.3 Commenting
|
||||
2.4 Line Lengths
|
||||
2.5 General Style
|
||||
2.6 Non-clobbering All Over
|
||||
2.7 Platform Dependent Code
|
||||
2.8 Write Separate Patches
|
||||
2.9 Patch Against Recent Sources
|
||||
2.10 Document
|
||||
2.11 Test Cases
|
||||
|
||||
3. Pushing Out Your Changes
|
||||
3.1 Write Access to git Repository
|
||||
@ -29,7 +34,7 @@
|
||||
3.3 How To Make a Patch without git
|
||||
3.4 How to get your changes into the main sources
|
||||
3.5 Write good commit messages
|
||||
3.6 About pull requests
|
||||
3.6 Please don't send pull requests
|
||||
|
||||
==============================================================================
|
||||
|
||||
@ -37,20 +42,16 @@
|
||||
|
||||
1.1 Join the Community
|
||||
|
||||
Skip over to https://curl.haxx.se/mail/ and join the appropriate mailing
|
||||
Skip over to http://curl.haxx.se/mail/ and join the appropriate mailing
|
||||
list(s). Read up on details before you post questions. Read this file before
|
||||
you start sending patches! We prefer patches and discussions being held on
|
||||
the mailing list(s), not sent to individuals.
|
||||
|
||||
Before posting to one of the curl mailing lists, please read up on the mailing
|
||||
list etiquette: https://curl.haxx.se/mail/etiquette.html
|
||||
list etiquette: http://curl.haxx.se/mail/etiquette.html
|
||||
|
||||
We also hang out on IRC in #curl on irc.freenode.net
|
||||
|
||||
If you're at all interested in the code side of things, consider clicking
|
||||
'watch' on the curl repo at github to get notified on pull requests and new
|
||||
issues posted there.
|
||||
|
||||
1.2. License
|
||||
|
||||
When contributing with code, you agree to put your changes and new code under
|
||||
@ -77,20 +78,53 @@
|
||||
|
||||
1.3 What To Read
|
||||
|
||||
Source code, the man pages, the INTERNALS document, TODO, KNOWN_BUGS and the
|
||||
most recent changes in the git log. Just lurking on the curl-library mailing
|
||||
list is gonna give you a lot of insights on what's going on right now. Asking
|
||||
there is a good idea too.
|
||||
Source code, the man pages, the INTERNALS document, TODO, KNOWN_BUGS, the
|
||||
most recent CHANGES. Just lurking on the curl-library mailing list is gonna
|
||||
give you a lot of insights on what's going on right now. Asking there is a
|
||||
good idea too.
|
||||
|
||||
2. Write a good patch
|
||||
2. cURL Coding Standards
|
||||
|
||||
2.1 Follow code style
|
||||
2.1 Naming
|
||||
|
||||
When writing C code, follow the CODE_STYLE already established in the
|
||||
project. Consistent style makes code easier to read and mistakes less likely
|
||||
to happen.
|
||||
Try using a non-confusing naming scheme for your new functions and variable
|
||||
names. It doesn't necessarily have to mean that you should use the same as in
|
||||
other places of the code, just that the names should be logical,
|
||||
understandable and be named according to what they're used for. File-local
|
||||
functions should be made static. We like lower case names.
|
||||
|
||||
2.2 Non-clobbering All Over
|
||||
See the INTERNALS document on how we name non-exported library-global
|
||||
symbols.
|
||||
|
||||
2.2 Indenting
|
||||
|
||||
Use the same indenting levels and bracing method as all the other code
|
||||
already does. It makes the source code easier to follow if all of it is
|
||||
written using the same style. We don't ask you to like it, we just ask you to
|
||||
follow the tradition! ;-) This mainly means: 2-level indents, using spaces
|
||||
only (no tabs) and having the opening brace ({) on the same line as the if()
|
||||
or while().
|
||||
|
||||
Also note that we use if() and while() with no space before the parenthesis.
|
||||
|
||||
2.3 Commenting
|
||||
|
||||
Comment your source code extensively using C comments (/* comment */), DO NOT
|
||||
use C++ comments (// this style). Commented code is quality code and enables
|
||||
future modifications much more. Uncommented code risk having to be completely
|
||||
replaced when someone wants to extend things, since other persons' source
|
||||
code can get quite hard to read.
|
||||
|
||||
2.4 Line Lengths
|
||||
|
||||
We write source lines shorter than 80 columns.
|
||||
|
||||
2.5 General Style
|
||||
|
||||
Keep your functions small. If they're small you avoid a lot of mistakes and
|
||||
you don't accidentally mix up variables etc.
|
||||
|
||||
2.6 Non-clobbering All Over
|
||||
|
||||
When you write new functionality or fix bugs, it is important that you don't
|
||||
fiddle all over the source files and functions. Remember that it is likely
|
||||
@ -99,7 +133,14 @@
|
||||
functionality, try writing it in a new source file. If you fix bugs, try to
|
||||
fix one bug at a time and send them as separate patches.
|
||||
|
||||
2.3 Write Separate Patches
|
||||
2.7 Platform Dependent Code
|
||||
|
||||
Use #ifdef HAVE_FEATURE to do conditional code. We avoid checking for
|
||||
particular operating systems or hardware in the #ifdef lines. The
|
||||
HAVE_FEATURE shall be generated by the configure script for unix-like systems
|
||||
and they are hard-coded in the config-[system].h files for the others.
|
||||
|
||||
2.8 Write Separate Patches
|
||||
|
||||
It is annoying when you get a huge patch from someone that is said to fix 511
|
||||
odd problems, but discussions and opinions don't agree with 510 of them - or
|
||||
@ -113,14 +154,14 @@
|
||||
Also, separate patches enable bisecting much better when we track problems in
|
||||
the future.
|
||||
|
||||
2.4 Patch Against Recent Sources
|
||||
2.9 Patch Against Recent Sources
|
||||
|
||||
Please try to get the latest available sources to make your patches
|
||||
against. It makes the life of the developers so much easier. The very best is
|
||||
if you get the most up-to-date sources from the git repository, but the
|
||||
latest release archive is quite OK as well!
|
||||
|
||||
2.5 Document
|
||||
2.10 Document
|
||||
|
||||
Writing docs is dead boring and one of the big problems with many open source
|
||||
projects. Someone's gotta do it. It makes it a lot easier if you submit a
|
||||
@ -131,7 +172,7 @@
|
||||
ASCII files. All HTML files on the web site and in the release archives are
|
||||
generated from the nroff/ASCII versions.
|
||||
|
||||
2.6 Test Cases
|
||||
2.11 Test Cases
|
||||
|
||||
Since the introduction of the test suite, we can quickly verify that the main
|
||||
features are working as they're supposed to. To maintain this situation and
|
||||
@ -158,7 +199,7 @@
|
||||
|
||||
You need to first checkout the repository:
|
||||
|
||||
git clone https://github.com/curl/curl.git
|
||||
git clone git://github.com/bagder/curl.git
|
||||
|
||||
You then proceed and edit all the files you like and you commit them to your
|
||||
local repository:
|
||||
@ -200,8 +241,8 @@
|
||||
|
||||
For unix-like operating systems:
|
||||
|
||||
https://savannah.gnu.org/projects/patch/
|
||||
https://www.gnu.org/software/diffutils/
|
||||
http://www.gnu.org/software/patch/patch.html
|
||||
http://www.gnu.org/directory/diffutils.html
|
||||
|
||||
For Windows:
|
||||
|
||||
@ -247,15 +288,27 @@
|
||||
and make sure that you have your own user and email setup correctly in git
|
||||
before you commit
|
||||
|
||||
3.6 About pull requests
|
||||
3.6 Please don't send pull requests
|
||||
|
||||
With git (and especially github) it is easy and tempting to send a pull
|
||||
request to the curl project to have changes merged this way instead of
|
||||
mailing patches to the curl-library mailing list.
|
||||
request to one or more people in the curl project to have changes merged this
|
||||
way instead of mailing patches to the curl-library mailing list.
|
||||
|
||||
We used to dislike this but we're trying to change that and accept that this
|
||||
is a frictionless way for people to contribute to the project. We now welcome
|
||||
pull requests!
|
||||
We don't like that. We want them mailed for these reasons:
|
||||
|
||||
We will continue to avoid using github's merge tools to make the history
|
||||
linear and to make sure commits follow our style guidelines.
|
||||
- Peer review. Anyone and everyone on the list can review, comment and
|
||||
improve on the patch. Pull requests limit this ability.
|
||||
|
||||
- Anyone can merge the patch into their own trees for testing and those who
|
||||
have push rights can push it to the main repo. It doesn't have to be anyone
|
||||
the patch author knows beforehand.
|
||||
|
||||
- Commit messages can be tweaked and changed if merged locally instead of
|
||||
using github. Merges directly on github requires the changes to be perfect
|
||||
already, which they seldom are.
|
||||
|
||||
- Merges on github prevents rebases and even enforces --no-ff which is a git
|
||||
style we don't otherwise use in the project
|
||||
|
||||
However: once patches have been reviewed and deemed fine on list they are
|
||||
perfectly OK to be pulled from a published git tree.
|
||||
|
176
docs/DISTRO-DILEMMA
Normal file
176
docs/DISTRO-DILEMMA
Normal file
@ -0,0 +1,176 @@
|
||||
Date: February 11, 2007
|
||||
Author: Daniel Stenberg <daniel@haxx.se>
|
||||
URL: http://curl.haxx.se/legal/distro-dilemma.html
|
||||
|
||||
Condition
|
||||
|
||||
This document is written to describe the situation as it is right now.
|
||||
libcurl 7.16.1 is currently the latest version available. Things may of
|
||||
course change in the future.
|
||||
|
||||
This document reflects my view and understanding of these things. Please tell
|
||||
me where and how you think I'm wrong, and I'll try to correct my mistakes.
|
||||
|
||||
Background
|
||||
|
||||
The Free Software Foundation has deemed the Original BSD license[1] to be
|
||||
"incompatible"[2] with GPL[3]. I'd rather say it is the other way around, but
|
||||
the point is the same: if you distribute a binary version of a GPL program,
|
||||
it MUST NOT be linked with any Original BSD-licensed parts or libraries.
|
||||
Doing so will violate the GPL license. For a long time, very many GPL
|
||||
licensed programs have avoided this license mess by adding an exception[8] to
|
||||
their license. And many others have just closed their eyes for this problem.
|
||||
|
||||
libcurl is MIT-style[4] licensed - how on earth did this dilemma fall onto
|
||||
our plates?
|
||||
|
||||
libcurl is only a little library. libcurl can be built to use OpenSSL for its
|
||||
SSL/TLS capabilities. OpenSSL is basically Original BSD licensed[5].
|
||||
|
||||
If libcurl built to use OpenSSL is used by a GPL-licensed application and you
|
||||
decide to distribute a binary version of it (Linux distros - for example -
|
||||
tend to), you have a clash. GPL vs Original BSD.
|
||||
|
||||
This dilemma is not libcurl-specific nor is it specific to any particular
|
||||
Linux distro. (This article mentions and refers to Debian several times, but
|
||||
only because Debian seems to be the only Linux distro to have faced this
|
||||
issue yet since no other distro is shipping libcurl built with two SSL
|
||||
libraries.)
|
||||
|
||||
Part of the Operating System
|
||||
|
||||
This would not be a problem if the used lib would be considered part of the
|
||||
underlying operating system, as then the GPL license has an exception
|
||||
clause[6] that allows applications to use such libs without having to be
|
||||
allowed to distribute it or its sources. Possibly some distros will claim
|
||||
that OpenSSL is part of their operating system.
|
||||
|
||||
Debian does however not take this stance and has officially(?) claimed that
|
||||
OpenSSL is not a required part of the Debian operating system
|
||||
|
||||
Some people claim that this paragraph cannot be exploited this way by a Linux
|
||||
distro, but I am not a lawyer and that is a discussion left outside of this
|
||||
document.
|
||||
|
||||
GnuTLS
|
||||
|
||||
Since May 2005 libcurl can get built to use GnuTLS instead of OpenSSL. GnuTLS
|
||||
is an LGPL[7] licensed library that offers a matching set of features as
|
||||
OpenSSL does. Now, you can build and distribute an TLS/SSL capable libcurl
|
||||
without including any Original BSD licensed code.
|
||||
|
||||
I believe Debian is the first (only?) distro that provides libcurl/GnuTLS
|
||||
packages.
|
||||
|
||||
yassl
|
||||
|
||||
libcurl can get also get built to use yassl for the TLS/SSL layer. yassl is a
|
||||
GPL[3] licensed library.
|
||||
|
||||
|
||||
GnuTLS vs OpenSSL vs yassl
|
||||
|
||||
While these three libraries offer similar features, they are not equal.
|
||||
libcurl does not (yet) offer a standardized stable ABI if you decide to
|
||||
switch from using libcurl-openssl to libcurl-gnutls or vice-versa. The GnuTLS
|
||||
and yassl support is very recent in libcurl and it has not been tested nor
|
||||
used very extensively, while the OpenSSL equivalent code has been used and
|
||||
thus matured since 1999.
|
||||
|
||||
GnuTLS
|
||||
- LGPL licensed
|
||||
- supports SRP
|
||||
- lacks SSLv2 support
|
||||
- lacks MD2 support (used by at least some CA certs)
|
||||
- lacks the crypto functions libcurl uses for NTLM
|
||||
|
||||
OpenSSL
|
||||
- Original BSD licensed
|
||||
- lacks SRP
|
||||
- supports SSLv2
|
||||
- older and more widely used
|
||||
- provides crypto functions libcurl uses for NTLM
|
||||
- libcurl can do non-blocking connects with it in 7.15.4 and later
|
||||
|
||||
yassl
|
||||
- GPL licensed
|
||||
- much untested and unproven in the real work by (lib)curl users so we don't
|
||||
know a lot about restrictions or benefits from using this
|
||||
|
||||
The Better License, Original BSD, GPL or LGPL?
|
||||
|
||||
It isn't obvious or without debate to any objective interested party that
|
||||
either of these licenses are the "better" or even the "preferred" one in a
|
||||
generic situation.
|
||||
|
||||
Instead, I think we should accept the fact that the SSL/TLS libraries and
|
||||
their different licenses will fit different applications and their authors
|
||||
differently depending on the applications' licenses and their general usage
|
||||
pattern (considering how GPL and LGPL libraries for example can be burdensome
|
||||
for embedded systems usage).
|
||||
|
||||
In Debian land, there seems to be a common opinion that LGPL is "maximally
|
||||
compatible" with apps while Original BSD is not. Like this:
|
||||
|
||||
http://lists.debian.org/debian-devel/2005/09/msg01417.html
|
||||
|
||||
More SSL Libraries
|
||||
|
||||
In libcurl, there's no stopping us here. There are more Open Source/Free
|
||||
SSL/TLS libraries out there and we would very much like to support them as
|
||||
well, to offer application authors an even wider scope of choice.
|
||||
|
||||
Application Angle of this Problem
|
||||
|
||||
libcurl is built to use one SSL/TLS library. It uses a single fixed name (by
|
||||
default) on the built/created lib file, and applications are built/linked to
|
||||
use that single lib. Replacing one libcurl instance with another one that
|
||||
uses the other SSL/TLS library might break one or more applications (due to
|
||||
ABI differences and/or different feature set). You want your application to
|
||||
use the libcurl it was built for.
|
||||
|
||||
Project cURL Angle of this Problem
|
||||
|
||||
We distribute libcurl and everyone may build libcurl with either library at
|
||||
their choice. This problem is not directly a problem of ours. It merely
|
||||
affects users - GPL application authors only - of our lib as it comes
|
||||
included and delivered on some distros.
|
||||
|
||||
libcurl has different ABI when built with different SSL/TLS libraries due to
|
||||
these reasons:
|
||||
|
||||
1. No one has worked on fixing this. The mutex/lock callbacks should be set
|
||||
with a generic libcurl function that should use the proper underlying
|
||||
functions.
|
||||
|
||||
2. The CURLOPT_SSL_CTX_FUNCTION option is not possible to "emulate" on GnuTLS
|
||||
but simply requires OpenSSL.
|
||||
|
||||
3. There might be some other subtle differences just because nobody has yet
|
||||
tried to make a fixed ABI like this.
|
||||
|
||||
Distro Angle of this Problem
|
||||
|
||||
To my knowledge there is only one distro that ships libcurl built with either
|
||||
OpenSSL or GnuTLS.
|
||||
|
||||
Debian Linux is now (since mid September 2005) providing two different
|
||||
libcurl packages, one for libcurl built with OpenSSL and one built with
|
||||
GnuTLS. They use different .so names and can this both be installed in a
|
||||
single system simultaneously. This has been said to be a transitional system
|
||||
not desired to keep in the long run.
|
||||
|
||||
Footnotes
|
||||
|
||||
[1] = http://www.xfree86.org/3.3.6/COPYRIGHT2.html#6
|
||||
[2] = http://www.fsf.org/licensing/essays/bsd.html
|
||||
[3] = http://www.fsf.org/licensing/licenses/gpl.html
|
||||
[4] = http://curl.haxx.se/docs/copyright.html
|
||||
[5] = http://www.openssl.org/source/license.html
|
||||
[6] = http://www.fsf.org/licensing/licenses/gpl.html end of section 3
|
||||
[7] = http://www.fsf.org/licensing/licenses/lgpl.html
|
||||
[8] = http://en.wikipedia.org/wiki/OpenSSL_exception
|
||||
|
||||
Feedback/Updates provided by
|
||||
|
||||
Eric Cooper
|
132
docs/FAQ
132
docs/FAQ
@ -21,7 +21,6 @@ FAQ
|
||||
1.12 I have a problem who can I chat with?
|
||||
1.13 curl's ECCN number?
|
||||
1.14 How do I submit my patch?
|
||||
1.15 How do I port libcurl to my OS?
|
||||
|
||||
2. Install Related Problems
|
||||
2.1 configure doesn't find OpenSSL even when it is installed
|
||||
@ -30,7 +29,6 @@ FAQ
|
||||
2.2 Does curl work/build with other SSL libraries?
|
||||
2.3 Where can I find a copy of LIBEAY32.DLL?
|
||||
2.4 Does curl support SOCKS (RFC 1928) ?
|
||||
2.5 Install libcurl for both 32bit and 64bit?
|
||||
|
||||
3. Usage Problems
|
||||
3.1 curl: (1) SSL is disabled, https: not supported
|
||||
@ -83,7 +81,6 @@ FAQ
|
||||
4.18 file:// URLs containing drive letters (Windows, NetWare)
|
||||
4.19 Why doesn't cURL return an error when the network cable is unplugged?
|
||||
4.20 curl doesn't return error for HTTP non-200 responses!
|
||||
4.21 Why is there a HTTP/1.1 in my HTTP/2 request?
|
||||
|
||||
5. libcurl Issues
|
||||
5.1 Is libcurl thread-safe?
|
||||
@ -137,7 +134,7 @@ FAQ
|
||||
|
||||
A free and easy-to-use client-side URL transfer library, supporting DICT,
|
||||
FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3,
|
||||
POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP.
|
||||
POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET and TFTP.
|
||||
|
||||
libcurl supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading,
|
||||
Kerberos, SPNEGO, HTTP form based upload, proxies, cookies, user+password
|
||||
@ -226,9 +223,7 @@ FAQ
|
||||
implement it for you, that is not a very friendly attitude. We spend a
|
||||
considerable time already on maintaining and developing curl. In order to
|
||||
get more out of us, you should consider trading in some of your time and
|
||||
efforts in return. Simply go to the GitHub repo which resides at
|
||||
https://github.com/curl/curl, fork the project, and create pull requests
|
||||
with your proposed changes.
|
||||
efforts in return.
|
||||
|
||||
If you write the code, chances are bigger that it will get into curl faster.
|
||||
|
||||
@ -254,10 +249,9 @@ FAQ
|
||||
|
||||
We still get help from companies. Haxx provides web site, bandwidth, mailing
|
||||
lists etc, sourceforge.net hosts project services we take advantage from,
|
||||
like the bug tracker, and GitHub hosts the primary git repository at
|
||||
https://github.com/curl/curl. Also again, some companies have sponsored
|
||||
certain parts of the development in the past and I hope some will continue to
|
||||
do so in the future.
|
||||
like the bug tracker and github hosts the primary git repository. Also
|
||||
again, some companies have sponsored certain parts of the development in the
|
||||
past and I hope some will continue to do so in the future.
|
||||
|
||||
If you want to support our project, consider a donation or a banner-program
|
||||
or even better: by helping us coding, documenting, testing etc.
|
||||
@ -282,7 +276,7 @@ FAQ
|
||||
Please do not mail any single individual unless you really need to. Keep
|
||||
curl-related questions on a suitable mailing list. All available mailing
|
||||
lists are listed in the MANUAL document and online at
|
||||
https://curl.haxx.se/mail/
|
||||
http://curl.haxx.se/mail/
|
||||
|
||||
Keeping curl-related questions and discussions on mailing lists allows
|
||||
others to join in and help, to share their ideas, contribute their
|
||||
@ -303,7 +297,7 @@ FAQ
|
||||
your curl-related problems.
|
||||
|
||||
We list available alternatives on the curl web site:
|
||||
https://curl.haxx.se/support.html
|
||||
http://curl.haxx.se/support.html
|
||||
|
||||
1.10 How many are using curl?
|
||||
|
||||
@ -320,7 +314,7 @@ FAQ
|
||||
In May 2012 Daniel did a counting game and came up with a number that may
|
||||
be completely wrong or somewhat accurate. Over 500 million!
|
||||
|
||||
See https://daniel.haxx.se/blog/2012/05/16/300m-users/
|
||||
See http://daniel.haxx.se/blog/2012/05/16/300m-users/
|
||||
|
||||
1.11 Why don't you update ca-bundle.crt
|
||||
|
||||
@ -342,7 +336,7 @@ FAQ
|
||||
If you want the most recent collection of ca certs that Mozilla Firefox
|
||||
uses, we recommend that you extract the collection yourself from Mozilla
|
||||
Firefox (by running 'make ca-bundle), or by using our online service setup
|
||||
for this purpose: https://curl.haxx.se/docs/caextract.html
|
||||
for this purpose: http://curl.haxx.se/docs/caextract.html
|
||||
|
||||
1.12 I have a problem who can I chat with?
|
||||
|
||||
@ -356,15 +350,13 @@ FAQ
|
||||
cryptography. When doing so, the Export Control Classification Number (ECCN)
|
||||
is used to identify the level of export control etc.
|
||||
|
||||
Apache Software Foundation gives a good explanation of ECCNs at
|
||||
https://www.apache.org/dev/crypto.html
|
||||
ASF gives a good explanation at http://www.apache.org/dev/crypto.html
|
||||
|
||||
We believe curl's number might be ECCN 5D002, another possibility is
|
||||
5D992. It seems necessary to write them (the authority that administers ECCN
|
||||
numbers), asking to confirm.
|
||||
5D992. It seems necessary to write them, asking to confirm.
|
||||
|
||||
Comprehensible explanations of the meaning of such numbers and how to obtain
|
||||
them (resp.) are here
|
||||
Comprehensible explanations of the meaning of such numbers and how to
|
||||
obtain them (resp.) are here
|
||||
|
||||
http://www.bis.doc.gov/licensing/exportingbasics.htm
|
||||
http://www.bis.doc.gov/licensing/do_i_needaneccn.html
|
||||
@ -387,19 +379,6 @@ FAQ
|
||||
|
||||
Lots of more details are found in the CONTRIBUTE and INTERNALS docs.
|
||||
|
||||
1.15 How do I port libcurl to my OS?
|
||||
|
||||
Here's a rough step-by-step:
|
||||
|
||||
1. copy a suitable lib/config-*.h file as a start to lib/config-[youros].h
|
||||
|
||||
2. edit lib/config-[youros].h to match your OS and setup
|
||||
|
||||
3. edit lib/curl_setup.h to include config-[youros].h when your OS is
|
||||
detected by the preprocessor, in the style others already exist
|
||||
|
||||
4. compile lib/*.c and make them into a library
|
||||
|
||||
|
||||
2. Install Related Problems
|
||||
|
||||
@ -450,7 +429,7 @@ FAQ
|
||||
GnuTLS, yassl, NSS, PolarSSL, axTLS, Secure Transport (native iOS/OS X),
|
||||
WinSSL (native Windows) or GSKit (native IBM i). They all have their pros
|
||||
and cons, and we try to maintain a comparison of them here:
|
||||
https://curl.haxx.se/docs/ssl-compared.html
|
||||
http://curl.haxx.se/docs/ssl-compared.html
|
||||
|
||||
2.3 Where can I find a copy of LIBEAY32.DLL?
|
||||
|
||||
@ -465,32 +444,6 @@ FAQ
|
||||
|
||||
Yes, SOCKS 4 and 5 are supported.
|
||||
|
||||
2.5 Install libcurl for both 32bit and 64bit?
|
||||
|
||||
In curl's configure procedure one of the regular include files get created
|
||||
with platform specific information. The file 'curl/curlbuild.h' in the
|
||||
installed libcurl file tree is therefore somewhat tied to that particular
|
||||
platform.
|
||||
|
||||
To allow applications to get built for either 32bit or 64bit you need to
|
||||
install libcurl headers for both setups and unfortunately curl doesn't do
|
||||
this automatically.
|
||||
|
||||
A commonly used procedure is this:
|
||||
|
||||
$ ./configure [32bit platform]
|
||||
$ mv curl/curlbuild.h curl/curlbuild-32bit.h
|
||||
$ ./configure [64bit platform]
|
||||
$ mv curl/curlbuild.h curl/curlbuild-64bit.h
|
||||
|
||||
Then you make a toplevel curl/curlbuild.h replacement that only does this:
|
||||
|
||||
#ifdef IS_32BIT
|
||||
#include "curlbuild-32bit.h"
|
||||
else
|
||||
#include "curlbuild-64bit.h"
|
||||
#endif
|
||||
|
||||
|
||||
3. Usage problems
|
||||
|
||||
@ -588,7 +541,7 @@ FAQ
|
||||
|
||||
Find out more about which languages that support curl directly, and how to
|
||||
install and use them, in the libcurl section of the curl web site:
|
||||
https://curl.haxx.se/libcurl/
|
||||
http://curl.haxx.se/libcurl/
|
||||
|
||||
All the various bindings to libcurl are made by other projects and people,
|
||||
outside of the cURL project. The cURL project itself only produces libcurl
|
||||
@ -721,7 +674,7 @@ FAQ
|
||||
certificate. Server certificate verification is enabled by default in curl
|
||||
and libcurl and is often the reason for problems as explained in FAQ entry
|
||||
4.12 and the SSLCERTS document
|
||||
(https://curl.haxx.se/docs/sslcerts.html). Server certificates that are
|
||||
(http://curl.haxx.se/docs/sslcerts.html). Server certificates that are
|
||||
"self-signed" or otherwise signed by a CA that you do not have a CA cert
|
||||
for, cannot be verified. If the verification during a connect fails, you are
|
||||
refused access. You then need to explicitly disable the verification to
|
||||
@ -811,9 +764,8 @@ FAQ
|
||||
request-body in a GET request with something like "curl -X GET -d data
|
||||
[URL]"
|
||||
|
||||
Note that -X doesn't actually change curl's behavior as it only modifies the
|
||||
actual string sent in the request, but that may of course trigger a
|
||||
different set of events.
|
||||
Note that -X doesn't change curl's behavior. It only modifies the actual
|
||||
string sent in the request.
|
||||
|
||||
Accordingly, by using -XPOST on a command line that for example would follow
|
||||
a 303 redirect, you will effectively prevent curl from behaving
|
||||
@ -1012,7 +964,7 @@ FAQ
|
||||
this check.
|
||||
|
||||
Details are also in the SSLCERTS file in the release archives, found online
|
||||
here: https://curl.haxx.se/docs/sslcerts.html
|
||||
here: http://curl.haxx.se/docs/sslcerts.html
|
||||
|
||||
4.13 Why is curl -R on Windows one hour off?
|
||||
|
||||
@ -1074,7 +1026,7 @@ FAQ
|
||||
timeout is set.
|
||||
|
||||
See option TcpMaxConnectRetransmissions on this page:
|
||||
https://support.microsoft.com/en-us/kb/175523/en-us
|
||||
http://support.microsoft.com/?scid=kb%3Ben-us%3B175523&x=6&y=7
|
||||
|
||||
Also, even on non-Windows systems there may run a firewall or anti-virus
|
||||
software or similar that accepts the connection but does not actually do
|
||||
@ -1091,7 +1043,7 @@ FAQ
|
||||
You'll find that even if D:\blah.txt does exist, cURL returns a 'file
|
||||
not found' error.
|
||||
|
||||
According to RFC 1738 (https://www.ietf.org/rfc/rfc1738.txt),
|
||||
According to RFC 1738 (http://www.faqs.org/rfcs/rfc1738.html),
|
||||
file:// URLs must contain a host component, but it is ignored by
|
||||
most implementations. In the above example, 'D:' is treated as the
|
||||
host component, and is taken away. Thus, cURL tries to open '/blah.txt'.
|
||||
@ -1119,7 +1071,7 @@ FAQ
|
||||
|
||||
In such cases, the TCP/IP stack is responsible for detecting when the
|
||||
network connection is irrevocably lost. Since with some protocols it is
|
||||
perfectly legal for the client to wait indefinitely for data, the stack may
|
||||
perfectly legal for the client wait indefinitely for data, the stack may
|
||||
never report a problem, and even when it does, it can take up to 20 minutes
|
||||
for it to detect an issue. The curl option --keepalive-time enables
|
||||
keep-alive support in the TCP/IP stack which makes it periodically probe the
|
||||
@ -1163,16 +1115,6 @@ FAQ
|
||||
You can also use the -w option and the variable %{response_code} to extract
|
||||
the exact response code that was return in the response.
|
||||
|
||||
4.21 Why is there a HTTP/1.1 in my HTTP/2 request?
|
||||
|
||||
If you use verbose to see the HTTP request when you send off a HTTP/2
|
||||
request, it will still say 1.1.
|
||||
|
||||
The reason for this is that we first generate the request to send using the
|
||||
old 1.1 style and show that request in the verbose output, and then we
|
||||
convert it over to the binary header-compressed HTTP/2 style. The actual
|
||||
"1.1" part from that request is then not actually used in the transfer. The
|
||||
binary HTTP/2 headers are not human readable.
|
||||
|
||||
5. libcurl Issues
|
||||
|
||||
@ -1195,13 +1137,13 @@ FAQ
|
||||
If you use a OpenSSL-powered libcurl in a multi-threaded environment, you
|
||||
need to provide one or two locking functions:
|
||||
|
||||
https://www.openssl.org/docs/crypto/threads.html
|
||||
http://www.openssl.org/docs/crypto/threads.html
|
||||
|
||||
If you use a GnuTLS-powered libcurl in a multi-threaded environment, you
|
||||
need to provide locking function(s) for libgcrypt (which is used by GnuTLS
|
||||
for the crypto functions).
|
||||
|
||||
https://web.archive.org/web/20111103083330/http://www.gnu.org/software/gnutls/manual/html_node/Multi_002dthreaded-applications.html
|
||||
http://www.gnu.org/software/gnutls/manual/html_node/Multi_002dthreaded-applications.html
|
||||
|
||||
No special locking is needed with a NSS-powered libcurl. NSS is thread-safe.
|
||||
|
||||
@ -1332,7 +1274,7 @@ FAQ
|
||||
you want to change name resolver function you must rebuild libcurl and tell
|
||||
it to use a different function.
|
||||
|
||||
- The non-IPv6 resolver that can use one out of four host name resolve calls
|
||||
- The non-ipv6 resolver that can use one out of four host name resolve calls
|
||||
(depending on what your system supports):
|
||||
|
||||
A - gethostbyname()
|
||||
@ -1340,15 +1282,15 @@ FAQ
|
||||
C - gethostbyname_r() with 5 arguments
|
||||
D - gethostbyname_r() with 6 arguments
|
||||
|
||||
- The IPv6-resolver that uses getaddrinfo()
|
||||
- The ipv6-resolver that uses getaddrinfo()
|
||||
|
||||
- The c-ares based name resolver that uses the c-ares library for resolves.
|
||||
Using this offers asynchronous name resolves.
|
||||
|
||||
- The threaded resolver (default option on Windows). It uses:
|
||||
|
||||
A - gethostbyname() on plain IPv4 hosts
|
||||
B - getaddrinfo() on IPv6 enabled hosts
|
||||
A - gethostbyname() on plain ipv4 hosts
|
||||
B - getaddrinfo() on ipv6-enabled hosts
|
||||
|
||||
Also note that libcurl never resolves or reverse-lookups addresses given as
|
||||
pure numbers, such as 127.0.0.1 or ::1.
|
||||
@ -1377,7 +1319,7 @@ FAQ
|
||||
Also note that on many networks NATs or other IP-munging techniques are used
|
||||
that makes you see and use a different IP address locally than what the
|
||||
remote server will see you coming from. You may also consider using
|
||||
https://www.torproject.org/ .
|
||||
http://www.torproject.org .
|
||||
|
||||
5.13 How do I stop an ongoing transfer?
|
||||
|
||||
@ -1429,7 +1371,7 @@ FAQ
|
||||
to do "LIST -a" or similar to see them.
|
||||
|
||||
The application thus needs to parse the LIST output. One such existing
|
||||
list parser is available at https://cr.yp.to/ftpparse.html Versions of
|
||||
list parser is available at http://cr.yp.to/ftpparse.html Versions of
|
||||
libcurl since 7.21.0 also provide the ability to specify a wildcard to
|
||||
download multiple files from one FTP directory.
|
||||
|
||||
@ -1548,7 +1490,7 @@ FAQ
|
||||
notice" somewhere. Most probably like in the documentation or in the section
|
||||
where other third party dependencies already are mentioned and acknowledged.
|
||||
|
||||
As can be seen here: https://curl.haxx.se/docs/companies.html and elsewhere,
|
||||
As can be seen here: http://curl.haxx.se/docs/companies.html and elsewhere,
|
||||
more and more companies are discovering the power of libcurl and take
|
||||
advantage of it even in commercial environments.
|
||||
|
||||
@ -1568,7 +1510,9 @@ FAQ
|
||||
|
||||
7.2 Who wrote PHP/CURL?
|
||||
|
||||
PHP/CURL was initially written by Sterling Hughes.
|
||||
PHP/CURL is a module that comes with the regular PHP package. It depends and
|
||||
uses libcurl, so you need to have libcurl installed properly first before
|
||||
PHP/CURL can be used. PHP/CURL was initially written by Sterling Hughes.
|
||||
|
||||
7.3 Can I perform multiple requests using the same handle?
|
||||
|
||||
@ -1577,10 +1521,4 @@ FAQ
|
||||
unknown to me).
|
||||
|
||||
After a transfer, you just set new options in the handle and make another
|
||||
transfer. This will make libcurl re-use the same connection if it can.
|
||||
|
||||
7.4 Does PHP/CURL have dependencies?
|
||||
|
||||
PHP/CURL is a module that comes with the regular PHP package. It depends on
|
||||
and uses libcurl, so you need to have libcurl installed properly before
|
||||
PHP/CURL can be used.
|
||||
transfer. This will make libcurl to re-use the same connection if it can.
|
||||
|
@ -127,15 +127,9 @@ FILE
|
||||
- upload
|
||||
- resume
|
||||
|
||||
SMB
|
||||
- SMBv1 over TCP and SSL
|
||||
- download
|
||||
- upload
|
||||
- authentication with NTLMv1
|
||||
|
||||
SMTP
|
||||
- authentication: Plain, Login, CRAM-MD5, Digest-MD5, NTLM (*9), Kerberos 5
|
||||
(*4) and External.
|
||||
- authentication: Plain, Login, CRAM-MD5, Digest-MD5, NTLM (*9) and Kerberos 5
|
||||
(*4)
|
||||
- send e-mails
|
||||
- mail from support
|
||||
- mail size support
|
||||
@ -150,8 +144,8 @@ SMTPS (*1)
|
||||
|
||||
POP3
|
||||
- authentication: Clear Text, APOP and SASL
|
||||
- SASL based authentication: Plain, Login, CRAM-MD5, Digest-MD5, NTLM (*9),
|
||||
Kerberos 5 (*4) and External.
|
||||
- SASL based authentication: Plain, Login, CRAM-MD5, Digest-MD5, NTLM (*9) and
|
||||
Kerberos 5 (*4)
|
||||
- list e-mails
|
||||
- retrieve e-mails
|
||||
- enhanced command support for: CAPA, DELE, TOP, STAT, UIDL and NOOP via
|
||||
@ -165,8 +159,8 @@ POP3S (*1)
|
||||
|
||||
IMAP
|
||||
- authentication: Clear Text and SASL
|
||||
- SASL based authentication: Plain, Login, CRAM-MD5, Digest-MD5, NTLM (*9),
|
||||
Kerberos 5 (*4) and External.
|
||||
- SASL based authentication: Plain, Login, CRAM-MD5, Digest-MD5, NTLM (*9) and
|
||||
Kerberos 5 (*4)
|
||||
- list the folders of a mailbox
|
||||
- select a mailbox with support for verifying the UIDVALIDITY
|
||||
- fetch e-mails with support for specifying the UID and SECTION
|
||||
|
@ -65,7 +65,7 @@ OpenSSL took over where SSLeay was abandoned.
|
||||
May, first Debian package.
|
||||
|
||||
August, LDAP:// and FILE:// support added. The curl web site gets 1300 visits
|
||||
weekly. Moved site to curl.haxx.nu.
|
||||
weekly.
|
||||
|
||||
Released curl 6.0 in September. 15000 lines of code.
|
||||
|
||||
@ -81,8 +81,6 @@ the easy interface and turned out to be the beginning of actually getting
|
||||
other software and programs to get based on and powered by libcurl. Almost
|
||||
20000 lines of code.
|
||||
|
||||
June 2000: the curl site moves to "curl.haxx.se"
|
||||
|
||||
August, the curl web site gets 4000 visits weekly.
|
||||
|
||||
The PHP guys adopted libcurl already the same month, when the first ever third
|
||||
|
@ -1,4 +1,4 @@
|
||||
Updated: July 3, 2012 (https://curl.haxx.se/docs/http-cookies.html)
|
||||
Updated: July 3, 2012 (http://curl.haxx.se/docs/http-cookies.html)
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
@ -34,9 +34,9 @@ HTTP Cookies
|
||||
servers with the Cookie: header.
|
||||
|
||||
For a very long time, the only spec explaining how to use cookies was the
|
||||
original Netscape spec from 1994: https://curl.haxx.se/rfc/cookie_spec.html
|
||||
original Netscape spec from 1994: http://curl.haxx.se/rfc/cookie_spec.html
|
||||
|
||||
In 2011, RFC6265 (https://www.ietf.org/rfc/rfc6265.txt) was finally published
|
||||
In 2011, RFC6265 (http://www.ietf.org/rfc/rfc6265.txt) was finally published
|
||||
and details how cookies work within HTTP.
|
||||
|
||||
1.2 Cookies saved to disk
|
||||
|
111
docs/HTTP2.md
111
docs/HTTP2.md
@ -1,111 +0,0 @@
|
||||
HTTP/2 with curl
|
||||
================
|
||||
|
||||
[HTTP/2 Spec](https://www.rfc-editor.org/rfc/rfc7540.txt)
|
||||
[http2 explained](https://daniel.haxx.se/http2/)
|
||||
|
||||
Build prerequisites
|
||||
-------------------
|
||||
- nghttp2
|
||||
- OpenSSL, NSS, GnutTLS or PolarSSL with a new enough version
|
||||
|
||||
[nghttp2](https://nghttp2.org/)
|
||||
-------------------------------
|
||||
|
||||
libcurl uses this 3rd party library for the low level protocol handling
|
||||
parts. The reason for this is that HTTP/2 is much more complex at that layer
|
||||
than HTTP/1.1 (which we implement on our own) and that nghttp2 is an already
|
||||
existing and well functional library.
|
||||
|
||||
We require at least version 1.0.0.
|
||||
|
||||
Over an http:// URL
|
||||
-------------------
|
||||
|
||||
If `CURLOPT_HTTP_VERSION` is set to `CURL_HTTP_VERSION_2_0`, libcurl will
|
||||
include an upgrade header in the initial request to the host to allow
|
||||
upgrading to HTTP/2.
|
||||
|
||||
Possibly we can later introduce an option that will cause libcurl to fail if
|
||||
not possible to upgrade. Possibly we introduce an option that makes libcurl
|
||||
use HTTP/2 at once over http://
|
||||
|
||||
Over an https:// URL
|
||||
--------------------
|
||||
|
||||
If `CURLOPT_HTTP_VERSION` is set to `CURL_HTTP_VERSION_2_0`, libcurl will use
|
||||
ALPN (or NPN) to negotiate which protocol to continue with. Possibly introduce
|
||||
an option that will cause libcurl to fail if not possible to use HTTP/2.
|
||||
|
||||
`CURL_HTTP_VERSION_2TLS` was added in 7.47.0 as a way to ask libcurl to prefer
|
||||
HTTP/2 for HTTPS but stick to 1.1 by default for plain old HTTP connections.
|
||||
|
||||
ALPN is the TLS extension that HTTP/2 is expected to use. The NPN extension is
|
||||
for a similar purpose, was made prior to ALPN and is used for SPDY so early
|
||||
HTTP/2 servers are implemented using NPN before ALPN support is widespread.
|
||||
|
||||
`CURLOPT_SSL_ENABLE_ALPN` and `CURLOPT_SSL_ENABLE_NPN` are offered to allow
|
||||
applications to explicitly disable ALPN or NPN.
|
||||
|
||||
SSL libs
|
||||
--------
|
||||
|
||||
The challenge is the ALPN and NPN support and all our different SSL
|
||||
backends. You may need a fairly updated SSL library version for it to
|
||||
provide the necessary TLS features. Right now we support:
|
||||
|
||||
- OpenSSL: ALPN and NPN
|
||||
- NSS: ALPN and NPN
|
||||
- GnuTLS: ALPN
|
||||
- PolarSSL: ALPN
|
||||
|
||||
Multiplexing
|
||||
------------
|
||||
|
||||
Starting in 7.43.0, libcurl fully supports HTTP/2 multiplexing, which is the
|
||||
term for doing multiple independent transfers over the same physical TCP
|
||||
connection.
|
||||
|
||||
To take advantage of multiplexing, you need to use the multi interface and set
|
||||
`CURLMOPT_PIPELINING` to `CURLPIPE_MULTIPLEX`. With that bit set, libcurl will
|
||||
attempt to re-use existing HTTP/2 connections and just add a new stream over
|
||||
that when doing subsequent parallel requests.
|
||||
|
||||
While libcurl sets up a connection to a HTTP server there is a period during
|
||||
which it doesn't know if it can pipeline or do multiplexing and if you add new
|
||||
transfers in that period, libcurl will default to start new connections for
|
||||
those transfers. With the new option `CURLOPT_PIPEWAIT` (added in 7.43.0), you
|
||||
can ask that a transfer should rather wait and see in case there's a
|
||||
connection for the same host in progress that might end up being possible to
|
||||
multiplex on. It favours keeping the number of connections low to the cost of
|
||||
slightly longer time to first byte transferred.
|
||||
|
||||
Applications
|
||||
------------
|
||||
|
||||
We hide HTTP/2's binary nature and convert received HTTP/2 traffic to headers
|
||||
in HTTP 1.1 style. This allows applications to work unmodified.
|
||||
|
||||
curl tool
|
||||
---------
|
||||
|
||||
curl offers the `--http2` command line option to enable use of HTTP/2.
|
||||
|
||||
Since 7.47.0, the curl tool enables HTTP/2 by default for HTTPS connections.
|
||||
|
||||
HTTP Alternative Services
|
||||
-------------------------
|
||||
|
||||
Alt-Svc is a suggested extension with a corresponding frame (ALTSVC) in HTTP/2
|
||||
that tells the client about an alternative "route" to the same content for the
|
||||
same origin server that you get the response from. A browser or long-living
|
||||
client can use that hint to create a new connection asynchronously. For
|
||||
libcurl, we may introduce a way to bring such clues to the applicaton and/or
|
||||
let a subsequent request use the alternate route
|
||||
automatically. [Spec](https://tools.ietf.org/html/draft-ietf-httpbis-alt-svc-14)
|
||||
|
||||
TODO
|
||||
----
|
||||
|
||||
- Implement "prior-knowledge" HTTP/2 connections over clear text so that
|
||||
curl can connect with HTTP/2 at once without 1.1+Upgrade.
|
98
docs/INSTALL
98
docs/INSTALL
@ -20,10 +20,10 @@ Building from git
|
||||
If you get your code off a git repository, see the GIT-INFO file in the
|
||||
root directory for specific instructions on how to proceed.
|
||||
|
||||
Unix
|
||||
UNIX
|
||||
====
|
||||
|
||||
A normal Unix installation is made in three or four steps (after you've
|
||||
A normal unix installation is made in three or four steps (after you've
|
||||
unpacked the source archive):
|
||||
|
||||
./configure
|
||||
@ -173,13 +173,13 @@ Win32
|
||||
advice given above.
|
||||
|
||||
KB94248 - How To Use the C Run-Time
|
||||
https://support.microsoft.com/kb/94248/en-us
|
||||
http://support.microsoft.com/kb/94248/en-us
|
||||
|
||||
KB140584 - How to link with the correct C Run-Time (CRT) library
|
||||
https://support.microsoft.com/kb/140584/en-us
|
||||
http://support.microsoft.com/kb/140584/en-us
|
||||
|
||||
KB190799 - Potential Errors Passing CRT Objects Across DLL Boundaries
|
||||
https://msdn.microsoft.com/en-us/library/ms235460
|
||||
http://msdn.microsoft.com/en-us/library/ms235460
|
||||
|
||||
If your app is misbehaving in some strange way, or it is suffering
|
||||
from memory corruption, before asking for further help, please try
|
||||
@ -209,8 +209,8 @@ Win32
|
||||
environment variables, for example:
|
||||
|
||||
set ZLIB_PATH=c:\zlib-1.2.8
|
||||
set OPENSSL_PATH=c:\openssl-1.0.2c
|
||||
set LIBSSH2_PATH=c:\libssh2-1.6.0
|
||||
set OPENSSL_PATH=c:\openssl-0.9.8y
|
||||
set LIBSSH2_PATH=c:\libssh2-1.4.3
|
||||
|
||||
ATTENTION: if you want to build with libssh2 support you have to use latest
|
||||
version 0.17 - previous versions will NOT work with 7.17.0 and later!
|
||||
@ -232,7 +232,7 @@ Win32
|
||||
- optional MingW32-built OpenLDAP SDK available from:
|
||||
http://www.gknw.net/mirror/openldap/
|
||||
- optional recent Novell CLDAP SDK available from:
|
||||
https://www.novell.com/developer/ndk/ldap_libraries_for_c.html
|
||||
http://developer.novell.com/ndk/cldap.htm
|
||||
|
||||
Cygwin
|
||||
------
|
||||
@ -254,7 +254,7 @@ Win32
|
||||
If you use MSVC 6 it is required that you use the February 2003 edition of
|
||||
the 'Platform SDK' which can be downloaded from:
|
||||
|
||||
https://www.microsoft.com/en-us/download/details.aspx?id=12261
|
||||
http://www.microsoft.com/en-us/download/details.aspx?id=12261
|
||||
|
||||
Building any software with MSVC 6 without having PSDK installed is just
|
||||
asking for trouble down the road once you have released it, you might notice
|
||||
@ -263,7 +263,7 @@ Win32
|
||||
software built in such way will at some point regret having done so.
|
||||
|
||||
If the compiler has been updated with the installation of a service pack as
|
||||
those mentioned in https://support.microsoft.com/kb/194022 the compiler can be
|
||||
those mentioned in http://support.microsoft.com/kb/194022 the compiler can be
|
||||
safely used to read source code, translate and make it object code.
|
||||
|
||||
But, even with the service packs mentioned above installed, the resulting
|
||||
@ -299,7 +299,7 @@ Win32
|
||||
Then run 'nmake vc' in curl's root directory.
|
||||
|
||||
If you want to compile with zlib support, you will need to build
|
||||
zlib (http://www.zlib.net/) as well. Please read the zlib
|
||||
zlib (http://www.gzip.org/zlib/) as well. Please read the zlib
|
||||
documentation on how to compile zlib. Define the ZLIB_PATH environment
|
||||
variable to the location of zlib.h and zlib.lib, for example:
|
||||
|
||||
@ -317,7 +317,7 @@ Win32
|
||||
Before running nmake define the OPENSSL_PATH environment variable with
|
||||
the root/base directory of OpenSSL, for example:
|
||||
|
||||
set OPENSSL_PATH=c:\openssl-0.9.8zc
|
||||
set OPENSSL_PATH=c:\openssl-0.9.8y
|
||||
|
||||
Then run 'nmake vc-ssl' or 'nmake vc-ssl-dll' in curl's root
|
||||
directory. 'nmake vc-ssl' will create a libcurl static and dynamic
|
||||
@ -416,21 +416,15 @@ Win32
|
||||
CURL_DISABLE_FILE disables FILE
|
||||
CURL_DISABLE_TFTP disables TFTP
|
||||
CURL_DISABLE_HTTP disables HTTP
|
||||
CURL_DISABLE_IMAP disables IMAP
|
||||
CURL_DISABLE_POP3 disables POP3
|
||||
CURL_DISABLE_SMTP disables SMTP
|
||||
|
||||
If you want to set any of these defines you have the following options:
|
||||
If you want to set any of these defines you have the following
|
||||
possibilities:
|
||||
|
||||
- Modify lib/config-win32.h
|
||||
- Modify lib/curl_setup.h
|
||||
- Modify lib/Makefile.vc6
|
||||
- Modify the "Preprocessor Definitions" in the libcurl project
|
||||
|
||||
Note: The pre-processor settings can be found using the Visual Studio IDE
|
||||
under "Project -> Settings -> C/C++ -> General" in VC6 and "Project ->
|
||||
Properties -> Configuration Properties -> C/C++ -> Preprocessor" in later
|
||||
versions.
|
||||
- Add defines to Project/Settings/C/C++/General/Preprocessor Definitions
|
||||
in the vc6libcurl.dsw/vc6libcurl.dsp Visual C++ 6 IDE project.
|
||||
|
||||
Using BSD-style lwIP instead of Winsock TCP/IP stack in Win32 builds
|
||||
--------------------------------------------------------------------
|
||||
@ -442,12 +436,8 @@ Win32
|
||||
|
||||
- Modify lib/config-win32.h and src/config-win32.h
|
||||
- Modify lib/Makefile.vc6
|
||||
- Modify the "Preprocessor Definitions" in the libcurl project
|
||||
|
||||
Note: The pre-processor settings can be found using the Visual Studio IDE
|
||||
under "Project -> Settings -> C/C++ -> General" in VC6 and "Project ->
|
||||
Properties -> Configuration Properties -> C/C++ -> Preprocessor" in later
|
||||
versions.
|
||||
- Add definition to Project/Settings/C/C++/General/Preprocessor Definitions
|
||||
in the vc6libcurl.dsw/vc6libcurl.dsp Visual C++ 6 IDE project.
|
||||
|
||||
Once that libcurl has been built with BSD-style lwIP TCP/IP stack support,
|
||||
in order to use it with your program it is mandatory that your program
|
||||
@ -471,15 +461,6 @@ Win32
|
||||
add '-DCURL_STATICLIB' to your CFLAGS. Otherwise the linker will look for
|
||||
dynamic import symbols.
|
||||
|
||||
Legacy Windows and SSL
|
||||
----------------------
|
||||
|
||||
WinSSL (specifically SChannel from Windows SSPI), is the native SSL library
|
||||
in Windows. However, WinSSL in Windows <= XP is unable to connect to servers
|
||||
that no longer support the legacy handshakes and algorithms used by those
|
||||
versions. If you will be using curl in one of those earlier versions of
|
||||
Windows you should choose another SSL backend such as OpenSSL.
|
||||
|
||||
Apple iOS and Mac OS X
|
||||
======================
|
||||
|
||||
@ -674,10 +655,12 @@ NetWare
|
||||
- gnu make and awk running on the platform you compile on;
|
||||
native Win32 versions can be downloaded from:
|
||||
http://www.gknw.net/development/prgtools/
|
||||
- recent Novell LibC or Novell CLib SDK available from:
|
||||
https://www.novell.com/developer/ndk/
|
||||
- recent Novell LibC SDK available from:
|
||||
http://developer.novell.com/ndk/libc.htm
|
||||
- or recent Novell CLib SDK available from:
|
||||
http://developer.novell.com/ndk/clib.htm
|
||||
- optional recent Novell CLDAP SDK available from:
|
||||
https://www.novell.com/developer/ndk/ldap_libraries_for_c.html
|
||||
http://developer.novell.com/ndk/cldap.htm
|
||||
- optional zlib sources (static or dynamic linking with zlib.imp);
|
||||
sources with NetWare Makefile can be obtained from:
|
||||
http://www.gknw.net/mirror/zlib/
|
||||
@ -706,7 +689,7 @@ NetWare
|
||||
Builds automatically created 8 times a day from current git are here:
|
||||
http://www.gknw.net/mirror/curl/autobuilds/
|
||||
the status of these builds can be viewed at the autobuild table:
|
||||
https://curl.haxx.se/dev/builds.html
|
||||
http://curl.haxx.se/dev/builds.html
|
||||
|
||||
eCos
|
||||
====
|
||||
@ -832,7 +815,7 @@ VxWorks
|
||||
|
||||
To build libcurl for VxWorks you need:
|
||||
|
||||
- CYGWIN (free, https://cygwin.com/)
|
||||
- CYGWIN (free, http://cygwin.com/)
|
||||
- Wind River Workbench (commercial)
|
||||
|
||||
If you have CYGWIN and Workbench installed on you machine
|
||||
@ -950,10 +933,9 @@ REDUCING SIZE
|
||||
important factor. First, be sure to set the CFLAGS variable when
|
||||
configuring with any relevant compiler optimization flags to reduce the
|
||||
size of the binary. For gcc, this would mean at minimum the -Os option,
|
||||
and potentially the -march=X, -mdynamic-no-pic and -flto options as well,
|
||||
e.g.
|
||||
and potentially the -march=X and -mdynamic-no-pic options as well, e.g.
|
||||
|
||||
./configure CFLAGS='-Os' LDFLAGS='-Wl,-Bsymbolic'...
|
||||
./configure CFLAGS='-Os' ...
|
||||
|
||||
Note that newer compilers often produce smaller code than older versions
|
||||
due to improved optimization.
|
||||
@ -971,9 +953,7 @@ REDUCING SIZE
|
||||
--disable-ipv6 (disables support for IPv6)
|
||||
--disable-manual (disables support for the built-in documentation)
|
||||
--disable-proxy (disables support for HTTP and SOCKS proxies)
|
||||
--disable-unix-sockets (disables support for UNIX sockets)
|
||||
--disable-verbose (eliminates debugging strings and error code strings)
|
||||
--disable-versioned-symbols (disables support for versioned symbols)
|
||||
--enable-hidden-symbols (eliminates unneeded symbols in the shared library)
|
||||
--without-libidn (disables support for the libidn DNS library)
|
||||
--without-librtmp (disables support for RTMP)
|
||||
@ -986,7 +966,7 @@ REDUCING SIZE
|
||||
configure command-line, e.g.
|
||||
|
||||
CFLAGS="-Os -ffunction-sections -fdata-sections \
|
||||
-fno-unwind-tables -fno-asynchronous-unwind-tables -flto" \
|
||||
-fno-unwind-tables -fno-asynchronous-unwind-tables" \
|
||||
LDFLAGS="-Wl,-s -Wl,-Bsymbolic -Wl,--gc-sections"
|
||||
|
||||
Be sure also to strip debugging symbols from your binaries after
|
||||
@ -996,9 +976,9 @@ REDUCING SIZE
|
||||
.comment section).
|
||||
|
||||
Using these techniques it is possible to create a basic HTTP-only shared
|
||||
libcurl library for i386 Linux platforms that is only 109 KiB in size, and
|
||||
an FTP-only library that is 109 KiB in size (as of libcurl version 7.45.0,
|
||||
using gcc 4.9.2).
|
||||
libcurl library for i386 Linux platforms that is only 114 KiB in size, and
|
||||
an FTP-only library that is 115 KiB in size (as of libcurl version 7.35.0,
|
||||
using gcc 4.8.2).
|
||||
|
||||
You may find that statically linking libcurl to your application will
|
||||
result in a lower total size than dynamically linking.
|
||||
@ -1096,18 +1076,18 @@ Useful URLs
|
||||
|
||||
axTLS http://axtls.sourceforge.net/
|
||||
c-ares http://c-ares.haxx.se/
|
||||
GNU GSS https://www.gnu.org/software/gss/
|
||||
GnuTLS https://www.gnu.org/software/gnutls/
|
||||
Heimdal http://www.h5l.org/
|
||||
libidn https://www.gnu.org/software/libidn/
|
||||
GNU GSS http://www.gnu.org/software/gss/
|
||||
GnuTLS http://www.gnu.org/software/gnutls/
|
||||
Heimdal http://www.pdc.kth.se/heimdal/
|
||||
libidn http://www.gnu.org/software/libidn/
|
||||
libmetalink https://launchpad.net/libmetalink/
|
||||
libssh2 http://www.libssh2.org/
|
||||
MIT Kerberos http://web.mit.edu/kerberos/www/dist/
|
||||
NSS https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS
|
||||
NSS http://www.mozilla.org/projects/security/pki/nss/
|
||||
OpenLDAP http://www.openldap.org/
|
||||
OpenSSL https://www.openssl.org/
|
||||
PolarSSL https://tls.mbed.org/
|
||||
wolfSSL https://www.wolfssl.com/wolfSSL/
|
||||
OpenSSL http://www.openssl.org/
|
||||
PolarSSL http://polarssl.org/
|
||||
yassl http://www.yassl.com/
|
||||
Zlib http://www.zlib.net/
|
||||
|
||||
MingW http://www.mingw.org/
|
||||
|
@ -95,7 +95,7 @@ install instructions may produce erratic behaviour in DevCpp. For further info
|
||||
check the following sites
|
||||
|
||||
http://aditsu.freeunixhost.com/dev-cpp-faq.html
|
||||
https://sourceforge.net/p/dev-cpp/discussion/48211/thread/2a85ea46
|
||||
http://sourceforge.net/forum/message.php?msg_id=3252213
|
||||
|
||||
As I have mentioned before I will confine this to the SSL Library compilations
|
||||
but the process is very similar for compilation of the executable - curl.exe;
|
||||
@ -248,7 +248,7 @@ SSL Files
|
||||
openssl-0.9.7e-win32-bin.zip for the minimalist package of the openssl-0.9.7e
|
||||
binaries ported to MS Windows 95/98/NT/XP using the MingW32/GCC-3.1
|
||||
development environment. The file may be downloaded at
|
||||
https://curl.haxx.se/download/.
|
||||
http://curl.haxx.se/download/.
|
||||
|
||||
2- Open the above zip file. You will find two files - SDL.dll,
|
||||
SDL_mixer.dll. Install them in the directory C:\WINDOWS\SYSTEM32 for Win 9x
|
||||
|
911
docs/INTERNALS
911
docs/INTERNALS
File diff suppressed because it is too large
Load Diff
118
docs/KNOWN_BUGS
118
docs/KNOWN_BUGS
@ -3,46 +3,13 @@ join in and help us correct one or more of these! Also be sure to check the
|
||||
changelog of the current development status, as one or more of these problems
|
||||
may have been fixed since this was written!
|
||||
|
||||
93. It is not possible to pass a 64-bit value using CURLFORM_CONTENTLEN with
|
||||
CURLFORM_ARRAY, when compiled on 32-bit platforms that support 64-bit
|
||||
integers. This is because the underlying structure 'curl_forms' uses a dual
|
||||
purpose char* for storing these values in via casting. For more information
|
||||
see the now closed related issue:
|
||||
https://github.com/curl/curl/issues/608
|
||||
|
||||
92. curl tool 7.47.1 in Windows will not --output to literal paths \\?\ or to
|
||||
reserved dos device names unless the device prefix \\.\ is used. To send
|
||||
output to a device that has a reserved dos device name you can use the
|
||||
Windows device prefix (eg: --output \\.\NUL). You can also use the
|
||||
redirection operator to send output to a literal path or a reserved device
|
||||
name (eg: > NUL).
|
||||
The next release of curl will support --output in Windows to literal paths
|
||||
and to reserved device names without the device prefix.
|
||||
https://github.com/curl/curl/commit/c3aac48
|
||||
https://github.com/curl/curl/commit/4fc80f3
|
||||
|
||||
91. "curl_easy_perform hangs with imap and PolarSSL"
|
||||
https://github.com/curl/curl/issues/334
|
||||
|
||||
90. IMAP "SEARCH ALL" truncates output on large boxes. "A quick search of the
|
||||
code reveals that pingpong.c contains some truncation code, at line 408,
|
||||
when it deems the server response to be too large truncating it to 40
|
||||
characters"
|
||||
https://curl.haxx.se/bug/view.cgi?id=1366
|
||||
|
||||
89. Disabling HTTP Pipelining when there are ongoing transfers can lead to
|
||||
heap corruption and crash. https://curl.haxx.se/bug/view.cgi?id=1411
|
||||
|
||||
88. libcurl doesn't support CURLINFO_FILETIME for SFTP transfers and thus
|
||||
curl's -R option also doesn't work then.
|
||||
|
||||
87. -J/--remote-header-name doesn't decode %-encoded file names. RFC6266
|
||||
details how it should be done. The can of worm is basically that we have no
|
||||
charset handling in curl and ascii >=128 is a challenge for us. Not to
|
||||
mention that decoding also means that we need to check for nastiness that is
|
||||
attempted, like "../" sequences and the like. Probably everything to the left
|
||||
of any embedded slashes should be cut off.
|
||||
https://curl.haxx.se/bug/view.cgi?id=1294
|
||||
http://curl.haxx.se/bug/view.cgi?id=1294
|
||||
|
||||
86. The disconnect commands (LOGOUT and QUIT) may not be sent by IMAP, POP3
|
||||
and SMTP if a failure occurs during the authentication phase of a
|
||||
@ -53,8 +20,7 @@ may have been fixed since this was written!
|
||||
CURLINFO_STARTTRANSFER_TIME is wrong. While using POST
|
||||
CURLINFO_STARTTRANSFER_TIME minus CURLINFO_PRETRANSFER_TIME is near to zero
|
||||
every time.
|
||||
https://github.com/curl/curl/issues/218
|
||||
https://curl.haxx.se/bug/view.cgi?id=1213
|
||||
http://curl.haxx.se/bug/view.cgi?id=1213
|
||||
|
||||
84. CURLINFO_SSL_VERIFYRESULT is only implemented for the OpenSSL and NSS
|
||||
backends, so relying on this information in a generic app is flaky.
|
||||
@ -62,57 +28,67 @@ may have been fixed since this was written!
|
||||
82. When building with the Windows Borland compiler, it fails because the
|
||||
"tlib" tool doesn't support hyphens (minus signs) in file names and we have
|
||||
such in the build.
|
||||
https://curl.haxx.se/bug/view.cgi?id=1222
|
||||
http://curl.haxx.se/bug/view.cgi?id=1222
|
||||
|
||||
81. When using -J (with -O), automatically resumed downloading together with
|
||||
"-C -" fails. Without -J the same command line works! This happens because
|
||||
the resume logic is worked out before the target file name (and thus its
|
||||
pre-transfer size) has been figured out!
|
||||
https://curl.haxx.se/bug/view.cgi?id=1169
|
||||
http://curl.haxx.se/bug/view.cgi?id=1169
|
||||
|
||||
80. Curl doesn't recognize certificates in DER format in keychain, but it
|
||||
works with PEM.
|
||||
https://curl.haxx.se/bug/view.cgi?id=1065
|
||||
http://curl.haxx.se/bug/view.cgi?id=1065
|
||||
|
||||
79. SMTP. When sending data to multiple recipients, curl will abort and return
|
||||
failure if one of the recipients indicate failure (on the "RCPT TO"
|
||||
command). Ordinary mail programs would proceed and still send to the ones
|
||||
that can receive data. This is subject for change in the future.
|
||||
https://curl.haxx.se/bug/view.cgi?id=1116
|
||||
http://curl.haxx.se/bug/view.cgi?id=1116
|
||||
|
||||
78. curl and libcurl don't always signal the client properly when "sending"
|
||||
zero bytes files - it makes for example the command line client not creating
|
||||
any file at all. Like when using FTP.
|
||||
http://curl.haxx.se/bug/view.cgi?id=1063
|
||||
|
||||
76. The SOCKET type in Win64 is 64 bits large (and thus so is curl_socket_t on
|
||||
that platform), and long is only 32 bits. It makes it impossible for
|
||||
curl_easy_getinfo() to return a socket properly with the CURLINFO_LASTSOCKET
|
||||
option as for all other operating systems.
|
||||
|
||||
75. NTLM authentication involving unicode user name or password only works
|
||||
properly if built with UNICODE defined together with the WinSSL/schannel
|
||||
backend. The original problem was mentioned in:
|
||||
https://curl.haxx.se/mail/lib-2009-10/0024.html
|
||||
https://curl.haxx.se/bug/view.cgi?id=896
|
||||
http://curl.haxx.se/mail/lib-2009-10/0024.html
|
||||
http://curl.haxx.se/bug/view.cgi?id=896
|
||||
|
||||
The WinSSL/schannel version verified to work as mentioned in
|
||||
https://curl.haxx.se/mail/lib-2012-07/0073.html
|
||||
http://curl.haxx.se/mail/lib-2012-07/0073.html
|
||||
|
||||
73. if a connection is made to a FTP server but the server then just never
|
||||
sends the 220 response or otherwise is dead slow, libcurl will not
|
||||
acknowledge the connection timeout during that phase but only the "real"
|
||||
timeout - which may surprise users as it is probably considered to be the
|
||||
connect phase to most people. Brought up (and is being misunderstood) in:
|
||||
https://curl.haxx.se/bug/view.cgi?id=856
|
||||
http://curl.haxx.se/bug/view.cgi?id=856
|
||||
|
||||
72. "Pausing pipeline problems."
|
||||
https://curl.haxx.se/mail/lib-2009-07/0214.html
|
||||
http://curl.haxx.se/mail/lib-2009-07/0214.html
|
||||
|
||||
70. Problem re-using easy handle after call to curl_multi_remove_handle
|
||||
https://curl.haxx.se/mail/lib-2009-07/0249.html
|
||||
http://curl.haxx.se/mail/lib-2009-07/0249.html
|
||||
|
||||
68. "More questions about ares behavior".
|
||||
https://curl.haxx.se/mail/lib-2009-08/0012.html
|
||||
http://curl.haxx.se/mail/lib-2009-08/0012.html
|
||||
|
||||
67. When creating multipart formposts. The file name part can be encoded with
|
||||
something beyond ascii but currently libcurl will only pass in the verbatim
|
||||
string the app provides. There are several browsers that already do this
|
||||
encoding. The key seems to be the updated draft to RFC2231:
|
||||
https://tools.ietf.org/html/draft-reschke-rfc2231-in-http-02
|
||||
http://tools.ietf.org/html/draft-reschke-rfc2231-in-http-02
|
||||
|
||||
66. When using telnet, the time limitation options don't work.
|
||||
https://curl.haxx.se/bug/view.cgi?id=846
|
||||
http://curl.haxx.se/bug/view.cgi?id=846
|
||||
|
||||
65. When doing FTP over a socks proxy or CONNECT through HTTP proxy and the
|
||||
multi interface is used, libcurl will fail if the (passive) TCP connection
|
||||
@ -123,27 +99,27 @@ may have been fixed since this was written!
|
||||
63. When CURLOPT_CONNECT_ONLY is used, the handle cannot reliably be re-used
|
||||
for any further requests or transfers. The work-around is then to close that
|
||||
handle with curl_easy_cleanup() and create a new. Some more details:
|
||||
https://curl.haxx.se/mail/lib-2009-04/0300.html
|
||||
http://curl.haxx.se/mail/lib-2009-04/0300.html
|
||||
|
||||
61. If an upload using Expect: 100-continue receives an HTTP 417 response,
|
||||
it ought to be automatically resent without the Expect:. A workaround is
|
||||
for the client application to redo the transfer after disabling Expect:.
|
||||
https://curl.haxx.se/mail/archive-2008-02/0043.html
|
||||
http://curl.haxx.se/mail/archive-2008-02/0043.html
|
||||
|
||||
60. libcurl closes the connection if an HTTP 401 reply is received while it
|
||||
is waiting for the the 100-continue response.
|
||||
https://curl.haxx.se/mail/lib-2008-08/0462.html
|
||||
http://curl.haxx.se/mail/lib-2008-08/0462.html
|
||||
|
||||
58. It seems sensible to be able to use CURLOPT_NOBODY and
|
||||
CURLOPT_FAILONERROR with FTP to detect if a file exists or not, but it is
|
||||
not working: https://curl.haxx.se/mail/lib-2008-07/0295.html
|
||||
not working: http://curl.haxx.se/mail/lib-2008-07/0295.html
|
||||
|
||||
56. When libcurl sends CURLOPT_POSTQUOTE commands when connected to a SFTP
|
||||
server using the multi interface, the commands are not being sent correctly
|
||||
and instead the connection is "cancelled" (the operation is considered done)
|
||||
prematurely. There is a half-baked (busy-looping) patch provided in the bug
|
||||
report but it cannot be accepted as-is. See
|
||||
https://curl.haxx.se/bug/view.cgi?id=748
|
||||
http://curl.haxx.se/bug/view.cgi?id=748
|
||||
|
||||
55. libcurl fails to build with MIT Kerberos for Windows (KfW) due to KfW's
|
||||
library header files exporting symbols/macros that should be kept private
|
||||
@ -152,13 +128,13 @@ may have been fixed since this was written!
|
||||
52. Gautam Kachroo's issue that identifies a problem with the multi interface
|
||||
where a connection can be re-used without actually being properly
|
||||
SSL-negotiated:
|
||||
https://curl.haxx.se/mail/lib-2008-01/0277.html
|
||||
http://curl.haxx.se/mail/lib-2008-01/0277.html
|
||||
|
||||
49. If using --retry and the transfer timeouts (possibly due to using -m or
|
||||
-y/-Y) the next attempt doesn't resume the transfer properly from what was
|
||||
downloaded in the previous attempt but will truncate and restart at the
|
||||
original position where it was at before the previous failed attempt. See
|
||||
https://curl.haxx.se/mail/lib-2008-01/0080.html and Mandriva bug report
|
||||
http://curl.haxx.se/mail/lib-2008-01/0080.html and Mandriva bug report
|
||||
https://qa.mandriva.com/show_bug.cgi?id=22565
|
||||
|
||||
48. If a CONNECT response-headers are larger than BUFSIZE (16KB) when the
|
||||
@ -167,25 +143,25 @@ may have been fixed since this was written!
|
||||
protocol code. This should be very rare.
|
||||
|
||||
43. There seems to be a problem when connecting to the Microsoft telnet server.
|
||||
https://curl.haxx.se/bug/view.cgi?id=649
|
||||
http://curl.haxx.se/bug/view.cgi?id=649
|
||||
|
||||
41. When doing an operation over FTP that requires the ACCT command (but not
|
||||
when logging in), the operation will fail since libcurl doesn't detect this
|
||||
and thus fails to issue the correct command:
|
||||
https://curl.haxx.se/bug/view.cgi?id=635
|
||||
http://curl.haxx.se/bug/view.cgi?id=635
|
||||
|
||||
39. Steffen Rumler's Race Condition in Curl_proxyCONNECT:
|
||||
https://curl.haxx.se/mail/lib-2007-01/0045.html
|
||||
http://curl.haxx.se/mail/lib-2007-01/0045.html
|
||||
|
||||
38. Kumar Swamy Bhatt's problem in ftp/ssl "LIST" operation:
|
||||
https://curl.haxx.se/mail/lib-2007-01/0103.html
|
||||
http://curl.haxx.se/mail/lib-2007-01/0103.html
|
||||
|
||||
35. Both SOCKS5 and SOCKS4 proxy connections are done blocking, which is very
|
||||
bad when used with the multi interface.
|
||||
|
||||
34. The SOCKS4 connection codes don't properly acknowledge (connect) timeouts.
|
||||
Also see #12. According to bug #1556528, even the SOCKS5 connect code does
|
||||
not do it right: https://curl.haxx.se/bug/view.cgi?id=604
|
||||
not do it right: http://curl.haxx.se/bug/view.cgi?id=604
|
||||
|
||||
31. "curl-config --libs" will include details set in LDFLAGS when configure is
|
||||
run that might be needed only for building libcurl. Further, curl-config
|
||||
@ -193,7 +169,7 @@ may have been fixed since this was written!
|
||||
|
||||
26. NTLM authentication using SSPI (on Windows) when (lib)curl is running in
|
||||
"system context" will make it use wrong(?) user name - at least when compared
|
||||
to what winhttp does. See https://curl.haxx.se/bug/view.cgi?id=535
|
||||
to what winhttp does. See http://curl.haxx.se/bug/view.cgi?id=535
|
||||
|
||||
23. SOCKS-related problems:
|
||||
B) libcurl doesn't support FTPS over a SOCKS proxy.
|
||||
@ -221,7 +197,7 @@ may have been fixed since this was written!
|
||||
be to use a data structure other than a plain C string, one that can handle
|
||||
embedded NUL characters. From a practical standpoint, most FTP servers
|
||||
would not meaningfully support NUL characters within RFC 959 <string>,
|
||||
anyway (e.g., Unix pathnames may not contain NUL).
|
||||
anyway (e.g., UNIX pathnames may not contain NUL).
|
||||
|
||||
14. Test case 165 might fail on a system which has libidn present, but with an
|
||||
old iconv version (2.1.3 is a known bad version), since it doesn't recognize
|
||||
@ -239,8 +215,8 @@ may have been fixed since this was written!
|
||||
10. To get HTTP Negotiate (SPNEGO) authentication to work fine, you need to
|
||||
provide a (fake) user name (this concerns both curl and the lib) because the
|
||||
code wrongly only considers authentication if there's a user name provided.
|
||||
https://curl.haxx.se/bug/view.cgi?id=440 How?
|
||||
https://curl.haxx.se/mail/lib-2004-08/0182.html
|
||||
http://curl.haxx.se/bug/view.cgi?id=440 How?
|
||||
http://curl.haxx.se/mail/lib-2004-08/0182.html
|
||||
|
||||
8. Doing resumed upload over HTTP does not work with '-C -', because curl
|
||||
doesn't do a HEAD first to get the initial size. This needs to be done
|
||||
@ -256,4 +232,14 @@ may have been fixed since this was written!
|
||||
5. libcurl doesn't treat the content-length of compressed data properly, as
|
||||
it seems HTTP servers send the *uncompressed* length in that header and
|
||||
libcurl thinks of it as the *compressed* length. Some explanations are here:
|
||||
https://curl.haxx.se/mail/lib-2003-06/0146.html
|
||||
http://curl.haxx.se/mail/lib-2003-06/0146.html
|
||||
|
||||
2. If a HTTP server responds to a HEAD request and includes a body (thus
|
||||
violating the RFC2616), curl won't wait to read the response but just stop
|
||||
reading and return back. If a second request (let's assume a GET) is then
|
||||
immediately made to the same server again, the connection will be re-used
|
||||
fine of course, and the second request will be sent off but when the
|
||||
response is to get read, the previous response-body is what curl will read
|
||||
and havoc is what happens.
|
||||
More details on this is found in this libcurl mailing list thread:
|
||||
http://curl.haxx.se/mail/lib-2002-08/0000.html
|
||||
|
245
docs/LIBCURL-STRUCTS
Normal file
245
docs/LIBCURL-STRUCTS
Normal file
@ -0,0 +1,245 @@
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
| (__| |_| | _ <| |___
|
||||
\___|\___/|_| \_\_____|
|
||||
|
||||
Structs in libcurl
|
||||
|
||||
This document 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.
|
||||
|
||||
1. The main structs in libcurl
|
||||
1.1 SessionHandle
|
||||
1.2 connectdata
|
||||
1.3 Curl_multi
|
||||
1.4 Curl_handler
|
||||
1.5 conncache
|
||||
1.6 Curl_share
|
||||
1.7 CookieInfo
|
||||
|
||||
==============================================================================
|
||||
|
||||
1. The main structs in libcurl
|
||||
|
||||
1.1 SessionHandle
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
->mstate is the multi state of this particular SessionHandle. 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() is called etc.
|
||||
|
||||
The libcurl source code generally use the name 'data' for the variable that
|
||||
points to the SessionHandle.
|
||||
|
||||
|
||||
1.2 connectdata
|
||||
|
||||
A general idea in libcurl is to keep connections around in a connection
|
||||
"cache" after they have been used in case they will be used again and then
|
||||
re-use an existing one instead of creating a new as it creates a significant
|
||||
performance boost.
|
||||
|
||||
Each 'connectdata' identifies a single physical connection to a server. If
|
||||
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
|
||||
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.
|
||||
|
||||
Functions in libcurl will assume that connectdata->data points to the
|
||||
SessionHandle that uses this connection.
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
internal concerns.
|
||||
|
||||
The libcurl source code generally use the name 'conn' for the variable that
|
||||
points to the connectdata.
|
||||
|
||||
|
||||
1.3 Curl_multi
|
||||
|
||||
Internally, the easy interface is implemented as a wrapper around multi
|
||||
interface functions. This makes everything multi interface.
|
||||
|
||||
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(). The start of the list is ->easyp
|
||||
and ->num_easy is a counter of added SessionHandles.
|
||||
|
||||
->msglist is a linked list of messages to send back when
|
||||
curl_multi_info_read() is called. Basically a node is added to that list
|
||||
when an individual SessionHandle'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.
|
||||
|
||||
->sockhash is a hash table to allow fast lookups of socket descriptor to
|
||||
which SessionHandle that uses that descriptor. This is necessary for the
|
||||
multi_socket API.
|
||||
|
||||
->conn_cache points to the connection cache. It keeps track of all
|
||||
connections that are kept after use. The cache has a maximum size.
|
||||
|
||||
->closure_handle is described in the 'connectdata' section.
|
||||
|
||||
The libcurl source code generally use the name 'multi' for the variable that
|
||||
points to the Curl_multi struct.
|
||||
|
||||
|
||||
1.4 Curl_handler
|
||||
|
||||
Each unique protocol that is supported by libcurl needs to provide at least
|
||||
one Curl_handler struct. It defines what the protocol is called and what
|
||||
functions the main code should call to deal with protocol specific issues.
|
||||
In general, there's a source file named [protocol].c in which there's a
|
||||
"struct Curl_handler Curl_handler_[protocol]" declared. In url.c there's
|
||||
then the main array with all individual Curl_handler structs pointed to from
|
||||
a single array which is scanned through when a URL is given to libcurl to
|
||||
work with.
|
||||
|
||||
->scheme is the URL scheme name, usually spelled out in uppercase. That's
|
||||
"HTTP" or "FTP" etc. SSL versions of the protcol need its own Curl_handler
|
||||
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
|
||||
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.
|
||||
|
||||
->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.
|
||||
|
||||
Some protocols will alter the connectdata->recv[] and connectdata->send[]
|
||||
function pointers in this function.
|
||||
|
||||
->connecting is similarly a function that keeps getting called as long as the
|
||||
protocol considers itself still in the connecting phase.
|
||||
|
||||
->do_it is the function called to issue the transfer request. What we call
|
||||
the DO action internally. If the DO is not enough and things need to be kept
|
||||
getting done for the entire DO sequence to complete, ->doing is then usually
|
||||
also provided. Each protocol that needs to do multiple commands or similar
|
||||
for do/doing need to implement their own state machines (see SCP, SFTP,
|
||||
FTP). Some protocols (only FTP and only due to historical reasons) has a
|
||||
separate piece of the DO state called DO_MORE.
|
||||
|
||||
->doing keeps getting called while issuing the transfer request command(s)
|
||||
|
||||
->done gets called when the transfer is complete and DONE. That's after the
|
||||
main data has been transferred.
|
||||
|
||||
->do_more gets called during the DO_MORE state. The FTP protocol uses this
|
||||
state when setting up the second connection.
|
||||
|
||||
->proto_getsock
|
||||
->doing_getsock
|
||||
->domore_getsock
|
||||
->perform_getsock
|
||||
Functions that return socket information. Which socket(s) to wait for which
|
||||
action(s) during the particular multi state.
|
||||
|
||||
->disconnect is called immediately before the TCP connection is shutdown.
|
||||
|
||||
->readwrite gets called during transfer to allow the protocol to do extra
|
||||
reads/writes
|
||||
|
||||
->defport is the default report TCP or UDP port this protocol uses
|
||||
|
||||
->protocol is one or more bits in the CURLPROTO_* set. The SSL versions have
|
||||
their "base" protocol set and then the SSL variation. Like "HTTP|HTTPS".
|
||||
|
||||
->flags is a bitmask with additional information about the protocol that will
|
||||
make it get treated differently by the generic engine:
|
||||
|
||||
PROTOPT_SSL - will make it connect and negotiate SSL
|
||||
|
||||
PROTOPT_DUAL - this protocol uses two connections
|
||||
|
||||
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.
|
||||
|
||||
PROTOPT_NONETWORK - a protocol that doesn't use network (read file:)
|
||||
|
||||
PROTOPT_NEEDSPWD - this protocol needs a password and will use a default
|
||||
one unless one is provided
|
||||
|
||||
PROTOPT_NOURLQUERY - this protocol can't handle a query part on the URL
|
||||
(?foo=bar)
|
||||
|
||||
|
||||
1.5 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.
|
||||
|
||||
|
||||
1.6 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
|
||||
holds.
|
||||
|
||||
Then individual SessionHandle 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
|
||||
session cache.
|
||||
|
||||
|
||||
1.7 CookieInfo
|
||||
|
||||
This is the main cookie struct. It holds all known cookies and related
|
||||
information. Each SessionHandle 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.
|
@ -18,34 +18,34 @@ accompany your license with an exception[2]. This particular problem was
|
||||
addressed when the Modified BSD license was created, which does not have the
|
||||
announcement clause that collides with GPL.
|
||||
|
||||
libcurl https://curl.haxx.se/docs/copyright.html
|
||||
libcurl http://curl.haxx.se/docs/copyright.html
|
||||
|
||||
Uses an MIT (or Modified BSD)-style license that is as liberal as
|
||||
possible.
|
||||
|
||||
OpenSSL https://www.openssl.org/source/license.html
|
||||
OpenSSL http://www.openssl.org/source/license.html
|
||||
|
||||
(May be used for SSL/TLS support) Uses an Original BSD-style license
|
||||
with an announcement clause that makes it "incompatible" with GPL. You
|
||||
are not allowed to ship binaries that link with OpenSSL that includes
|
||||
GPL code (unless that specific GPL code includes an exception for
|
||||
OpenSSL - a habit that is growing more and more common). If OpenSSL's
|
||||
licensing is a problem for you, consider using another TLS library.
|
||||
licensing is a problem for you, consider using GnuTLS or yassl
|
||||
instead.
|
||||
|
||||
GnuTLS http://www.gnutls.org/
|
||||
|
||||
(May be used for SSL/TLS support) Uses the LGPL[3] license. If this is
|
||||
a problem for you, consider using another TLS library. Also note that
|
||||
a problem for you, consider using OpenSSL instead. Also note that
|
||||
GnuTLS itself depends on and uses other libs (libgcrypt and
|
||||
libgpg-error) and they too are LGPL- or GPL-licensed.
|
||||
|
||||
WolfSSL https://www.wolfssl.com/
|
||||
yassl http://www.yassl.com/
|
||||
|
||||
(May be used for SSL/TLS support) Uses the GPL[1] license or a
|
||||
propietary license. If this is a problem for you, consider using
|
||||
another TLS library.
|
||||
(May be used for SSL/TLS support) Uses the GPL[1] license. If this is
|
||||
a problem for you, consider using OpenSSL or GnuTLS instead.
|
||||
|
||||
NSS https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS
|
||||
NSS http://www.mozilla.org/projects/security/pki/nss/
|
||||
|
||||
(May be used for SSL/TLS support) Is covered by the MPL[4] license,
|
||||
the GPL[1] license and the LGPL[3] license. You may choose to license
|
||||
@ -57,29 +57,13 @@ axTLS http://axtls.sourceforge.net/
|
||||
|
||||
(May be used for SSL/TLS support) Uses a Modified BSD-style license.
|
||||
|
||||
mbedTLS https://tls.mbed.org/
|
||||
|
||||
(May be used for SSL/TLS support) Uses the GPL[1] license or a
|
||||
propietary license. If this is a problem for you, consider using
|
||||
another TLS library.
|
||||
|
||||
BoringSSL https://boringssl.googlesource.com/
|
||||
|
||||
(May be used for SSL/TLS support) As an OpenSSL fork, it has the same
|
||||
license as that.
|
||||
|
||||
libressl http://www.libressl.org/
|
||||
|
||||
(May be used for SSL/TLS support) As an OpenSSL fork, it has the same
|
||||
license as that.
|
||||
|
||||
c-ares https://daniel.haxx.se/projects/c-ares/license.html
|
||||
c-ares http://daniel.haxx.se/projects/c-ares/license.html
|
||||
|
||||
(Used for asynchronous name resolves) Uses an MIT license that is very
|
||||
liberal and imposes no restrictions on any other library or part you
|
||||
may link with.
|
||||
|
||||
zlib http://www.zlib.net/zlib_license.html
|
||||
zlib http://www.gzip.org/zlib/zlib_license.html
|
||||
|
||||
(Used for compressed Transfer-Encoding support) Uses an MIT-style
|
||||
license that shouldn't collide with any other library.
|
||||
@ -89,12 +73,12 @@ MIT Kerberos http://web.mit.edu/kerberos/www/dist/
|
||||
(May be used for GSS support) MIT licensed, that shouldn't collide
|
||||
with any other parts.
|
||||
|
||||
Heimdal http://www.h5l.org
|
||||
Heimdal http://www.pdc.kth.se/heimdal/
|
||||
|
||||
(May be used for GSS support) Heimdal is Original BSD licensed with
|
||||
the announcement clause.
|
||||
|
||||
GNU GSS https://www.gnu.org/software/gss/
|
||||
GNU GSS http://www.gnu.org/software/gss/
|
||||
|
||||
(May be used for GSS support) GNU GSS is GPL licensed. Note that you
|
||||
may not distribute binary curl packages that uses this if you build
|
||||
@ -121,10 +105,10 @@ libssh2 http://www.libssh2.org/
|
||||
(Used for scp and sftp support) libssh2 uses a Modified BSD-style
|
||||
license.
|
||||
|
||||
[1] = GPL - GNU General Public License: https://www.gnu.org/licenses/gpl.html
|
||||
[2] = https://www.gnu.org/licenses/gpl-faq.html#GPLIncompatibleLibs details on
|
||||
[1] = GPL - GNU General Public License: http://www.gnu.org/licenses/gpl.html
|
||||
[2] = http://www.fsf.org/licenses/gpl-faq.html#GPLIncompatibleLibs details on
|
||||
how to write such an exception to the GPL
|
||||
[3] = LGPL - GNU Lesser General Public License:
|
||||
https://www.gnu.org/licenses/lgpl.html
|
||||
http://www.gnu.org/licenses/lgpl.html
|
||||
[4] = MPL - Mozilla Public License:
|
||||
https://www.mozilla.org/MPL/
|
||||
http://www.mozilla.org/MPL/
|
||||
|
@ -33,7 +33,7 @@ MAIL ETIQUETTE
|
||||
1.1 Mailing Lists
|
||||
|
||||
The mailing lists we have are all listed and described at
|
||||
https://curl.haxx.se/mail/
|
||||
http://curl.haxx.se/mail/
|
||||
|
||||
Each mailing list is targeted to a specific set of users and subjects,
|
||||
please use the one or the ones that suit you the most.
|
||||
@ -230,7 +230,7 @@ MAIL ETIQUETTE
|
||||
Quote as little as possible. Just enough to provide the context you cannot
|
||||
leave out. A lengthy description can be found here:
|
||||
|
||||
https://www.netmeister.org/news/learn2quote.html
|
||||
http://www.netmeister.org/news/learn2quote.html
|
||||
|
||||
2.7 Digest
|
||||
|
||||
|
19
docs/MANUAL
19
docs/MANUAL
@ -3,7 +3,7 @@ LATEST VERSION
|
||||
You always find news about what's going on as well as the latest versions
|
||||
from the curl web pages, located at:
|
||||
|
||||
https://curl.haxx.se
|
||||
http://curl.haxx.se
|
||||
|
||||
SIMPLE USAGE
|
||||
|
||||
@ -59,10 +59,6 @@ SIMPLE USAGE
|
||||
|
||||
curl "http://[2001:1890:1112:1::20]/"
|
||||
|
||||
Get a file from an SMB server:
|
||||
|
||||
curl -u "domain\username:passwd" smb://server.example.com/share/file.txt
|
||||
|
||||
DOWNLOAD TO A FILE
|
||||
|
||||
Get a web page and store in a local file with a specific name:
|
||||
@ -232,11 +228,6 @@ UPLOADING
|
||||
|
||||
curl --proxytunnel -x proxy:port -T localfile ftp.upload.com
|
||||
|
||||
SMB / SMBS
|
||||
|
||||
curl -T file.txt -u "domain\username:passwd"
|
||||
smb://server.example.com/share/
|
||||
|
||||
HTTP
|
||||
|
||||
Upload all data on stdin to a specified HTTP site:
|
||||
@ -470,8 +461,8 @@ COOKIES
|
||||
stored cookies which match the request as it follows the location. The
|
||||
file "empty.txt" may be a nonexistent file.
|
||||
|
||||
To read and write cookies from a netscape cookie file, you can set both -b
|
||||
and -c to use the same file:
|
||||
Alas, to both read and write cookies from a netscape cookie file, you can
|
||||
set both -b and -c to use the same file:
|
||||
|
||||
curl -b cookies.txt -c cookies.txt www.example.com
|
||||
|
||||
@ -824,7 +815,7 @@ LDAP
|
||||
Working with LDAP URLs":
|
||||
http://developer.netscape.com/docs/manuals/dirsdk/csdk30/url.htm
|
||||
|
||||
RFC 2255, "The LDAP URL Format" https://curl.haxx.se/rfc/rfc2255.txt
|
||||
RFC 2255, "The LDAP URL Format" http://curl.haxx.se/rfc/rfc2255.txt
|
||||
|
||||
To show you an example, this is how I can get all people from my local LDAP
|
||||
server that has a certain sub-domain in their email address:
|
||||
@ -1011,7 +1002,7 @@ MAILING LISTS
|
||||
|
||||
For your convenience, we have several open mailing lists to discuss curl,
|
||||
its development and things relevant to this. Get all info at
|
||||
https://curl.haxx.se/mail/. Some of the lists available are:
|
||||
http://curl.haxx.se/mail/. Some of the lists available are:
|
||||
|
||||
curl-users
|
||||
|
||||
|
@ -5,11 +5,11 @@
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
# Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
# are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
@ -33,22 +33,22 @@ SUBDIRS = examples libcurl
|
||||
|
||||
CLEANFILES = $(GENHTMLPAGES) $(PDFPAGES)
|
||||
|
||||
EXTRA_DIST = MANUAL BUGS CONTRIBUTE FAQ FEATURES INTERNALS SSLCERTS \
|
||||
README.win32 RESOURCES TODO TheArtOfHttpScripting THANKS VERSIONS \
|
||||
KNOWN_BUGS BINDINGS $(man_MANS) $(HTMLPAGES) HISTORY INSTALL \
|
||||
$(PDFPAGES) LICENSE-MIXING README.netware INSTALL.devcpp \
|
||||
MAIL-ETIQUETTE HTTP-COOKIES SECURITY RELEASE-PROCEDURE SSL-PROBLEMS \
|
||||
HTTP2.md ROADMAP.md CODE_OF_CONDUCT.md CODE_STYLE.md
|
||||
EXTRA_DIST = MANUAL BUGS CONTRIBUTE FAQ FEATURES INTERNALS SSLCERTS \
|
||||
README.win32 RESOURCES TODO TheArtOfHttpScripting THANKS VERSIONS \
|
||||
KNOWN_BUGS BINDINGS $(man_MANS) $(HTMLPAGES) HISTORY INSTALL \
|
||||
$(PDFPAGES) LICENSE-MIXING README.netware DISTRO-DILEMMA INSTALL.devcpp \
|
||||
MAIL-ETIQUETTE HTTP-COOKIES LIBCURL-STRUCTS SECURITY RELEASE-PROCEDURE \
|
||||
SSL-PROBLEMS
|
||||
|
||||
MAN2HTML= roffit < $< >$@
|
||||
|
||||
SUFFIXES = .1 .html .pdf
|
||||
|
||||
html: $(HTMLPAGES)
|
||||
cd libcurl && make html
|
||||
cd libcurl; make html
|
||||
|
||||
pdf: $(PDFPAGES)
|
||||
cd libcurl && make pdf
|
||||
cd libcurl; make pdf
|
||||
|
||||
.1.html:
|
||||
$(MAN2HTML)
|
||||
|
@ -1,3 +1,9 @@
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
| (__| |_| | _ <| |___
|
||||
\___|\___/|_| \_\_____|
|
||||
|
||||
curl release procedure - how to do a release
|
||||
============================================
|
||||
|
||||
@ -11,8 +17,8 @@ in the source code repo
|
||||
- make sure all relevant changes are committed on the master branch
|
||||
|
||||
- tag the git repo in this style: `git tag -a curl-7_34_0`. -a annotates the
|
||||
tag and we use underscores instead of dots in the version number.
|
||||
|
||||
tag and we use underscores instead of dots in the version number.
|
||||
|
||||
- run "./maketgz 7.34.0" to build the release tarballs. It is important that
|
||||
you run this on a machine with the correct set of autotools etc installed
|
||||
as this is what then will be shipped and used by most users on *nix like
|
||||
@ -78,10 +84,11 @@ Coming dates
|
||||
Based on the description above, here are some planned release dates (at the
|
||||
time of this writing):
|
||||
|
||||
- October 7, 2015 (version 7.45.0)
|
||||
- November 5, 2014 (version 7.39.0)
|
||||
- December 31, 2014
|
||||
- February 25, 2015
|
||||
- April 22, 2015
|
||||
- June 17, 2015
|
||||
- August 12, 2015
|
||||
- October 7, 2015
|
||||
- December 2, 2015
|
||||
- January 27, 2016
|
||||
- March 23, 2016
|
||||
- May 18, 2016
|
||||
- July 13, 2016
|
||||
- September 7, 2016
|
||||
|
@ -36,7 +36,7 @@ This document lists documents and standards used by curl.
|
||||
|
||||
RFC 2109 - HTTP State Management Mechanism (cookie stuff)
|
||||
- Also, read Netscape's specification at
|
||||
https://curl.haxx.se/rfc/cookie_spec.html
|
||||
http://curl.haxx.se/rfc/cookie_spec.html
|
||||
|
||||
RFC 2183 - The Content-Disposition Header Field
|
||||
|
||||
|
132
docs/ROADMAP.md
132
docs/ROADMAP.md
@ -5,94 +5,47 @@ Roadmap of things Daniel Stenberg and Steve Holme want to work on next. It is
|
||||
intended to serve as a guideline for others for information, feedback and
|
||||
possible participation.
|
||||
|
||||
HTTP/2
|
||||
------
|
||||
|
||||
- test suite
|
||||
|
||||
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.
|
||||
|
||||
To decide: if we need to bundle parts of the nghttp2 stuff that probably
|
||||
won't be shipped by many distros.
|
||||
|
||||
- provide option for HTTP/2 "prior knowledge" over clear text
|
||||
|
||||
As it would avoid the roundtrip-heavy Upgrade: procedures when you _know_
|
||||
it speaks HTTP/2.
|
||||
|
||||
HTTP cookies
|
||||
------------
|
||||
|
||||
Two cookie drafts have been adopted by the httpwg in IETF and we should
|
||||
support them as the popular browsers will as well:
|
||||
|
||||
[Deprecate modification of 'secure' cookies from non-secure
|
||||
origins](https://tools.ietf.org/html/draft-ietf-httpbis-cookie-alone-00)
|
||||
|
||||
[Cookie Prefixes](https://tools.ietf.org/html/draft-ietf-httpbis-cookie-prefixes-00)
|
||||
|
||||
[Firefox bug report about secure cookies](https://bugzilla.mozilla.org/show_bug.cgi?id=976073)
|
||||
|
||||
SRV records
|
||||
-----------
|
||||
|
||||
How to find services for specific domains/hosts.
|
||||
|
||||
HTTPS to proxy
|
||||
--------------
|
||||
|
||||
To avoid network traffic to/from the proxy getting snooped on. There's a git
|
||||
branch in the public git repository for this that we need to make sure works
|
||||
for all TLS backends and then merge!
|
||||
|
||||
curl_formadd()
|
||||
--------------
|
||||
|
||||
make sure there's an easy handle passed in to `curl_formadd()`,
|
||||
`curl_formget()` and `curl_formfree()` by adding replacement functions and
|
||||
deprecating the old ones to allow custom mallocs and more
|
||||
|
||||
third-party SASL
|
||||
----------------
|
||||
|
||||
add support for third-party SASL libraries such as Cyrus SASL - may need to
|
||||
move existing native and SSPI based authentication into vsasl folder after
|
||||
reworking HTTP and SASL code
|
||||
|
||||
SASL authentication in LDAP
|
||||
---------------------------
|
||||
|
||||
...
|
||||
|
||||
Simplify the SMTP email
|
||||
-----------------------
|
||||
|
||||
Simplify the SMTP email interface so that programmers don't have to
|
||||
construct the body of an email that contains all the headers, alternative
|
||||
content, images and attachments - maintain raw interface so that
|
||||
programmers that want to do this can
|
||||
|
||||
email capabilities
|
||||
------------------
|
||||
|
||||
Allow the email protocols to return the capabilities before
|
||||
authenticating. This will allow an application to decide on the best
|
||||
authentication mechanism
|
||||
|
||||
Win32 pthreads
|
||||
--------------
|
||||
|
||||
Allow Windows threading model to be replaced by Win32 pthreads port
|
||||
|
||||
dynamic buffer size
|
||||
New stuff - libcurl
|
||||
-------------------
|
||||
|
||||
Implement a dynamic buffer size to allow SFTP to use much larger buffers and
|
||||
possibly allow the size to be customizable by applications. Use less memory
|
||||
when handles are not in use?
|
||||
1. http2 test suite
|
||||
|
||||
2. http2 multiplexing/pipelining
|
||||
|
||||
3. SPDY
|
||||
|
||||
4. SRV records
|
||||
|
||||
5. HTTPS to proxy
|
||||
|
||||
6. make sure there's an easy handle passed in to `curl_formadd()`,
|
||||
`curl_formget()` and `curl_formfree()` by adding replacement functions and
|
||||
deprecating the old ones to allow custom mallocs and more
|
||||
|
||||
7. HTTP Digest authentication via Windows SSPI
|
||||
|
||||
8. SASL GSSAPI (Kerberos 5) authentication via a GSS-API library
|
||||
|
||||
9. add support for third-party SASL libraries such as Cyrus SASL - may need to
|
||||
move existing native and SSPI based authentication into vsasl folder after
|
||||
reworking HTTP and SASL code
|
||||
|
||||
10. SASL authentication in LDAP
|
||||
|
||||
11. Simplify the SMTP email interface so that programmers don't have to
|
||||
construct the body of an email that contains all the headers, alternative
|
||||
content, images and attachments - maintain raw interface so that
|
||||
programmers that want to do this can
|
||||
|
||||
12. Allow the email protocols to return the capabilities before
|
||||
authenticating. This will allow an application to decide on the best
|
||||
authentication mechanism
|
||||
|
||||
13. Allow Windows threading model to be replaced by Win32 pthreads port
|
||||
|
||||
14. Implement a dynamic buffer size to allow SFTP to use much larger buffers
|
||||
and possibly allow the size to be customizable by applications. Use less
|
||||
memory when handles are not in use?
|
||||
|
||||
New stuff - curl
|
||||
----------------
|
||||
@ -111,12 +64,13 @@ Improve
|
||||
|
||||
2. curl -h output (considered overwhelming to users)
|
||||
|
||||
3. we have > 170 command line options, is there a way to redo things to
|
||||
3. we have > 160 command line options, is there a way to redo things to
|
||||
simplify or improve the situation as we are likely to keep adding
|
||||
features/options in the future too
|
||||
|
||||
4. docs (considered "bad" by users but how do we make it better?)
|
||||
|
||||
- split up `curl_easy_setopt.3`
|
||||
- split up curl.1
|
||||
|
||||
5. authentication framework (consider merging HTTP and SASL authentication to
|
||||
@ -129,5 +83,7 @@ Improve
|
||||
Remove
|
||||
------
|
||||
|
||||
1. makefile.vc files as there is no point in maintaining two sets of Windows
|
||||
1. cmake support (nobody maintains it)
|
||||
|
||||
2. makefile.vc files as there is no point in maintaining two sets of Windows
|
||||
makefiles. Note: These are currently being used by the Windows autobuilds
|
||||
|
@ -14,7 +14,7 @@ Publishing Information
|
||||
----------------------
|
||||
|
||||
All known and public curl or libcurl related vulnerabilities are listed on
|
||||
[the curl web site security page](https://curl.haxx.se/docs/security.html).
|
||||
[the curl web site security page](http://curl.haxx.se/docs/security.html).
|
||||
|
||||
Security vulnerabilities should not be entered in the project's public bug
|
||||
tracker unless the necessary configuration is in place to limit access to the
|
||||
|
@ -26,7 +26,7 @@ CA bundle missing intermediate certificates
|
||||
problems if your CA cert does not have the certificates for the
|
||||
intermediates in the whole trust chain.
|
||||
|
||||
Protocol version
|
||||
SSL version
|
||||
|
||||
Some broken servers fail to support the protocol negotiation properly that
|
||||
SSL servers are supposed to handle. This may cause the connection to fail
|
||||
@ -36,9 +36,7 @@ Protocol version
|
||||
An additional complication can be that modern SSL libraries sometimes are
|
||||
built with support for older SSL and TLS versions disabled!
|
||||
|
||||
All versions of SSL are considered insecure and should be avoided. Use TLS.
|
||||
|
||||
Ciphers
|
||||
SSL ciphers
|
||||
|
||||
Clients give servers a list of ciphers to select from. If the list doesn't
|
||||
include any ciphers the server wants/can use, the connection handshake
|
||||
@ -53,14 +51,10 @@ Ciphers
|
||||
Note that these weak ciphers are identified as flawed. For example, this
|
||||
includes symmetric ciphers with less than 128 bit keys and RC4.
|
||||
|
||||
WinSSL in Windows XP is not able to connect to servers that no longer
|
||||
support the legacy handshakes and algorithms used by those versions, so we
|
||||
advice against building curl to use WinSSL on really old Windows versions.
|
||||
|
||||
References:
|
||||
|
||||
https://tools.ietf.org/html/draft-popov-tls-prohibiting-rc4-01
|
||||
|
||||
http://tools.ietf.org/html/draft-popov-tls-prohibiting-rc4-01
|
||||
|
||||
Allow BEAST
|
||||
|
||||
BEAST is the name of a TLS 1.0 attack that surfaced 2011. When adding means
|
||||
@ -71,17 +65,3 @@ Allow BEAST
|
||||
introduced. Exactly as it sounds, it re-introduces the BEAST vulnerability
|
||||
but on the other hand it allows curl to connect to that kind of strange
|
||||
servers.
|
||||
|
||||
Disabling certificate revocation checks
|
||||
|
||||
Some SSL backends may do certificate revocation checks (CRL, OCSP, etc)
|
||||
depending on the OS or build configuration. The --ssl-no-revoke option was
|
||||
introduced in 7.44.0 to disable revocation checking but currently is only
|
||||
supported for WinSSL (the native Windows SSL library), with an exception in
|
||||
the case of Windows' Untrusted Publishers blacklist which it seems can't be
|
||||
bypassed. This option may have broader support to accommodate other SSL
|
||||
backends in the future.
|
||||
|
||||
References:
|
||||
|
||||
https://curl.haxx.se/docs/ssl-compared.html
|
||||
|
@ -20,8 +20,8 @@ support.
|
||||
It is about trust
|
||||
-----------------
|
||||
|
||||
This system is about trust. In your local CA certificate store you have certs
|
||||
from *trusted* Certificate Authorities that you then can use to verify that the
|
||||
This system is about trust. In your local CA cert bundle you have certs from
|
||||
*trusted* Certificate Authorities that you then can use to verify that the
|
||||
server certificates you see are valid. They're signed by one of the CAs you
|
||||
trust.
|
||||
|
||||
@ -35,16 +35,16 @@ Certificate Verification
|
||||
------------------------
|
||||
|
||||
libcurl performs peer SSL certificate verification by default. This is done
|
||||
by using a CA certificate store that the SSL library can use to make sure the
|
||||
peer's server certificate is valid.
|
||||
by using CA cert bundle that the SSL library can use to make sure the peer's
|
||||
server certificate is valid.
|
||||
|
||||
If you communicate with HTTPS, FTPS or other TLS-using servers using
|
||||
certificates that are signed by CAs present in the store, you can be sure
|
||||
certificates that are signed by CAs present in the bundle, you can be sure
|
||||
that the remote server really is the one it claims to be.
|
||||
|
||||
If the remote server uses a self-signed certificate, if you don't install a CA
|
||||
cert store, if the server uses a certificate signed by a CA that isn't
|
||||
included in the store you use or if the remote host is an impostor
|
||||
cert bundle, if the server uses a certificate signed by a CA that isn't
|
||||
included in the bundle you use or if the remote host is an impostor
|
||||
impersonating your favorite site, and you want to transfer files from this
|
||||
server, do one of the following:
|
||||
|
||||
@ -59,22 +59,12 @@ server, do one of the following:
|
||||
|
||||
With the curl command line tool: --cacert [file]
|
||||
|
||||
3. Add the CA cert for your server to the existing default CA certificate
|
||||
store. The default CA certificate store can changed at compile time with the
|
||||
following configure options:
|
||||
3. Add the CA cert for your server to the existing default CA cert bundle.
|
||||
The default path of the CA bundle used can be changed by running configure
|
||||
with the --with-ca-bundle option pointing out the path of your choice.
|
||||
|
||||
--with-ca-bundle=FILE: use the specified file as CA certificate store. CA
|
||||
certificates need to be concatenated in PEM format into this file.
|
||||
|
||||
--with-ca-path=PATH: use the specified path as CA certificate store. CA
|
||||
certificates need to be stored as individual PEM files in this directory.
|
||||
You may need to run c_rehash after adding files there.
|
||||
|
||||
If neither of the two options is specified, configure will try to auto-detect
|
||||
a setting. It's also possible to explicitly not hardcode any default store
|
||||
but rely on the built in default the crypto library may provide instead.
|
||||
You can achieve that by passing both --without-ca-bundle and
|
||||
--without-ca-path to the configure script.
|
||||
To do this, you need to get the CA cert for your server in PEM format and
|
||||
then append that to your CA cert bundle.
|
||||
|
||||
If you use Internet Explorer, this is one way to get extract the CA cert
|
||||
for a particular server:
|
||||
@ -86,7 +76,7 @@ server, do one of the following:
|
||||
- Convert it from crt to PEM using the openssl tool:
|
||||
openssl x509 -inform DES -in yourdownloaded.crt \
|
||||
-out outcert.pem -text
|
||||
- Add the 'outcert.pem' to the CA certificate store or use it stand-alone
|
||||
- Append the 'outcert.pem' to the CA cert bundle or use it stand-alone
|
||||
as described below.
|
||||
|
||||
If you use the 'openssl' tool, this is one way to get extract the CA cert
|
||||
@ -99,9 +89,9 @@ server, do one of the following:
|
||||
- If you want to see the data in the certificate, you can do: "openssl
|
||||
x509 -inform PEM -in certfile -text -out certdata" where certfile is
|
||||
the cert you extracted from logfile. Look in certdata.
|
||||
- If you want to trust the certificate, you can add it to your CA
|
||||
certificate store or use it stand-alone as described. Just remember that
|
||||
the security is no better than the way you obtained the certificate.
|
||||
- If you want to trust the certificate, you can append it to your
|
||||
cert bundle or use it stand-alone as described. Just remember that the
|
||||
security is no better than the way you obtained the certificate.
|
||||
|
||||
4. If you're using the curl command line tool, you can specify your own CA
|
||||
cert path by setting the environment variable `CURL_CA_BUNDLE` to the path
|
||||
@ -119,13 +109,13 @@ server, do one of the following:
|
||||
5. Get a better/different/newer CA cert bundle! One option is to extract the
|
||||
one a recent Firefox browser uses by running 'make ca-bundle' in the curl
|
||||
build tree root, or possibly download a version that was generated this
|
||||
way for you: [CA Extract](https://curl.haxx.se/docs/caextract.html)
|
||||
way for you: [CA Extract](http://curl.haxx.se/docs/caextract.html)
|
||||
|
||||
Neglecting to use one of the above methods when dealing with a server using a
|
||||
certificate that isn't signed by one of the certificates in the installed CA
|
||||
certificate store, will cause SSL to report an error ("certificate verify
|
||||
failed") during the handshake and SSL will then refuse further communication
|
||||
with that server.
|
||||
cert bundle, will cause SSL to report an error ("certificate verify failed")
|
||||
during the handshake and SSL will then refuse further communication with that
|
||||
server.
|
||||
|
||||
Certificate Verification with NSS
|
||||
---------------------------------
|
||||
@ -133,8 +123,8 @@ Certificate Verification with NSS
|
||||
If libcurl was built with NSS support, then depending on the OS distribution,
|
||||
it is probably required to take some additional steps to use the system-wide
|
||||
CA cert db. RedHat ships with an additional module, libnsspem.so, which
|
||||
enables NSS to read the OpenSSL PEM CA bundle. On openSUSE you can install
|
||||
p11-kit-nss-trust which makes NSS use the system wide CA certificate store. NSS
|
||||
enables NSS to read the OpenSSL PEM CA bundle. This library is missing in
|
||||
OpenSuSE, and without it, NSS can only work with its own internal formats. NSS
|
||||
also has a new [database format](https://wiki.mozilla.org/NSS_Shared_DB).
|
||||
|
||||
Starting with version 7.19.7, libcurl automatically adds the 'sql:' prefix to
|
||||
|
175
docs/THANKS
175
docs/THANKS
@ -36,14 +36,10 @@ Alex Suykov
|
||||
Alex Vinnik
|
||||
Alex aka WindEagle
|
||||
Alexander Beedie
|
||||
Alexander Dyagilev
|
||||
Alexander Elgert
|
||||
Alexander Klauer
|
||||
Alexander Kourakos
|
||||
Alexander Krasnostavsky
|
||||
Alexander Lazic
|
||||
Alexander Pepper
|
||||
Alexander Peslyak
|
||||
Alexander Zhuravlev
|
||||
Alexey Borzov
|
||||
Alexey Pesternikov
|
||||
@ -56,7 +52,6 @@ Alona Rossen
|
||||
Amol Pattekar
|
||||
Amr Shahin
|
||||
Anatoli Tubman
|
||||
Anders Bakken
|
||||
Anders Gustafsson
|
||||
Anders Havn
|
||||
Andi Jahja
|
||||
@ -75,6 +70,7 @@ Andrei Benea
|
||||
Andrei Cipu
|
||||
Andrei Kurushin
|
||||
Andrej E Baranov
|
||||
Andres Garcia
|
||||
Andrew Benham
|
||||
Andrew Biggs
|
||||
Andrew Bushnell
|
||||
@ -84,7 +80,6 @@ Andrew Kurushin
|
||||
Andrew Moise
|
||||
Andrew Wansink
|
||||
Andrew de los Reyes
|
||||
Andrey Labunets
|
||||
Andrii Moiseiev
|
||||
Andrés García
|
||||
Andy Cedilnik
|
||||
@ -92,7 +87,6 @@ Andy Serpa
|
||||
Andy Tsouladze
|
||||
Angus Mackay
|
||||
Anthon Pang
|
||||
Anthony Avina
|
||||
Anthony Bryan
|
||||
Anthony G. Basile
|
||||
Antoine Calando
|
||||
@ -107,7 +101,6 @@ Arnaud Ebalard
|
||||
Arthur Murray
|
||||
Arve Knudsen
|
||||
Arvid Norberg
|
||||
Ashish Shukla
|
||||
Ask Bjørn Hansen
|
||||
Askar Safin
|
||||
Ates Goral
|
||||
@ -115,12 +108,10 @@ Augustus Saunders
|
||||
Avery Fay
|
||||
Axel Tillequin
|
||||
Balaji Parasuram
|
||||
Balaji Salunke
|
||||
Balint Szilakszi
|
||||
Barry Abrahamson
|
||||
Bart Whiteley
|
||||
Bas Mevissen
|
||||
Ben Boeckel
|
||||
Ben Darnell
|
||||
Ben Greear
|
||||
Ben Madsen
|
||||
@ -131,20 +122,15 @@ Benbuck Nason
|
||||
Benjamin Gerard
|
||||
Benjamin Gilbert
|
||||
Benjamin Johnson
|
||||
Benjamin Kircher
|
||||
Benoit Neil
|
||||
Benoit Sigoure
|
||||
Bernard Leak
|
||||
Bernard Spil
|
||||
Bernhard Reutner-Fischer
|
||||
Bert Huijben
|
||||
Bertrand Demiddelaer
|
||||
Bertrand Simonnet
|
||||
Bill Doyle
|
||||
Bill Egert
|
||||
Bill Hoffman
|
||||
Bill Middlecamp
|
||||
Bill Nagel
|
||||
Bjoern Sikora
|
||||
Bjorn Augustsson
|
||||
Bjorn Reese
|
||||
@ -155,8 +141,6 @@ Bob Richmond
|
||||
Bob Schader
|
||||
Bogdan Nicula
|
||||
Brad Burdick
|
||||
Brad Fitzpatrick
|
||||
Brad Harder
|
||||
Brad Hards
|
||||
Brad King
|
||||
Brad Spencer
|
||||
@ -166,15 +150,12 @@ Brandon Wang
|
||||
Brendan Jurd
|
||||
Brent Beardsley
|
||||
Brian Akins
|
||||
Brian Chrisman
|
||||
Brian Dessent
|
||||
Brian J. Murrell
|
||||
Brian Prodoehl
|
||||
Brian R Duffy
|
||||
Brian Ulm
|
||||
Brock Noland
|
||||
Bruce Mitchener
|
||||
Bruno Thomsen
|
||||
Bruno de Carvalho
|
||||
Bryan Henderson
|
||||
Bryan Kemp
|
||||
@ -182,20 +163,19 @@ Byrial Jensen
|
||||
Cameron Kaiser
|
||||
Camille Moncelier
|
||||
Caolan McNamara
|
||||
Carlo Wood
|
||||
Carsten Lange
|
||||
Casey O'Donnell
|
||||
Catalin Patulea
|
||||
Cedric Deltheil
|
||||
Chad Monroe
|
||||
Chandrakant Bagul
|
||||
Charles Kerr
|
||||
Charles Romestant
|
||||
Chen Prog
|
||||
Chih-Chung Chang
|
||||
Chris "Bob Bob"
|
||||
Chris Araman
|
||||
Chris Combes
|
||||
Chris Conlon
|
||||
Chris Conroy
|
||||
Chris Deidun
|
||||
Chris Flerackers
|
||||
Chris Gaukroger
|
||||
@ -209,7 +189,6 @@ Christian Krause
|
||||
Christian Kurz
|
||||
Christian Robottom Reis
|
||||
Christian Schmitz
|
||||
Christian Stewart
|
||||
Christian Vogt
|
||||
Christian Weisgerber
|
||||
Christophe Demory
|
||||
@ -223,7 +202,6 @@ Claes Jakobsson
|
||||
Clarence Gardner
|
||||
Clemens Gruber
|
||||
Clifford Wolf
|
||||
Clint Clayton
|
||||
Cody Jones
|
||||
Cody Mack
|
||||
Colby Ranger
|
||||
@ -240,10 +218,8 @@ Cris Bailiff
|
||||
Cristian Rodríguez
|
||||
Curt Bogmine
|
||||
Cyrill Osterwalder
|
||||
Cédric Connes
|
||||
Cédric Deltheil
|
||||
D. Flinkmann
|
||||
Da-Yoon Chung
|
||||
Dag Ekengren
|
||||
Dagobert Michelsen
|
||||
Damian Dixon
|
||||
@ -259,15 +235,8 @@ Dan Zitter
|
||||
Daniel Black
|
||||
Daniel Cater
|
||||
Daniel Egger
|
||||
Daniel Hwang
|
||||
Daniel Johnson
|
||||
Daniel Kahn Gillmor
|
||||
Daniel Lee Hwang
|
||||
Daniel Melani
|
||||
Daniel Mentz
|
||||
Daniel Schauenberg
|
||||
Daniel Seither
|
||||
Daniel Shahaf
|
||||
Daniel Steinberg
|
||||
Daniel Stenberg
|
||||
Daniel Theron
|
||||
@ -281,9 +250,7 @@ Dave May
|
||||
Dave Reisner
|
||||
Dave Thompson
|
||||
Dave Vasilevsky
|
||||
Davey Shafik
|
||||
David Bau
|
||||
David Benjamin
|
||||
David Binderman
|
||||
David Blaikie
|
||||
David Byron
|
||||
@ -312,7 +279,6 @@ David Woodhouse
|
||||
David Wright
|
||||
David Yan
|
||||
Dengminwen
|
||||
Denis Feklushkin
|
||||
Dennis Clarke
|
||||
Derek Higgins
|
||||
Detlef Schmier
|
||||
@ -321,7 +287,6 @@ Diego Casorran
|
||||
Dilyan Palauzov
|
||||
Dima Barsky
|
||||
Dima Tisnek
|
||||
Dimitar Boevski
|
||||
Dimitre Dimitrov
|
||||
Dimitrios Siganos
|
||||
Dimitris Sarris
|
||||
@ -331,25 +296,21 @@ Dirk Manske
|
||||
Dmitri Shubin
|
||||
Dmitriy Sergeyev
|
||||
Dmitry Bartsevich
|
||||
Dmitry Eremin-Solenikov
|
||||
Dmitry Falko
|
||||
Dmitry Kurochkin
|
||||
Dmitry Popov
|
||||
Dmitry Rechkin
|
||||
Dmitry S. Baikov
|
||||
Dolbneff A.V
|
||||
Domenico Andreoli
|
||||
Dominick Meglio
|
||||
Dominique Leuenberger
|
||||
Doug Kaufman
|
||||
Doug Porter
|
||||
Douglas Creager
|
||||
Douglas E. Wegscheid
|
||||
Douglas Kilpatrick
|
||||
Douglas R. Horner
|
||||
Douglas Steinwand
|
||||
Dov Murik
|
||||
Drake Arconis
|
||||
Duane Cathey
|
||||
Duncan Mac-Vicar Prett
|
||||
Dustin Boswell
|
||||
@ -364,12 +325,10 @@ Edward Rudd
|
||||
Edward Sheldrake
|
||||
Eelco Dolstra
|
||||
Eetu Ojanen
|
||||
Egon Eckert
|
||||
Eldar Zaitov
|
||||
Ellis Pritchard
|
||||
Elmira A Semenova
|
||||
Emanuele Bovisio
|
||||
Emil Lerner
|
||||
Emil Romanus
|
||||
Emiliano Ida
|
||||
Enrico Scholz
|
||||
@ -382,14 +341,12 @@ Eric Lubin
|
||||
Eric Melville
|
||||
Eric Mertens
|
||||
Eric Rautman
|
||||
Eric Ridge
|
||||
Eric S. Raymond
|
||||
Eric Thelin
|
||||
Eric Vergnaud
|
||||
Eric Wong
|
||||
Eric Young
|
||||
Erick Nuwendam
|
||||
Erik Janssen
|
||||
Erik Johansson
|
||||
Ernest Beinrohr
|
||||
Erwan Legrand
|
||||
@ -404,16 +361,13 @@ Fabian Hiernaux
|
||||
Fabian Keil
|
||||
Fabrizio Ammollo
|
||||
Fedor Karpelevitch
|
||||
Feist Josselin
|
||||
Felix Yan
|
||||
Felix von Leitner
|
||||
Feng Tu
|
||||
Flavio Medeiros
|
||||
Florian Schoppmann
|
||||
Florian Weimer
|
||||
Forrest Cahoon
|
||||
Francisco Moraes
|
||||
Frank Gevaerts
|
||||
Francois Charlier
|
||||
Frank Hempel
|
||||
Frank Keeney
|
||||
Frank McGeough
|
||||
@ -425,7 +379,6 @@ François Charlier
|
||||
Fred Machado
|
||||
Fred New
|
||||
Fred Noz
|
||||
Fred Stluka
|
||||
Frederic Lepied
|
||||
Fredrik Thulin
|
||||
Gabriel Kuri
|
||||
@ -460,11 +413,10 @@ Glen A Johnson Jr.
|
||||
Glen Nakamura
|
||||
Glen Scott
|
||||
Glenn Sheridan
|
||||
Google Inc.
|
||||
Gokhan Sengun
|
||||
Gordon Marler
|
||||
Gorilla Maguila
|
||||
Grant Erickson
|
||||
Grant Pannell
|
||||
Greg Hewgill
|
||||
Greg Morse
|
||||
Greg Onufer
|
||||
@ -477,14 +429,12 @@ Guido Berhoerster
|
||||
Guillaume Arluison
|
||||
Gunter Knauf
|
||||
Gustaf Hui
|
||||
Gustavo Grieco
|
||||
Gwenole Beauchesne
|
||||
Gökhan Şengün
|
||||
Götz Babin-Ebell
|
||||
Hamish Mackenzie
|
||||
Hang Kin Lau
|
||||
Hang Su
|
||||
Hanno Böck
|
||||
Hanno Kranzhoff
|
||||
Hans Steegers
|
||||
Hans-Jurgen May
|
||||
@ -522,20 +472,16 @@ Iida Yosiaki
|
||||
Ilguiz Latypov
|
||||
Ilja van Sprundel
|
||||
Immanuel Gregoire
|
||||
Inca R
|
||||
Ingmar Runge
|
||||
Ingo Ralf Blum
|
||||
Ingo Wilken
|
||||
Isaac Boukris
|
||||
Ishan SinghLevett
|
||||
Ivo Bellin Salarin
|
||||
Jack Zhang
|
||||
Jacky Lam
|
||||
Jacob Meuser
|
||||
Jacob Moshenko
|
||||
Jactry Zeng
|
||||
Jad Chamcham
|
||||
Jaime Fullaondo
|
||||
Jakub Zakrzewski
|
||||
James Bursa
|
||||
James Cheng
|
||||
@ -563,14 +509,12 @@ Jason Liu
|
||||
Jason McDonald
|
||||
Jason S. Priebe
|
||||
Javier Barroso
|
||||
Javier G. Sogo
|
||||
Jay Austin
|
||||
Jayesh A Shah
|
||||
Jaz Fresh
|
||||
Jean Jacques Drouin
|
||||
Jean-Claude Chauve
|
||||
Jean-Francois Bertrand
|
||||
Jean-Francois Durand
|
||||
Jean-Louis Lemaire
|
||||
Jean-Marc Ranger
|
||||
Jean-Noël Rouvignac
|
||||
@ -583,13 +527,9 @@ Jeff Lawson
|
||||
Jeff Phillips
|
||||
Jeff Pohlmeyer
|
||||
Jeff Weber
|
||||
Jeffrey Walton
|
||||
Jens Rantil
|
||||
Jeremy Friesner
|
||||
Jeremy Huddleston
|
||||
Jeremy Lin
|
||||
Jeroen Koekkoek
|
||||
Jeroen Ooms
|
||||
Jerome Muffat-Meridol
|
||||
Jerome Robert
|
||||
Jerome Vouillon
|
||||
@ -598,13 +538,11 @@ Jerry Wu
|
||||
Jes Badwal
|
||||
Jesper Jensen
|
||||
Jesse Noller
|
||||
Jesse Tan
|
||||
Jie He
|
||||
Jim Drash
|
||||
Jim Freeman
|
||||
Jim Hollinger
|
||||
Jim Meyering
|
||||
Jiri Dvorak
|
||||
Jiri Hruska
|
||||
Jiri Jaburek
|
||||
Jiri Malak
|
||||
@ -613,15 +551,12 @@ Joe Halpin
|
||||
Joe Malicki
|
||||
Joe Mason
|
||||
Joel Chen
|
||||
Joel Depooter
|
||||
Jofell Gallardo
|
||||
Johan Anderson
|
||||
Johan Lantz
|
||||
Johan Nilsson
|
||||
Johan van Selst
|
||||
Johannes Bauer
|
||||
Johannes Ernst
|
||||
Johannes Schindelin
|
||||
John Bradshaw
|
||||
John Coffey
|
||||
John Crow
|
||||
@ -632,12 +567,10 @@ John Gardiner Myers
|
||||
John Janssen
|
||||
John Joseph Bachir
|
||||
John Kelly
|
||||
John Kohl
|
||||
John Lask
|
||||
John Levon
|
||||
John Lightsey
|
||||
John Malmberg
|
||||
John Marino
|
||||
John Marshall
|
||||
John McGowan
|
||||
John P. McCaskey
|
||||
John Suprock
|
||||
@ -647,18 +580,14 @@ Johnny Luong
|
||||
Jon Grubbs
|
||||
Jon Nelson
|
||||
Jon Sargeant
|
||||
Jon Seymour
|
||||
Jon Spencer
|
||||
Jon Torrey
|
||||
Jon Travis
|
||||
Jon Turner
|
||||
Jonas Forsman
|
||||
Jonas Minnberg
|
||||
Jonas Schnelli
|
||||
Jonatan Lander
|
||||
Jonatan Vela
|
||||
Jonathan Cardoso Machado
|
||||
Jonathan Cardoso Machado Machado
|
||||
Jonathan Hseu
|
||||
Jonathan Nieder
|
||||
Jongki Suwandi
|
||||
@ -675,32 +604,27 @@ Judson Bishop
|
||||
Juergen Wilke
|
||||
Jukka Pihl
|
||||
Julian Noble
|
||||
Julian Ospald
|
||||
Julian Taylor
|
||||
Julien Chaffraix
|
||||
Julien Nabet
|
||||
Julien Royer
|
||||
Jun-ichiro itojun Hagino
|
||||
Jurij Smakov
|
||||
Justin Ehlert
|
||||
Justin Fletcher
|
||||
Justin Karneges
|
||||
Justin Maggard
|
||||
Jörg Mueller-Tolk
|
||||
Jörn Hartroth
|
||||
K. R. Walker
|
||||
Kai Engert
|
||||
Kai Sommerfeld
|
||||
Kai-Uwe Rommel
|
||||
Kalle Vahlman
|
||||
Kamil Dudka
|
||||
Kang Lin
|
||||
Kang-Jin Lee
|
||||
Karl M
|
||||
Karl Moerder
|
||||
Karol Pietrzak
|
||||
Kaspar Brand
|
||||
Katie Wang
|
||||
Kazuho Oku
|
||||
Kees Cook
|
||||
Keith MacDonald
|
||||
Keith McGuigan
|
||||
@ -727,8 +651,6 @@ Krishnendu Majumdar
|
||||
Krister Johansen
|
||||
Kristian Gunstone
|
||||
Kristian Köhntopp
|
||||
Kurt Fankhauser
|
||||
Kyle J. McKay
|
||||
Kyle L. Huff
|
||||
Kyle Sallee
|
||||
Lachlan O'Dea
|
||||
@ -744,11 +666,9 @@ Lars Nilsson
|
||||
Lars Torben Wilson
|
||||
Lau Hang Kin
|
||||
Laurent Rabret
|
||||
Lauri Kasanen
|
||||
Legoff Vincent
|
||||
Lehel Bernadt
|
||||
Leif W
|
||||
Leith Bade
|
||||
Len Krause
|
||||
Lenaic Lefever
|
||||
Lenny Rachitsky
|
||||
@ -760,21 +680,16 @@ Linas Vepstas
|
||||
Lindley French
|
||||
Ling Thio
|
||||
Linus Nielsen Feltzing
|
||||
Lior Kaplan
|
||||
Lisa Xu
|
||||
Liviu Chircu
|
||||
Liza Alenchery
|
||||
Lluís Batlle i Rossell
|
||||
Loic Dachary
|
||||
Loren Kirkby
|
||||
Luan Cestari
|
||||
Luca Altea
|
||||
Luca Alteas
|
||||
Lucas Adamski
|
||||
Lucas Pardue
|
||||
Ludek Finstrle
|
||||
Ludovico Cavedon
|
||||
Ludwig Nussel
|
||||
Lukas Ruzicka
|
||||
Lukasz Czekierda
|
||||
Luke Amery
|
||||
Luke Call
|
||||
@ -785,8 +700,6 @@ Maciej Karpiuk
|
||||
Maciej Puzio
|
||||
Maciej W. Rozycki
|
||||
Maks Naumov
|
||||
Maksim Kuzevanov
|
||||
Maksim Stsepanenka
|
||||
Mamoru Tasaka
|
||||
Mandy Wu
|
||||
Manfred Schwarb
|
||||
@ -794,10 +707,8 @@ Manuel Massing
|
||||
Marc Boucher
|
||||
Marc Deslauriers
|
||||
Marc Doughty
|
||||
Marc Hesse
|
||||
Marc Hoersken
|
||||
Marc Kleine-Budde
|
||||
Marc Renault
|
||||
Marcel Raad
|
||||
Marcel Roelofs
|
||||
Marcelo Juchem
|
||||
@ -820,7 +731,6 @@ Mark Salisbury
|
||||
Mark Snelling
|
||||
Mark Tully
|
||||
Markus Duft
|
||||
Markus Elfring
|
||||
Markus Koetter
|
||||
Markus Moeller
|
||||
Markus Oberhumer
|
||||
@ -849,7 +759,6 @@ Matt Wixson
|
||||
Matteo Rocco
|
||||
Matthew Blain
|
||||
Matthew Clarke
|
||||
Matthew Hall
|
||||
Matthias Bolte
|
||||
Maurice Barnum
|
||||
Mauro Iorio
|
||||
@ -870,23 +779,17 @@ Michael Day
|
||||
Michael Goffioul
|
||||
Michael Jahn
|
||||
Michael Jerris
|
||||
Michael Kalinin
|
||||
Michael Kaufmann
|
||||
Michael König
|
||||
Michael Mealling
|
||||
Michael Mueller
|
||||
Michael Osipov
|
||||
Michael Smith
|
||||
Michael Stapelberg
|
||||
Michael Stillwell
|
||||
Michael Wallner
|
||||
Michal Bonino
|
||||
Michal Gorny
|
||||
Michal Marek
|
||||
Michał Fita
|
||||
Michał Górny
|
||||
Michał Kowalczyk
|
||||
Michał Piechowski
|
||||
Michel Promonet
|
||||
Michele Bini
|
||||
Miguel Angel
|
||||
Miguel Diaz
|
||||
@ -910,14 +813,12 @@ Mitz Wark
|
||||
Mohamed Lrhazi
|
||||
Mohammad AlSaleh
|
||||
Mohun Biswas
|
||||
Mostyn Bramley-Moore
|
||||
Moonesamy
|
||||
Myk Taylor
|
||||
Nach M. S.
|
||||
Nagai H
|
||||
Nathan Coulter
|
||||
Nathan O'Sullivan
|
||||
Nathanael Nerode
|
||||
Nathaniel Waisbrot
|
||||
Naveen Chandran
|
||||
Naveen Noel
|
||||
Neil Bowers
|
||||
@ -941,25 +842,18 @@ Nikos Mavrogiannopoulos
|
||||
Ning Dong
|
||||
Nir Soffer
|
||||
Nis Jorgensen
|
||||
Nobuhiro Ban
|
||||
Nodak Sodak
|
||||
Norbert Frese
|
||||
Norbert Kett
|
||||
Norbert Novotny
|
||||
Octavio Schroeder
|
||||
Ofer
|
||||
Ola Mork
|
||||
Olaf Flebbe
|
||||
Olaf Stüben
|
||||
Oliver Gondža
|
||||
Oliver Graute
|
||||
Oliver Kuckertz
|
||||
Oliver Schindler
|
||||
Olivier Berger
|
||||
Orange Tsai
|
||||
Oren Souroujon
|
||||
Oren Tirosh
|
||||
Orgad Shaneh
|
||||
Ori Avtalion
|
||||
Oscar Koeroo
|
||||
Oscar Norlander
|
||||
@ -975,7 +869,6 @@ Patricia Muscalu
|
||||
Patrick Bihan-Faou
|
||||
Patrick McManus
|
||||
Patrick Monnerat
|
||||
Patrick Rapin
|
||||
Patrick Scott
|
||||
Patrick Smith
|
||||
Patrick Watson
|
||||
@ -988,7 +881,6 @@ Paul Marks
|
||||
Paul Marquis
|
||||
Paul Moore
|
||||
Paul Nolan
|
||||
Paul Oliver
|
||||
Paul Querna
|
||||
Paul Saab
|
||||
Pavel Cenek
|
||||
@ -998,6 +890,7 @@ Pawel A. Gajda
|
||||
Pawel Kierski
|
||||
Pedro Larroy
|
||||
Pedro Neves
|
||||
Pete Su
|
||||
Peter Bray
|
||||
Peter Forret
|
||||
Peter Gal
|
||||
@ -1005,7 +898,6 @@ Peter Heuchert
|
||||
Peter Hjalmarsson
|
||||
Peter Korsgaard
|
||||
Peter Lamberg
|
||||
Peter Laser
|
||||
Peter O'Gorman
|
||||
Peter Pentchev
|
||||
Peter Silva
|
||||
@ -1014,7 +906,6 @@ Peter Sylvester
|
||||
Peter Todd
|
||||
Peter Verhas
|
||||
Peter Wang
|
||||
Peter Wu
|
||||
Peter Wullinger
|
||||
Peteris Krumins
|
||||
Petr Bahula
|
||||
@ -1045,15 +936,12 @@ Quanah Gibson-Mount
|
||||
Quinn Slack
|
||||
Radu Simionescu
|
||||
Rafa Muyo
|
||||
Rafael Antonio
|
||||
Rafael Sagula
|
||||
Rafayel Mkrtchyan
|
||||
Rafaël Carré
|
||||
Rainer Canavan
|
||||
Rainer Jung
|
||||
Rainer Koenig
|
||||
Rajesh Naganathan
|
||||
Rajkumar Mandal
|
||||
Ralf S. Engelschall
|
||||
Ralph Beckmann
|
||||
Ralph Mitchell
|
||||
@ -1063,7 +951,6 @@ Ravi Pratap
|
||||
Ray Dassen
|
||||
Ray Pekowski
|
||||
Ray Satiro
|
||||
Razvan Cojocaru
|
||||
Reinout van Schouwen
|
||||
Remi Gacogne
|
||||
Renato Botelho
|
||||
@ -1075,7 +962,6 @@ Rene Rebe
|
||||
Reuven Wachtfogel
|
||||
Reza Arbab
|
||||
Ricardo Cadime
|
||||
Rich Burridge
|
||||
Rich Gray
|
||||
Rich Rauenzahn
|
||||
Richard Archer
|
||||
@ -1084,12 +970,10 @@ Richard Bramante
|
||||
Richard Clayton
|
||||
Richard Cooper
|
||||
Richard Gorton
|
||||
Richard Hosking
|
||||
Richard Michael
|
||||
Richard Moore
|
||||
Richard Prescott
|
||||
Richard Silverman
|
||||
Richard van den Berg
|
||||
Rick Jones
|
||||
Rick Richardson
|
||||
Rob Crittenden
|
||||
@ -1113,7 +997,6 @@ Robson Braga Araujo
|
||||
Rodney Simmons
|
||||
Rodric Glaser
|
||||
Rodrigo Silva
|
||||
Roger Leigh
|
||||
Roland Blom
|
||||
Roland Krikava
|
||||
Roland Zimmermann
|
||||
@ -1137,9 +1020,7 @@ S. Moonesamy
|
||||
Salvador Dávila
|
||||
Salvatore Sorrentino
|
||||
Sam Deane
|
||||
Sam Hurst
|
||||
Sam Roth
|
||||
Sam Schanken
|
||||
Sam Listopad
|
||||
Sampo Kellomaki
|
||||
Samuel Díaz García
|
||||
Samuel Listopad
|
||||
@ -1157,22 +1038,19 @@ Scott Barrett
|
||||
Scott Cantor
|
||||
Scott Davis
|
||||
Scott McCreary
|
||||
Sean Boudreau
|
||||
Sebastian Pohlschmidt
|
||||
Sebastian Rasmussen
|
||||
Sebastien Willemijns
|
||||
Senthil Raja Velu
|
||||
Sergei Nikulov
|
||||
Sergey Tatarincev
|
||||
Sergio Ballestrero
|
||||
Seshubabu Pasam
|
||||
Seth Mos
|
||||
Sh Diao
|
||||
Shao Shuchao
|
||||
Sharad Gupta
|
||||
Shard
|
||||
Shawn Landden
|
||||
Shawn Poulson
|
||||
Shine Fan
|
||||
Shmulik Regev
|
||||
Siddhartha Prakash Jain
|
||||
Sidney San Martin
|
||||
@ -1188,8 +1066,6 @@ Spork Schivago
|
||||
Stadler Stephan
|
||||
Stan van de Burgt
|
||||
Stanislav Ivochkin
|
||||
Stefan Bühler
|
||||
Stefan Eissing
|
||||
Stefan Esser
|
||||
Stefan Krause
|
||||
Stefan Neis
|
||||
@ -1204,7 +1080,6 @@ Stephen More
|
||||
Sterling Hughes
|
||||
Steve Green
|
||||
Steve H Truong
|
||||
Steve Havelka
|
||||
Steve Holme
|
||||
Steve Lhomme
|
||||
Steve Little
|
||||
@ -1221,28 +1096,20 @@ Sune Ahlgren
|
||||
Sven Anders
|
||||
Sven Neuhaus
|
||||
Sven Wegener
|
||||
Svyatoslav Mishyn
|
||||
Symeon Paraschoudis
|
||||
Sébastien Willemijns
|
||||
T. Bharath
|
||||
T. Yamada
|
||||
TJ Saunders
|
||||
Tae Hyoung Ahn
|
||||
Taneli Vahakangas
|
||||
Tanguy Fautre
|
||||
Tatsuhiro Tsujikawa
|
||||
Temprimus
|
||||
Terri Oda
|
||||
Thomas Braun
|
||||
Thomas Glanzmann
|
||||
Thomas J. Moore
|
||||
Thomas Klausner
|
||||
Thomas L. Shinnick
|
||||
Thomas Lopatic
|
||||
Thomas Ruecker
|
||||
Thomas Schwinge
|
||||
Thomas Tonino
|
||||
Thorsten Schöning
|
||||
Tiit Pikma
|
||||
Till Maas
|
||||
Tim Ansell
|
||||
@ -1253,19 +1120,16 @@ Tim Costello
|
||||
Tim Harder
|
||||
Tim Heckman
|
||||
Tim Newsome
|
||||
Tim Rühsen
|
||||
Tim Sneddon
|
||||
Tim Stack
|
||||
Tim Starling
|
||||
Timo Sirainen
|
||||
Timotej Lazar
|
||||
Tinus van den Berg
|
||||
Tobias Markus
|
||||
Tobias Rundström
|
||||
Tobias Stoeckmann
|
||||
Toby Peterson
|
||||
Todd A Ouska
|
||||
Todd Kulesza
|
||||
Todd Ouska
|
||||
Todd Vierling
|
||||
Tom Benoist
|
||||
Tom Donovan
|
||||
@ -1282,8 +1146,6 @@ Tomas Hoger
|
||||
Tomas Mlcoch
|
||||
Tomas Pospisek
|
||||
Tomas Szepe
|
||||
Tomas Tomecek
|
||||
Tomasz Kojm
|
||||
Tomasz Lacki
|
||||
Tommie Gannert
|
||||
Tommy Tam
|
||||
@ -1303,14 +1165,12 @@ Török Edwin
|
||||
Ulf Härnhammar
|
||||
Ulf Samuelsson
|
||||
Ulrich Doehner
|
||||
Ulrich Telle
|
||||
Ulrich Zadow
|
||||
Venkat Akella
|
||||
Victor Snezhko
|
||||
Vijay Panghal
|
||||
Vikram Saxena
|
||||
Viktor Szakáts
|
||||
Ville Skyttä
|
||||
Vilmos Nebehaj
|
||||
Vincent Bronner
|
||||
Vincent Le Normand
|
||||
@ -1323,13 +1183,9 @@ Vladimir Grishchenko
|
||||
Vladimir Lazarenko
|
||||
Vojtech Janota
|
||||
Vojtech Minarik
|
||||
Vojtěch Král
|
||||
Vsevolod Novikov
|
||||
W. Mark Kubacki
|
||||
Waldek Kozba
|
||||
Walter J. Mack
|
||||
Ward Willats
|
||||
Warren Menzer
|
||||
Wayne Haigh
|
||||
Werner Koch
|
||||
Wesley Laxton
|
||||
@ -1343,7 +1199,6 @@ Wojciech Zwiefka
|
||||
Wouter Van Rooy
|
||||
Wu Yongzheng
|
||||
Xavier Bouchoux
|
||||
Xiangbin Li
|
||||
Yaakov Selkowitz
|
||||
Yamada Yasuharu
|
||||
Yang Tse
|
||||
@ -1355,7 +1210,6 @@ Yi Huang
|
||||
Yingwei Liu
|
||||
Yousuke Kimoto
|
||||
Yukihiro Kawada
|
||||
Yun SangHo
|
||||
Yuriy Sosov
|
||||
Yves Arrouye
|
||||
Yves Lejeune
|
||||
@ -1366,5 +1220,4 @@ Zvi Har'El
|
||||
nk
|
||||
swalkaus at yahoo.com
|
||||
tommink[at]post.pl
|
||||
Štefan Kremeň
|
||||
Никита Дорохин
|
||||
|
@ -1,55 +0,0 @@
|
||||
# This is a list of names we have recorded that already are thanked
|
||||
# appropriately in THANKS. This list contains variations of their names and
|
||||
# their "canonical" name. This file is used for scripting purposes to avoid
|
||||
# duplicate entries and will not be included in release tarballs.
|
||||
# When removing dupes that aren't identical names from THANKS, add a line
|
||||
# here!
|
||||
#
|
||||
# Used-by: contributor.sh
|
||||
s/Andres Garcia/Andrés García/
|
||||
s/Chris Conroy/Christopher Conroy/
|
||||
s/Francois Charlier/François Charlier/
|
||||
s/Gokhan Sengun/Gökhan Şengün/
|
||||
s/John Malmberg/John E. Malmberg/
|
||||
s/Luca Alteas/Luca Altea/
|
||||
s/Michal Gorny/Michał Górny/
|
||||
s/Michal Górny/Michał Górny/
|
||||
s/Moonesamy/S. Moonesamy/
|
||||
s/Pete Su$/Peter Su/
|
||||
s/Sam Listopad/Samuel Listopad/
|
||||
s/Sebastien Willemijns/Sébastien Willemijns/
|
||||
s/YAMADA Yasuharu/Yasuharu Yamada/
|
||||
s/Karl M$/Karl Moerder/
|
||||
s/Bjorn Stenberg/Björn Stenberg/
|
||||
s/upstream tests 305 and 404//
|
||||
s/Gaël PORTAY/Gaël Portay/
|
||||
s/Romulo Ceccon/Romulo A. Ceccon/
|
||||
s/Nach M. S$/Nach M. S./
|
||||
s/Jay Satiro/Ray Satiro/
|
||||
s/Richard J. Moore/Richard Moore/
|
||||
s/Sergey Nikulov/Sergei Nikulov/
|
||||
s/Petr Písař/Petr Pisar/
|
||||
s/Nick Zitzmann (originally)/Nick Zitzmann/
|
||||
s/product-security at Apple//
|
||||
s/IT DOES NOT WORK//
|
||||
s/Albert Chin/Albert Chin-A-Young/
|
||||
s/Paras S\z/Paras Sethia/
|
||||
s/Paras Sethiaethia/Paras Sethia/
|
||||
s/Дмитрий Фалько/Dmitry Falko/
|
||||
s/byte_bucket in the #curl IRC channel//
|
||||
s/Michal Górny and Anthony G. Basile//
|
||||
s/Alejandro Alvarez$/Alejandro Alvarez Ayllon/
|
||||
s/Ant Bryan/Anthony Bryan/
|
||||
s/Cédric Deltheil/Cédric Deltheil/
|
||||
s/Christian Hagele/Christian Hägele/
|
||||
s/douglas steinwand/Douglas Steinwand/
|
||||
s/Frank Van Uffelen and Fabian Hiernaux//
|
||||
s/Rodrigo Silva (MestreLion)/Rodrigo Silva/
|
||||
s/tetetest tetetest//
|
||||
s/Jiří Hruška/Jiri Hruska/
|
||||
s/Viktor Szakats/Viktor Szakáts/
|
||||
s/Jonathan Cardoso/Jonathan Cardoso Machado/
|
||||
s/Linus Nielsen/Linus Nielsen Feltzing/
|
||||
s/Todd Ouska$/Todd A Ouska/
|
||||
s/Tim Ruehsen/Tim Rühsen/
|
||||
s/Michael Koenig/Michael König/
|
518
docs/TODO
518
docs/TODO
@ -9,11 +9,6 @@
|
||||
Things to do in project cURL. Please tell us what you think, contribute and
|
||||
send us patches that improve things!
|
||||
|
||||
Be aware that these are things that we could do, or have once been considered
|
||||
things we could do. If you want to work on any of these areas, please
|
||||
consider bringing it up for discussions first on the mailing list so that we
|
||||
all agree it is still a good idea for the project!
|
||||
|
||||
All bugs documented in the KNOWN_BUGS document are subject for fixing!
|
||||
|
||||
1. libcurl
|
||||
@ -24,20 +19,10 @@
|
||||
1.6 Modified buffer size approach
|
||||
1.7 Detect when called from within callbacks
|
||||
1.8 Allow SSL (HTTPS) to proxy
|
||||
1.9 Cache negative name resolves
|
||||
1.10 Support IDNA2008
|
||||
1.11 minimize dependencies with dynamicly loaded modules
|
||||
1.12 have form functions use CURL handle argument
|
||||
1.13 Add CURLOPT_MAIL_CLIENT option
|
||||
1.14 Typesafe curl_easy_setopt()
|
||||
1.15 TCP Fast Open
|
||||
1.16 Try to URL encode given URL
|
||||
|
||||
2. libcurl - multi interface
|
||||
2.1 More non-blocking
|
||||
2.2 Better support for same name resolves
|
||||
2.3 Non-blocking curl_multi_remove_handle()
|
||||
2.4 Split connect and authentication process
|
||||
2.2 Fix HTTP Pipelining for PUT
|
||||
|
||||
3. Documentation
|
||||
3.1 Update date and version in man pages
|
||||
@ -57,8 +42,7 @@
|
||||
5.3 Rearrange request header order
|
||||
5.4 SPDY
|
||||
5.5 auth= in URLs
|
||||
5.6 Refuse "downgrade" redirects
|
||||
5.7 More compressions
|
||||
5.6 Digest via Windows SSPI
|
||||
|
||||
6. TELNET
|
||||
6.1 ditch stdin
|
||||
@ -69,88 +53,72 @@
|
||||
7. SMTP
|
||||
7.1 Pipelining
|
||||
7.2 Enhanced capability support
|
||||
|
||||
|
||||
8. POP3
|
||||
8.1 Pipelining
|
||||
8.2 Enhanced capability support
|
||||
|
||||
|
||||
9. IMAP
|
||||
9.1 Enhanced capability support
|
||||
|
||||
|
||||
10. LDAP
|
||||
10.1 SASL based authentication mechanisms
|
||||
|
||||
11. New protocols
|
||||
11.1 RSYNC
|
||||
|
||||
11. SMB
|
||||
11.1 File listing support
|
||||
11.2 Honor file timestamps
|
||||
11.3 Use NTLMv2
|
||||
11.4 Create remote directories
|
||||
12. SSL
|
||||
12.1 Disable specific versions
|
||||
12.2 Provide mutex locking API
|
||||
12.3 Evaluate SSL patches
|
||||
12.4 Cache OpenSSL contexts
|
||||
12.5 Export session ids
|
||||
12.6 Provide callback for cert verification
|
||||
12.7 improve configure --with-ssl
|
||||
12.8 Support DANE
|
||||
|
||||
12. New protocols
|
||||
12.1 RSYNC
|
||||
13. GnuTLS
|
||||
13.1 SSL engine stuff
|
||||
13.2 check connection
|
||||
|
||||
13. SSL
|
||||
13.1 Disable specific versions
|
||||
13.2 Provide mutex locking API
|
||||
13.3 Evaluate SSL patches
|
||||
13.4 Cache OpenSSL contexts
|
||||
13.5 Export session ids
|
||||
13.6 Provide callback for cert verification
|
||||
13.7 improve configure --with-ssl
|
||||
13.8 Support DANE
|
||||
14. SASL
|
||||
14.1 Other authentication mechanisms
|
||||
14.2 GSSAPI via GSS-API libraries
|
||||
|
||||
15. Client
|
||||
15.1 sync
|
||||
15.2 glob posts
|
||||
15.3 prevent file overwriting
|
||||
15.4 simultaneous parallel transfers
|
||||
15.5 provide formpost headers
|
||||
15.6 warning when setting an option
|
||||
|
||||
14. GnuTLS
|
||||
14.1 SSL engine stuff
|
||||
14.2 check connection
|
||||
16. Build
|
||||
16.1 roffit
|
||||
|
||||
15. WinSSL/SChannel
|
||||
15.1 Add support for client certificate authentication
|
||||
15.2 Add support for custom server certificate validation
|
||||
15.3 Add support for the --ciphers option
|
||||
17. Test suite
|
||||
17.1 SSL tunnel
|
||||
17.2 nicer lacking perl message
|
||||
17.3 more protocols supported
|
||||
17.4 more platforms supported
|
||||
17.5 Add support for concurrent connections
|
||||
|
||||
16. SASL
|
||||
16.1 Other authentication mechanisms
|
||||
16.2 Add QOP support to GSSAPI authentication
|
||||
18. Next SONAME bump
|
||||
18.1 http-style HEAD output for FTP
|
||||
18.2 combine error codes
|
||||
18.3 extend CURLOPT_SOCKOPTFUNCTION prototype
|
||||
|
||||
17. Command line tool
|
||||
17.1 sync
|
||||
17.2 glob posts
|
||||
17.3 prevent file overwriting
|
||||
17.4 simultaneous parallel transfers
|
||||
17.5 provide formpost headers
|
||||
17.6 warning when setting an option
|
||||
17.7 warning when sending binary output to terminal
|
||||
17.8 offer color-coded HTTP header output
|
||||
17.9 Choose the name of file in braces for complex URLs
|
||||
17.10 improve how curl works in a windows console window
|
||||
17.11 -w output to stderr
|
||||
17.12 keep running, read instructions from pipe/socket
|
||||
|
||||
18. Build
|
||||
18.1 roffit
|
||||
|
||||
19. Test suite
|
||||
19.1 SSL tunnel
|
||||
19.2 nicer lacking perl message
|
||||
19.3 more protocols supported
|
||||
19.4 more platforms supported
|
||||
19.5 Add support for concurrent connections
|
||||
19.6 Use the RFC6265 test suite
|
||||
|
||||
20. Next SONAME bump
|
||||
20.1 http-style HEAD output for FTP
|
||||
20.2 combine error codes
|
||||
20.3 extend CURLOPT_SOCKOPTFUNCTION prototype
|
||||
|
||||
21. Next major release
|
||||
21.1 cleanup return codes
|
||||
21.2 remove obsolete defines
|
||||
21.3 size_t
|
||||
21.4 remove several functions
|
||||
21.5 remove CURLOPT_FAILONERROR
|
||||
21.6 remove CURLOPT_DNS_USE_GLOBAL_CACHE
|
||||
21.7 remove progress meter from libcurl
|
||||
21.8 remove 'curl_httppost' from public
|
||||
19. Next major release
|
||||
19.1 cleanup return codes
|
||||
19.2 remove obsolete defines
|
||||
19.3 size_t
|
||||
19.4 remove several functions
|
||||
19.5 remove CURLOPT_FAILONERROR
|
||||
19.6 remove CURLOPT_DNS_USE_GLOBAL_CACHE
|
||||
19.7 remove progress meter from libcurl
|
||||
19.8 remove 'curl_httppost' from public
|
||||
19.9 have form functions use CURL handle argument
|
||||
19.10 Add CURLOPT_MAIL_CLIENT option
|
||||
|
||||
==============================================================================
|
||||
|
||||
@ -166,7 +134,7 @@
|
||||
|
||||
Use 'struct lifreq' and SIOCGLIFADDR instead of 'struct ifreq' and
|
||||
SIOCGIFADDR on newer Solaris versions as they claim the latter is obsolete.
|
||||
To support IPv6 interface addresses for network interfaces properly.
|
||||
To support ipv6 interface addresses for network interfaces properly.
|
||||
|
||||
1.4 signal-based resolver timeouts
|
||||
|
||||
@ -175,7 +143,7 @@
|
||||
signal handler back into the library with a sigsetjmp, which effectively
|
||||
causes libcurl to continue running within the signal handler. This is
|
||||
non-portable and could cause problems on some platforms. A discussion on the
|
||||
problem is available at https://curl.haxx.se/mail/lib-2008-09/0197.html
|
||||
problem is available at http://curl.haxx.se/mail/lib-2008-09/0197.html
|
||||
|
||||
Also, alarm() provides timeout resolution only to the nearest second. alarm
|
||||
ought to be replaced by setitimer on systems that support it.
|
||||
@ -220,83 +188,11 @@
|
||||
|
||||
To prevent local users from snooping on your traffic to the proxy. Supported
|
||||
by Chrome already:
|
||||
https://www.chromium.org/developers/design-documents/secure-web-proxy
|
||||
http://www.chromium.org/developers/design-documents/secure-web-proxy
|
||||
|
||||
...and by Firefox soon:
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=378637
|
||||
|
||||
1.9 Cache negative name resolves
|
||||
|
||||
A name resolve that has failed is likely to fail when made again within a
|
||||
short period of time. Currently we only cache positive responses.
|
||||
|
||||
1.10 Support IDNA2008
|
||||
|
||||
International Domain Names are supported in libcurl since years back, powered
|
||||
by libidn. libidn implements IDNA2003 which has been superseded by IDNA2008.
|
||||
libidn2 is an existing library offering support for IDNA2008.
|
||||
|
||||
1.11 minimize dependencies with dynamicly loaded modules
|
||||
|
||||
We can create a system with loadable modules/plug-ins, where these modules
|
||||
would be the ones that link to 3rd party libs. That would allow us to avoid
|
||||
having to load ALL dependencies since only the necessary ones for this
|
||||
app/invoke/used protocols would be necessary to load. See
|
||||
https://github.com/curl/curl/issues/349
|
||||
|
||||
1.12 have form functions use CURL handle argument
|
||||
|
||||
curl_formadd() and curl_formget() both currently have no CURL handle
|
||||
argument, but both can use a callback that is set in the easy handle, and
|
||||
thus curl_formget() with callback cannot function without first having
|
||||
curl_easy_perform() (or similar) called - which is hard to grasp and a design
|
||||
mistake.
|
||||
|
||||
The curl_formadd() design can probably also be reconsidered to make it easier
|
||||
to use and less error-prone. Probably easiest by splitting it into several
|
||||
function calls.
|
||||
|
||||
1.13 Add CURLOPT_MAIL_CLIENT option
|
||||
|
||||
Rather than use the URL to specify the mail client string to present in the
|
||||
HELO and EHLO commands, libcurl should support a new CURLOPT specifically for
|
||||
specifying this data as the URL is non-standard and to be honest a bit of a
|
||||
hack ;-)
|
||||
|
||||
Please see the following thread for more information:
|
||||
https://curl.haxx.se/mail/lib-2012-05/0178.html
|
||||
|
||||
1.14 Typesafe curl_easy_setopt()
|
||||
|
||||
One of the most common problems in libcurl using applications is the lack of
|
||||
type checks for curl_easy_setopt() which happens because it accepts varargs
|
||||
and thus can take any type.
|
||||
|
||||
One possible solution to this is to introduce a few different versions of the
|
||||
setopt version for the different kinds of data you can set.
|
||||
|
||||
curl_easy_set_num() - sets a long value
|
||||
|
||||
curl_easy_set_large() - sets a curl_off_t value
|
||||
|
||||
curl_easy_set_ptr() - sets a pointer
|
||||
|
||||
curl_easy_set_cb() - sets a callback PLUS its callback data
|
||||
|
||||
1.15 TCP Fast Open
|
||||
|
||||
RFC 7413 defines how to include data already in the TCP SYN handshake to
|
||||
reduce latency.
|
||||
|
||||
1.16 Try to URL encode given URL
|
||||
|
||||
Given a URL that for example contains spaces, libcurl could have an option
|
||||
that would try somewhat harder than it does now and convert spaces to %20 and
|
||||
perhaps URL encoded byte values over 128 etc (basically do what the redirect
|
||||
following code already does).
|
||||
|
||||
https://github.com/curl/curl/issues/514
|
||||
|
||||
2. libcurl - multi interface
|
||||
|
||||
2.1 More non-blocking
|
||||
@ -313,28 +209,11 @@
|
||||
- The "DONE" operation (post transfer protocol-specific actions) for the
|
||||
protocols SFTP, SMTP, FTP. Fixing Curl_done() for this is a worthy task.
|
||||
|
||||
2.2 Better support for same name resolves
|
||||
2.2 Fix HTTP Pipelining for PUT
|
||||
|
||||
If a name resolve has been initiated for name NN and a second easy handle
|
||||
wants to resolve that name as well, make it wait for the first resolve to end
|
||||
up in the cache instead of doing a second separate resolve. This is
|
||||
especially needed when adding many simultaneous handles using the same host
|
||||
name when the DNS resolver can get flooded.
|
||||
|
||||
2.3 Non-blocking curl_multi_remove_handle()
|
||||
|
||||
The multi interface has a few API calls that assume a blocking behavior, like
|
||||
add_handle() and remove_handle() which limits what we can do internally. The
|
||||
multi API need to be moved even more into a single function that "drives"
|
||||
everything in a non-blocking manner and signals when something is done. A
|
||||
remove or add would then only ask for the action to get started and then
|
||||
multi_perform() etc still be called until the add/remove is completed.
|
||||
|
||||
2.4 Split connect and authentication process
|
||||
|
||||
The multi interface treats the authentication process as part of the connect
|
||||
phase. As such any failures during authentication won't trigger the relevant
|
||||
QUIT or LOGOFF for protocols such as IMAP, POP3 and SMTP.
|
||||
HTTP Pipelining can be a way to greatly enhance performance for multiple
|
||||
serial requests and currently libcurl only supports that for HEAD and GET
|
||||
requests but it should also be possible for PUT.
|
||||
|
||||
3. Documentation
|
||||
|
||||
@ -351,14 +230,14 @@
|
||||
HOST is a command for a client to tell which host name to use, to offer FTP
|
||||
servers named-based virtual hosting:
|
||||
|
||||
https://tools.ietf.org/html/rfc7151
|
||||
http://tools.ietf.org/html/rfc7151
|
||||
|
||||
4.2 Alter passive/active on failure and retry
|
||||
|
||||
When trying to connect passively to a server which only supports active
|
||||
connections, libcurl returns CURLE_FTP_WEIRD_PASV_REPLY and closes the
|
||||
connection. There could be a way to fallback to an active connection (and
|
||||
vice versa). https://curl.haxx.se/bug/feature.cgi?id=1754793
|
||||
vice versa). http://curl.haxx.se/bug/feature.cgi?id=1754793
|
||||
|
||||
4.3 Earlier bad letter detection
|
||||
|
||||
@ -395,13 +274,13 @@ This is not detailed in any FTP specification.
|
||||
5.1 Better persistency for HTTP 1.0
|
||||
|
||||
"Better" support for persistent connections over HTTP 1.0
|
||||
https://curl.haxx.se/bug/feature.cgi?id=1089001
|
||||
http://curl.haxx.se/bug/feature.cgi?id=1089001
|
||||
|
||||
5.2 support FF3 sqlite cookie files
|
||||
|
||||
Firefox 3 is changing from its former format to a a sqlite database instead.
|
||||
We should consider how (lib)curl can/should support this.
|
||||
https://curl.haxx.se/bug/feature.cgi?id=1871388
|
||||
http://curl.haxx.se/bug/feature.cgi?id=1871388
|
||||
|
||||
5.3 Rearrange request header order
|
||||
|
||||
@ -431,25 +310,15 @@ This is not detailed in any FTP specification.
|
||||
For example:
|
||||
|
||||
http://test:pass;auth=NTLM@example.com would be equivalent to specifying --user
|
||||
test:pass;auth=NTLM or --user test:pass --ntlm from the command line.
|
||||
test:pass;auth=NTLM or --user test:pass --ntlm from the command line.
|
||||
|
||||
Additionally this should be implemented for proxy base URLs as well.
|
||||
|
||||
5.6 Refuse "downgrade" redirects
|
||||
|
||||
See https://github.com/curl/curl/issues/226
|
||||
|
||||
Consider a way to tell curl to refuse to "downgrade" protocol with a redirect
|
||||
and/or possibly a bit that refuses redirect to change protocol completely.
|
||||
|
||||
5.7 More compressions
|
||||
|
||||
Compression algorithms that perform better than gzip are being considered for
|
||||
use and inclusion in existing browsers. For example 'brotli'. If servers
|
||||
follow along it is a good reason for us to also allow users to take advantage
|
||||
of this. The algorithm: https://github.com/google/brotli The Firefox bug:
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=366559
|
||||
5.6 Digest via Windows SSPI
|
||||
|
||||
libcurl already supports HTTP Digest Authentication via native routines as well
|
||||
as SASL Digest via both Windows SSPI and native routines. In addition to this
|
||||
libcurl should also support HTTP Digest Authentication via Windows SSPI.
|
||||
|
||||
6. TELNET
|
||||
|
||||
@ -514,52 +383,32 @@ to provide the data to send.
|
||||
be possible to use ldap_bind_s() instead specifying the security context
|
||||
information ourselves.
|
||||
|
||||
11. SMB
|
||||
11. New protocols
|
||||
|
||||
11.1 File listing support
|
||||
|
||||
Add support for listing the contents of a SMB share. The output should probably
|
||||
be the same as/similar to FTP.
|
||||
|
||||
11.2 Honor file timestamps
|
||||
|
||||
The timestamp of the transferred file should reflect that of the original file.
|
||||
|
||||
11.3 Use NTLMv2
|
||||
|
||||
Currently the SMB authentication uses NTLMv1.
|
||||
|
||||
11.4 Create remote directories
|
||||
|
||||
Support for creating remote directories when uploading a file to a directory
|
||||
that doesn't exist on the server, just like --ftp-create-dirs.
|
||||
|
||||
12. New protocols
|
||||
|
||||
12.1 RSYNC
|
||||
11.1 RSYNC
|
||||
|
||||
There's no RFC for the protocol or an URI/URL format. An implementation
|
||||
should most probably use an existing rsync library, such as librsync.
|
||||
|
||||
13. SSL
|
||||
12. SSL
|
||||
|
||||
13.1 Disable specific versions
|
||||
12.1 Disable specific versions
|
||||
|
||||
Provide an option that allows for disabling specific SSL versions, such as
|
||||
SSLv2 https://curl.haxx.se/bug/feature.cgi?id=1767276
|
||||
SSLv2 http://curl.haxx.se/bug/feature.cgi?id=1767276
|
||||
|
||||
13.2 Provide mutex locking API
|
||||
12.2 Provide mutex locking API
|
||||
|
||||
Provide a libcurl API for setting mutex callbacks in the underlying SSL
|
||||
library, so that the same application code can use mutex-locking
|
||||
independently of OpenSSL or GnutTLS being used.
|
||||
|
||||
13.3 Evaluate SSL patches
|
||||
12.3 Evaluate SSL patches
|
||||
|
||||
Evaluate/apply Gertjan van Wingerde's SSL patches:
|
||||
https://curl.haxx.se/mail/lib-2004-03/0087.html
|
||||
http://curl.haxx.se/mail/lib-2004-03/0087.html
|
||||
|
||||
13.4 Cache OpenSSL contexts
|
||||
12.4 Cache OpenSSL contexts
|
||||
|
||||
"Look at SSL cafile - quick traces look to me like these are done on every
|
||||
request as well, when they should only be necessary once per SSL context (or
|
||||
@ -569,7 +418,7 @@ that doesn't exist on the server, just like --ftp-create-dirs.
|
||||
style connections are re-used. It will make us use slightly more memory but
|
||||
it will libcurl do less creations and deletions of SSL contexts.
|
||||
|
||||
13.5 Export session ids
|
||||
12.5 Export session ids
|
||||
|
||||
Add an interface to libcurl that enables "session IDs" to get
|
||||
exported/imported. Cris Bailiff said: "OpenSSL has functions which can
|
||||
@ -577,92 +426,55 @@ that doesn't exist on the server, just like --ftp-create-dirs.
|
||||
the state from such a buffer at a later date - this is used by mod_ssl for
|
||||
apache to implement and SSL session ID cache".
|
||||
|
||||
13.6 Provide callback for cert verification
|
||||
12.6 Provide callback for cert verification
|
||||
|
||||
OpenSSL supports a callback for customised verification of the peer
|
||||
certificate, but this doesn't seem to be exposed in the libcurl APIs. Could
|
||||
it be? There's so much that could be done if it were!
|
||||
|
||||
13.7 improve configure --with-ssl
|
||||
12.7 improve configure --with-ssl
|
||||
|
||||
make the configure --with-ssl option first check for OpenSSL, then GnuTLS,
|
||||
then NSS...
|
||||
|
||||
13.8 Support DANE
|
||||
12.8 Support DANE
|
||||
|
||||
DNS-Based Authentication of Named Entities (DANE) is a way to provide SSL
|
||||
keys and certs over DNS using DNSSEC as an alternative to the CA model.
|
||||
https://www.rfc-editor.org/rfc/rfc6698.txt
|
||||
http://www.rfc-editor.org/rfc/rfc6698.txt
|
||||
|
||||
An initial patch was posted by Suresh Krishnaswamy on March 7th 2013
|
||||
(https://curl.haxx.se/mail/lib-2013-03/0075.html) but it was a too simple
|
||||
(http://curl.haxx.se/mail/lib-2013-03/0075.html) but it was a too simple
|
||||
approach. See Daniel's comments:
|
||||
https://curl.haxx.se/mail/lib-2013-03/0103.html . libunbound may be the
|
||||
http://curl.haxx.se/mail/lib-2013-03/0103.html . libunbound may be the
|
||||
correct library to base this development on.
|
||||
|
||||
14. GnuTLS
|
||||
13. GnuTLS
|
||||
|
||||
14.1 SSL engine stuff
|
||||
13.1 SSL engine stuff
|
||||
|
||||
Is this even possible?
|
||||
|
||||
14.2 check connection
|
||||
13.2 check connection
|
||||
|
||||
Add a way to check if the connection seems to be alive, to correspond to the
|
||||
SSL_peak() way we use with OpenSSL.
|
||||
|
||||
15. WinSSL/SChannel
|
||||
14. SASL
|
||||
|
||||
15.1 Add support for client certificate authentication
|
||||
14.1 Other authentication mechanisms
|
||||
|
||||
WinSSL/SChannel currently makes use of the OS-level system and user
|
||||
certificate and private key stores. This does not allow the application
|
||||
or the user to supply a custom client certificate using curl or libcurl.
|
||||
|
||||
Therefore support for the existing -E/--cert and --key options should be
|
||||
implemented by supplying a custom certificate to the SChannel APIs, see:
|
||||
- Getting a Certificate for Schannel
|
||||
https://msdn.microsoft.com/en-us/library/windows/desktop/aa375447.aspx
|
||||
|
||||
15.2 Add support for custom server certificate validation
|
||||
|
||||
WinSSL/SChannel currently makes use of the OS-level system and user
|
||||
certificate trust store. This does not allow the application or user to
|
||||
customize the server certificate validation process using curl or libcurl.
|
||||
|
||||
Therefore support for the existing --cacert or --capath options should be
|
||||
implemented by supplying a custom certificate to the SChannel APIs, see:
|
||||
- Getting a Certificate for Schannel
|
||||
https://msdn.microsoft.com/en-us/library/windows/desktop/aa375447.aspx
|
||||
|
||||
15.3 Add support for the --ciphers option
|
||||
|
||||
The cipher suites used by WinSSL/SChannel are configured on an OS-level
|
||||
instead of an application-level. This does not allow the application or
|
||||
the user to customize the configured cipher suites using curl or libcurl.
|
||||
|
||||
Therefore support for the existing --ciphers option should be implemented
|
||||
by mapping the OpenSSL/GnuTLS cipher suites to the SChannel APIs, see
|
||||
- Specifying Schannel Ciphers and Cipher Strengths
|
||||
https://msdn.microsoft.com/en-us/library/windows/desktop/aa380161.aspx
|
||||
|
||||
16. SASL
|
||||
|
||||
16.1 Other authentication mechanisms
|
||||
|
||||
Add support for other authentication mechanisms such as OLP,
|
||||
Add support for other authentication mechanisms such as EXTERNAL, OLP,
|
||||
GSS-SPNEGO and others.
|
||||
|
||||
14.2 GSSAPI via GSS-API libraries
|
||||
|
||||
16.2 Add QOP support to GSSAPI authentication
|
||||
Add support for GSSAPI authentication via third-party GSS-API libraries, such
|
||||
as Heimdal and MIT Kerberos.
|
||||
|
||||
Currently the GSSAPI authentication only supports the default QOP of auth
|
||||
(Authentication), whilst Kerberos V5 supports both auth-int (Authentication
|
||||
with integrity protection) and auth-conf (Authentication with integrity and
|
||||
privacy protection).
|
||||
15. Client
|
||||
|
||||
17. Command line tool
|
||||
|
||||
17.1 sync
|
||||
15.1 sync
|
||||
|
||||
"curl --sync http://example.com/feed[1-100].rss" or
|
||||
"curl --sync http://example.net/{index,calendar,history}.html"
|
||||
@ -671,12 +483,12 @@ that doesn't exist on the server, just like --ftp-create-dirs.
|
||||
remote file is newer than the local file. A Last-Modified HTTP date header
|
||||
should also be used to set the mod date on the downloaded file.
|
||||
|
||||
17.2 glob posts
|
||||
15.2 glob posts
|
||||
|
||||
Globbing support for -d and -F, as in 'curl -d "name=foo[0-9]" URL'.
|
||||
This is easily scripted though.
|
||||
|
||||
17.3 prevent file overwriting
|
||||
15.3 prevent file overwriting
|
||||
|
||||
Add an option that prevents cURL from overwriting existing local files. When
|
||||
used, and there already is an existing file with the target file name
|
||||
@ -684,14 +496,14 @@ that doesn't exist on the server, just like --ftp-create-dirs.
|
||||
existing). So that index.html becomes first index.html.1 and then
|
||||
index.html.2 etc.
|
||||
|
||||
17.4 simultaneous parallel transfers
|
||||
15.4 simultaneous parallel transfers
|
||||
|
||||
The client could be told to use maximum N simultaneous parallel transfers and
|
||||
then just make sure that happens. It should of course not make more than one
|
||||
connection to the same remote host. This would require the client to use the
|
||||
multi interface. https://curl.haxx.se/bug/feature.cgi?id=1558595
|
||||
multi interface. http://curl.haxx.se/bug/feature.cgi?id=1558595
|
||||
|
||||
17.5 provide formpost headers
|
||||
15.5 provide formpost headers
|
||||
|
||||
Extending the capabilities of the multipart formposting. How about leaving
|
||||
the ';type=foo' syntax as it is and adding an extra tag (headers) which
|
||||
@ -705,88 +517,43 @@ that doesn't exist on the server, just like --ftp-create-dirs.
|
||||
which should overwrite the program reasonable defaults (plain/text,
|
||||
8bit...)
|
||||
|
||||
17.6 warning when setting an option
|
||||
15.6 warning when setting an option
|
||||
|
||||
Display a warning when libcurl returns an error when setting an option.
|
||||
This can be useful to tell when support for a particular feature hasn't been
|
||||
compiled into the library.
|
||||
Display a warning when libcurl returns an error when setting an option.
|
||||
This can be useful to tell when support for a particular feature hasn't been
|
||||
compiled into the library.
|
||||
|
||||
17.7 warning when sending binary output to terminal
|
||||
16. Build
|
||||
|
||||
Provide a way that prompts the user for confirmation before binary data is
|
||||
sent to the terminal, much in the style 'less' does it.
|
||||
|
||||
17.8 offer color-coded HTTP header output
|
||||
|
||||
By offering different color output on the header name and the header
|
||||
contents, they could be made more readable and thus help users working on
|
||||
HTTP services.
|
||||
|
||||
17.9 Choose the name of file in braces for complex URLs
|
||||
|
||||
When using braces to download a list of URLs and you use complicated names
|
||||
in the list of alternatives, it could be handy to allow curl to use other
|
||||
names when saving.
|
||||
|
||||
Consider a way to offer that. Possibly like
|
||||
{partURL1:name1,partURL2:name2,partURL3:name3} where the name following the
|
||||
colon is the output name.
|
||||
|
||||
See https://github.com/curl/curl/issues/221
|
||||
|
||||
17.10 improve how curl works in a windows console window
|
||||
|
||||
If you pull the scrollbar when transferring with curl in a Windows console
|
||||
window, the transfer is interrupted and can get disconnected. This can
|
||||
probably be improved. See https://github.com/curl/curl/issues/322
|
||||
|
||||
17.11 -w output to stderr
|
||||
|
||||
-w is quite useful, but not to those of us who use curl without -o or -O
|
||||
(such as for scripting through a higher level language). It would be nice to
|
||||
have an option that is exactly like -w but sends it to stderr
|
||||
instead. Proposed name: --write-stderr. See
|
||||
https://github.com/curl/curl/issues/613
|
||||
|
||||
17.12 keep running, read instructions from pipe/socket
|
||||
|
||||
Provide an option that makes curl not exit after the last URL (or even work
|
||||
without a given URL), and then make it read instructions passed on a pipe or
|
||||
over a socket to make further instructions so that a second subsequent curl
|
||||
invoke can talk to the still running instance and ask for transfers to get
|
||||
done, and thus maintain its connection pool, DNS cache and more.
|
||||
|
||||
18. Build
|
||||
|
||||
18.1 roffit
|
||||
16.1 roffit
|
||||
|
||||
Consider extending 'roffit' to produce decent ASCII output, and use that
|
||||
instead of (g)nroff when building src/tool_hugehelp.c
|
||||
|
||||
19. Test suite
|
||||
17. Test suite
|
||||
|
||||
19.1 SSL tunnel
|
||||
17.1 SSL tunnel
|
||||
|
||||
Make our own version of stunnel for simple port forwarding to enable HTTPS
|
||||
and FTP-SSL tests without the stunnel dependency, and it could allow us to
|
||||
provide test tools built with either OpenSSL or GnuTLS
|
||||
|
||||
19.2 nicer lacking perl message
|
||||
17.2 nicer lacking perl message
|
||||
|
||||
If perl wasn't found by the configure script, don't attempt to run the tests
|
||||
but explain something nice why it doesn't.
|
||||
|
||||
19.3 more protocols supported
|
||||
17.3 more protocols supported
|
||||
|
||||
Extend the test suite to include more protocols. The telnet could just do FTP
|
||||
or http operations (for which we have test servers).
|
||||
|
||||
19.4 more platforms supported
|
||||
17.4 more platforms supported
|
||||
|
||||
Make the test suite work on more platforms. OpenBSD and Mac OS. Remove
|
||||
fork()s and it should become even more portable.
|
||||
|
||||
19.5 Add support for concurrent connections
|
||||
17.5 Add support for concurrent connections
|
||||
|
||||
Tests 836, 882 and 938 were designed to verify that separate connections aren't
|
||||
used when using different login credentials in protocols that shouldn't re-use
|
||||
@ -800,24 +567,14 @@ that doesn't exist on the server, just like --ftp-create-dirs.
|
||||
and thus the wait for connections loop is never entered to receive the second
|
||||
connection.
|
||||
|
||||
19.6 Use the RFC6265 test suite
|
||||
18. Next SONAME bump
|
||||
|
||||
A test suite made for HTTP cookies (RFC 6265) by Adam Barth is available at
|
||||
https://github.com/abarth/http-state/tree/master/tests
|
||||
|
||||
It'd be really awesome if someone would write a script/setup that would run
|
||||
curl with that test suite and detect deviances. Ideally, that would even be
|
||||
incorporated into our regular test suite.
|
||||
|
||||
|
||||
20. Next SONAME bump
|
||||
|
||||
20.1 http-style HEAD output for FTP
|
||||
18.1 http-style HEAD output for FTP
|
||||
|
||||
#undef CURL_FTP_HTTPSTYLE_HEAD in lib/ftp.c to remove the HTTP-style headers
|
||||
from being output in NOBODY requests over FTP
|
||||
|
||||
20.2 combine error codes
|
||||
18.2 combine error codes
|
||||
|
||||
Combine some of the error codes to remove duplicates. The original
|
||||
numbering should not be changed, and the old identifiers would be
|
||||
@ -842,29 +599,29 @@ that doesn't exist on the server, just like --ftp-create-dirs.
|
||||
|
||||
CURLE_TFTP_PERM => CURLE_REMOTE_ACCESS_DENIED
|
||||
|
||||
20.3 extend CURLOPT_SOCKOPTFUNCTION prototype
|
||||
18.3 extend CURLOPT_SOCKOPTFUNCTION prototype
|
||||
|
||||
The current prototype only provides 'purpose' that tells what the
|
||||
connection/socket is for, but not any protocol or similar. It makes it hard
|
||||
for applications to differentiate on TCP vs UDP and even HTTP vs FTP and
|
||||
similar.
|
||||
|
||||
21. Next major release
|
||||
19. Next major release
|
||||
|
||||
21.1 cleanup return codes
|
||||
19.1 cleanup return codes
|
||||
|
||||
curl_easy_cleanup() returns void, but curl_multi_cleanup() returns a
|
||||
CURLMcode. These should be changed to be the same.
|
||||
|
||||
21.2 remove obsolete defines
|
||||
19.2 remove obsolete defines
|
||||
|
||||
remove obsolete defines from curl/curl.h
|
||||
|
||||
21.3 size_t
|
||||
19.3 size_t
|
||||
|
||||
make several functions use size_t instead of int in their APIs
|
||||
|
||||
21.4 remove several functions
|
||||
19.4 remove several functions
|
||||
|
||||
remove the following functions from the public API:
|
||||
|
||||
@ -885,18 +642,18 @@ that doesn't exist on the server, just like --ftp-create-dirs.
|
||||
|
||||
curl_multi_socket_all
|
||||
|
||||
21.5 remove CURLOPT_FAILONERROR
|
||||
19.5 remove CURLOPT_FAILONERROR
|
||||
|
||||
Remove support for CURLOPT_FAILONERROR, it has gotten too kludgy and weird
|
||||
internally. Let the app judge success or not for itself.
|
||||
|
||||
21.6 remove CURLOPT_DNS_USE_GLOBAL_CACHE
|
||||
19.6 remove CURLOPT_DNS_USE_GLOBAL_CACHE
|
||||
|
||||
Remove support for a global DNS cache. Anything global is silly, and we
|
||||
already offer the share interface for the same functionality but done
|
||||
"right".
|
||||
|
||||
21.7 remove progress meter from libcurl
|
||||
19.7 remove progress meter from libcurl
|
||||
|
||||
The internally provided progress meter output doesn't belong in the library.
|
||||
Basically no application wants it (apart from curl) but instead applications
|
||||
@ -906,7 +663,7 @@ that doesn't exist on the server, just like --ftp-create-dirs.
|
||||
variable types passed to it instead of doubles so that big files work
|
||||
correctly.
|
||||
|
||||
21.8 remove 'curl_httppost' from public
|
||||
19.8 remove 'curl_httppost' from public
|
||||
|
||||
curl_formadd() was made to fill in a public struct, but the fact that the
|
||||
struct is public is never really used by application for their own advantage
|
||||
@ -914,3 +671,22 @@ that doesn't exist on the server, just like --ftp-create-dirs.
|
||||
|
||||
Changing them to return a private handle will benefit the implementation and
|
||||
allow us much greater freedoms while still maintaining a solid API and ABI.
|
||||
|
||||
19.9 have form functions use CURL handle argument
|
||||
|
||||
curl_formadd() and curl_formget() both currently have no CURL handle
|
||||
argument, but both can use a callback that is set in the easy handle, and
|
||||
thus curl_formget() with callback cannot function without first having
|
||||
curl_easy_perform() (or similar) called - which is hard to grasp and a design
|
||||
mistake.
|
||||
|
||||
19.10 Add CURLOPT_MAIL_CLIENT option
|
||||
|
||||
Rather than use the URL to specify the mail client string to present in the
|
||||
HELO and EHLO commands, libcurl should support a new CURLOPT specifically for
|
||||
specifying this data as the URL is non-standard and to be honest a bit of a
|
||||
hack ;-)
|
||||
|
||||
Please see the following thread for more information:
|
||||
http://curl.haxx.se/mail/lib-2012-05/0178.html
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
Updated: Dec 24, 2013 (http://curl.haxx.se/docs/httpscripting.html)
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
@ -22,8 +23,6 @@ The Art Of Scripting HTTP Requests Using Curl
|
||||
3. Fetch a page
|
||||
3.1 GET
|
||||
3.2 HEAD
|
||||
3.3 Multiple URLs in a single command line
|
||||
3.4 Multiple HTTP methods in a single command line
|
||||
4. HTML forms
|
||||
4.1 Forms explained
|
||||
4.2 GET
|
||||
@ -136,8 +135,8 @@ The Art Of Scripting HTTP Requests Using Curl
|
||||
|
||||
The Uniform Resource Locator format is how you specify the address of a
|
||||
particular resource on the Internet. You know these, you've seen URLs like
|
||||
https://curl.haxx.se or https://yourbank.com a million times. RFC 3986 is the
|
||||
canonical spec. And yeah, the formal name is not URL, it is URI.
|
||||
http://curl.haxx.se or https://yourbank.com a million times. RFC 3986 is the
|
||||
canonical spec.
|
||||
|
||||
2.2 Host
|
||||
|
||||
@ -194,6 +193,7 @@ The Art Of Scripting HTTP Requests Using Curl
|
||||
the associated response. The path is what is to the right side of the slash
|
||||
that follows the host name and possibly port number.
|
||||
|
||||
|
||||
3. Fetch a page
|
||||
|
||||
3.1 GET
|
||||
@ -203,7 +203,7 @@ The Art Of Scripting HTTP Requests Using Curl
|
||||
issues a GET request to the server and receives the document it asked for.
|
||||
If you issue the command line
|
||||
|
||||
curl https://curl.haxx.se
|
||||
curl http://curl.haxx.se
|
||||
|
||||
you get a web page returned in your terminal window. The entire HTML document
|
||||
that that URL holds.
|
||||
@ -224,46 +224,6 @@ The Art Of Scripting HTTP Requests Using Curl
|
||||
may see a Content-Length: in the response headers, but there must not be an
|
||||
actual body in the HEAD response.
|
||||
|
||||
3.3 Multiple URLs in a single command line
|
||||
|
||||
A single curl command line may involve one or many URLs. The most common case
|
||||
is probably to just use one, but you can specify any amount of URLs. Yes
|
||||
any. No limits. You'll then get requests repeated over and over for all the
|
||||
given URLs.
|
||||
|
||||
Example, send two GETs:
|
||||
|
||||
curl http://url1.example.com http://url2.example.com
|
||||
|
||||
If you use --data to POST to the URL, using multiple URLs means that you send
|
||||
that same POST to all the given URLs.
|
||||
|
||||
Example, send two POSTs:
|
||||
|
||||
curl --data name=curl http://url1.example.com http://url2.example.com
|
||||
|
||||
|
||||
3.4 Multiple HTTP methods in a single command line
|
||||
|
||||
Sometimes you need to operate on several URLs in a single command line and do
|
||||
different HTTP methods on each. For this, you'll enjoy the --next option. It
|
||||
is basically a separator that separates a bunch of options from the next. All
|
||||
the URLs before --next will get the same method and will get all the POST
|
||||
data merged into one.
|
||||
|
||||
When curl reaches the --next on the command line, it'll sort of reset the
|
||||
method and the POST data and allow a new set.
|
||||
|
||||
Perhaps this is best shown with a few examples. To send first a HEAD and then
|
||||
a GET:
|
||||
|
||||
curl -I http://example.com --next http://example.com
|
||||
|
||||
To first send a POST and then a GET:
|
||||
|
||||
curl -d score=10 http://example.com/post.cgi --next http://example.com/results.html
|
||||
|
||||
|
||||
4. HTML forms
|
||||
|
||||
4.1 Forms explained
|
||||
@ -342,10 +302,6 @@ The Art Of Scripting HTTP Requests Using Curl
|
||||
|
||||
curl --data-urlencode "name=I am Daniel" http://www.example.com
|
||||
|
||||
If you repeat --data several times on the command line, curl will
|
||||
concatenate all the given data pieces - and put a '&' symbol between each
|
||||
data segment.
|
||||
|
||||
4.4 File Upload POST
|
||||
|
||||
Back in late 1995 they defined an additional way to post data over HTTP. It
|
||||
@ -601,10 +557,8 @@ The Art Of Scripting HTTP Requests Using Curl
|
||||
truckload of advanced features to allow all those encryptions and key
|
||||
infrastructure mechanisms encrypted HTTP requires.
|
||||
|
||||
Curl supports encrypted fetches when built to use a TLS library and it can be
|
||||
built to use one out of a fairly large set of libraries - "curl -V" will show
|
||||
which one your curl was built to use (if any!). To get a page from a HTTPS
|
||||
server, simply run curl like:
|
||||
Curl supports encrypted fetches thanks to the freely available OpenSSL
|
||||
libraries. To get a page from a HTTPS server, simply run curl like:
|
||||
|
||||
curl https://secure.example.com
|
||||
|
||||
@ -628,13 +582,7 @@ The Art Of Scripting HTTP Requests Using Curl
|
||||
More about server certificate verification and ca cert bundles can be read
|
||||
in the SSLCERTS document, available online here:
|
||||
|
||||
https://curl.haxx.se/docs/sslcerts.html
|
||||
|
||||
At times you may end up with your own CA cert store and then you can tell
|
||||
curl to use that to verify the server's certificate:
|
||||
|
||||
curl --cacert ca-bundle.pem https://example.com/
|
||||
|
||||
http://curl.haxx.se/docs/sslcerts.html
|
||||
|
||||
11. Custom Request Elements
|
||||
|
||||
@ -744,7 +692,7 @@ The Art Of Scripting HTTP Requests Using Curl
|
||||
|
||||
14.1 Standards
|
||||
|
||||
RFC 7230 is a must to read if you want in-depth understanding of the HTTP
|
||||
RFC 2616 is a must to read if you want in-depth understanding of the HTTP
|
||||
protocol
|
||||
|
||||
RFC 3986 explains the URL syntax
|
||||
@ -755,4 +703,4 @@ The Art Of Scripting HTTP Requests Using Curl
|
||||
|
||||
14.2 Sites
|
||||
|
||||
https://curl.haxx.se is the home of the cURL project
|
||||
http://curl.haxx.se is the home of the cURL project
|
||||
|
@ -1,18 +1,22 @@
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
| (__| |_| | _ <| |___
|
||||
\___|\___/|_| \_\_____|
|
||||
|
||||
Version Numbers and Releases
|
||||
============================
|
||||
|
||||
Curl is not only curl. Curl is also libcurl. They're actually individually
|
||||
versioned, but they mostly follow each other rather closely.
|
||||
|
||||
The version numbering is always built up using the same system:
|
||||
|
||||
X.Y.Z
|
||||
X.Y[.Z]
|
||||
|
||||
- X is main version number
|
||||
- Y is release number
|
||||
- Z is patch number
|
||||
|
||||
## Bumping numbers
|
||||
Where
|
||||
X is main version number
|
||||
Y is release number
|
||||
Z is patch number
|
||||
|
||||
One of these numbers will get bumped in each new release. The numbers to the
|
||||
right of a bumped number will be reset to zero. If Z is zero, it may not be
|
||||
@ -53,4 +57,4 @@ Version Numbers and Releases
|
||||
release. It makes comparisons with greater than and less than work.
|
||||
|
||||
This number is also available as three separate defines:
|
||||
`LIBCURL_VERSION_MAJOR`, `LIBCURL_VERSION_MINOR` and `LIBCURL_VERSION_PATCH`.
|
||||
LIBCURL_VERSION_MAJOR, LIBCURL_VERSION_MINOR and LIBCURL_VERSION_PATCH.
|
||||
|
@ -9,7 +9,7 @@
|
||||
.\" *
|
||||
.\" * 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.
|
||||
.\" * are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
.\" *
|
||||
.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
.\" * copies of the Software, and permit persons to whom the Software is
|
||||
|
289
docs/curl.1
289
docs/curl.1
@ -5,11 +5,11 @@
|
||||
.\" * | (__| |_| | _ <| |___
|
||||
.\" * \___|\___/|_| \_\_____|
|
||||
.\" *
|
||||
.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
.\" *
|
||||
.\" * This software is licensed as described in the file COPYING, which
|
||||
.\" * you should have received as part of this distribution. The terms
|
||||
.\" * are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
.\" * are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
.\" *
|
||||
.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
.\" * copies of the Software, and permit persons to whom the Software is
|
||||
@ -20,7 +20,7 @@
|
||||
.\" *
|
||||
.\" **************************************************************************
|
||||
.\"
|
||||
.TH curl 1 "30 Nov 2014" "Curl 7.40.0" "Curl Manual"
|
||||
.TH curl 1 "2 Aug 2014" "Curl 7.38.0" "Curl Manual"
|
||||
.SH NAME
|
||||
curl \- transfer a URL
|
||||
.SH SYNOPSIS
|
||||
@ -30,8 +30,8 @@ curl \- transfer a URL
|
||||
.B curl
|
||||
is a tool to transfer data from or to a server, using one of the supported
|
||||
protocols (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP,
|
||||
LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET
|
||||
and TFTP). The command is designed to work without user interaction.
|
||||
LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET and TFTP). The
|
||||
command is designed to work without user interaction.
|
||||
|
||||
curl offers a busload of useful tricks like proxy support, user
|
||||
authentication, FTP upload, HTTP post, SSL connections, cookies, file transfer
|
||||
@ -39,7 +39,8 @@ resume, Metalink, and more. As you will see below, the number of features will
|
||||
make your head spin!
|
||||
|
||||
curl is powered by libcurl for all transfer-related features. See
|
||||
\fIlibcurl(3)\fP for details.
|
||||
.BR libcurl (3)
|
||||
for details.
|
||||
.SH URL
|
||||
The URL syntax is protocol-dependent. You'll find a detailed description in
|
||||
RFC 3986.
|
||||
@ -77,11 +78,6 @@ probably have to put the full URL within double quotes to avoid the shell from
|
||||
interfering with it. This also goes for other characters treated special, like
|
||||
for example '&', '?' and '*'.
|
||||
|
||||
Provide the IPv6 zone index in the URL with an escaped percentage sign and the
|
||||
interface name. Like in
|
||||
|
||||
http://[fe80::3%25eth0]/
|
||||
|
||||
If you specify URL without protocol:// prefix, curl will attempt to guess what
|
||||
protocol you might want. It will then default to HTTP but try other protocols
|
||||
based on often-used host name prefixes. For example, for host names starting
|
||||
@ -171,13 +167,12 @@ a level of control).
|
||||
.IP "-2, --sslv2"
|
||||
(SSL) Forces curl to use SSL version 2 when negotiating with a remote SSL
|
||||
server. Sometimes curl is built without SSLv2 support. SSLv2 is widely
|
||||
considered insecure (see RFC 6176).
|
||||
considered insecure.
|
||||
.IP "-3, --sslv3"
|
||||
(SSL) Forces curl to use SSL version 3 when negotiating with a remote SSL
|
||||
server. Sometimes curl is built without SSLv3 support. SSLv3 is widely
|
||||
considered insecure (see RFC 7568).
|
||||
server. Sometimes curl is built without SSLv3 support.
|
||||
.IP "-4, --ipv4"
|
||||
This option tells curl to resolve names to IPv4 addresses only, and not for
|
||||
Tis option tells curl to resolve names to IPv4 addresses only, and not for
|
||||
example try IPv6.
|
||||
.IP "-6, --ipv6"
|
||||
This option tells curl to resolve names to IPv6 addresses only, and not for
|
||||
@ -213,25 +208,16 @@ be in the format "NAME1=VALUE1; NAME2=VALUE2".
|
||||
|
||||
If no '=' symbol is used in the line, it is treated as a filename to use to
|
||||
read previously stored cookie lines from, which should be used in this session
|
||||
if they match. Using this method also activates the cookie engine which will
|
||||
if they match. Using this method also activates the "cookie parser" which will
|
||||
make curl record incoming cookies too, which may be handy if you're using this
|
||||
in combination with the \fI-L, --location\fP option. The file format of the
|
||||
file to read cookies from should be plain HTTP headers (Set-Cookie style) or
|
||||
the Netscape/Mozilla cookie file format.
|
||||
file to read cookies from should be plain HTTP headers or the Netscape/Mozilla
|
||||
cookie file format.
|
||||
|
||||
The file specified with \fI-b, --cookie\fP is only used as input. No cookies
|
||||
will be written to the file. To store cookies, use the \fI-c, --cookie-jar\fP
|
||||
option.
|
||||
|
||||
Exercise caution if you are using this option and multiple transfers may occur.
|
||||
If you use the NAME1=VALUE1; format, or in a file use the Set-Cookie format and
|
||||
don't specify a domain, then the cookie is sent for any domain (even after
|
||||
redirects are followed) and cannot be modified by a server-set cookie. If the
|
||||
cookie engine is enabled and a server sets a cookie of the same name then both
|
||||
will be sent on a future transfer to that server, likely not what you intended.
|
||||
To address these issues set a domain in Set-Cookie (doing that will include
|
||||
sub-domains) or use the Netscape format.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "-B, --use-ascii"
|
||||
(FTP/LDAP) Enable ASCII transfer. For FTP, this can also be enforced by using
|
||||
@ -263,9 +249,6 @@ won't fail or even report an error clearly. Using -v will get a warning
|
||||
displayed, but that is the only visible feedback you get about this possibly
|
||||
lethal situation.
|
||||
|
||||
Since 7.43.0 cookies that were imported in the Set-Cookie format without a
|
||||
domain name are not exported by this option.
|
||||
|
||||
If this option is used several times, the last specified file name will be
|
||||
used.
|
||||
.IP "-C, --continue-at <offset>"
|
||||
@ -281,11 +264,11 @@ If this option is used several times, the last one will be used.
|
||||
.IP "--ciphers <list of ciphers>"
|
||||
(SSL) Specifies which ciphers to use in the connection. The list of ciphers
|
||||
must specify valid ciphers. Read up on SSL cipher list details on this URL:
|
||||
\fIhttps://www.openssl.org/docs/apps/ciphers.html\fP
|
||||
\fIhttp://www.openssl.org/docs/apps/ciphers.html\fP
|
||||
|
||||
NSS ciphers are done differently than OpenSSL and GnuTLS. The full list of NSS
|
||||
ciphers is in the NSSCipherSuite entry at this URL:
|
||||
\fIhttps://git.fedorahosted.org/cgit/mod_nss.git/plain/docs/mod_nss.html#Directives\fP
|
||||
\fIhttp://git.fedorahosted.org/cgit/mod_nss.git/plain/docs/mod_nss.html#Directives\fP
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "--compressed"
|
||||
@ -310,9 +293,7 @@ uses no dir or if the dirs it mentions already exist, no dir will be created.
|
||||
To create remote directories when using FTP or SFTP, try
|
||||
\fI--ftp-create-dirs\fP.
|
||||
.IP "--crlf"
|
||||
Convert LF to CRLF in upload. Useful for MVS (OS/390).
|
||||
|
||||
(SMTP added in 7.40.0)
|
||||
(FTP) Convert LF to CRLF in upload. Useful for MVS (OS/390).
|
||||
.IP "--crlfile <file>"
|
||||
(HTTPS/FTPS) Provide a file using PEM format with a Certificate Revocation
|
||||
List that may specify peer certificates that are to be considered revoked.
|
||||
@ -327,10 +308,9 @@ presses the submit button. This will cause curl to pass the data to the server
|
||||
using the content-type application/x-www-form-urlencoded. Compare to
|
||||
\fI-F, --form\fP.
|
||||
|
||||
\fI-d, --data\fP is the same as \fI--data-ascii\fP. \fI--data-raw\fP is almost
|
||||
the same but does not have a special interpretation of the @ character. To
|
||||
post data purely binary, you should instead use the \fI--data-binary\fP option.
|
||||
To URL-encode the value of a form field you may use \fI--data-urlencode\fP.
|
||||
\fI-d, --data\fP is the same as \fI--data-ascii\fP. To post data purely binary,
|
||||
you should instead use the \fI--data-binary\fP option. To URL-encode the value
|
||||
of a form field you may use \fI--data-urlencode\fP.
|
||||
|
||||
If any of these options is used more than once on the same command line, the
|
||||
data pieces specified will be merged together with a separating
|
||||
@ -342,8 +322,7 @@ read the data from, or - if you want curl to read the data from
|
||||
stdin. Multiple files can also be specified. Posting data from a file
|
||||
named 'foobar' would thus be done with \fI--data\fP @foobar. When --data is
|
||||
told to read from a file like that, carriage returns and newlines will be
|
||||
stripped out. If you don't want the @ character to have a special
|
||||
interpretation use \fI--data-raw\fP instead.
|
||||
stripped out.
|
||||
.IP "-D, --dump-header <file>"
|
||||
Write the protocol headers to the specified file.
|
||||
|
||||
@ -368,10 +347,6 @@ and carriage returns are preserved and conversions are never done.
|
||||
|
||||
If this option is used several times, the ones following the first will append
|
||||
data as described in \fI-d, --data\fP.
|
||||
.IP "--data-raw <data>"
|
||||
(HTTP) This posts data similarly to \fI--data\fP but without the special
|
||||
interpretation of the @ character. See \fI-d, --data\fP.
|
||||
(Added in 7.43.0)
|
||||
.IP "--data-urlencode <data>"
|
||||
(HTTP) This posts data, similar to the other --data options with the exception
|
||||
that this performs URL-encoding. (Added in 7.18.0)
|
||||
@ -430,9 +405,6 @@ the traditional PORT command.
|
||||
\fB--eprt\fP can be used to explicitly enable EPRT again and \fB--no-eprt\fP
|
||||
is an alias for \fB--disable-eprt\fP.
|
||||
|
||||
If the server is an IPv6 host, this option will have no effect as EPRT is
|
||||
necessary then.
|
||||
|
||||
Disabling EPRT only changes the active behavior. If you want to switch to
|
||||
passive mode you need to not use \fI-P, --ftp-port\fP or force it with
|
||||
\fI--ftp-pasv\fP.
|
||||
@ -444,9 +416,6 @@ but with this option, it will not try using EPSV.
|
||||
\fB--epsv\fP can be used to explicitly enable EPSV again and \fB--no-epsv\fP
|
||||
is an alias for \fB--disable-epsv\fP.
|
||||
|
||||
If the server is an IPv6 host, this option will have no effect as EPSV is
|
||||
necessary then.
|
||||
|
||||
Disabling EPSV only changes the passive behavior. If you want to switch to
|
||||
active mode you need to use \fI-P, --ftp-port\fP.
|
||||
.IP "--dns-interface <interface>"
|
||||
@ -494,10 +463,10 @@ If this option is used several times, the last one will be used.
|
||||
(SSL) Tells curl to use the specified client certificate file when getting a
|
||||
file with HTTPS, FTPS or another SSL-based protocol. The certificate must be
|
||||
in PKCS#12 format if using Secure Transport, or PEM format if using any other
|
||||
engine. If the optional password isn't specified, it will be queried for on
|
||||
the terminal. Note that this option assumes a \&"certificate" file that is the
|
||||
private key and the client certificate concatenated! See \fI--cert\fP and
|
||||
\fI--key\fP to specify them independently.
|
||||
engine. If the optional password isn't specified, it will be queried
|
||||
for on the terminal. Note that this option assumes a \&"certificate" file that
|
||||
is the private key and the private certificate concatenated! See \fI--cert\fP
|
||||
and \fI--key\fP to specify them independently.
|
||||
|
||||
If curl is built against the NSS SSL library then this option can tell
|
||||
curl the nickname of the certificate to use within the NSS database defined
|
||||
@ -529,13 +498,6 @@ after having run curl.
|
||||
(SSL) Specify the path name to the Entropy Gathering Daemon socket. The socket
|
||||
is used to seed the random engine for SSL connections. See also the
|
||||
\fI--random-file\fP option.
|
||||
.IP "--expect100-timeout <seconds>"
|
||||
(HTTP) Maximum time in seconds that you allow curl to wait for a 100-continue
|
||||
response when curl emits an Expects: 100-continue header in its request. By
|
||||
default curl will wait one second. This option accepts decimal values! When
|
||||
curl stops waiting, it will continue as if the response has been received.
|
||||
|
||||
(Added in 7.47.0)
|
||||
.IP "--cert-type <type>"
|
||||
(SSL) Tells curl what certificate type the provided certificate is in. PEM,
|
||||
DER and ENG are recognized types. If not specified, PEM is assumed.
|
||||
@ -570,42 +532,19 @@ OpenSSL-powered curl to make SSL-connections much more efficiently than using
|
||||
|
||||
If this option is set, the default capath value will be ignored, and if it is
|
||||
used several times, the last one will be used.
|
||||
.IP "--pinnedpubkey <pinned public key (hashes)>"
|
||||
(SSL) Tells curl to use the specified public key file (or hashes) to verify the
|
||||
peer. This can be a path to a file which contains a single public key in PEM or
|
||||
DER format, or any number of base64 encoded sha256 hashes preceded by
|
||||
\'sha256//\' and separated by \';\'
|
||||
.IP "--pinnedpubkey <pinned public key>"
|
||||
(SSL) Tells curl to use the specified public key file to verify the peer. The
|
||||
file must contain a single public key in DER format.
|
||||
|
||||
When negotiating a TLS or SSL connection, the server sends a certificate
|
||||
indicating its identity. A public key is extracted from this certificate and
|
||||
if it does not exactly match the public key provided to this option, curl will
|
||||
abort the connection before sending or receiving any data.
|
||||
|
||||
Added in 7.39.0 for OpenSSL, GnuTLS and GSKit. Added in 7.43.0 for NSS and
|
||||
wolfSSL/CyaSSL. sha256 support added in 7.44.0 for OpenSSL,
|
||||
GnuTLS, NSS and wolfSSL/CyaSSL. Other SSL backends not supported.
|
||||
This is currently only implemented in the OpenSSL and GnuTLS backends.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "--cert-status"
|
||||
(SSL) Tells curl to verify the status of the server certificate by using the
|
||||
Certificate Status Request (aka. OCSP stapling) TLS extension.
|
||||
|
||||
If this option is enabled and the server sends an invalid (e.g. expired)
|
||||
response, if the response suggests that the server certificate has been revoked,
|
||||
or no response at all is received, the verification fails.
|
||||
|
||||
This is currently only implemented in the OpenSSL, GnuTLS and NSS backends.
|
||||
(Added in 7.41.0)
|
||||
.IP "--false-start"
|
||||
|
||||
(SSL) Tells curl to use false start during the TLS handshake. False start is a
|
||||
mode where a TLS client will start sending application data before verifying
|
||||
the server's Finished message, thus saving a round trip when performing a full
|
||||
handshake.
|
||||
|
||||
This is currently only implemented in the NSS and Secure Transport (on iOS 7.0
|
||||
or later, or OS X 10.9 or later) backends.
|
||||
(Added in 7.42.0)
|
||||
(Added in 7.39.0)
|
||||
.IP "-f, --fail"
|
||||
(HTTP) Fail silently (no output at all) on server errors. This is mostly done
|
||||
to better enable scripts etc to better deal with failed attempts. In normal
|
||||
@ -633,9 +572,7 @@ input:
|
||||
\fBcurl\fP -F password=@/etc/passwd www.mypasswords.com
|
||||
|
||||
To read content from stdin instead of a file, use - as the filename. This goes
|
||||
for both @ and < constructs. Unfortunately it does not support reading the
|
||||
file from a named pipe or similar, as it needs the full size before the
|
||||
transfer starts.
|
||||
for both @ and < constructs.
|
||||
|
||||
You can also tell curl what Content-Type to use by using 'type=', in a manner
|
||||
similar to:
|
||||
@ -697,7 +634,6 @@ curl does one CWD with the full target directory and then operates on the file
|
||||
\&"normally" (like in the multicwd case). This is somewhat more standards
|
||||
compliant than 'nocwd' but without the full penalty of 'multicwd'.
|
||||
.RE
|
||||
.IP
|
||||
(Added in 7.15.1)
|
||||
.IP "--ftp-pasv"
|
||||
(FTP) Use passive mode for the data connection. Passive is the internal default
|
||||
@ -790,24 +726,16 @@ Example:
|
||||
|
||||
\&# curl -H "X-First-Name: Joe" http://192.168.0.1/
|
||||
|
||||
\fBWARNING\fP: headers set with this option will be set in all requests - even
|
||||
after redirects are followed, like when told with \fB-L, --location\fP. This
|
||||
can lead to the header being sent to other hosts than the original host, so
|
||||
sensitive headers should be used with caution combined with following
|
||||
redirects.
|
||||
|
||||
This option can be used multiple times to add/replace/remove multiple headers.
|
||||
.IP "--hostpubmd5 <md5>"
|
||||
(SCP/SFTP) Pass a string containing 32 hexadecimal digits. The string should
|
||||
be the 128 bit MD5 checksum of the remote host's public key, curl will refuse
|
||||
the connection with the host unless the md5sums match. (Added in 7.17.1)
|
||||
.IP "--ignore-content-length"
|
||||
For HTTP, Ignore the Content-Length header. This is particularly useful for
|
||||
servers running Apache 1.x, which will report incorrect Content-Length for
|
||||
files larger than 2 gigabytes.
|
||||
|
||||
For FTP (since 7.46.0), skip the RETR command to figure out the size before
|
||||
downloading a file.
|
||||
(HTTP)
|
||||
Ignore the Content-Length header. This is particularly useful for servers
|
||||
running Apache 1.x, which will report incorrect Content-Length for files
|
||||
larger than 2 gigabytes.
|
||||
.IP "-i, --include"
|
||||
(HTTP) Include the HTTP-header in the output. The HTTP-header includes things
|
||||
like server-name, date of the document, HTTP-version and more...
|
||||
@ -834,17 +762,8 @@ cookies when they're closed down.
|
||||
server-specified Content-Disposition filename instead of extracting a filename
|
||||
from the URL.
|
||||
|
||||
If the server specifies a file name and a file with that name already exists
|
||||
in the current working directory it will not be overwritten and an error will
|
||||
occur. If the server doesn't specify a file name then this option has no
|
||||
effect.
|
||||
|
||||
There's no attempt to decode %-sequences (yet) in the provided file name, so
|
||||
this option may provide you with rather unexpected file names.
|
||||
|
||||
\fBWARNING\fP: Exercise judicious use of this option, especially on Windows. A
|
||||
rogue server could send you the name of a DLL or other file that could possibly
|
||||
be loaded automatically by Windows or some third party software.
|
||||
.IP "-k, --insecure"
|
||||
(SSL) This option explicitly allows curl to perform "insecure" SSL connections
|
||||
and transfers. All SSL connections are attempted to be made secure by using
|
||||
@ -852,7 +771,7 @@ the CA certificate bundle installed by default. This makes all connections
|
||||
considered "insecure" fail unless \fI-k, --insecure\fP is used.
|
||||
|
||||
See this online resource for further details:
|
||||
\fBhttps://curl.haxx.se/docs/sslcerts.html\fP
|
||||
\fBhttp://curl.haxx.se/docs/sslcerts.html\fP
|
||||
.IP "-K, --config <config file>"
|
||||
Specify which config file to read curl arguments from. The config file is a
|
||||
text file in which command line arguments can be written which then will be
|
||||
@ -879,7 +798,7 @@ Note that to be able to specify a URL in the config file, you need to specify
|
||||
it using the \fI--url\fP option, and not by simply writing the URL on its own
|
||||
line. So, it could look similar to this:
|
||||
|
||||
url = "https://curl.haxx.se/docs/"
|
||||
url = "http://curl.haxx.se/docs/"
|
||||
|
||||
When curl is invoked, it always (unless \fI-q\fP is used) checks for a default
|
||||
config file and uses it if found. The default config file is checked for in
|
||||
@ -887,12 +806,12 @@ the following places in this order:
|
||||
|
||||
1) curl tries to find the "home dir": It first checks for the CURL_HOME and
|
||||
then the HOME environment variables. Failing that, it uses getpwuid() on
|
||||
Unix-like systems (which returns the home dir given the current user in your
|
||||
UNIX-like systems (which returns the home dir given the current user in your
|
||||
system). On Windows, it then checks for the APPDATA variable, or as a last
|
||||
resort the '%USERPROFILE%\\Application Data'.
|
||||
|
||||
2) On windows, if there is no _curlrc file in the home dir, it checks for one
|
||||
in the same dir the curl executable is placed. On Unix-like systems, it will
|
||||
in the same dir the curl executable is placed. On UNIX-like systems, it will
|
||||
simply try to load .curlrc from the determined home dir.
|
||||
|
||||
.nf
|
||||
@ -977,7 +896,7 @@ re-send the following request using the same unmodified method.
|
||||
|
||||
You can tell curl to not change the non-GET request method to GET after a 30x
|
||||
response by using the dedicated options for that: \fI--post301\fP,
|
||||
\fI--post302\fP and \fI--post303\fP.
|
||||
\fI--post302\fP and \fI-post303\fP.
|
||||
.IP "--libcurl <file>"
|
||||
Append this option to any ordinary curl command line, and you will get a
|
||||
libcurl-using C source code written to the file that does the equivalent
|
||||
@ -1100,11 +1019,14 @@ in Metalink file, hash check will fail.
|
||||
.IP "-n, --netrc"
|
||||
Makes curl scan the \fI.netrc\fP (\fI_netrc\fP on Windows) file in the user's
|
||||
home directory for login name and password. This is typically used for FTP on
|
||||
Unix. If used with HTTP, curl will enable user authentication. See
|
||||
\fInetrc(5)\fP \fIftp(1)\fP for details on the file format. Curl will not
|
||||
complain if that file doesn't have the right permissions (it should not be
|
||||
either world- or group-readable). The environment variable "HOME" is used to
|
||||
find the home directory.
|
||||
UNIX. If used with HTTP, curl will enable user authentication. See
|
||||
.BR netrc(4)
|
||||
or
|
||||
.BR ftp(1)
|
||||
for details on the file format. Curl will not complain if that file
|
||||
doesn't have the right permissions (it should not be either world- or
|
||||
group-readable). The environment variable "HOME" is used to find the home
|
||||
directory.
|
||||
|
||||
A quick and very simple example of how to setup a \fI.netrc\fP to allow curl
|
||||
to FTP to the machine host.domain.com with user name \&'myself' and password
|
||||
@ -1205,15 +1127,12 @@ output to be done to stdout.
|
||||
Write output to a local file named like the remote file we get. (Only the file
|
||||
part of the remote file is used, the path is cut off.)
|
||||
|
||||
The file will be saved in the current working directory. If you want the file
|
||||
saved in a different directory, make sure you change the current working
|
||||
directory before invoking curl with this option.
|
||||
The remote file name to use for saving is extracted from the given URL,
|
||||
nothing else.
|
||||
|
||||
The remote file name to use for saving is extracted from the given URL, nothing
|
||||
else, and if it already exists it will be overwritten. If you want the server
|
||||
to be able to choose the file name refer to \fI-J, --remote-header-name\fP
|
||||
which can be used in addition to this option. If the server chooses a file name
|
||||
and that name already exists it will not be overwritten.
|
||||
Consequentially, the file will be saved in the current working directory. If
|
||||
you want the file saved in a different directory, make sure you change current
|
||||
working directory before you invoke curl with the \fB-O, --remote-name\fP flag!
|
||||
|
||||
There is no URL decoding done on the file name. If it has %20 or other URL
|
||||
encoded parts of the name, they will end up as-is as file name.
|
||||
@ -1269,7 +1188,7 @@ i.e "my.host.domain" to specify the machine
|
||||
make curl pick the same IP address that is already used for the control
|
||||
connection
|
||||
.RE
|
||||
.IP
|
||||
|
||||
If this option is used several times, the last one will be used. Disable the
|
||||
use of PORT with \fI--ftp-pasv\fP. Disable the attempt to use the EPRT command
|
||||
instead of PORT by using \fI--disable-eprt\fP. EPRT is really PORT++.
|
||||
@ -1283,28 +1202,22 @@ available.
|
||||
(SSL/SSH) Passphrase for the private key
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "--path-as-is"
|
||||
Tell curl to not handle sequences of /../ or /./ in the given URL
|
||||
path. Normally curl will squash or merge them according to standards but with
|
||||
this option set you tell it not to do that.
|
||||
|
||||
(Added in 7.42.0)
|
||||
.IP "--post301"
|
||||
(HTTP) Tells curl to respect RFC 7230/6.4.2 and not convert POST requests
|
||||
(HTTP) Tells curl to respect RFC 2616/10.3.2 and not convert POST requests
|
||||
into GET requests when following a 301 redirection. The non-RFC behaviour is
|
||||
ubiquitous in web browsers, so curl does the conversion by default to maintain
|
||||
consistency. However, a server may require a POST to remain a POST after such
|
||||
a redirection. This option is meaningful only when using \fI-L, --location\fP
|
||||
(Added in 7.17.1)
|
||||
.IP "--post302"
|
||||
(HTTP) Tells curl to respect RFC 7230/6.4.3 and not convert POST requests
|
||||
(HTTP) Tells curl to respect RFC 2616/10.3.2 and not convert POST requests
|
||||
into GET requests when following a 302 redirection. The non-RFC behaviour is
|
||||
ubiquitous in web browsers, so curl does the conversion by default to maintain
|
||||
consistency. However, a server may require a POST to remain a POST after such
|
||||
a redirection. This option is meaningful only when using \fI-L, --location\fP
|
||||
(Added in 7.19.1)
|
||||
.IP "--post303"
|
||||
(HTTP) Tells curl to respect RFC 7230/6.4.4 and not convert POST requests
|
||||
(HTTP) Tells curl to respect RFC 2616/10.3.2 and not convert POST requests
|
||||
into GET requests when following a 303 redirection. The non-RFC behaviour is
|
||||
ubiquitous in web browsers, so curl does the conversion by default to maintain
|
||||
consistency. However, a server may require a POST to remain a POST after such
|
||||
@ -1351,40 +1264,9 @@ This option can be used multiple times, in which case the effect is the same
|
||||
as concatenating the protocols into one instance of the option.
|
||||
|
||||
(Added in 7.20.2)
|
||||
.IP "--proto-default <protocol>"
|
||||
Tells curl to use \fIprotocol\fP for any URL missing a scheme name.
|
||||
|
||||
Example:
|
||||
|
||||
.RS
|
||||
.IP "--proto-default https ftp.mozilla.org"
|
||||
https://ftp.mozilla.org
|
||||
.RE
|
||||
|
||||
An unknown or unsupported protocol causes error
|
||||
\fICURLE_UNSUPPORTED_PROTOCOL\fP.
|
||||
|
||||
This option does not change the default proxy protocol (http).
|
||||
|
||||
Without this option curl would make a guess based on the host, see \fI--url\fP
|
||||
for details.
|
||||
|
||||
(Added in 7.45.0)
|
||||
.IP "--proto-redir <protocols>"
|
||||
Tells curl to use the listed protocols on redirect. See --proto for how
|
||||
protocols are represented.
|
||||
|
||||
Example:
|
||||
|
||||
.RS
|
||||
.IP "--proto-redir -all,http,https"
|
||||
Allow only HTTP and HTTPS on redirect.
|
||||
.RE
|
||||
|
||||
By default curl will allow all protocols on redirect except several disabled
|
||||
for security reasons: Since 7.19.4 FILE and SCP are disabled, and since 7.40.0
|
||||
SMB and SMBS are also disabled. Specifying \fIall\fP or \fI+all\fP enables all
|
||||
protocols on redirect, including those disabled for security.
|
||||
Tells curl to use the listed protocols after a redirect. See --proto for
|
||||
how protocols are represented.
|
||||
|
||||
(Added in 7.20.2)
|
||||
.IP "--proxy-anyauth"
|
||||
@ -1405,11 +1287,6 @@ with a remote host. (Added in 7.17.1)
|
||||
.IP "--proxy-ntlm"
|
||||
Tells curl to use HTTP NTLM authentication when communicating with the given
|
||||
proxy. Use \fI--ntlm\fP for enabling NTLM with a remote host.
|
||||
.IP "--proxy-service-name <servicename>"
|
||||
This option allows you to change the service name for proxy negotiation.
|
||||
|
||||
Examples: --proxy-negotiate proxy-name \fI--proxy-service-name\fP sockd would use
|
||||
sockd/proxy-name. (Added in 7.43.0).
|
||||
.IP "--proxy1.0 <proxyhost[:port]>"
|
||||
Use the specified HTTP 1.0 proxy. If the port number is not specified, it is
|
||||
assumed at port 1080.
|
||||
@ -1499,12 +1376,15 @@ specifies the last 500 bytes
|
||||
specifies the bytes from offset 9500 and forward
|
||||
.TP
|
||||
.B 0-0,-1
|
||||
specifies the first and last byte only(*)(HTTP)
|
||||
specifies the first and last byte only(*)(H)
|
||||
.TP
|
||||
.B 500-700,600-799
|
||||
specifies 300 bytes from offset 500(H)
|
||||
.TP
|
||||
.B 100-199,500-599
|
||||
specifies two separate 100-byte ranges(*) (HTTP)
|
||||
specifies two separate 100-byte ranges(*)(H)
|
||||
.RE
|
||||
.IP
|
||||
|
||||
(*) = NOTE that this will cause the server to reply with a multipart
|
||||
response!
|
||||
|
||||
@ -1588,11 +1468,6 @@ terminal/stdout unless you redirect it.
|
||||
.IP "--sasl-ir"
|
||||
Enable initial response in SASL authentication.
|
||||
(Added in 7.31.0)
|
||||
.IP "--service-name <servicename>"
|
||||
This option allows you to change the service name for SPNEGO.
|
||||
|
||||
Examples: --negotiate \fI--service-name\fP sockd would use
|
||||
sockd/server-name. (Added in 7.43.0).
|
||||
.IP "-S, --show-error"
|
||||
When used with \fI-s\fP it makes curl show an error message if it fails.
|
||||
.IP "--ssl"
|
||||
@ -1615,10 +1490,6 @@ and TLS1.0 protocols known as BEAST. If this option isn't used, the SSL layer
|
||||
may use workarounds known to cause interoperability problems with some older
|
||||
SSL implementations. WARNING: this option loosens the SSL security, and by
|
||||
using this flag you ask for exactly that. (Added in 7.25.0)
|
||||
.IP "--ssl-no-revoke"
|
||||
(WinSSL) This option tells curl to disable certificate revocation checks.
|
||||
WARNING: this option loosens the SSL security, and by using this flag you ask
|
||||
for exactly that. (Added in 7.44.0)
|
||||
.IP "--socks4 <host[:port]>"
|
||||
Use the specified SOCKS4 proxy. If the port number is not specified, it is
|
||||
assumed at port 1080. (Added in 7.15.2)
|
||||
@ -1730,14 +1601,6 @@ default 512 bytes will be used.
|
||||
If this option is used several times, the last one will be used.
|
||||
|
||||
(Added in 7.20.0)
|
||||
.IP "--tftp-no-options"
|
||||
(TFTP) Tells curl not to send TFTP options requests.
|
||||
|
||||
This option improves interop with some legacy servers that do not acknowledge
|
||||
or properly implement TFTP options. When this option is used
|
||||
\fI--tftp-blksize\fP is ignored.
|
||||
|
||||
(Added in 7.48.0)
|
||||
.IP "--tlsauthtype <authtype>"
|
||||
Set TLS authentication type. Currently, the only supported option is "SRP",
|
||||
for TLS-SRP (RFC 5054). If \fI--tlsuser\fP and \fI--tlspassword\fP are
|
||||
@ -1792,9 +1655,6 @@ If this option is used several times, the last one will be used.
|
||||
.IP "--trace-time"
|
||||
Prepends a time stamp to each trace or verbose line that curl displays.
|
||||
(Added in 7.14.0)
|
||||
.IP "--unix-socket <path>"
|
||||
(HTTP) Connect through this Unix domain socket, instead of using the
|
||||
network. (Added in 7.40.0)
|
||||
.IP "-u, --user <user:password>"
|
||||
Specify the user name and password to use for server authentication. Overrides
|
||||
\fI-n, --netrc\fP and \fI--netrc-optional\fP.
|
||||
@ -1806,7 +1666,7 @@ impossible to use a colon in the user name with this option. The password can,
|
||||
still.
|
||||
|
||||
When using Kerberos V5 with a Windows based server you should include the
|
||||
Windows domain name in the user name, in order for the server to successfully
|
||||
Windows domain name in the user name, in order for the server to succesfully
|
||||
obtain a Kerberos Ticket. If you don't then the initial authentication
|
||||
handshake may fail.
|
||||
|
||||
@ -1819,7 +1679,7 @@ Principal Name) formats. For example, EXAMPLE\\user and user@example.com
|
||||
respectively.
|
||||
|
||||
If you use a Windows SSPI-enabled curl binary and perform Kerberos V5,
|
||||
Negotiate, NTLM or Digest authentication then you can tell curl to select
|
||||
Negotiate, NTLM or DIGEST-MD5 authentication then you can tell curl to select
|
||||
the user name and password from your environment by specifying a single colon
|
||||
with this option: "-u :".
|
||||
|
||||
@ -1836,12 +1696,6 @@ If this option is used several times, the last one will be used.
|
||||
Specify a URL to fetch. This option is mostly handy when you want to specify
|
||||
URL(s) in a config file.
|
||||
|
||||
If the given URL is missing a scheme name (such as "http://" or "ftp://" etc)
|
||||
then curl will make a guess based on the host. If the outermost sub-domain name
|
||||
matches DICT, FTP, IMAP, LDAP, POP3 or SMTP then that protocol will be used,
|
||||
otherwise HTTP will be used. Since 7.45.0 guessing can be disabled by setting a
|
||||
default protocol, see \fI--proto-default\fP for details.
|
||||
|
||||
This option may be used any number of times. To control where this URL is
|
||||
written, use the \fI-o, --output\fP or the \fI-O, --remote-name\fP options.
|
||||
.IP "-v, --verbose"
|
||||
@ -1986,7 +1840,7 @@ displayed with millisecond resolution.
|
||||
The URL that was fetched last. This is most meaningful if you've told curl
|
||||
to follow location: headers.
|
||||
.RE
|
||||
.IP
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "-x, --proxy <[protocol://][user:password@]proxyhost[:port]>"
|
||||
Use the specified proxy.
|
||||
@ -2020,7 +1874,7 @@ password.
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "-X, --request <command>"
|
||||
(HTTP) Specifies a custom request method to use when communicating with the
|
||||
HTTP server. The specified request method will be used instead of the method
|
||||
HTTP server. The specified request will be used instead of the method
|
||||
otherwise used (which defaults to GET). Read the HTTP 1.1 specification for
|
||||
details and explanations. Common additional HTTP requests include PUT and
|
||||
DELETE, but related technologies like WebDAV offers PROPFIND, COPY, MOVE and
|
||||
@ -2034,11 +1888,6 @@ alter the way curl behaves. So for example if you want to make a proper HEAD
|
||||
request, using -X HEAD will not suffice. You need to use the \fI-I, --head\fP
|
||||
option.
|
||||
|
||||
The method string you set with -X will be used for all requests, which if you
|
||||
for example use \fB-L, --location\fP may cause unintended side-effects when
|
||||
curl doesn't change request method according to the HTTP 30x response codes -
|
||||
and similar.
|
||||
|
||||
(FTP)
|
||||
Specifies a custom FTP command to use instead of LIST when doing file lists
|
||||
with FTP.
|
||||
@ -2361,7 +2210,7 @@ are meant to never change.
|
||||
Daniel Stenberg is the main author, but the whole list of contributors is
|
||||
found in the separate THANKS file.
|
||||
.SH WWW
|
||||
https://curl.haxx.se
|
||||
http://curl.haxx.se
|
||||
.SH FTP
|
||||
ftp://ftp.sunet.se/pub/www/utilities/curl/
|
||||
.SH "SEE ALSO"
|
||||
|
4
docs/examples/.gitignore
vendored
4
docs/examples/.gitignore
vendored
@ -73,7 +73,3 @@ smtp-vrfy
|
||||
url2file
|
||||
usercertinmem
|
||||
xmlstream
|
||||
http2-download
|
||||
http2-serverpush
|
||||
http2-upload
|
||||
imap-lsub
|
||||
|
@ -5,11 +5,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@ -19,10 +19,9 @@
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
/* <DESC>
|
||||
* Source code using the multi interface to download many
|
||||
* files, with a capped maximum amount of simultaneous transfers.
|
||||
* </DESC>
|
||||
/* Example application source code using the multi interface to download many
|
||||
* files, but with a capped maximum amount of simultaneous transfers.
|
||||
*
|
||||
* Written by Michael Wallner
|
||||
*/
|
||||
|
||||
@ -63,6 +62,7 @@ static const char *urls[] = {
|
||||
"http://www.uefa.com",
|
||||
"http://www.ieee.org",
|
||||
"http://www.apple.com",
|
||||
"http://www.sony.com",
|
||||
"http://www.symantec.com",
|
||||
"http://www.zdnet.com",
|
||||
"http://www.fujitsu.com",
|
||||
@ -127,42 +127,41 @@ int main(void)
|
||||
uses */
|
||||
curl_multi_setopt(cm, CURLMOPT_MAXCONNECTS, (long)MAX);
|
||||
|
||||
for(C = 0; C < MAX; ++C) {
|
||||
for (C = 0; C < MAX; ++C) {
|
||||
init(cm, C);
|
||||
}
|
||||
|
||||
while(U) {
|
||||
while (U) {
|
||||
curl_multi_perform(cm, &U);
|
||||
|
||||
if(U) {
|
||||
if (U) {
|
||||
FD_ZERO(&R);
|
||||
FD_ZERO(&W);
|
||||
FD_ZERO(&E);
|
||||
|
||||
if(curl_multi_fdset(cm, &R, &W, &E, &M)) {
|
||||
if (curl_multi_fdset(cm, &R, &W, &E, &M)) {
|
||||
fprintf(stderr, "E: curl_multi_fdset\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if(curl_multi_timeout(cm, &L)) {
|
||||
if (curl_multi_timeout(cm, &L)) {
|
||||
fprintf(stderr, "E: curl_multi_timeout\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if(L == -1)
|
||||
if (L == -1)
|
||||
L = 100;
|
||||
|
||||
if(M == -1) {
|
||||
if (M == -1) {
|
||||
#ifdef WIN32
|
||||
Sleep(L);
|
||||
#else
|
||||
sleep((unsigned int)L / 1000);
|
||||
sleep(L / 1000);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
T.tv_sec = L/1000;
|
||||
T.tv_usec = (L%1000)*1000;
|
||||
|
||||
if(0 > select(M+1, &R, &W, &E, &T)) {
|
||||
if (0 > select(M+1, &R, &W, &E, &T)) {
|
||||
fprintf(stderr, "E: select(%i,,,,%li): %i: %s\n",
|
||||
M+1, L, errno, strerror(errno));
|
||||
return EXIT_FAILURE;
|
||||
@ -170,8 +169,8 @@ int main(void)
|
||||
}
|
||||
}
|
||||
|
||||
while((msg = curl_multi_info_read(cm, &Q))) {
|
||||
if(msg->msg == CURLMSG_DONE) {
|
||||
while ((msg = curl_multi_info_read(cm, &Q))) {
|
||||
if (msg->msg == CURLMSG_DONE) {
|
||||
char *url;
|
||||
CURL *e = msg->easy_handle;
|
||||
curl_easy_getinfo(msg->easy_handle, CURLINFO_PRIVATE, &url);
|
||||
@ -183,7 +182,7 @@ int main(void)
|
||||
else {
|
||||
fprintf(stderr, "E: CURLMsg (%d)\n", msg->msg);
|
||||
}
|
||||
if(C < CNT) {
|
||||
if (C < CNT) {
|
||||
init(cm, C++);
|
||||
U++; /* just to prevent it from remaining at 0 if there are more
|
||||
URLs to get */
|
||||
|
@ -5,11 +5,11 @@
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
# Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
# are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
@ -61,6 +61,3 @@ endif
|
||||
include Makefile.inc
|
||||
|
||||
all: $(check_PROGRAMS)
|
||||
|
||||
checksrc:
|
||||
@@PERL@ $(top_srcdir)/lib/checksrc.pl -D$(top_srcdir)/docs/examples *.c
|
||||
|
@ -9,7 +9,7 @@
|
||||
#
|
||||
# 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.
|
||||
# are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
|
@ -1,43 +1,20 @@
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# 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.
|
||||
#
|
||||
###########################################################################
|
||||
|
||||
# These are all libcurl example programs to be test compiled
|
||||
check_PROGRAMS = 10-at-a-time anyauthput cookie_interface debug fileupload \
|
||||
fopen ftpget ftpgetresp ftpupload getinfo getinmemory http-post httpput \
|
||||
https multi-app multi-debugcallback multi-double multi-post multi-single \
|
||||
persistant post-callback postit2 sepheaders simple simplepost simplessl \
|
||||
sendrecv httpcustomheader certinfo chkspeed ftpgetinfo ftp-wildcard \
|
||||
smtp-mail smtp-multi smtp-ssl smtp-tls smtp-vrfy smtp-expn rtsp \
|
||||
externalsocket resolve progressfunc pop3-retr pop3-list pop3-uidl \
|
||||
pop3-dele pop3-top pop3-stat pop3-noop pop3-ssl pop3-tls pop3-multi \
|
||||
imap-list imap-lsub imap-fetch imap-store imap-append imap-examine \
|
||||
imap-search imap-create imap-delete imap-copy imap-noop imap-ssl \
|
||||
imap-tls imap-multi url2file sftpget ftpsget postinmemory http2-download \
|
||||
http2-upload http2-serverpush getredirect
|
||||
sendrecv httpcustomheader certinfo chkspeed ftpgetinfo ftp-wildcard \
|
||||
smtp-mail smtp-multi smtp-ssl smtp-tls smtp-vrfy smtp-expn rtsp \
|
||||
externalsocket resolve progressfunc pop3-retr pop3-list pop3-uidl pop3-dele \
|
||||
pop3-top pop3-stat pop3-noop pop3-ssl pop3-tls pop3-multi imap-list \
|
||||
imap-lsub imap-fetch imap-store imap-append imap-examine imap-search \
|
||||
imap-create imap-delete imap-copy imap-noop imap-ssl imap-tls imap-multi \
|
||||
url2file sftpget ftpsget postinmemory
|
||||
|
||||
# These examples require external dependencies that may not be commonly
|
||||
# available on POSIX systems, so don't bother attempting to compile them here.
|
||||
COMPLICATED_EXAMPLES = curlgtk.c curlx.c htmltitle.cpp cacertinmem.c \
|
||||
ftpuploadresume.c ghiper.c hiperfifo.c htmltidy.c multithread.c \
|
||||
COMPLICATED_EXAMPLES = curlgtk.c curlx.c htmltitle.cpp cacertinmem.c \
|
||||
ftpuploadresume.c ghiper.c hiperfifo.c htmltidy.c multithread.c \
|
||||
opensslthreadlock.c sampleconv.c synctime.c threaded-ssl.c evhiperfifo.c \
|
||||
smooth-gtk-thread.c version-check.pl href_extractor.c asiohiper.cpp \
|
||||
smooth-gtk-thread.c version-check.pl href_extractor.c asiohiper.cpp \
|
||||
multi-uv.c xmlstream.c usercertinmem.c sessioninfo.c
|
||||
|
@ -5,11 +5,11 @@
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
# Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
# are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
# are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
@ -21,7 +21,7 @@
|
||||
###########################################################################
|
||||
#
|
||||
## Makefile for building curl examples with MingW (GCC-3.2 or later)
|
||||
## and optionally OpenSSL (1.0.2a), libssh2 (1.5), zlib (1.2.8), librtmp (2.4)
|
||||
## and optionally OpenSSL (0.9.8), libssh2 (1.3), zlib (1.2.5), librtmp (2.3)
|
||||
##
|
||||
## Usage: mingw32-make -f Makefile.m32 CFG=-feature1[-feature2][-feature3][...]
|
||||
## Example: mingw32-make -f Makefile.m32 CFG=-zlib-ssl-spi-winidn
|
||||
@ -38,23 +38,23 @@ ZLIB_PATH = ../../../zlib-1.2.8
|
||||
endif
|
||||
# Edit the path below to point to the base of your OpenSSL package.
|
||||
ifndef OPENSSL_PATH
|
||||
OPENSSL_PATH = ../../../openssl-1.0.2a
|
||||
OPENSSL_PATH = ../../../openssl-0.9.8y
|
||||
endif
|
||||
# Edit the path below to point to the base of your LibSSH2 package.
|
||||
ifndef LIBSSH2_PATH
|
||||
LIBSSH2_PATH = ../../../libssh2-1.5.0
|
||||
LIBSSH2_PATH = ../../../libssh2-1.4.3
|
||||
endif
|
||||
# Edit the path below to point to the base of your librtmp package.
|
||||
ifndef LIBRTMP_PATH
|
||||
LIBRTMP_PATH = ../../../librtmp-2.4
|
||||
LIBRTMP_PATH = ../../../librtmp-2.3
|
||||
endif
|
||||
# Edit the path below to point to the base of your libidn package.
|
||||
ifndef LIBIDN_PATH
|
||||
LIBIDN_PATH = ../../../libidn-1.32
|
||||
LIBIDN_PATH = ../../../libidn-1.18
|
||||
endif
|
||||
# Edit the path below to point to the base of your MS IDN package.
|
||||
# Microsoft Internationalized Domain Names (IDN) Mitigation APIs 1.1
|
||||
# https://www.microsoft.com/en-us/download/details.aspx?id=734
|
||||
# http://www.microsoft.com/downloads/en/details.aspx?FamilyID=ad6158d7-ddba-416a-9109-07607425a815
|
||||
ifndef WINIDN_PATH
|
||||
WINIDN_PATH = ../../../Microsoft IDN Mitigation APIs
|
||||
endif
|
||||
@ -62,10 +62,6 @@ endif
|
||||
ifndef LDAP_SDK
|
||||
LDAP_SDK = c:/novell/ndk/cldapsdk/win32
|
||||
endif
|
||||
# Edit the path below to point to the base of your nghttp2 package.
|
||||
ifndef NGHTTP2_PATH
|
||||
NGHTTP2_PATH = ../../../nghttp2-1.0.0
|
||||
endif
|
||||
|
||||
PROOT = ../..
|
||||
|
||||
@ -76,24 +72,14 @@ endif
|
||||
|
||||
# Edit the var below to set to your architecture or set environment var.
|
||||
ifndef ARCH
|
||||
ifeq ($(findstring x86_64,$(shell $(CC) -dumpmachine)),x86_64)
|
||||
ARCH = w64
|
||||
else
|
||||
ARCH = w32
|
||||
endif
|
||||
ARCH = w32
|
||||
endif
|
||||
|
||||
CC = $(CROSSPREFIX)gcc
|
||||
CFLAGS = -g -O2 -Wall
|
||||
CFLAGS += -fno-strict-aliasing
|
||||
ifeq ($(ARCH),w64)
|
||||
CFLAGS += -m64 -D_AMD64_
|
||||
LDFLAGS += -m64
|
||||
RCFLAGS += -F pe-x86-64
|
||||
else
|
||||
CFLAGS += -m32
|
||||
LDFLAGS += -m32
|
||||
RCFLAGS += -F pe-i386
|
||||
CFLAGS += -D_AMD64_
|
||||
endif
|
||||
# comment LDFLAGS below to keep debug info
|
||||
LDFLAGS = -s
|
||||
@ -172,12 +158,9 @@ ifeq ($(findstring -metalink,$(CFG)),-metalink)
|
||||
METALINK = 1
|
||||
endif
|
||||
ifeq ($(findstring -winssl,$(CFG)),-winssl)
|
||||
WINSSL = 1
|
||||
SCHANNEL = 1
|
||||
SSPI = 1
|
||||
endif
|
||||
ifeq ($(findstring -nghttp2,$(CFG)),-nghttp2)
|
||||
NGHTTP2 = 1
|
||||
endif
|
||||
|
||||
INCLUDES = -I. -I$(PROOT) -I$(PROOT)/include -I$(PROOT)/lib
|
||||
|
||||
@ -201,10 +184,6 @@ ifdef RTMP
|
||||
CFLAGS += -DUSE_LIBRTMP
|
||||
curl_LDADD += -L"$(LIBRTMP_PATH)/librtmp" -lrtmp -lwinmm
|
||||
endif
|
||||
ifdef NGHTTP2
|
||||
CFLAGS += -DUSE_NGHTTP2
|
||||
curl_LDADD += -L"$(NGHTTP2_PATH)/lib" -lnghttp2
|
||||
endif
|
||||
ifdef SSH2
|
||||
CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H
|
||||
curl_LDADD += -L"$(LIBSSH2_PATH)/win32" -lssh2
|
||||
@ -225,7 +204,7 @@ ifdef SSL
|
||||
ifndef DYN
|
||||
OPENSSL_LIBS += -lgdi32 -lcrypt32
|
||||
endif
|
||||
CFLAGS += -DUSE_OPENSSL
|
||||
CFLAGS += -DUSE_SSLEAY
|
||||
curl_LDADD += -L"$(OPENSSL_LIBPATH)" $(OPENSSL_LIBS)
|
||||
endif
|
||||
ifdef ZLIB
|
||||
@ -244,7 +223,7 @@ endif
|
||||
endif
|
||||
ifdef SSPI
|
||||
CFLAGS += -DUSE_WINDOWS_SSPI
|
||||
ifdef WINSSL
|
||||
ifdef SCHANNEL
|
||||
CFLAGS += -DUSE_SCHANNEL
|
||||
endif
|
||||
endif
|
||||
|
@ -19,12 +19,12 @@ endif
|
||||
|
||||
# Edit the path below to point to the base of your OpenSSL package.
|
||||
ifndef OPENSSL_PATH
|
||||
OPENSSL_PATH = ../../../openssl-1.0.2a
|
||||
OPENSSL_PATH = ../../../openssl-0.9.8y
|
||||
endif
|
||||
|
||||
# Edit the path below to point to the base of your LibSSH2 package.
|
||||
ifndef LIBSSH2_PATH
|
||||
LIBSSH2_PATH = ../../../libssh2-1.5.0
|
||||
LIBSSH2_PATH = ../../../libssh2-1.4.3
|
||||
endif
|
||||
|
||||
# Edit the path below to point to the base of your axTLS package.
|
||||
@ -34,12 +34,12 @@ endif
|
||||
|
||||
# Edit the path below to point to the base of your libidn package.
|
||||
ifndef LIBIDN_PATH
|
||||
LIBIDN_PATH = ../../../libidn-1.32
|
||||
LIBIDN_PATH = ../../../libidn-1.18
|
||||
endif
|
||||
|
||||
# Edit the path below to point to the base of your librtmp package.
|
||||
ifndef LIBRTMP_PATH
|
||||
LIBRTMP_PATH = ../../../librtmp-2.4
|
||||
LIBRTMP_PATH = ../../../librtmp-2.3
|
||||
endif
|
||||
|
||||
# Edit the path below to point to the base of your fbopenssl package.
|
||||
|
@ -32,7 +32,51 @@ actually torture our web site with your tests! Thanks.
|
||||
|
||||
EXAMPLES
|
||||
|
||||
Each example source code file is designed to be and work stand-alone and
|
||||
rather self-explanatory. The examples may at times lack the level of error
|
||||
checks you need in a real world, but that is then only for the sake of
|
||||
readability: to make the code smaller and easier to follow.
|
||||
anyauthput.c - HTTP PUT using "any" authentication method
|
||||
cacertinmem.c - Use a built-in PEM certificate to retrieve a https page
|
||||
cookie_interface.c - shows usage of simple cookie interface
|
||||
curlgtk.c - download using a GTK progress bar
|
||||
curlx.c - getting file info from the remote cert data
|
||||
debug.c - showing how to use the debug callback
|
||||
fileupload.c - uploading to a file:// URL
|
||||
fopen.c - fopen() layer that supports opening URLs and files
|
||||
ftpget.c - simple getting a file from FTP
|
||||
ftpgetresp.c - get the response strings from the FTP server
|
||||
ftpupload.c - upload a file to an FTP server
|
||||
ftpuploadresume.c - resume an upload to an FTP server
|
||||
getinfo.c - get the Content-Type from the recent transfer
|
||||
getinmemory.c - download a file to memory only
|
||||
ghiper.c - curl_multi_socket() using code with glib-2
|
||||
hiperfifo.c - downloads all URLs written to the fifo, using
|
||||
curl_multi_socket() and libevent
|
||||
htmltidy.c - download a document and use libtidy to parse the HTML
|
||||
htmltitle.cc - download a HTML file and extract the <title> tag from a HTML
|
||||
page using libxml
|
||||
http-post.c - HTTP POST
|
||||
httpput.c - HTTP PUT a local file
|
||||
https.c - simple HTTPS transfer
|
||||
imap.c - simple IMAP transfer
|
||||
multi-app.c - a multi-interface app
|
||||
multi-debugcallback.c - a multi-interface app using the debug callback
|
||||
multi-double.c - a multi-interface app doing two simultaneous transfers
|
||||
multi-post.c - a multi-interface app doing a multipart formpost
|
||||
multi-single.c - a multi-interface app getting a single file
|
||||
multi-uv.c - a multi-interface app using libuv
|
||||
multithread.c - an example using multi-treading transferring multiple files
|
||||
opensslthreadlock.c - show how to do locking when using OpenSSL multi-threaded
|
||||
persistant.c - request two URLs with a persistent connection
|
||||
pop3s.c - POP3S transfer
|
||||
pop3slist.c - POP3S LIST
|
||||
post-callback.c - send a HTTP POST using a callback
|
||||
postit2.c - send a HTTP multipart formpost
|
||||
sampleconv.c - showing how a program on a non-ASCII platform would invoke
|
||||
callbacks to do its own codeset conversions instead of using
|
||||
the built-in iconv functions in libcurl
|
||||
sepheaders.c - download headers to a separate file
|
||||
simple.c - the most simple download a URL source
|
||||
simplepost.c - HTTP POST
|
||||
simplessl.c - HTTPS example with certificates many options set
|
||||
synctime.c - Sync local time by extracting date from remote HTTP servers
|
||||
url2file.c - download a document and store it in a file
|
||||
xmlstream.c - Stream-parse a document using the streaming Expat parser
|
||||
10-at-a-time.c - Download many files simultaneously, 10 at a time.
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
# pass files as argument(s)
|
||||
|
||||
my $docroot="https://curl.haxx.se/libcurl/c";
|
||||
my $docroot="http://curl.haxx.se/libcurl/c";
|
||||
|
||||
for $f (@ARGV) {
|
||||
open(NEW, ">$f.new");
|
||||
|
@ -5,11 +5,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@ -19,11 +19,6 @@
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
/* <DESC>
|
||||
* HTTP PUT upload with authentiction using "any" method. libcurl picks the
|
||||
* one the server supports/wants.
|
||||
* </DESC>
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#ifdef WIN32
|
||||
@ -78,8 +73,7 @@
|
||||
/* ioctl callback function */
|
||||
static curlioerr my_ioctl(CURL *handle, curliocmd cmd, void *userp)
|
||||
{
|
||||
int *fdp = (int *)userp;
|
||||
int fd = *fdp;
|
||||
intptr_t fd = (intptr_t)userp;
|
||||
|
||||
(void)handle; /* not used in here */
|
||||
|
||||
@ -101,11 +95,10 @@ static curlioerr my_ioctl(CURL *handle, curliocmd cmd, void *userp)
|
||||
/* read callback function, fread() look alike */
|
||||
static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream)
|
||||
{
|
||||
ssize_t retcode;
|
||||
size_t retcode;
|
||||
curl_off_t nread;
|
||||
|
||||
int *fdp = (int *)stream;
|
||||
int fd = *fdp;
|
||||
intptr_t fd = (intptr_t)stream;
|
||||
|
||||
retcode = read(fd, ptr, size * nmemb);
|
||||
|
||||
@ -121,7 +114,7 @@ int main(int argc, char **argv)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res;
|
||||
int hd;
|
||||
intptr_t hd ;
|
||||
struct stat file_info;
|
||||
|
||||
char *file;
|
||||
@ -134,7 +127,7 @@ int main(int argc, char **argv)
|
||||
url = argv[2];
|
||||
|
||||
/* get the file size of the local file */
|
||||
hd = open(file, O_RDONLY);
|
||||
hd = open(file, O_RDONLY) ;
|
||||
fstat(hd, &file_info);
|
||||
|
||||
/* In windows, this will init the winsock stuff */
|
||||
@ -147,20 +140,20 @@ int main(int argc, char **argv)
|
||||
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
|
||||
|
||||
/* which file to upload */
|
||||
curl_easy_setopt(curl, CURLOPT_READDATA, (void*)&hd);
|
||||
curl_easy_setopt(curl, CURLOPT_READDATA, (void*)hd);
|
||||
|
||||
/* set the ioctl function */
|
||||
curl_easy_setopt(curl, CURLOPT_IOCTLFUNCTION, my_ioctl);
|
||||
|
||||
/* pass the file descriptor to the ioctl callback as well */
|
||||
curl_easy_setopt(curl, CURLOPT_IOCTLDATA, (void*)&hd);
|
||||
curl_easy_setopt(curl, CURLOPT_IOCTLDATA, (void*)hd);
|
||||
|
||||
/* enable "uploading" (which means PUT when doing HTTP) */
|
||||
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L) ;
|
||||
|
||||
/* specify target URL, and note that this URL should also include a file
|
||||
name, not only a directory (as you can do with GTP uploads) */
|
||||
curl_easy_setopt(curl, CURLOPT_URL, url);
|
||||
curl_easy_setopt(curl,CURLOPT_URL, url);
|
||||
|
||||
/* and give the size of the upload, this supports large file sizes
|
||||
on systems that have general support for it */
|
||||
|
@ -5,11 +5,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 2012 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 2012, 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.
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@ -20,11 +20,11 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* <DESC>
|
||||
* demonstrate the use of multi socket interface with boost::asio
|
||||
* </DESC>
|
||||
*/
|
||||
/*
|
||||
* file: asiohiper.cpp
|
||||
* Example program to demonstrate the use of multi socket interface
|
||||
* with boost::asio
|
||||
*
|
||||
* This program is in c++ and uses boost::asio instead of libevent/libev.
|
||||
* Requires boost::asio, boost::bind and boost::system
|
||||
*
|
||||
@ -48,7 +48,6 @@
|
||||
#include <curl/curl.h>
|
||||
#include <boost/asio.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
#include <iostream>
|
||||
|
||||
#define MSG_OUT stdout /* Send info to stdout, change to stderr if you want */
|
||||
|
||||
@ -85,7 +84,7 @@ static int multi_timer_cb(CURLM *multi, long timeout_ms, GlobalInfo *g)
|
||||
/* cancel running timer */
|
||||
timer.cancel();
|
||||
|
||||
if(timeout_ms > 0)
|
||||
if ( timeout_ms > 0 )
|
||||
{
|
||||
/* update timer */
|
||||
timer.expires_from_now(boost::posix_time::millisec(timeout_ms));
|
||||
@ -104,44 +103,26 @@ static int multi_timer_cb(CURLM *multi, long timeout_ms, GlobalInfo *g)
|
||||
/* Die if we get a bad CURLMcode somewhere */
|
||||
static void mcode_or_die(const char *where, CURLMcode code)
|
||||
{
|
||||
if(CURLM_OK != code)
|
||||
if ( CURLM_OK != code )
|
||||
{
|
||||
const char *s;
|
||||
switch(code)
|
||||
switch ( code )
|
||||
{
|
||||
case CURLM_CALL_MULTI_PERFORM:
|
||||
s = "CURLM_CALL_MULTI_PERFORM";
|
||||
case CURLM_CALL_MULTI_PERFORM: s="CURLM_CALL_MULTI_PERFORM"; break;
|
||||
case CURLM_BAD_HANDLE: s="CURLM_BAD_HANDLE"; break;
|
||||
case CURLM_BAD_EASY_HANDLE: s="CURLM_BAD_EASY_HANDLE"; break;
|
||||
case CURLM_OUT_OF_MEMORY: s="CURLM_OUT_OF_MEMORY"; break;
|
||||
case CURLM_INTERNAL_ERROR: s="CURLM_INTERNAL_ERROR"; break;
|
||||
case CURLM_UNKNOWN_OPTION: s="CURLM_UNKNOWN_OPTION"; break;
|
||||
case CURLM_LAST: s="CURLM_LAST"; break;
|
||||
default: s="CURLM_unknown";
|
||||
break;
|
||||
case CURLM_BAD_HANDLE:
|
||||
s = "CURLM_BAD_HANDLE";
|
||||
break;
|
||||
case CURLM_BAD_EASY_HANDLE:
|
||||
s = "CURLM_BAD_EASY_HANDLE";
|
||||
break;
|
||||
case CURLM_OUT_OF_MEMORY:
|
||||
s = "CURLM_OUT_OF_MEMORY";
|
||||
break;
|
||||
case CURLM_INTERNAL_ERROR:
|
||||
s = "CURLM_INTERNAL_ERROR";
|
||||
break;
|
||||
case CURLM_UNKNOWN_OPTION:
|
||||
s = "CURLM_UNKNOWN_OPTION";
|
||||
break;
|
||||
case CURLM_LAST:
|
||||
s = "CURLM_LAST";
|
||||
break;
|
||||
default:
|
||||
s = "CURLM_unknown";
|
||||
break;
|
||||
case CURLM_BAD_SOCKET:
|
||||
s = "CURLM_BAD_SOCKET";
|
||||
case CURLM_BAD_SOCKET: s="CURLM_BAD_SOCKET";
|
||||
fprintf(MSG_OUT, "\nERROR: %s returns %s", where, s);
|
||||
/* ignore this error */
|
||||
return;
|
||||
}
|
||||
|
||||
fprintf(MSG_OUT, "\nERROR: %s returns %s", where, s);
|
||||
|
||||
exit(code);
|
||||
}
|
||||
}
|
||||
@ -158,9 +139,9 @@ static void check_multi_info(GlobalInfo *g)
|
||||
|
||||
fprintf(MSG_OUT, "\nREMAINING: %d", g->still_running);
|
||||
|
||||
while((msg = curl_multi_info_read(g->multi, &msgs_left)))
|
||||
while ((msg = curl_multi_info_read(g->multi, &msgs_left)))
|
||||
{
|
||||
if(msg->msg == CURLMSG_DONE)
|
||||
if (msg->msg == CURLMSG_DONE)
|
||||
{
|
||||
easy = msg->easy_handle;
|
||||
res = msg->data.result;
|
||||
@ -176,19 +157,17 @@ static void check_multi_info(GlobalInfo *g)
|
||||
}
|
||||
|
||||
/* Called by asio when there is an action on a socket */
|
||||
static void event_cb(GlobalInfo *g, boost::asio::ip::tcp::socket *tcp_socket,
|
||||
int action)
|
||||
static void event_cb(GlobalInfo * g, boost::asio::ip::tcp::socket * tcp_socket, int action)
|
||||
{
|
||||
fprintf(MSG_OUT, "\nevent_cb: action=%d", action);
|
||||
|
||||
CURLMcode rc;
|
||||
rc = curl_multi_socket_action(g->multi, tcp_socket->native_handle(), action,
|
||||
&g->still_running);
|
||||
rc = curl_multi_socket_action(g->multi, tcp_socket->native_handle(), action, &g->still_running);
|
||||
|
||||
mcode_or_die("event_cb: curl_multi_socket_action", rc);
|
||||
check_multi_info(g);
|
||||
|
||||
if(g->still_running <= 0)
|
||||
if ( g->still_running <= 0 )
|
||||
{
|
||||
fprintf(MSG_OUT, "\nlast transfer done, kill timeout");
|
||||
timer.cancel();
|
||||
@ -198,7 +177,7 @@ static void event_cb(GlobalInfo *g, boost::asio::ip::tcp::socket *tcp_socket,
|
||||
/* Called by asio when our timeout expires */
|
||||
static void timer_cb(const boost::system::error_code & error, GlobalInfo *g)
|
||||
{
|
||||
if(!error)
|
||||
if ( !error)
|
||||
{
|
||||
fprintf(MSG_OUT, "\ntimer_cb: ");
|
||||
|
||||
@ -215,7 +194,7 @@ static void remsock(int *f, GlobalInfo *g)
|
||||
{
|
||||
fprintf(MSG_OUT, "\nremsock: ");
|
||||
|
||||
if(f)
|
||||
if ( f )
|
||||
{
|
||||
free(f);
|
||||
}
|
||||
@ -227,10 +206,9 @@ static void setsock(int *fdp, curl_socket_t s, CURL*e, int act, GlobalInfo*g)
|
||||
|
||||
std::map<curl_socket_t, boost::asio::ip::tcp::socket *>::iterator it = socket_map.find(s);
|
||||
|
||||
if(it == socket_map.end())
|
||||
if ( it == socket_map.end() )
|
||||
{
|
||||
fprintf(MSG_OUT, "\nsocket %d is a c-ares socket, ignoring", s);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -238,36 +216,44 @@ static void setsock(int *fdp, curl_socket_t s, CURL*e, int act, GlobalInfo*g)
|
||||
|
||||
*fdp = act;
|
||||
|
||||
if(act == CURL_POLL_IN)
|
||||
if ( act == CURL_POLL_IN )
|
||||
{
|
||||
fprintf(MSG_OUT, "\nwatching for socket to become readable");
|
||||
|
||||
tcp_socket->async_read_some(boost::asio::null_buffers(),
|
||||
boost::bind(&event_cb, g, tcp_socket, act));
|
||||
boost::bind(&event_cb, g,
|
||||
tcp_socket,
|
||||
act));
|
||||
}
|
||||
else if (act == CURL_POLL_OUT)
|
||||
else if ( act == CURL_POLL_OUT )
|
||||
{
|
||||
fprintf(MSG_OUT, "\nwatching for socket to become writable");
|
||||
|
||||
tcp_socket->async_write_some(boost::asio::null_buffers(),
|
||||
boost::bind(&event_cb, g, tcp_socket, act));
|
||||
boost::bind(&event_cb, g,
|
||||
tcp_socket,
|
||||
act));
|
||||
}
|
||||
else if(act == CURL_POLL_INOUT)
|
||||
else if ( act == CURL_POLL_INOUT )
|
||||
{
|
||||
fprintf(MSG_OUT, "\nwatching for socket to become readable & writable");
|
||||
|
||||
tcp_socket->async_read_some(boost::asio::null_buffers(),
|
||||
boost::bind(&event_cb, g, tcp_socket, act));
|
||||
boost::bind(&event_cb, g,
|
||||
tcp_socket,
|
||||
act));
|
||||
|
||||
tcp_socket->async_write_some(boost::asio::null_buffers(),
|
||||
boost::bind(&event_cb, g, tcp_socket, act));
|
||||
boost::bind(&event_cb, g,
|
||||
tcp_socket,
|
||||
act));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void addsock(curl_socket_t s, CURL *easy, int action, GlobalInfo *g)
|
||||
{
|
||||
/* fdp is used to store current action */
|
||||
int *fdp = (int *) calloc(sizeof(int), 1);
|
||||
int *fdp = (int *)calloc(sizeof(int), 1); /* fdp is used to store current action */
|
||||
|
||||
setsock(fdp, s, easy, action, g);
|
||||
curl_multi_assign(g->multi, s, fdp);
|
||||
@ -279,20 +265,20 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
|
||||
fprintf(MSG_OUT, "\nsock_cb: socket=%d, what=%d, sockp=%p", s, what, sockp);
|
||||
|
||||
GlobalInfo *g = (GlobalInfo*) cbp;
|
||||
int *actionp = (int *) sockp;
|
||||
const char *whatstr[] = { "none", "IN", "OUT", "INOUT", "REMOVE"};
|
||||
int *actionp = (int*) sockp;
|
||||
const char *whatstr[]={ "none", "IN", "OUT", "INOUT", "REMOVE"};
|
||||
|
||||
fprintf(MSG_OUT,
|
||||
"\nsocket callback: s=%d e=%p what=%s ", s, e, whatstr[what]);
|
||||
|
||||
if(what == CURL_POLL_REMOVE)
|
||||
if ( what == CURL_POLL_REMOVE )
|
||||
{
|
||||
fprintf(MSG_OUT, "\n");
|
||||
remsock(actionp, g);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!actionp)
|
||||
if ( !actionp )
|
||||
{
|
||||
fprintf(MSG_OUT, "\nAdding data: %s", whatstr[what]);
|
||||
addsock(s, e, what, g);
|
||||
@ -305,19 +291,19 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
|
||||
setsock(actionp, s, e, what, g);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* CURLOPT_WRITEFUNCTION */
|
||||
static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data)
|
||||
{
|
||||
|
||||
size_t written = size * nmemb;
|
||||
char* pBuffer = (char *) malloc(written + 1);
|
||||
char* pBuffer = (char*)malloc(written + 1);
|
||||
|
||||
strncpy(pBuffer, (const char *)ptr, written);
|
||||
pBuffer[written] = '\0';
|
||||
pBuffer [written] = '\0';
|
||||
|
||||
fprintf(MSG_OUT, "%s", pBuffer);
|
||||
|
||||
@ -326,12 +312,12 @@ static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data)
|
||||
return written;
|
||||
}
|
||||
|
||||
|
||||
/* CURLOPT_PROGRESSFUNCTION */
|
||||
static int prog_cb(void *p, double dltotal, double dlnow, double ult,
|
||||
double uln)
|
||||
static int prog_cb (void *p, double dltotal, double dlnow, double ult,
|
||||
double uln)
|
||||
{
|
||||
ConnInfo *conn = (ConnInfo *)p;
|
||||
|
||||
(void)ult;
|
||||
(void)uln;
|
||||
|
||||
@ -342,15 +328,16 @@ static int prog_cb(void *p, double dltotal, double dlnow, double ult,
|
||||
}
|
||||
|
||||
/* CURLOPT_OPENSOCKETFUNCTION */
|
||||
static curl_socket_t opensocket(void *clientp, curlsocktype purpose,
|
||||
static curl_socket_t opensocket(void *clientp,
|
||||
curlsocktype purpose,
|
||||
struct curl_sockaddr *address)
|
||||
{
|
||||
fprintf(MSG_OUT, "\nopensocket :");
|
||||
|
||||
curl_socket_t sockfd = CURL_SOCKET_BAD;
|
||||
|
||||
/* restrict to IPv4 */
|
||||
if(purpose == CURLSOCKTYPE_IPCXN && address->family == AF_INET)
|
||||
/* restrict to ipv4 */
|
||||
if (purpose == CURLSOCKTYPE_IPCXN && address->family == AF_INET)
|
||||
{
|
||||
/* create a tcp socket object */
|
||||
boost::asio::ip::tcp::socket *tcp_socket = new boost::asio::ip::tcp::socket(io_service);
|
||||
@ -359,9 +346,9 @@ static curl_socket_t opensocket(void *clientp, curlsocktype purpose,
|
||||
boost::system::error_code ec;
|
||||
tcp_socket->open(boost::asio::ip::tcp::v4(), ec);
|
||||
|
||||
if(ec)
|
||||
if (ec)
|
||||
{
|
||||
/* An error occurred */
|
||||
//An error occurred
|
||||
std::cout << std::endl << "Couldn't open socket [" << ec << "][" << ec.message() << "]";
|
||||
fprintf(MSG_OUT, "\nERROR: Returning CURL_SOCKET_BAD to signal error");
|
||||
}
|
||||
@ -379,13 +366,13 @@ static curl_socket_t opensocket(void *clientp, curlsocktype purpose,
|
||||
}
|
||||
|
||||
/* CURLOPT_CLOSESOCKETFUNCTION */
|
||||
static int close_socket(void *clientp, curl_socket_t item)
|
||||
static int closesocket(void *clientp, curl_socket_t item)
|
||||
{
|
||||
fprintf(MSG_OUT, "\nclose_socket : %d", item);
|
||||
fprintf(MSG_OUT, "\nclosesocket : %d", item);
|
||||
|
||||
std::map<curl_socket_t, boost::asio::ip::tcp::socket *>::iterator it = socket_map.find(item);
|
||||
|
||||
if(it != socket_map.end())
|
||||
if ( it != socket_map.end() )
|
||||
{
|
||||
delete it->second;
|
||||
socket_map.erase(it);
|
||||
@ -395,21 +382,22 @@ static int close_socket(void *clientp, curl_socket_t item)
|
||||
}
|
||||
|
||||
/* Create a new easy handle, and add it to the global curl_multi */
|
||||
static void new_conn(char *url, GlobalInfo *g)
|
||||
static void new_conn(char *url, GlobalInfo *g )
|
||||
{
|
||||
ConnInfo *conn;
|
||||
CURLMcode rc;
|
||||
|
||||
conn = (ConnInfo *) calloc(1, sizeof(ConnInfo));
|
||||
conn = (ConnInfo *)calloc(1, sizeof(ConnInfo));
|
||||
memset(conn, 0, sizeof(ConnInfo));
|
||||
conn->error[0]='\0';
|
||||
|
||||
conn->easy = curl_easy_init();
|
||||
if(!conn->easy)
|
||||
|
||||
if ( !conn->easy )
|
||||
{
|
||||
fprintf(MSG_OUT, "\ncurl_easy_init() failed, exiting!");
|
||||
|
||||
exit(2);
|
||||
}
|
||||
|
||||
conn->global = g;
|
||||
conn->url = strdup(url);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_URL, conn->url);
|
||||
@ -428,7 +416,7 @@ static void new_conn(char *url, GlobalInfo *g)
|
||||
curl_easy_setopt(conn->easy, CURLOPT_OPENSOCKETFUNCTION, opensocket);
|
||||
|
||||
/* call this function to close a socket */
|
||||
curl_easy_setopt(conn->easy, CURLOPT_CLOSESOCKETFUNCTION, close_socket);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_CLOSESOCKETFUNCTION, closesocket);
|
||||
|
||||
fprintf(MSG_OUT,
|
||||
"\nAdding easy %p to multi %p (%s)", conn->easy, g->multi, url);
|
||||
@ -442,7 +430,7 @@ static void new_conn(char *url, GlobalInfo *g)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
GlobalInfo g;
|
||||
|
||||
CURLMcode rc;
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
@ -462,6 +450,5 @@ int main(int argc, char **argv)
|
||||
curl_multi_cleanup(g.multi);
|
||||
|
||||
fprintf(MSG_OUT, "\ndone.\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -5,11 +5,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@ -19,19 +19,25 @@
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
/* <DESC>
|
||||
* CA cert in memory with OpenSSL to get a HTTPS page.
|
||||
* </DESC>
|
||||
/* Example using a "in core" PEM certificate to retrieve a https page.
|
||||
* Written by Theo Borm
|
||||
*/
|
||||
|
||||
/* on a netBSD system with OPENSSL& LIBCURL installed from
|
||||
* pkgsrc (using default paths) this program can be compiled using:
|
||||
* gcc -I/usr/pkg/include -L/usr/pkg/lib -lcurl -Wl,-R/usr/pkg/lib -lssl
|
||||
* -lcrypto -lz -o curlcacerttest curlcacerttest.c
|
||||
* on other operating systems you may want to change paths to headers
|
||||
* and libraries
|
||||
*/
|
||||
#include <openssl/ssl.h>
|
||||
#include <curl/curl.h>
|
||||
#include <stdio.h>
|
||||
|
||||
size_t writefunction( void *ptr, size_t size, size_t nmemb, void *stream)
|
||||
{
|
||||
fwrite(ptr, size, nmemb, stream);
|
||||
return (nmemb*size);
|
||||
fwrite(ptr,size,nmemb,stream);
|
||||
return(nmemb*size);
|
||||
}
|
||||
|
||||
static CURLcode sslctx_function(CURL * curl, void * sslctx, void * parm)
|
||||
@ -87,14 +93,14 @@ static CURLcode sslctx_function(CURL * curl, void * sslctx, void * parm)
|
||||
* structure that SSL can use
|
||||
*/
|
||||
PEM_read_bio_X509(bio, &cert, 0, NULL);
|
||||
if(cert == NULL)
|
||||
if (cert == NULL)
|
||||
printf("PEM_read_bio_X509 failed...\n");
|
||||
|
||||
/* get a pointer to the X509 certificate store (which may be empty!) */
|
||||
store=SSL_CTX_get_cert_store((SSL_CTX *)sslctx);
|
||||
|
||||
/* add our certificate to this store */
|
||||
if(X509_STORE_add_cert(store, cert)==0)
|
||||
if (X509_STORE_add_cert(store, cert)==0)
|
||||
printf("error adding certificate\n");
|
||||
|
||||
/* decrease reference counts */
|
||||
@ -102,7 +108,7 @@ static CURLcode sslctx_function(CURL * curl, void * sslctx, void * parm)
|
||||
BIO_free(bio);
|
||||
|
||||
/* all set to go */
|
||||
return CURLE_OK;
|
||||
return CURLE_OK ;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
@ -112,22 +118,22 @@ int main(void)
|
||||
|
||||
rv=curl_global_init(CURL_GLOBAL_ALL);
|
||||
ch=curl_easy_init();
|
||||
rv=curl_easy_setopt(ch, CURLOPT_VERBOSE, 0L);
|
||||
rv=curl_easy_setopt(ch, CURLOPT_HEADER, 0L);
|
||||
rv=curl_easy_setopt(ch, CURLOPT_NOPROGRESS, 1L);
|
||||
rv=curl_easy_setopt(ch, CURLOPT_NOSIGNAL, 1L);
|
||||
rv=curl_easy_setopt(ch, CURLOPT_WRITEFUNCTION, *writefunction);
|
||||
rv=curl_easy_setopt(ch, CURLOPT_WRITEDATA, stdout);
|
||||
rv=curl_easy_setopt(ch, CURLOPT_HEADERFUNCTION, *writefunction);
|
||||
rv=curl_easy_setopt(ch, CURLOPT_HEADERDATA, stderr);
|
||||
rv=curl_easy_setopt(ch, CURLOPT_SSLCERTTYPE, "PEM");
|
||||
rv=curl_easy_setopt(ch, CURLOPT_SSL_VERIFYPEER, 1L);
|
||||
rv=curl_easy_setopt(ch,CURLOPT_VERBOSE, 0L);
|
||||
rv=curl_easy_setopt(ch,CURLOPT_HEADER, 0L);
|
||||
rv=curl_easy_setopt(ch,CURLOPT_NOPROGRESS, 1L);
|
||||
rv=curl_easy_setopt(ch,CURLOPT_NOSIGNAL, 1L);
|
||||
rv=curl_easy_setopt(ch,CURLOPT_WRITEFUNCTION, *writefunction);
|
||||
rv=curl_easy_setopt(ch,CURLOPT_WRITEDATA, stdout);
|
||||
rv=curl_easy_setopt(ch,CURLOPT_HEADERFUNCTION, *writefunction);
|
||||
rv=curl_easy_setopt(ch,CURLOPT_HEADERDATA, stderr);
|
||||
rv=curl_easy_setopt(ch,CURLOPT_SSLCERTTYPE,"PEM");
|
||||
rv=curl_easy_setopt(ch,CURLOPT_SSL_VERIFYPEER,1L);
|
||||
rv=curl_easy_setopt(ch, CURLOPT_URL, "https://www.example.com/");
|
||||
|
||||
/* first try: retrieve page without cacerts' certificate -> will fail
|
||||
*/
|
||||
rv=curl_easy_perform(ch);
|
||||
if(rv==CURLE_OK)
|
||||
if (rv==CURLE_OK)
|
||||
printf("*** transfer succeeded ***\n");
|
||||
else
|
||||
printf("*** transfer failed ***\n");
|
||||
@ -136,9 +142,9 @@ int main(void)
|
||||
* load the certificate by installing a function doing the nescessary
|
||||
* "modifications" to the SSL CONTEXT just before link init
|
||||
*/
|
||||
rv=curl_easy_setopt(ch, CURLOPT_SSL_CTX_FUNCTION, *sslctx_function);
|
||||
rv=curl_easy_setopt(ch,CURLOPT_SSL_CTX_FUNCTION, *sslctx_function);
|
||||
rv=curl_easy_perform(ch);
|
||||
if(rv==CURLE_OK)
|
||||
if (rv==CURLE_OK)
|
||||
printf("*** transfer succeeded ***\n");
|
||||
else
|
||||
printf("*** transfer failed ***\n");
|
||||
|
@ -5,11 +5,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@ -19,10 +19,6 @@
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
/* <DESC>
|
||||
* Extract lots of TLS certificate info.
|
||||
* </DESC>
|
||||
*/
|
||||
#include <stdio.h>
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
@ -5,11 +5,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@ -19,10 +19,6 @@
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
/* <DESC>
|
||||
* Show transfer timing info after download completes.
|
||||
* </DESC>
|
||||
*/
|
||||
/* Example source code to show how the callback function can be used to
|
||||
* download data into a chunk of memory instead of storing it in a file.
|
||||
* After successful download we use curl_easy_getinfo() calls to get the
|
||||
@ -68,78 +64,63 @@ int main(int argc, char *argv[])
|
||||
const char *url = URL_1M;
|
||||
char *appname = argv[0];
|
||||
|
||||
if(argc > 1) {
|
||||
if (argc > 1) {
|
||||
/* parse input parameters */
|
||||
for(argc--, argv++; *argv; argc--, argv++) {
|
||||
if(strncasecmp(*argv, "-", 1) == 0) {
|
||||
if(strncasecmp(*argv, "-H", 2) == 0) {
|
||||
for (argc--, argv++; *argv; argc--, argv++) {
|
||||
if (strncasecmp(*argv, "-", 1) == 0) {
|
||||
if (strncasecmp(*argv, "-H", 2) == 0) {
|
||||
fprintf(stderr,
|
||||
"\rUsage: %s [-m=1|2|5|10|20|50|100] [-t] [-x] [url]\n",
|
||||
appname);
|
||||
exit(1);
|
||||
}
|
||||
else if(strncasecmp(*argv, "-V", 2) == 0) {
|
||||
} else if (strncasecmp(*argv, "-V", 2) == 0) {
|
||||
fprintf(stderr, "\r%s %s - %s\n",
|
||||
appname, CHKSPEED_VERSION, curl_version());
|
||||
exit(1);
|
||||
}
|
||||
else if(strncasecmp(*argv, "-A", 2) == 0) {
|
||||
} else if (strncasecmp(*argv, "-A", 2) == 0) {
|
||||
prtall = 1;
|
||||
}
|
||||
else if(strncasecmp(*argv, "-X", 2) == 0) {
|
||||
} else if (strncasecmp(*argv, "-X", 2) == 0) {
|
||||
prtsep = 1;
|
||||
}
|
||||
else if(strncasecmp(*argv, "-T", 2) == 0) {
|
||||
} else if (strncasecmp(*argv, "-T", 2) == 0) {
|
||||
prttime = 1;
|
||||
}
|
||||
else if(strncasecmp(*argv, "-M=", 3) == 0) {
|
||||
} else if (strncasecmp(*argv, "-M=", 3) == 0) {
|
||||
long m = strtol((*argv)+3, NULL, 10);
|
||||
switch(m) {
|
||||
case 1:
|
||||
url = URL_1M;
|
||||
break;
|
||||
case 2:
|
||||
url = URL_2M;
|
||||
break;
|
||||
case 5:
|
||||
url = URL_5M;
|
||||
break;
|
||||
case 10:
|
||||
url = URL_10M;
|
||||
break;
|
||||
case 20:
|
||||
url = URL_20M;
|
||||
break;
|
||||
case 50:
|
||||
url = URL_50M;
|
||||
break;
|
||||
case 100:
|
||||
url = URL_100M;
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "\r%s: invalid parameter %s\n",
|
||||
appname, *argv + 3);
|
||||
exit(1);
|
||||
case 1: url = URL_1M;
|
||||
break;
|
||||
case 2: url = URL_2M;
|
||||
break;
|
||||
case 5: url = URL_5M;
|
||||
break;
|
||||
case 10: url = URL_10M;
|
||||
break;
|
||||
case 20: url = URL_20M;
|
||||
break;
|
||||
case 50: url = URL_50M;
|
||||
break;
|
||||
case 100: url = URL_100M;
|
||||
break;
|
||||
default: fprintf(stderr, "\r%s: invalid parameter %s\n",
|
||||
appname, *argv + 3);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
fprintf(stderr, "\r%s: invalid or unknown option %s\n",
|
||||
appname, *argv);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
url = *argv;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* print separator line */
|
||||
if(prtsep) {
|
||||
if (prtsep) {
|
||||
printf("-------------------------------------------------\n");
|
||||
}
|
||||
/* print localtime */
|
||||
if(prttime) {
|
||||
if (prttime) {
|
||||
time_t t = time(NULL);
|
||||
printf("Localtime: %s", ctime(&t));
|
||||
}
|
||||
@ -182,7 +163,7 @@ int main(int argc, char *argv[])
|
||||
if((CURLE_OK == res) && (val>0))
|
||||
printf("Average download speed: %0.3f kbyte/sec.\n", val / 1024);
|
||||
|
||||
if(prtall) {
|
||||
if (prtall) {
|
||||
/* check for name resolution time */
|
||||
res = curl_easy_getinfo(curl_handle, CURLINFO_NAMELOOKUP_TIME, &val);
|
||||
if((CURLE_OK == res) && (val>0))
|
||||
@ -193,8 +174,8 @@ int main(int argc, char *argv[])
|
||||
if((CURLE_OK == res) && (val>0))
|
||||
printf("Connect time: %0.3f sec.\n", val);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
} else {
|
||||
fprintf(stderr, "Error while fetching '%s' : %s\n",
|
||||
url, curl_easy_strerror(res));
|
||||
}
|
||||
|
@ -5,11 +5,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@ -19,10 +19,7 @@
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
/* <DESC>
|
||||
* Import and export cookies with COOKIELIST.
|
||||
* </DESC>
|
||||
*/
|
||||
/* This example shows usage of simple cookie interface. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@ -42,18 +39,17 @@ print_cookies(CURL *curl)
|
||||
|
||||
printf("Cookies, curl knows:\n");
|
||||
res = curl_easy_getinfo(curl, CURLINFO_COOKIELIST, &cookies);
|
||||
if(res != CURLE_OK) {
|
||||
fprintf(stderr, "Curl curl_easy_getinfo failed: %s\n",
|
||||
curl_easy_strerror(res));
|
||||
if (res != CURLE_OK) {
|
||||
fprintf(stderr, "Curl curl_easy_getinfo failed: %s\n", curl_easy_strerror(res));
|
||||
exit(1);
|
||||
}
|
||||
nc = cookies, i = 1;
|
||||
while(nc) {
|
||||
while (nc) {
|
||||
printf("[%d]: %s\n", i, nc->data);
|
||||
nc = nc->next;
|
||||
i++;
|
||||
}
|
||||
if(i == 1) {
|
||||
if (i == 1) {
|
||||
printf("(none)\n");
|
||||
}
|
||||
curl_slist_free_all(cookies);
|
||||
@ -67,14 +63,14 @@ main(void)
|
||||
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
if (curl) {
|
||||
char nline[256];
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://www.example.com/");
|
||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, ""); /* start cookie engine */
|
||||
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, ""); /* just to start the cookie engine */
|
||||
res = curl_easy_perform(curl);
|
||||
if(res != CURLE_OK) {
|
||||
if (res != CURLE_OK) {
|
||||
fprintf(stderr, "Curl perform failed: %s\n", curl_easy_strerror(res));
|
||||
return 1;
|
||||
}
|
||||
@ -93,41 +89,30 @@ main(void)
|
||||
#endif
|
||||
/* Netscape format cookie */
|
||||
snprintf(nline, sizeof(nline), "%s\t%s\t%s\t%s\t%lu\t%s\t%s",
|
||||
".google.com", "TRUE", "/", "FALSE",
|
||||
(unsigned long)time(NULL) + 31337UL,
|
||||
"PREF", "hello google, i like you very much!");
|
||||
".google.com", "TRUE", "/", "FALSE", (unsigned long)time(NULL) + 31337UL, "PREF", "hello google, i like you very much!");
|
||||
res = curl_easy_setopt(curl, CURLOPT_COOKIELIST, nline);
|
||||
if(res != CURLE_OK) {
|
||||
fprintf(stderr, "Curl curl_easy_setopt failed: %s\n",
|
||||
curl_easy_strerror(res));
|
||||
if (res != CURLE_OK) {
|
||||
fprintf(stderr, "Curl curl_easy_setopt failed: %s\n", curl_easy_strerror(res));
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* HTTP-header style cookie. If you use the Set-Cookie format and don't
|
||||
specify a domain then the cookie is sent for any domain and will not be
|
||||
modified, likely not what you intended. Starting in 7.43.0 any-domain
|
||||
cookies will not be exported either. For more information refer to the
|
||||
CURLOPT_COOKIELIST documentation.
|
||||
*/
|
||||
/* HTTP-header style cookie */
|
||||
snprintf(nline, sizeof(nline),
|
||||
"Set-Cookie: OLD_PREF=3d141414bf4209321; "
|
||||
"expires=Sun, 17-Jan-2038 19:14:07 GMT; path=/; domain=.google.com");
|
||||
res = curl_easy_setopt(curl, CURLOPT_COOKIELIST, nline);
|
||||
if(res != CURLE_OK) {
|
||||
fprintf(stderr, "Curl curl_easy_setopt failed: %s\n",
|
||||
curl_easy_strerror(res));
|
||||
if (res != CURLE_OK) {
|
||||
fprintf(stderr, "Curl curl_easy_setopt failed: %s\n", curl_easy_strerror(res));
|
||||
return 1;
|
||||
}
|
||||
|
||||
print_cookies(curl);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
if(res != CURLE_OK) {
|
||||
if (res != CURLE_OK) {
|
||||
fprintf(stderr, "Curl perform failed: %s\n", curl_easy_strerror(res));
|
||||
return 1;
|
||||
}
|
||||
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "Curl init failed!\n");
|
||||
|
@ -5,12 +5,9 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (c) 2000 David Odin (aka DindinX) for MandrakeSoft
|
||||
*/
|
||||
/* <DESC>
|
||||
* use the libcurl in a gtk-threaded application
|
||||
* </DESC>
|
||||
*/
|
||||
/* Copyright (c) 2000 David Odin (aka DindinX) for MandrakeSoft */
|
||||
/* an attempt to use the curl library in concert with a gtk-threaded application */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <gtk/gtk.h>
|
||||
@ -50,9 +47,9 @@ void *my_thread(void *ptr)
|
||||
gchar *url = ptr;
|
||||
|
||||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
const char *filename = "test.curl";
|
||||
outfile = fopen(filename, "wb");
|
||||
if(curl)
|
||||
{
|
||||
outfile = fopen("test.curl", "w");
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, url);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, outfile);
|
||||
@ -97,7 +94,7 @@ int main(int argc, char **argv)
|
||||
gtk_container_add(GTK_CONTAINER(Frame2), Bar);
|
||||
gtk_widget_show_all(Window);
|
||||
|
||||
if(!g_thread_create(&my_thread, argv[1], FALSE, NULL) != 0)
|
||||
if (!g_thread_create(&my_thread, argv[1], FALSE, NULL) != 0)
|
||||
g_warning("can't create the thread");
|
||||
|
||||
|
||||
|
@ -9,10 +9,7 @@
|
||||
certificate presented during ssl session establishment.
|
||||
|
||||
*/
|
||||
/* <DESC>
|
||||
* demonstrates use of SSL context callback, requires OpenSSL
|
||||
* </DESC>
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Copyright (c) 2003 The OpenEvidence Project. All rights reserved.
|
||||
@ -36,7 +33,7 @@
|
||||
* "This product includes software developed by the Openevidence Project
|
||||
* for use in the OpenEvidence Toolkit. (http://www.openevidence.org/)"
|
||||
* This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (https://www.openssl.org/)"
|
||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com)."
|
||||
@ -55,7 +52,7 @@
|
||||
* "This product includes software developed by the OpenEvidence Project
|
||||
* for use in the OpenEvidence Toolkit (http://www.openevidence.org/)
|
||||
* This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (https://www.openssl.org/)"
|
||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com)."
|
||||
@ -75,7 +72,7 @@
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (https://www.openssl.org/)
|
||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
@ -101,18 +98,13 @@
|
||||
static const char *curlx_usage[]={
|
||||
"usage: curlx args\n",
|
||||
" -p12 arg - tia file ",
|
||||
" -envpass arg - environement variable which content the tia private"
|
||||
" key password",
|
||||
" -envpass arg - environement variable which content the tia private key password",
|
||||
" -out arg - output file (response)- default stdout",
|
||||
" -in arg - input file (request)- default stdin",
|
||||
" -connect arg - URL of the server for the connection ex:"
|
||||
" www.openevidence.org",
|
||||
" -mimetype arg - MIME type for data in ex : application/timestamp-query"
|
||||
" or application/dvcs -default application/timestamp-query",
|
||||
" -acceptmime arg - MIME type acceptable for the response ex : "
|
||||
"application/timestamp-response or application/dvcs -default none",
|
||||
" -accesstype arg - an Object identifier in an AIA/SIA method, e.g."
|
||||
" AD_DVCS or ad_timestamping",
|
||||
" -connect arg - URL of the server for the connection ex: www.openevidence.org",
|
||||
" -mimetype arg - MIME type for data in ex : application/timestamp-query or application/dvcs -default application/timestamp-query",
|
||||
" -acceptmime arg - MIME type acceptable for the response ex : application/timestamp-response or application/dvcs -default none",
|
||||
" -accesstype arg - an Object identifier in an AIA/SIA method, e.g. AD_DVCS or ad_timestamping",
|
||||
NULL
|
||||
};
|
||||
|
||||
@ -133,22 +125,22 @@ static const char *curlx_usage[]={
|
||||
/* This is a context that we pass to all callbacks */
|
||||
|
||||
typedef struct sslctxparm_st {
|
||||
unsigned char * p12file;
|
||||
const char * pst;
|
||||
PKCS12 * p12;
|
||||
EVP_PKEY * pkey;
|
||||
X509 * usercert;
|
||||
STACK_OF(X509) * ca;
|
||||
unsigned char * p12file ;
|
||||
const char * pst ;
|
||||
PKCS12 * p12 ;
|
||||
EVP_PKEY * pkey ;
|
||||
X509 * usercert ;
|
||||
STACK_OF(X509) * ca ;
|
||||
CURL * curl;
|
||||
BIO * errorbio;
|
||||
int accesstype;
|
||||
int accesstype ;
|
||||
int verbose;
|
||||
|
||||
} sslctxparm;
|
||||
|
||||
/* some helper function. */
|
||||
|
||||
static char *ia5string(ASN1_IA5STRING *ia5)
|
||||
static char *i2s_ASN1_IA5STRING( ASN1_IA5STRING *ia5)
|
||||
{
|
||||
char *tmp;
|
||||
if(!ia5 || !ia5->length)
|
||||
@ -160,20 +152,20 @@ static char *ia5string(ASN1_IA5STRING *ia5)
|
||||
}
|
||||
|
||||
/* A conveniance routine to get an access URI. */
|
||||
static unsigned char *my_get_ext(X509 *cert, const int type,
|
||||
int extensiontype)
|
||||
{
|
||||
int i;
|
||||
STACK_OF(ACCESS_DESCRIPTION) * accessinfo;
|
||||
accessinfo = X509_get_ext_d2i(cert, extensiontype, NULL, NULL);
|
||||
|
||||
if(!sk_ACCESS_DESCRIPTION_num(accessinfo))
|
||||
static unsigned char *my_get_ext(X509 * cert, const int type, int extensiontype) {
|
||||
|
||||
int i;
|
||||
STACK_OF(ACCESS_DESCRIPTION) * accessinfo ;
|
||||
accessinfo = X509_get_ext_d2i(cert, extensiontype, NULL, NULL) ;
|
||||
|
||||
if (!sk_ACCESS_DESCRIPTION_num(accessinfo))
|
||||
return NULL;
|
||||
for(i = 0; i < sk_ACCESS_DESCRIPTION_num(accessinfo); i++) {
|
||||
for (i = 0; i < sk_ACCESS_DESCRIPTION_num(accessinfo); i++) {
|
||||
ACCESS_DESCRIPTION * ad = sk_ACCESS_DESCRIPTION_value(accessinfo, i);
|
||||
if(OBJ_obj2nid(ad->method) == type) {
|
||||
if(ad->location->type == GEN_URI) {
|
||||
return ia5string(ad->location->d.ia5);
|
||||
if (OBJ_obj2nid(ad->method) == type) {
|
||||
if (ad->location->type == GEN_URI) {
|
||||
return i2s_ASN1_IA5STRING(ad->location->d.ia5);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@ -192,86 +184,84 @@ static int ssl_app_verify_callback(X509_STORE_CTX *ctx, void *arg)
|
||||
sslctxparm * p = (sslctxparm *) arg;
|
||||
int ok;
|
||||
|
||||
if(p->verbose > 2)
|
||||
BIO_printf(p->errorbio, "entering ssl_app_verify_callback\n");
|
||||
if (p->verbose > 2)
|
||||
BIO_printf(p->errorbio,"entering ssl_app_verify_callback\n");
|
||||
|
||||
if((ok= X509_verify_cert(ctx)) && ctx->cert) {
|
||||
unsigned char * accessinfo;
|
||||
if(p->verbose > 1)
|
||||
X509_print_ex(p->errorbio, ctx->cert, 0, 0);
|
||||
if ((ok= X509_verify_cert(ctx)) && ctx->cert) {
|
||||
unsigned char * accessinfo ;
|
||||
if (p->verbose > 1)
|
||||
X509_print_ex(p->errorbio,ctx->cert,0,0);
|
||||
|
||||
if(accessinfo = my_get_ext(ctx->cert, p->accesstype, NID_sinfo_access)) {
|
||||
if(p->verbose)
|
||||
BIO_printf(p->errorbio, "Setting URL from SIA to: %s\n", accessinfo);
|
||||
if (accessinfo = my_get_ext(ctx->cert,p->accesstype ,NID_sinfo_access)) {
|
||||
if (p->verbose)
|
||||
BIO_printf(p->errorbio,"Setting URL from SIA to: %s\n", accessinfo);
|
||||
|
||||
curl_easy_setopt(p->curl, CURLOPT_URL, accessinfo);
|
||||
curl_easy_setopt(p->curl, CURLOPT_URL,accessinfo);
|
||||
}
|
||||
else if(accessinfo = my_get_ext(ctx->cert, p->accesstype,
|
||||
NID_info_access)) {
|
||||
if(p->verbose)
|
||||
BIO_printf(p->errorbio, "Setting URL from AIA to: %s\n", accessinfo);
|
||||
else if (accessinfo = my_get_ext(ctx->cert,p->accesstype,
|
||||
NID_info_access)) {
|
||||
if (p->verbose)
|
||||
BIO_printf(p->errorbio,"Setting URL from AIA to: %s\n", accessinfo);
|
||||
|
||||
curl_easy_setopt(p->curl, CURLOPT_URL, accessinfo);
|
||||
curl_easy_setopt(p->curl, CURLOPT_URL,accessinfo);
|
||||
}
|
||||
}
|
||||
if(p->verbose > 2)
|
||||
BIO_printf(p->errorbio, "leaving ssl_app_verify_callback with %d\n", ok);
|
||||
|
||||
return ok;
|
||||
if (p->verbose > 2)
|
||||
BIO_printf(p->errorbio,"leaving ssl_app_verify_callback with %d\n", ok);
|
||||
return(ok);
|
||||
}
|
||||
|
||||
|
||||
/* The SSL initialisation callback. The callback sets:
|
||||
/* This is an example of an curl SSL initialisation call back. The callback sets:
|
||||
- a private key and certificate
|
||||
- a trusted ca certificate
|
||||
- a preferred cipherlist
|
||||
- an application verification callback (the function above)
|
||||
*/
|
||||
|
||||
static CURLcode sslctxfun(CURL * curl, void * sslctx, void * parm)
|
||||
{
|
||||
static CURLcode sslctxfun(CURL * curl, void * sslctx, void * parm) {
|
||||
|
||||
sslctxparm * p = (sslctxparm *) parm;
|
||||
SSL_CTX * ctx = (SSL_CTX *) sslctx;
|
||||
SSL_CTX * ctx = (SSL_CTX *) sslctx ;
|
||||
|
||||
if(!SSL_CTX_use_certificate(ctx, p->usercert)) {
|
||||
BIO_printf(p->errorbio, "SSL_CTX_use_certificate problem\n");
|
||||
goto err;
|
||||
if (!SSL_CTX_use_certificate(ctx,p->usercert)) {
|
||||
BIO_printf(p->errorbio, "SSL_CTX_use_certificate problem\n"); goto err;
|
||||
}
|
||||
if(!SSL_CTX_use_PrivateKey(ctx, p->pkey)) {
|
||||
BIO_printf(p->errorbio, "SSL_CTX_use_PrivateKey\n");
|
||||
goto err;
|
||||
if (!SSL_CTX_use_PrivateKey(ctx,p->pkey)) {
|
||||
BIO_printf(p->errorbio, "SSL_CTX_use_PrivateKey\n"); goto err;
|
||||
}
|
||||
|
||||
if(!SSL_CTX_check_private_key(ctx)) {
|
||||
BIO_printf(p->errorbio, "SSL_CTX_check_private_key\n");
|
||||
goto err;
|
||||
if (!SSL_CTX_check_private_key(ctx)) {
|
||||
BIO_printf(p->errorbio, "SSL_CTX_check_private_key\n"); goto err;
|
||||
}
|
||||
|
||||
SSL_CTX_set_quiet_shutdown(ctx, 1);
|
||||
SSL_CTX_set_cipher_list(ctx, "RC4-MD5");
|
||||
SSL_CTX_set_quiet_shutdown(ctx,1);
|
||||
SSL_CTX_set_cipher_list(ctx,"RC4-MD5");
|
||||
SSL_CTX_set_mode(ctx, SSL_MODE_AUTO_RETRY);
|
||||
|
||||
X509_STORE_add_cert(SSL_CTX_get_cert_store(ctx),
|
||||
sk_X509_value(p->ca, sk_X509_num(p->ca)-1));
|
||||
X509_STORE_add_cert(SSL_CTX_get_cert_store(ctx), sk_X509_value(p->ca, sk_X509_num(p->ca)-1));
|
||||
|
||||
SSL_CTX_set_verify_depth(ctx,2);
|
||||
|
||||
SSL_CTX_set_verify(ctx,SSL_VERIFY_PEER,ZERO_NULL);
|
||||
|
||||
SSL_CTX_set_verify_depth(ctx, 2);
|
||||
SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, ZERO_NULL);
|
||||
SSL_CTX_set_cert_verify_callback(ctx, ssl_app_verify_callback, parm);
|
||||
|
||||
return CURLE_OK;
|
||||
|
||||
return CURLE_OK ;
|
||||
err:
|
||||
ERR_print_errors(p->errorbio);
|
||||
return CURLE_SSL_CERTPROBLEM;
|
||||
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
BIO* in=NULL;
|
||||
BIO* out=NULL;
|
||||
|
||||
char * outfile = NULL;
|
||||
char * infile = NULL;
|
||||
char * infile = NULL ;
|
||||
|
||||
int tabLength=100;
|
||||
char *binaryptr;
|
||||
@ -280,7 +270,7 @@ int main(int argc, char **argv)
|
||||
char* contenttype;
|
||||
const char** pp;
|
||||
unsigned char* hostporturl = NULL;
|
||||
BIO * p12bio;
|
||||
BIO * p12bio ;
|
||||
char **args = argv + 1;
|
||||
unsigned char * serverurl;
|
||||
sslctxparm p;
|
||||
@ -303,91 +293,66 @@ int main(int argc, char **argv)
|
||||
OpenSSL_add_all_digests();
|
||||
ERR_load_crypto_strings();
|
||||
|
||||
while(*args && *args[0] == '-') {
|
||||
if(!strcmp (*args, "-in")) {
|
||||
if(args[1]) {
|
||||
|
||||
|
||||
while (*args && *args[0] == '-') {
|
||||
if (!strcmp (*args, "-in")) {
|
||||
if (args[1]) {
|
||||
infile=*(++args);
|
||||
}
|
||||
else
|
||||
badarg=1;
|
||||
}
|
||||
else if(!strcmp (*args, "-out")) {
|
||||
if(args[1]) {
|
||||
} else badarg=1;
|
||||
} else if (!strcmp (*args, "-out")) {
|
||||
if (args[1]) {
|
||||
outfile=*(++args);
|
||||
}
|
||||
else
|
||||
badarg=1;
|
||||
}
|
||||
else if(!strcmp (*args, "-p12")) {
|
||||
if(args[1]) {
|
||||
} else badarg=1;
|
||||
} else if (!strcmp (*args, "-p12")) {
|
||||
if (args[1]) {
|
||||
p.p12file = *(++args);
|
||||
}
|
||||
else
|
||||
badarg=1;
|
||||
}
|
||||
else if(strcmp(*args, "-envpass") == 0) {
|
||||
if(args[1]) {
|
||||
} else badarg=1;
|
||||
} else if (strcmp(*args,"-envpass") == 0) {
|
||||
if (args[1]) {
|
||||
p.pst = getenv(*(++args));
|
||||
}
|
||||
else
|
||||
badarg=1;
|
||||
}
|
||||
else if(strcmp(*args, "-connect") == 0) {
|
||||
if(args[1]) {
|
||||
} else badarg=1;
|
||||
} else if (strcmp(*args,"-connect") == 0) {
|
||||
if (args[1]) {
|
||||
hostporturl = *(++args);
|
||||
}
|
||||
else
|
||||
badarg=1;
|
||||
}
|
||||
else if(strcmp(*args, "-mimetype") == 0) {
|
||||
if(args[1]) {
|
||||
} else badarg=1;
|
||||
} else if (strcmp(*args,"-mimetype") == 0) {
|
||||
if (args[1]) {
|
||||
mimetype = *(++args);
|
||||
}
|
||||
else
|
||||
badarg=1;
|
||||
}
|
||||
else if(strcmp(*args, "-acceptmime") == 0) {
|
||||
if(args[1]) {
|
||||
} else badarg=1;
|
||||
} else if (strcmp(*args,"-acceptmime") == 0) {
|
||||
if (args[1]) {
|
||||
mimetypeaccept = *(++args);
|
||||
}
|
||||
else
|
||||
badarg=1;
|
||||
}
|
||||
else if(strcmp(*args, "-accesstype") == 0) {
|
||||
if(args[1]) {
|
||||
if((p.accesstype = OBJ_obj2nid(OBJ_txt2obj(*++args, 0))) == 0)
|
||||
badarg=1;
|
||||
}
|
||||
else
|
||||
badarg=1;
|
||||
}
|
||||
else if(strcmp(*args, "-verbose") == 0) {
|
||||
} else badarg=1;
|
||||
} else if (strcmp(*args,"-accesstype") == 0) {
|
||||
if (args[1]) {
|
||||
if ((p.accesstype = OBJ_obj2nid(OBJ_txt2obj(*++args,0))) == 0) badarg=1;
|
||||
} else badarg=1;
|
||||
} else if (strcmp(*args,"-verbose") == 0) {
|
||||
p.verbose++;
|
||||
}
|
||||
else
|
||||
badarg=1;
|
||||
} else badarg=1;
|
||||
args++;
|
||||
}
|
||||
|
||||
if(mimetype==NULL || mimetypeaccept == NULL)
|
||||
badarg = 1;
|
||||
if (mimetype==NULL || mimetypeaccept == NULL) badarg = 1;
|
||||
|
||||
if(badarg) {
|
||||
for(pp=curlx_usage; (*pp != NULL); pp++)
|
||||
BIO_printf(p.errorbio, "%s\n", *pp);
|
||||
BIO_printf(p.errorbio, "\n");
|
||||
if (badarg) {
|
||||
for (pp=curlx_usage; (*pp != NULL); pp++)
|
||||
BIO_printf(p.errorbio,"%s\n",*pp);
|
||||
BIO_printf(p.errorbio,"\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* set input */
|
||||
|
||||
if((in=BIO_new(BIO_s_file())) == NULL) {
|
||||
if ((in=BIO_new(BIO_s_file())) == NULL) {
|
||||
BIO_printf(p.errorbio, "Error setting input bio\n");
|
||||
goto err;
|
||||
}
|
||||
else if(infile == NULL)
|
||||
BIO_set_fp(in, stdin, BIO_NOCLOSE|BIO_FP_TEXT);
|
||||
else if(BIO_read_filename(in, infile) <= 0) {
|
||||
} else if (infile == NULL)
|
||||
BIO_set_fp(in,stdin,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||
else if (BIO_read_filename(in,infile) <= 0) {
|
||||
BIO_printf(p.errorbio, "Error opening input file %s\n", infile);
|
||||
BIO_free(in);
|
||||
goto err;
|
||||
@ -395,13 +360,12 @@ int main(int argc, char **argv)
|
||||
|
||||
/* set output */
|
||||
|
||||
if((out=BIO_new(BIO_s_file())) == NULL) {
|
||||
if ((out=BIO_new(BIO_s_file())) == NULL) {
|
||||
BIO_printf(p.errorbio, "Error setting output bio.\n");
|
||||
goto err;
|
||||
}
|
||||
else if(outfile == NULL)
|
||||
BIO_set_fp(out, stdout, BIO_NOCLOSE|BIO_FP_TEXT);
|
||||
else if(BIO_write_filename(out, outfile) <= 0) {
|
||||
} else if (outfile == NULL)
|
||||
BIO_set_fp(out,stdout,BIO_NOCLOSE|BIO_FP_TEXT);
|
||||
else if (BIO_write_filename(out,outfile) <= 0) {
|
||||
BIO_printf(p.errorbio, "Error opening output file %s\n", outfile);
|
||||
BIO_free(out);
|
||||
goto err;
|
||||
@ -410,66 +374,62 @@ int main(int argc, char **argv)
|
||||
|
||||
p.errorbio = BIO_new_fp (stderr, BIO_NOCLOSE);
|
||||
|
||||
if(!(p.curl = curl_easy_init())) {
|
||||
if (!(p.curl = curl_easy_init())) {
|
||||
BIO_printf(p.errorbio, "Cannot init curl lib\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
if(!(p12bio = BIO_new_file(p.p12file , "rb"))) {
|
||||
BIO_printf(p.errorbio, "Error opening P12 file %s\n", p.p12file);
|
||||
goto err;
|
||||
|
||||
|
||||
if (!(p12bio = BIO_new_file(p.p12file , "rb"))) {
|
||||
BIO_printf(p.errorbio, "Error opening P12 file %s\n", p.p12file); goto err;
|
||||
}
|
||||
if(!(p.p12 = d2i_PKCS12_bio (p12bio, NULL))) {
|
||||
BIO_printf(p.errorbio, "Cannot decode P12 structure %s\n", p.p12file);
|
||||
goto err;
|
||||
if (!(p.p12 = d2i_PKCS12_bio (p12bio, NULL))) {
|
||||
BIO_printf(p.errorbio, "Cannot decode P12 structure %s\n", p.p12file); goto err;
|
||||
}
|
||||
|
||||
p.ca= NULL;
|
||||
if(!(PKCS12_parse (p.p12, p.pst, &(p.pkey), &(p.usercert), &(p.ca) ) )) {
|
||||
BIO_printf(p.errorbio, "Invalid P12 structure in %s\n", p.p12file);
|
||||
goto err;
|
||||
if (!(PKCS12_parse (p.p12, p.pst, &(p.pkey), &(p.usercert), &(p.ca) ) )) {
|
||||
BIO_printf(p.errorbio,"Invalid P12 structure in %s\n", p.p12file); goto err;
|
||||
}
|
||||
|
||||
if(sk_X509_num(p.ca) <= 0) {
|
||||
BIO_printf(p.errorbio, "No trustworthy CA given.%s\n", p.p12file);
|
||||
goto err;
|
||||
if (sk_X509_num(p.ca) <= 0) {
|
||||
BIO_printf(p.errorbio,"No trustworthy CA given.%s\n", p.p12file); goto err;
|
||||
}
|
||||
|
||||
if(p.verbose > 1)
|
||||
X509_print_ex(p.errorbio, p.usercert, 0, 0);
|
||||
if (p.verbose > 1)
|
||||
X509_print_ex(p.errorbio,p.usercert,0,0);
|
||||
|
||||
/* determine URL to go */
|
||||
|
||||
if(hostporturl) {
|
||||
size_t len = strlen(hostporturl) + 9;
|
||||
serverurl = malloc(len);
|
||||
snprintf(serverurl, len, "https://%s", hostporturl);
|
||||
if (hostporturl) {
|
||||
serverurl = malloc(9+strlen(hostporturl));
|
||||
sprintf(serverurl,"https://%s",hostporturl);
|
||||
}
|
||||
else if(p.accesstype != 0) { /* see whether we can find an AIA or SIA for a
|
||||
given access type */
|
||||
if(!(serverurl = my_get_ext(p.usercert, p.accesstype, NID_info_access))) {
|
||||
else if (p.accesstype != 0) { /* see whether we can find an AIA or SIA for a given access type */
|
||||
if (!(serverurl = my_get_ext(p.usercert,p.accesstype,NID_info_access))) {
|
||||
int j=0;
|
||||
BIO_printf(p.errorbio, "no service URL in user cert "
|
||||
BIO_printf(p.errorbio,"no service URL in user cert "
|
||||
"cherching in others certificats\n");
|
||||
for(j=0; j<sk_X509_num(p.ca); j++) {
|
||||
if((serverurl = my_get_ext(sk_X509_value(p.ca, j), p.accesstype,
|
||||
for (j=0;j<sk_X509_num(p.ca);j++) {
|
||||
if ((serverurl = my_get_ext(sk_X509_value(p.ca,j),p.accesstype,
|
||||
NID_info_access)))
|
||||
break;
|
||||
if((serverurl = my_get_ext(sk_X509_value(p.ca, j), p.accesstype,
|
||||
if ((serverurl = my_get_ext(sk_X509_value(p.ca,j),p.accesstype,
|
||||
NID_sinfo_access)))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!serverurl) {
|
||||
if (!serverurl) {
|
||||
BIO_printf(p.errorbio, "no service URL in certificats,"
|
||||
" check '-accesstype (AD_DVCS | ad_timestamping)'"
|
||||
" or use '-connect'\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
if(p.verbose)
|
||||
if (p.verbose)
|
||||
BIO_printf(p.errorbio, "Service URL: <%s>\n", serverurl);
|
||||
|
||||
curl_easy_setopt(p.curl, CURLOPT_URL, serverurl);
|
||||
@ -477,39 +437,38 @@ int main(int argc, char **argv)
|
||||
/* Now specify the POST binary data */
|
||||
|
||||
curl_easy_setopt(p.curl, CURLOPT_POSTFIELDS, binaryptr);
|
||||
curl_easy_setopt(p.curl, CURLOPT_POSTFIELDSIZE, (long)tabLength);
|
||||
curl_easy_setopt(p.curl, CURLOPT_POSTFIELDSIZE,(long)tabLength);
|
||||
|
||||
/* pass our list of custom made headers */
|
||||
|
||||
contenttype = malloc(15+strlen(mimetype));
|
||||
snprintf(contenttype, 15+strlen(mimetype), "Content-type: %s", mimetype);
|
||||
headers = curl_slist_append(headers, contenttype);
|
||||
sprintf(contenttype,"Content-type: %s",mimetype);
|
||||
headers = curl_slist_append(headers,contenttype);
|
||||
curl_easy_setopt(p.curl, CURLOPT_HTTPHEADER, headers);
|
||||
|
||||
if(p.verbose)
|
||||
if (p.verbose)
|
||||
BIO_printf(p.errorbio, "Service URL: <%s>\n", serverurl);
|
||||
|
||||
{
|
||||
FILE *outfp;
|
||||
BIO_get_fp(out, &outfp);
|
||||
BIO_get_fp(out,&outfp);
|
||||
curl_easy_setopt(p.curl, CURLOPT_WRITEDATA, outfp);
|
||||
}
|
||||
|
||||
res = curl_easy_setopt(p.curl, CURLOPT_SSL_CTX_FUNCTION, sslctxfun);
|
||||
res = curl_easy_setopt(p.curl, CURLOPT_SSL_CTX_FUNCTION, sslctxfun) ;
|
||||
|
||||
if(res != CURLE_OK)
|
||||
BIO_printf(p.errorbio, "%d %s=%d %d\n", __LINE__,
|
||||
"CURLOPT_SSL_CTX_FUNCTION", CURLOPT_SSL_CTX_FUNCTION, res);
|
||||
if (res != CURLE_OK)
|
||||
BIO_printf(p.errorbio,"%d %s=%d %d\n", __LINE__, "CURLOPT_SSL_CTX_FUNCTION",CURLOPT_SSL_CTX_FUNCTION,res);
|
||||
|
||||
curl_easy_setopt(p.curl, CURLOPT_SSL_CTX_DATA, &p);
|
||||
|
||||
{
|
||||
int lu; int i=0;
|
||||
while((lu = BIO_read (in, &binaryptr[i], tabLength-i)) >0 ) {
|
||||
while ((lu = BIO_read (in,&binaryptr[i],tabLength-i)) >0 ) {
|
||||
i+=lu;
|
||||
if(i== tabLength) {
|
||||
if (i== tabLength) {
|
||||
tabLength+=100;
|
||||
binaryptr=realloc(binaryptr, tabLength); /* should be more careful */
|
||||
binaryptr=realloc(binaryptr,tabLength); /* should be more careful */
|
||||
}
|
||||
}
|
||||
tabLength = i;
|
||||
@ -517,23 +476,23 @@ int main(int argc, char **argv)
|
||||
/* Now specify the POST binary data */
|
||||
|
||||
curl_easy_setopt(p.curl, CURLOPT_POSTFIELDS, binaryptr);
|
||||
curl_easy_setopt(p.curl, CURLOPT_POSTFIELDSIZE, (long)tabLength);
|
||||
curl_easy_setopt(p.curl, CURLOPT_POSTFIELDSIZE,(long)tabLength);
|
||||
|
||||
|
||||
/* Perform the request, res will get the return code */
|
||||
|
||||
BIO_printf(p.errorbio, "%d %s %d\n", __LINE__, "curl_easy_perform",
|
||||
BIO_printf(p.errorbio,"%d %s %d\n", __LINE__, "curl_easy_perform",
|
||||
res = curl_easy_perform(p.curl));
|
||||
{
|
||||
int result =curl_easy_getinfo(p.curl, CURLINFO_CONTENT_TYPE, &response);
|
||||
if(mimetypeaccept && p.verbose)
|
||||
if(!strcmp(mimetypeaccept, response))
|
||||
BIO_printf(p.errorbio, "the response has a correct mimetype : %s\n",
|
||||
int result =curl_easy_getinfo(p.curl,CURLINFO_CONTENT_TYPE,&response);
|
||||
if( mimetypeaccept && p.verbose)
|
||||
if(!strcmp(mimetypeaccept,response))
|
||||
BIO_printf(p.errorbio,"the response has a correct mimetype : %s\n",
|
||||
response);
|
||||
else
|
||||
BIO_printf(p.errorbio, "the response doesn\'t have an acceptable "
|
||||
BIO_printf(p.errorbio,"the reponse doesn\'t has an acceptable "
|
||||
"mime type, it is %s instead of %s\n",
|
||||
response, mimetypeaccept);
|
||||
response,mimetypeaccept);
|
||||
}
|
||||
|
||||
/*** code d'erreur si accept mime ***, egalement code return HTTP != 200 ***/
|
||||
@ -549,6 +508,6 @@ int main(int argc, char **argv)
|
||||
BIO_free(out);
|
||||
return (EXIT_SUCCESS);
|
||||
|
||||
err: BIO_printf(p.errorbio, "error");
|
||||
err: BIO_printf(p.errorbio,"error");
|
||||
exit(1);
|
||||
}
|
||||
|
@ -5,11 +5,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@ -19,10 +19,6 @@
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
/* <DESC>
|
||||
* Show how CURLOPT_DEBUGFUNCTION can be used.
|
||||
* </DESC>
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <curl/curl.h>
|
||||
|
||||
@ -62,14 +58,14 @@ void dump(const char *text,
|
||||
|
||||
for(c = 0; (c < width) && (i+c < size); c++) {
|
||||
/* check for 0D0A; if found, skip past and start a new line of output */
|
||||
if(nohex && (i+c+1 < size) && ptr[i+c]==0x0D && ptr[i+c+1]==0x0A) {
|
||||
if (nohex && (i+c+1 < size) && ptr[i+c]==0x0D && ptr[i+c+1]==0x0A) {
|
||||
i+=(c+2-width);
|
||||
break;
|
||||
}
|
||||
fprintf(stream, "%c",
|
||||
(ptr[i+c]>=0x20) && (ptr[i+c]<0x80)?ptr[i+c]:'.');
|
||||
/* check again for 0D0A, to avoid an extra \n if it's at width */
|
||||
if(nohex && (i+c+2 < size) && ptr[i+c+1]==0x0D && ptr[i+c+2]==0x0A) {
|
||||
if (nohex && (i+c+2 < size) && ptr[i+c+1]==0x0D && ptr[i+c+2]==0x0A) {
|
||||
i+=(c+3-width);
|
||||
break;
|
||||
}
|
||||
|
@ -5,11 +5,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@ -19,10 +19,6 @@
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
/* <DESC>
|
||||
* multi socket interface together with libev
|
||||
* </DESC>
|
||||
*/
|
||||
/* Example application source code using the multi socket interface to
|
||||
* download many files at once.
|
||||
*
|
||||
@ -119,12 +115,12 @@ static int multi_timer_cb(CURLM *multi, long timeout_ms, GlobalInfo *g)
|
||||
{
|
||||
DPRINT("%s %li\n", __PRETTY_FUNCTION__, timeout_ms);
|
||||
ev_timer_stop(g->loop, &g->timer_event);
|
||||
if(timeout_ms > 0) {
|
||||
if (timeout_ms > 0)
|
||||
{
|
||||
double t = timeout_ms / 1000;
|
||||
ev_timer_init(&g->timer_event, timer_cb, t, 0.);
|
||||
ev_timer_start(g->loop, &g->timer_event);
|
||||
}
|
||||
else
|
||||
}else
|
||||
timer_cb(g->loop, &g->timer_event, 0);
|
||||
return 0;
|
||||
}
|
||||
@ -132,32 +128,20 @@ static int multi_timer_cb(CURLM *multi, long timeout_ms, GlobalInfo *g)
|
||||
/* Die if we get a bad CURLMcode somewhere */
|
||||
static void mcode_or_die(const char *where, CURLMcode code)
|
||||
{
|
||||
if(CURLM_OK != code) {
|
||||
if ( CURLM_OK != code )
|
||||
{
|
||||
const char *s;
|
||||
switch (code) {
|
||||
case CURLM_BAD_HANDLE:
|
||||
s="CURLM_BAD_HANDLE";
|
||||
switch ( code )
|
||||
{
|
||||
case CURLM_BAD_HANDLE: s="CURLM_BAD_HANDLE"; break;
|
||||
case CURLM_BAD_EASY_HANDLE: s="CURLM_BAD_EASY_HANDLE"; break;
|
||||
case CURLM_OUT_OF_MEMORY: s="CURLM_OUT_OF_MEMORY"; break;
|
||||
case CURLM_INTERNAL_ERROR: s="CURLM_INTERNAL_ERROR"; break;
|
||||
case CURLM_UNKNOWN_OPTION: s="CURLM_UNKNOWN_OPTION"; break;
|
||||
case CURLM_LAST: s="CURLM_LAST"; break;
|
||||
default: s="CURLM_unknown";
|
||||
break;
|
||||
case CURLM_BAD_EASY_HANDLE:
|
||||
s="CURLM_BAD_EASY_HANDLE";
|
||||
break;
|
||||
case CURLM_OUT_OF_MEMORY:
|
||||
s="CURLM_OUT_OF_MEMORY";
|
||||
break;
|
||||
case CURLM_INTERNAL_ERROR:
|
||||
s="CURLM_INTERNAL_ERROR";
|
||||
break;
|
||||
case CURLM_UNKNOWN_OPTION:
|
||||
s="CURLM_UNKNOWN_OPTION";
|
||||
break;
|
||||
case CURLM_LAST:
|
||||
s="CURLM_LAST";
|
||||
break;
|
||||
default:
|
||||
s="CURLM_unknown";
|
||||
break;
|
||||
case CURLM_BAD_SOCKET:
|
||||
s="CURLM_BAD_SOCKET";
|
||||
case CURLM_BAD_SOCKET: s="CURLM_BAD_SOCKET";
|
||||
fprintf(MSG_OUT, "ERROR: %s returns %s\n", where, s);
|
||||
/* ignore this error */
|
||||
return;
|
||||
@ -180,8 +164,8 @@ static void check_multi_info(GlobalInfo *g)
|
||||
CURLcode res;
|
||||
|
||||
fprintf(MSG_OUT, "REMAINING: %d\n", g->still_running);
|
||||
while((msg = curl_multi_info_read(g->multi, &msgs_left))) {
|
||||
if(msg->msg == CURLMSG_DONE) {
|
||||
while ((msg = curl_multi_info_read(g->multi, &msgs_left))) {
|
||||
if (msg->msg == CURLMSG_DONE) {
|
||||
easy = msg->easy_handle;
|
||||
res = msg->data.result;
|
||||
curl_easy_getinfo(easy, CURLINFO_PRIVATE, &conn);
|
||||
@ -209,7 +193,8 @@ static void event_cb(EV_P_ struct ev_io *w, int revents)
|
||||
rc = curl_multi_socket_action(g->multi, w->fd, action, &g->still_running);
|
||||
mcode_or_die("event_cb: curl_multi_socket_action", rc);
|
||||
check_multi_info(g);
|
||||
if(g->still_running <= 0) {
|
||||
if ( g->still_running <= 0 )
|
||||
{
|
||||
fprintf(MSG_OUT, "last transfer done, kill timeout\n");
|
||||
ev_timer_stop(g->loop, &g->timer_event);
|
||||
}
|
||||
@ -223,8 +208,7 @@ static void timer_cb(EV_P_ struct ev_timer *w, int revents)
|
||||
GlobalInfo *g = (GlobalInfo *)w->data;
|
||||
CURLMcode rc;
|
||||
|
||||
rc = curl_multi_socket_action(g->multi, CURL_SOCKET_TIMEOUT, 0,
|
||||
&g->still_running);
|
||||
rc = curl_multi_socket_action(g->multi, CURL_SOCKET_TIMEOUT, 0, &g->still_running);
|
||||
mcode_or_die("timer_cb: curl_multi_socket_action", rc);
|
||||
check_multi_info(g);
|
||||
}
|
||||
@ -233,8 +217,9 @@ static void timer_cb(EV_P_ struct ev_timer *w, int revents)
|
||||
static void remsock(SockInfo *f, GlobalInfo *g)
|
||||
{
|
||||
printf("%s \n", __PRETTY_FUNCTION__);
|
||||
if(f) {
|
||||
if(f->evset)
|
||||
if ( f )
|
||||
{
|
||||
if ( f->evset )
|
||||
ev_io_stop(g->loop, &f->ev);
|
||||
free(f);
|
||||
}
|
||||
@ -252,7 +237,7 @@ static void setsock(SockInfo*f, curl_socket_t s, CURL*e, int act, GlobalInfo*g)
|
||||
f->sockfd = s;
|
||||
f->action = act;
|
||||
f->easy = e;
|
||||
if(f->evset)
|
||||
if ( f->evset )
|
||||
ev_io_stop(g->loop, &f->ev);
|
||||
ev_io_init(&f->ev, event_cb, f->sockfd, kind);
|
||||
f->ev.data = g;
|
||||
@ -284,16 +269,18 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
|
||||
|
||||
fprintf(MSG_OUT,
|
||||
"socket callback: s=%d e=%p what=%s ", s, e, whatstr[what]);
|
||||
if(what == CURL_POLL_REMOVE) {
|
||||
if ( what == CURL_POLL_REMOVE )
|
||||
{
|
||||
fprintf(MSG_OUT, "\n");
|
||||
remsock(fdp, g);
|
||||
}
|
||||
else {
|
||||
if(!fdp) {
|
||||
} else
|
||||
{
|
||||
if ( !fdp )
|
||||
{
|
||||
fprintf(MSG_OUT, "Adding data: %s\n", whatstr[what]);
|
||||
addsock(s, e, what, g);
|
||||
}
|
||||
else {
|
||||
} else
|
||||
{
|
||||
fprintf(MSG_OUT,
|
||||
"Changing action from %s to %s\n",
|
||||
whatstr[fdp->action], whatstr[what]);
|
||||
@ -339,7 +326,8 @@ static void new_conn(char *url, GlobalInfo *g )
|
||||
conn->error[0]='\0';
|
||||
|
||||
conn->easy = curl_easy_init();
|
||||
if(!conn->easy) {
|
||||
if ( !conn->easy )
|
||||
{
|
||||
fprintf(MSG_OUT, "curl_easy_init() failed, exiting!\n");
|
||||
exit(2);
|
||||
}
|
||||
@ -374,16 +362,16 @@ static void fifo_cb(EV_P_ struct ev_io *w, int revents)
|
||||
int n=0;
|
||||
GlobalInfo *g = (GlobalInfo *)w->data;
|
||||
|
||||
do {
|
||||
do
|
||||
{
|
||||
s[0]='\0';
|
||||
rv=fscanf(g->input, "%1023s%n", s, &n);
|
||||
s[n]='\0';
|
||||
if(n && s[0]) {
|
||||
new_conn(s, g); /* if we read a URL, go get it! */
|
||||
}
|
||||
else
|
||||
break;
|
||||
} while(rv != EOF);
|
||||
if ( n && s[0] )
|
||||
{
|
||||
new_conn(s,g); /* if we read a URL, go get it! */
|
||||
} else break;
|
||||
} while ( rv != EOF );
|
||||
}
|
||||
|
||||
/* Create a named pipe and tell libevent to monitor it */
|
||||
@ -394,20 +382,24 @@ static int init_fifo (GlobalInfo *g)
|
||||
curl_socket_t sockfd;
|
||||
|
||||
fprintf(MSG_OUT, "Creating named pipe \"%s\"\n", fifo);
|
||||
if(lstat (fifo, &st) == 0) {
|
||||
if((st.st_mode & S_IFMT) == S_IFREG) {
|
||||
if ( lstat (fifo, &st) == 0 )
|
||||
{
|
||||
if ( (st.st_mode & S_IFMT) == S_IFREG )
|
||||
{
|
||||
errno = EEXIST;
|
||||
perror("lstat");
|
||||
exit (1);
|
||||
}
|
||||
}
|
||||
unlink(fifo);
|
||||
if(mkfifo (fifo, 0600) == -1) {
|
||||
if ( mkfifo (fifo, 0600) == -1 )
|
||||
{
|
||||
perror("mkfifo");
|
||||
exit (1);
|
||||
}
|
||||
sockfd = open(fifo, O_RDWR | O_NONBLOCK, 0);
|
||||
if(sockfd == -1) {
|
||||
if ( sockfd == -1 )
|
||||
{
|
||||
perror("open");
|
||||
exit (1);
|
||||
}
|
||||
@ -416,7 +408,7 @@ static int init_fifo (GlobalInfo *g)
|
||||
fprintf(MSG_OUT, "Now, pipe some URL's into > %s\n", fifo);
|
||||
ev_io_init(&g->fifo_event, fifo_cb, sockfd, EV_READ);
|
||||
ev_io_start(g->loop, &g->fifo_event);
|
||||
return (0);
|
||||
return(0);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
|
@ -5,11 +5,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@ -19,10 +19,9 @@
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
/* <DESC>
|
||||
* An example demonstrating how an application can pass in a custom
|
||||
/*
|
||||
* This is an example demonstrating how an application can pass in a custom
|
||||
* socket to libcurl to use. This example also handles the connect itself.
|
||||
* </DESC>
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@ -39,7 +38,7 @@
|
||||
#include <sys/socket.h> /* socket definitions */
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h> /* inet (3) funtions */
|
||||
#include <unistd.h> /* misc. Unix functions */
|
||||
#include <unistd.h> /* misc. UNIX functions */
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
@ -54,7 +53,7 @@
|
||||
|
||||
static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream)
|
||||
{
|
||||
size_t written = fwrite(ptr, size, nmemb, (FILE *)stream);
|
||||
int written = fwrite(ptr, size, nmemb, (FILE *)stream);
|
||||
return written;
|
||||
}
|
||||
|
||||
@ -92,7 +91,7 @@ int main(void)
|
||||
WSADATA wsaData;
|
||||
int initwsa;
|
||||
|
||||
if((initwsa = WSAStartup(MAKEWORD(2, 0), &wsaData)) != 0) {
|
||||
if((initwsa = WSAStartup(MAKEWORD(2,0), &wsaData)) != 0) {
|
||||
printf("WSAStartup failed: %d\n", initwsa);
|
||||
return 1;
|
||||
}
|
||||
@ -107,7 +106,7 @@ int main(void)
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://99.99.99.99:9999");
|
||||
|
||||
/* Create the socket "manually" */
|
||||
if((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == CURL_SOCKET_BAD ) {
|
||||
if( (sockfd = socket(AF_INET, SOCK_STREAM, 0)) == CURL_SOCKET_BAD ) {
|
||||
printf("Error creating listening socket.\n");
|
||||
return 3;
|
||||
}
|
||||
@ -116,10 +115,10 @@ int main(void)
|
||||
servaddr.sin_family = AF_INET;
|
||||
servaddr.sin_port = htons(PORTNUM);
|
||||
|
||||
if(INADDR_NONE == (servaddr.sin_addr.s_addr = inet_addr(IPADDR)))
|
||||
if (INADDR_NONE == (servaddr.sin_addr.s_addr = inet_addr(IPADDR)))
|
||||
return 2;
|
||||
|
||||
if(connect(sockfd, (struct sockaddr *) &servaddr, sizeof(servaddr)) ==
|
||||
if(connect(sockfd,(struct sockaddr *) &servaddr, sizeof(servaddr)) ==
|
||||
-1) {
|
||||
close(sockfd);
|
||||
printf("client error: connect: %s\n", strerror(errno));
|
||||
|
@ -5,11 +5,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@ -19,10 +19,6 @@
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
/* <DESC>
|
||||
* Upload to a file:// URL
|
||||
* </DESC>
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <curl/curl.h>
|
||||
#include <sys/stat.h>
|
||||
|
@ -42,10 +42,6 @@
|
||||
*
|
||||
* This example requires libcurl 7.9.7 or later.
|
||||
*/
|
||||
/* <DESC>
|
||||
* implements an fopen() abstraction allowing reading from URLs
|
||||
* </DESC>
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@ -80,7 +76,7 @@ struct fcurl_data
|
||||
typedef struct fcurl_data URL_FILE;
|
||||
|
||||
/* exported functions */
|
||||
URL_FILE *url_fopen(const char *url, const char *operation);
|
||||
URL_FILE *url_fopen(const char *url,const char *operation);
|
||||
int url_fclose(URL_FILE *file);
|
||||
int url_feof(URL_FILE *file);
|
||||
size_t url_fread(void *ptr, size_t size, size_t nmemb, URL_FILE *file);
|
||||
@ -106,13 +102,13 @@ static size_t write_callback(char *buffer,
|
||||
|
||||
if(size > rembuff) {
|
||||
/* not enough space in buffer */
|
||||
newbuff=realloc(url->buffer, url->buffer_len + (size - rembuff));
|
||||
newbuff=realloc(url->buffer,url->buffer_len + (size - rembuff));
|
||||
if(newbuff==NULL) {
|
||||
fprintf(stderr, "callback buffer grow failed\n");
|
||||
fprintf(stderr,"callback buffer grow failed\n");
|
||||
size=rembuff;
|
||||
}
|
||||
else {
|
||||
/* realloc succeeded increase buffer size*/
|
||||
/* realloc suceeded increase buffer size*/
|
||||
url->buffer_len+=size - rembuff;
|
||||
url->buffer=newbuff;
|
||||
}
|
||||
@ -132,10 +128,9 @@ static int fill_buffer(URL_FILE *file, size_t want)
|
||||
fd_set fdexcep;
|
||||
struct timeval timeout;
|
||||
int rc;
|
||||
CURLMcode mc; /* curl_multi_fdset() return code */
|
||||
|
||||
/* only attempt to fill buffer if transactions still running and buffer
|
||||
* doesn't exceed required size already
|
||||
* doesnt exceed required size already
|
||||
*/
|
||||
if((!file->still_running) || (file->buffer_pos > want))
|
||||
return 0;
|
||||
@ -163,34 +158,15 @@ static int fill_buffer(URL_FILE *file, size_t want)
|
||||
}
|
||||
|
||||
/* get file descriptors from the transfers */
|
||||
mc = curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
|
||||
curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
|
||||
|
||||
if(mc != CURLM_OK) {
|
||||
fprintf(stderr, "curl_multi_fdset() failed, code %d.\n", mc);
|
||||
break;
|
||||
}
|
||||
/* In a real-world program you OF COURSE check the return code of the
|
||||
function calls. On success, the value of maxfd is guaranteed to be
|
||||
greater or equal than -1. We call select(maxfd + 1, ...), specially
|
||||
in case of (maxfd == -1), we call select(0, ...), which is basically
|
||||
equal to sleep. */
|
||||
|
||||
/* On success the value of maxfd is guaranteed to be >= -1. We call
|
||||
select(maxfd + 1, ...); specially in case of (maxfd == -1) there are
|
||||
no fds ready yet so we call select(0, ...) --or Sleep() on Windows--
|
||||
to sleep 100ms, which is the minimum suggested value in the
|
||||
curl_multi_fdset() doc. */
|
||||
|
||||
if(maxfd == -1) {
|
||||
#ifdef _WIN32
|
||||
Sleep(100);
|
||||
rc = 0;
|
||||
#else
|
||||
/* Portable sleep for platforms other than Windows. */
|
||||
struct timeval wait = { 0, 100 * 1000 }; /* 100ms */
|
||||
rc = select(0, NULL, NULL, NULL, &wait);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
/* Note that on some platforms 'timeout' may be modified by select().
|
||||
If you need access to the original value save a copy beforehand. */
|
||||
rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
|
||||
}
|
||||
rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
|
||||
|
||||
switch(rc) {
|
||||
case -1:
|
||||
@ -208,12 +184,14 @@ static int fill_buffer(URL_FILE *file, size_t want)
|
||||
}
|
||||
|
||||
/* use to remove want bytes from the front of a files buffer */
|
||||
static int use_buffer(URL_FILE *file, size_t want)
|
||||
static int use_buffer(URL_FILE *file,int want)
|
||||
{
|
||||
/* sort out buffer */
|
||||
if((file->buffer_pos - want) <=0) {
|
||||
/* ditch buffer - write will recreate */
|
||||
free(file->buffer);
|
||||
if(file->buffer)
|
||||
free(file->buffer);
|
||||
|
||||
file->buffer=NULL;
|
||||
file->buffer_pos=0;
|
||||
file->buffer_len=0;
|
||||
@ -229,10 +207,10 @@ static int use_buffer(URL_FILE *file, size_t want)
|
||||
return 0;
|
||||
}
|
||||
|
||||
URL_FILE *url_fopen(const char *url, const char *operation)
|
||||
URL_FILE *url_fopen(const char *url,const char *operation)
|
||||
{
|
||||
/* this code could check for URLs or types in the 'url' and
|
||||
basically use the real fopen() for standard files */
|
||||
basicly use the real fopen() for standard files */
|
||||
|
||||
URL_FILE *file;
|
||||
(void)operation;
|
||||
@ -243,7 +221,7 @@ URL_FILE *url_fopen(const char *url, const char *operation)
|
||||
|
||||
memset(file, 0, sizeof(URL_FILE));
|
||||
|
||||
if((file->handle.file=fopen(url, operation)))
|
||||
if((file->handle.file=fopen(url,operation)))
|
||||
file->type = CFTYPE_FILE; /* marked as URL */
|
||||
|
||||
else {
|
||||
@ -303,7 +281,9 @@ int url_fclose(URL_FILE *file)
|
||||
break;
|
||||
}
|
||||
|
||||
free(file->buffer);/* free any allocated buffer space */
|
||||
if(file->buffer)
|
||||
free(file->buffer);/* free any allocated buffer space */
|
||||
|
||||
free(file);
|
||||
|
||||
return ret;
|
||||
@ -337,13 +317,13 @@ size_t url_fread(void *ptr, size_t size, size_t nmemb, URL_FILE *file)
|
||||
|
||||
switch(file->type) {
|
||||
case CFTYPE_FILE:
|
||||
want=fread(ptr, size, nmemb, file->handle.file);
|
||||
want=fread(ptr,size,nmemb,file->handle.file);
|
||||
break;
|
||||
|
||||
case CFTYPE_CURL:
|
||||
want = nmemb * size;
|
||||
|
||||
fill_buffer(file, want);
|
||||
fill_buffer(file,want);
|
||||
|
||||
/* check if theres data in the buffer - if not fill_buffer()
|
||||
* either errored or EOF */
|
||||
@ -357,7 +337,7 @@ size_t url_fread(void *ptr, size_t size, size_t nmemb, URL_FILE *file)
|
||||
/* xfer data to caller */
|
||||
memcpy(ptr, file->buffer, want);
|
||||
|
||||
use_buffer(file, want);
|
||||
use_buffer(file,want);
|
||||
|
||||
want = want / size; /* number of items */
|
||||
break;
|
||||
@ -378,11 +358,11 @@ char *url_fgets(char *ptr, size_t size, URL_FILE *file)
|
||||
|
||||
switch(file->type) {
|
||||
case CFTYPE_FILE:
|
||||
ptr = fgets(ptr, (int)size, file->handle.file);
|
||||
ptr = fgets(ptr,size,file->handle.file);
|
||||
break;
|
||||
|
||||
case CFTYPE_CURL:
|
||||
fill_buffer(file, want);
|
||||
fill_buffer(file,want);
|
||||
|
||||
/* check if theres data in the buffer - if not fill either errored or
|
||||
* EOF */
|
||||
@ -406,7 +386,7 @@ char *url_fgets(char *ptr, size_t size, URL_FILE *file)
|
||||
memcpy(ptr, file->buffer, want);
|
||||
ptr[want]=0;/* allways null terminate */
|
||||
|
||||
use_buffer(file, want);
|
||||
use_buffer(file,want);
|
||||
|
||||
break;
|
||||
|
||||
@ -434,7 +414,9 @@ void url_rewind(URL_FILE *file)
|
||||
curl_multi_add_handle(multi_handle, file->handle.curl);
|
||||
|
||||
/* ditch buffer - write will recreate - resets stream pos*/
|
||||
free(file->buffer);
|
||||
if(file->buffer)
|
||||
free(file->buffer);
|
||||
|
||||
file->buffer=NULL;
|
||||
file->buffer_pos=0;
|
||||
file->buffer_len=0;
|
||||
@ -446,10 +428,6 @@ void url_rewind(URL_FILE *file)
|
||||
}
|
||||
}
|
||||
|
||||
#define FGETSFILE "fgets.test"
|
||||
#define FREADFILE "fread.test"
|
||||
#define REWINDFILE "rewind.test"
|
||||
|
||||
/* Small main program to retrive from a url using fgets and fread saving the
|
||||
* output to two test files (note the fgets method will corrupt binary files if
|
||||
* they contain 0 chars */
|
||||
@ -458,7 +436,7 @@ int main(int argc, char *argv[])
|
||||
URL_FILE *handle;
|
||||
FILE *outf;
|
||||
|
||||
size_t nread;
|
||||
int nread;
|
||||
char buffer[256];
|
||||
const char *url;
|
||||
|
||||
@ -468,7 +446,7 @@ int main(int argc, char *argv[])
|
||||
url=argv[1];/* use passed url */
|
||||
|
||||
/* copy from url line by line with fgets */
|
||||
outf=fopen(FGETSFILE, "wb+");
|
||||
outf=fopen("fgets.test","w+");
|
||||
if(!outf) {
|
||||
perror("couldn't open fgets output file\n");
|
||||
return 1;
|
||||
@ -482,8 +460,8 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
while(!url_feof(handle)) {
|
||||
url_fgets(buffer, sizeof(buffer), handle);
|
||||
fwrite(buffer, 1, strlen(buffer), outf);
|
||||
url_fgets(buffer,sizeof(buffer),handle);
|
||||
fwrite(buffer,1,strlen(buffer),outf);
|
||||
}
|
||||
|
||||
url_fclose(handle);
|
||||
@ -492,7 +470,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
/* Copy from url with fread */
|
||||
outf=fopen(FREADFILE, "wb+");
|
||||
outf=fopen("fread.test","w+");
|
||||
if(!outf) {
|
||||
perror("couldn't open fread output file\n");
|
||||
return 1;
|
||||
@ -506,8 +484,8 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
do {
|
||||
nread = url_fread(buffer, 1, sizeof(buffer), handle);
|
||||
fwrite(buffer, 1, nread, outf);
|
||||
nread = url_fread(buffer, 1,sizeof(buffer), handle);
|
||||
fwrite(buffer,1,nread,outf);
|
||||
} while(nread);
|
||||
|
||||
url_fclose(handle);
|
||||
@ -516,7 +494,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
/* Test rewind */
|
||||
outf=fopen(REWINDFILE, "wb+");
|
||||
outf=fopen("rewind.test","w+");
|
||||
if(!outf) {
|
||||
perror("couldn't open fread output file\n");
|
||||
return 1;
|
||||
@ -529,19 +507,21 @@ int main(int argc, char *argv[])
|
||||
return 2;
|
||||
}
|
||||
|
||||
nread = url_fread(buffer, 1, sizeof(buffer), handle);
|
||||
fwrite(buffer, 1, nread, outf);
|
||||
nread = url_fread(buffer, 1,sizeof(buffer), handle);
|
||||
fwrite(buffer,1,nread,outf);
|
||||
url_rewind(handle);
|
||||
|
||||
buffer[0]='\n';
|
||||
fwrite(buffer, 1, 1, outf);
|
||||
fwrite(buffer,1,1,outf);
|
||||
|
||||
nread = url_fread(buffer, 1,sizeof(buffer), handle);
|
||||
fwrite(buffer,1,nread,outf);
|
||||
|
||||
nread = url_fread(buffer, 1, sizeof(buffer), handle);
|
||||
fwrite(buffer, 1, nread, outf);
|
||||
|
||||
url_fclose(handle);
|
||||
|
||||
fclose(outf);
|
||||
|
||||
|
||||
return 0;/* all done */
|
||||
}
|
||||
|
@ -5,11 +5,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@ -19,10 +19,6 @@
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
/* <DESC>
|
||||
* FTP wildcard pattern matching
|
||||
* </DESC>
|
||||
*/
|
||||
#include <curl/curl.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@ -119,7 +115,7 @@ static long file_is_coming(struct curl_fileinfo *finfo,
|
||||
return CURL_CHUNK_BGN_FUNC_SKIP;
|
||||
}
|
||||
|
||||
data->output = fopen(finfo->filename, "wb");
|
||||
data->output = fopen(finfo->filename, "w");
|
||||
if(!data->output) {
|
||||
return CURL_CHUNK_BGN_FUNC_FAIL;
|
||||
}
|
||||
|
@ -5,11 +5,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@ -23,9 +23,11 @@
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
/* <DESC>
|
||||
* Get a single file from an FTP server.
|
||||
* </DESC>
|
||||
/*
|
||||
* This is an example showing how to get a single file from an FTP server.
|
||||
* It delays the actual destination file creation until the first write
|
||||
* callback so that it won't create an empty file in case the remote file
|
||||
* doesn't exist or something else fails.
|
||||
*/
|
||||
|
||||
struct FtpFile {
|
||||
@ -51,7 +53,7 @@ int main(void)
|
||||
CURL *curl;
|
||||
CURLcode res;
|
||||
struct FtpFile ftpfile={
|
||||
"curl.tar.gz", /* name to store the file as if successful */
|
||||
"curl.tar.gz", /* name to store the file as if succesful */
|
||||
NULL
|
||||
};
|
||||
|
||||
@ -63,7 +65,7 @@ int main(void)
|
||||
* You better replace the URL with one that works!
|
||||
*/
|
||||
curl_easy_setopt(curl, CURLOPT_URL,
|
||||
"ftp://ftp.example.com/curl/curl-7.9.2.tar.gz");
|
||||
"ftp://ftp.example.com/pub/www/utilities/curl/curl-7.9.2.tar.gz");
|
||||
/* Define our callback to get called when there's data to be written */
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_fwrite);
|
||||
/* Set a pointer to our struct to pass to the callback */
|
||||
|
@ -5,11 +5,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@ -24,9 +24,9 @@
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
/* <DESC>
|
||||
* Checks a single file's size and mtime from an FTP server.
|
||||
* </DESC>
|
||||
/*
|
||||
* This is an example showing how to check a single file's size and mtime
|
||||
* from an FTP server.
|
||||
*/
|
||||
|
||||
static size_t throw_away(void *ptr, size_t size, size_t nmemb, void *data)
|
||||
@ -65,18 +65,16 @@ int main(void)
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(CURLE_OK == res) {
|
||||
/* https://curl.haxx.se/libcurl/c/curl_easy_getinfo.html */
|
||||
/* http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html */
|
||||
res = curl_easy_getinfo(curl, CURLINFO_FILETIME, &filetime);
|
||||
if((CURLE_OK == res) && (filetime >= 0)) {
|
||||
time_t file_time = (time_t)filetime;
|
||||
printf("filetime %s: %s", filename, ctime(&file_time));
|
||||
}
|
||||
res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD,
|
||||
&filesize);
|
||||
res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &filesize);
|
||||
if((CURLE_OK == res) && (filesize>0.0))
|
||||
printf("filesize %s: %0.0f bytes\n", filename, filesize);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
/* we failed */
|
||||
fprintf(stderr, "curl told us %d\n", res);
|
||||
}
|
||||
|
@ -5,11 +5,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@ -23,11 +23,13 @@
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
/* <DESC>
|
||||
* Similar to ftpget.c but also stores the received response-lines
|
||||
/*
|
||||
* Similar to ftpget.c but this also stores the received response-lines
|
||||
* in a separate file using our own callback!
|
||||
* </DESC>
|
||||
*
|
||||
* This functionality was introduced in libcurl 7.9.3.
|
||||
*/
|
||||
|
||||
static size_t
|
||||
write_response(void *ptr, size_t size, size_t nmemb, void *data)
|
||||
{
|
||||
@ -35,9 +37,6 @@ write_response(void *ptr, size_t size, size_t nmemb, void *data)
|
||||
return fwrite(ptr, size, nmemb, writehere);
|
||||
}
|
||||
|
||||
#define FTPBODY "ftp-list"
|
||||
#define FTPHEADERS "ftp-responses"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl;
|
||||
@ -46,10 +45,10 @@ int main(void)
|
||||
FILE *respfile;
|
||||
|
||||
/* local file name to store the file as */
|
||||
ftpfile = fopen(FTPBODY, "wb"); /* b is binary, needed on win32 */
|
||||
ftpfile = fopen("ftp-list", "wb"); /* b is binary, needed on win32 */
|
||||
|
||||
/* local file name to store the FTP server's response lines in */
|
||||
respfile = fopen(FTPHEADERS, "wb"); /* b is binary, needed on win32 */
|
||||
respfile = fopen("ftp-responses", "wb"); /* b is binary, needed on win32 */
|
||||
|
||||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
|
@ -5,11 +5,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@ -24,9 +24,11 @@
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
/* <DESC>
|
||||
* Get a single file from an FTPS server.
|
||||
* </DESC>
|
||||
/*
|
||||
* This is an example showing how to get a single file from an FTPS server.
|
||||
* It delays the actual destination file creation until the first write
|
||||
* callback so that it won't create an empty file in case the remote file
|
||||
* doesn't exist or something else fails.
|
||||
*/
|
||||
|
||||
struct FtpFile {
|
||||
@ -53,7 +55,7 @@ int main(void)
|
||||
CURL *curl;
|
||||
CURLcode res;
|
||||
struct FtpFile ftpfile={
|
||||
"yourfile.bin", /* name to store the file as if successful */
|
||||
"yourfile.bin", /* name to store the file as if succesful */
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -5,11 +5,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@ -33,10 +33,11 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
/* <DESC>
|
||||
* Performs an FTP upload and renames the file just after a successful
|
||||
* transfer.
|
||||
* </DESC>
|
||||
/*
|
||||
* This example shows an FTP upload, with a rename of the file just after
|
||||
* a successful upload.
|
||||
*
|
||||
* Example based on source code provided by Erick Nuwendam. Thanks!
|
||||
*/
|
||||
|
||||
#define LOCAL_FILE "/tmp/uploadthis.txt"
|
||||
@ -104,7 +105,7 @@ int main(void)
|
||||
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
|
||||
|
||||
/* specify target */
|
||||
curl_easy_setopt(curl, CURLOPT_URL, REMOTE_URL);
|
||||
curl_easy_setopt(curl,CURLOPT_URL, REMOTE_URL);
|
||||
|
||||
/* pass in that last of FTP commands to run after the transfer */
|
||||
curl_easy_setopt(curl, CURLOPT_POSTQUOTE, headerlist);
|
||||
|
@ -5,11 +5,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@ -19,9 +19,13 @@
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
/* <DESC>
|
||||
* Upload to FTP, resuming failed transfers.
|
||||
* </DESC>
|
||||
/* Upload to FTP, resuming failed transfers
|
||||
*
|
||||
* Compile for MinGW like this:
|
||||
* gcc -Wall -pedantic -std=c99 ftpuploadwithresume.c -o ftpuploadresume.exe
|
||||
* -lcurl -lmsvcr70
|
||||
*
|
||||
* Written by Philip Bock
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@ -36,8 +40,7 @@
|
||||
/* The MinGW headers are missing a few Win32 function definitions,
|
||||
you shouldn't need this if you use VC++ */
|
||||
#if defined(__MINGW32__) && !defined(__MINGW64__)
|
||||
int __cdecl _snscanf(const char * input, size_t length,
|
||||
const char * format, ...);
|
||||
int __cdecl _snscanf(const char * input, size_t length, const char * format, ...);
|
||||
#endif
|
||||
|
||||
|
||||
@ -50,7 +53,7 @@ size_t getcontentlengthfunc(void *ptr, size_t size, size_t nmemb, void *stream)
|
||||
/* _snscanf() is Win32 specific */
|
||||
r = _snscanf(ptr, size * nmemb, "Content-Length: %ld\n", &len);
|
||||
|
||||
if(r) /* Microsoft: we don't read the specs */
|
||||
if (r) /* Microsoft: we don't read the specs */
|
||||
*((long *) stream) = len;
|
||||
|
||||
return size * nmemb;
|
||||
@ -68,7 +71,7 @@ size_t readfunc(void *ptr, size_t size, size_t nmemb, void *stream)
|
||||
FILE *f = stream;
|
||||
size_t n;
|
||||
|
||||
if(ferror(f))
|
||||
if (ferror(f))
|
||||
return CURL_READFUNC_ABORT;
|
||||
|
||||
n = fread(ptr, size, nmemb, f) * size;
|
||||
@ -86,7 +89,7 @@ int upload(CURL *curlhandle, const char * remotepath, const char * localpath,
|
||||
int c;
|
||||
|
||||
f = fopen(localpath, "rb");
|
||||
if(!f) {
|
||||
if (f == NULL) {
|
||||
perror(NULL);
|
||||
return 0;
|
||||
}
|
||||
@ -95,7 +98,7 @@ int upload(CURL *curlhandle, const char * remotepath, const char * localpath,
|
||||
|
||||
curl_easy_setopt(curlhandle, CURLOPT_URL, remotepath);
|
||||
|
||||
if(timeout)
|
||||
if (timeout)
|
||||
curl_easy_setopt(curlhandle, CURLOPT_FTP_RESPONSE_TIMEOUT, timeout);
|
||||
|
||||
curl_easy_setopt(curlhandle, CURLOPT_HEADERFUNCTION, getcontentlengthfunc);
|
||||
@ -106,15 +109,14 @@ int upload(CURL *curlhandle, const char * remotepath, const char * localpath,
|
||||
curl_easy_setopt(curlhandle, CURLOPT_READFUNCTION, readfunc);
|
||||
curl_easy_setopt(curlhandle, CURLOPT_READDATA, f);
|
||||
|
||||
/* disable passive mode */
|
||||
curl_easy_setopt(curlhandle, CURLOPT_FTPPORT, "-");
|
||||
curl_easy_setopt(curlhandle, CURLOPT_FTPPORT, "-"); /* disable passive mode */
|
||||
curl_easy_setopt(curlhandle, CURLOPT_FTP_CREATE_MISSING_DIRS, 1L);
|
||||
|
||||
curl_easy_setopt(curlhandle, CURLOPT_VERBOSE, 1L);
|
||||
|
||||
for(c = 0; (r != CURLE_OK) && (c < tries); c++) {
|
||||
for (c = 0; (r != CURLE_OK) && (c < tries); c++) {
|
||||
/* are we resuming? */
|
||||
if(c) { /* yes */
|
||||
if (c) { /* yes */
|
||||
/* determine the length of the file already written */
|
||||
|
||||
/*
|
||||
@ -129,7 +131,7 @@ int upload(CURL *curlhandle, const char * remotepath, const char * localpath,
|
||||
curl_easy_setopt(curlhandle, CURLOPT_HEADER, 1L);
|
||||
|
||||
r = curl_easy_perform(curlhandle);
|
||||
if(r != CURLE_OK)
|
||||
if (r != CURLE_OK)
|
||||
continue;
|
||||
|
||||
curl_easy_setopt(curlhandle, CURLOPT_NOBODY, 0L);
|
||||
@ -148,7 +150,7 @@ int upload(CURL *curlhandle, const char * remotepath, const char * localpath,
|
||||
|
||||
fclose(f);
|
||||
|
||||
if(r == CURLE_OK)
|
||||
if (r == CURLE_OK)
|
||||
return 1;
|
||||
else {
|
||||
fprintf(stderr, "%s\n", curl_easy_strerror(r));
|
||||
@ -163,8 +165,7 @@ int main(int c, char **argv)
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
curlhandle = curl_easy_init();
|
||||
|
||||
upload(curlhandle, "ftp://user:pass@example.com/path/file", "C:\\file",
|
||||
0, 3);
|
||||
upload(curlhandle, "ftp://user:pass@example.com/path/file", "C:\\file", 0, 3);
|
||||
|
||||
curl_easy_cleanup(curlhandle);
|
||||
curl_global_cleanup();
|
||||
|
@ -5,11 +5,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@ -19,10 +19,6 @@
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
/* <DESC>
|
||||
* Use getinfo to get content-type after completed transfer.
|
||||
* </DESC>
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <curl/curl.h>
|
||||
|
||||
@ -31,14 +27,18 @@ int main(void)
|
||||
CURL *curl;
|
||||
CURLcode res;
|
||||
|
||||
/* http://curl.haxx.se/libcurl/c/curl_easy_init.html */
|
||||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
/* http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTURL */
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://www.example.com/");
|
||||
/* http://curl.haxx.se/libcurl/c/curl_easy_perform.html */
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(CURLE_OK == res) {
|
||||
char *ct;
|
||||
/* ask for the content-type */
|
||||
/* http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html */
|
||||
res = curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &ct);
|
||||
|
||||
if((CURLE_OK == res) && ct)
|
||||
@ -46,6 +46,7 @@ int main(void)
|
||||
}
|
||||
|
||||
/* always cleanup */
|
||||
/* http://curl.haxx.se/libcurl/c/curl_easy_cleanup.html */
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
return 0;
|
||||
|
@ -5,11 +5,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@ -19,10 +19,8 @@
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
/* <DESC>
|
||||
* Shows how the write callback function can be used to download data into a
|
||||
* chunk of memory instead of storing it in a file.
|
||||
* </DESC>
|
||||
/* Example source code to show how the callback function can be used to
|
||||
* download data into a chunk of memory instead of storing it in a file.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@ -36,6 +34,7 @@ struct MemoryStruct {
|
||||
size_t size;
|
||||
};
|
||||
|
||||
|
||||
static size_t
|
||||
WriteMemoryCallback(void *contents, size_t size, size_t nmemb, void *userp)
|
||||
{
|
||||
@ -56,6 +55,7 @@ WriteMemoryCallback(void *contents, size_t size, size_t nmemb, void *userp)
|
||||
return realsize;
|
||||
}
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl_handle;
|
||||
@ -106,7 +106,8 @@ int main(void)
|
||||
/* cleanup curl stuff */
|
||||
curl_easy_cleanup(curl_handle);
|
||||
|
||||
free(chunk.memory);
|
||||
if(chunk.memory)
|
||||
free(chunk.memory);
|
||||
|
||||
/* we're done with libcurl, so clean it up */
|
||||
curl_global_cleanup();
|
||||
|
@ -1,70 +0,0 @@
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
/* <DESC>
|
||||
* Show how to extract Location: header and URL to redirect to.
|
||||
* </DESC>
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <curl/curl.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res;
|
||||
char *location;
|
||||
long response_code;
|
||||
|
||||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
|
||||
/* example.com is redirected, figure out the redirection! */
|
||||
|
||||
/* Perform the request, res will get the return code */
|
||||
res = curl_easy_perform(curl);
|
||||
/* Check for errors */
|
||||
if(res != CURLE_OK)
|
||||
fprintf(stderr, "curl_easy_perform() failed: %s\n",
|
||||
curl_easy_strerror(res));
|
||||
else {
|
||||
res = curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code);
|
||||
if((res == CURLE_OK) &&
|
||||
((response_code / 100) != 3)) {
|
||||
/* a redirect implies a 3xx response code */
|
||||
fprintf(stderr, "Not a redirect.\n");
|
||||
}
|
||||
else {
|
||||
res = curl_easy_getinfo(curl, CURLINFO_REDIRECT_URL, &location);
|
||||
|
||||
if((res == CURLE_OK) && location) {
|
||||
/* This is the new absolute URL that you could redirect to, even if
|
||||
* the Location: response header may have been a relative URL. */
|
||||
printf("Redirected to: %s\n", location);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
return 0;
|
||||
}
|
@ -5,11 +5,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@ -19,41 +19,38 @@
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
/* <DESC>
|
||||
* multi socket API usage together with with glib2
|
||||
* </DESC>
|
||||
*/
|
||||
/* Example application source code using the multi socket interface to
|
||||
* download many files at once.
|
||||
*
|
||||
* Written by Jeff Pohlmeyer
|
||||
|
||||
Requires glib-2.x and a (POSIX?) system that has mkfifo().
|
||||
Requires glib-2.x and a (POSIX?) system that has mkfifo().
|
||||
|
||||
This is an adaptation of libcurl's "hipev.c" and libevent's "event-test.c"
|
||||
sample programs, adapted to use glib's g_io_channel in place of libevent.
|
||||
This is an adaptation of libcurl's "hipev.c" and libevent's "event-test.c"
|
||||
sample programs, adapted to use glib's g_io_channel in place of libevent.
|
||||
|
||||
When running, the program creates the named pipe "hiper.fifo"
|
||||
When running, the program creates the named pipe "hiper.fifo"
|
||||
|
||||
Whenever there is input into the fifo, the program reads the input as a list
|
||||
of URL's and creates some new easy handles to fetch each URL via the
|
||||
curl_multi "hiper" API.
|
||||
Whenever there is input into the fifo, the program reads the input as a list
|
||||
of URL's and creates some new easy handles to fetch each URL via the
|
||||
curl_multi "hiper" API.
|
||||
|
||||
|
||||
Thus, you can try a single URL:
|
||||
% echo http://www.yahoo.com > hiper.fifo
|
||||
Thus, you can try a single URL:
|
||||
% echo http://www.yahoo.com > hiper.fifo
|
||||
|
||||
Or a whole bunch of them:
|
||||
% cat my-url-list > hiper.fifo
|
||||
Or a whole bunch of them:
|
||||
% cat my-url-list > hiper.fifo
|
||||
|
||||
The fifo buffer is handled almost instantly, so you can even add more URL's
|
||||
while the previous requests are still being downloaded.
|
||||
The fifo buffer is handled almost instantly, so you can even add more URL's
|
||||
while the previous requests are still being downloaded.
|
||||
|
||||
This is purely a demo app, all retrieved data is simply discarded by the write
|
||||
callback.
|
||||
This is purely a demo app, all retrieved data is simply discarded by the write
|
||||
callback.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#include <glib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
@ -63,10 +60,13 @@
|
||||
#include <errno.h>
|
||||
#include <curl/curl.h>
|
||||
|
||||
|
||||
#define MSG_OUT g_print /* Change to "g_error" to write to stderr */
|
||||
#define SHOW_VERBOSE 0 /* Set to non-zero for libcurl messages */
|
||||
#define SHOW_PROGRESS 0 /* Set to non-zero to enable progress callback */
|
||||
|
||||
|
||||
|
||||
/* Global information, common to all connections */
|
||||
typedef struct _GlobalInfo {
|
||||
CURLM *multi;
|
||||
@ -74,6 +74,8 @@ typedef struct _GlobalInfo {
|
||||
int still_running;
|
||||
} GlobalInfo;
|
||||
|
||||
|
||||
|
||||
/* Information associated with a specific easy handle */
|
||||
typedef struct _ConnInfo {
|
||||
CURL *easy;
|
||||
@ -82,6 +84,7 @@ typedef struct _ConnInfo {
|
||||
char error[CURL_ERROR_SIZE];
|
||||
} ConnInfo;
|
||||
|
||||
|
||||
/* Information associated with a specific socket */
|
||||
typedef struct _SockInfo {
|
||||
curl_socket_t sockfd;
|
||||
@ -93,25 +96,30 @@ typedef struct _SockInfo {
|
||||
GlobalInfo *global;
|
||||
} SockInfo;
|
||||
|
||||
|
||||
|
||||
|
||||
/* Die if we get a bad CURLMcode somewhere */
|
||||
static void mcode_or_die(const char *where, CURLMcode code) {
|
||||
if(CURLM_OK != code) {
|
||||
if ( CURLM_OK != code ) {
|
||||
const char *s;
|
||||
switch (code) {
|
||||
case CURLM_BAD_HANDLE: s="CURLM_BAD_HANDLE"; break;
|
||||
case CURLM_BAD_EASY_HANDLE: s="CURLM_BAD_EASY_HANDLE"; break;
|
||||
case CURLM_OUT_OF_MEMORY: s="CURLM_OUT_OF_MEMORY"; break;
|
||||
case CURLM_INTERNAL_ERROR: s="CURLM_INTERNAL_ERROR"; break;
|
||||
case CURLM_BAD_SOCKET: s="CURLM_BAD_SOCKET"; break;
|
||||
case CURLM_UNKNOWN_OPTION: s="CURLM_UNKNOWN_OPTION"; break;
|
||||
case CURLM_LAST: s="CURLM_LAST"; break;
|
||||
default: s="CURLM_unknown";
|
||||
case CURLM_BAD_HANDLE: s="CURLM_BAD_HANDLE"; break;
|
||||
case CURLM_BAD_EASY_HANDLE: s="CURLM_BAD_EASY_HANDLE"; break;
|
||||
case CURLM_OUT_OF_MEMORY: s="CURLM_OUT_OF_MEMORY"; break;
|
||||
case CURLM_INTERNAL_ERROR: s="CURLM_INTERNAL_ERROR"; break;
|
||||
case CURLM_BAD_SOCKET: s="CURLM_BAD_SOCKET"; break;
|
||||
case CURLM_UNKNOWN_OPTION: s="CURLM_UNKNOWN_OPTION"; break;
|
||||
case CURLM_LAST: s="CURLM_LAST"; break;
|
||||
default: s="CURLM_unknown";
|
||||
}
|
||||
MSG_OUT("ERROR: %s returns %s\n", where, s);
|
||||
exit(code);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Check for completed transfers, and remove their easy handles */
|
||||
static void check_multi_info(GlobalInfo *g)
|
||||
{
|
||||
@ -123,8 +131,8 @@ static void check_multi_info(GlobalInfo *g)
|
||||
CURLcode res;
|
||||
|
||||
MSG_OUT("REMAINING: %d\n", g->still_running);
|
||||
while((msg = curl_multi_info_read(g->multi, &msgs_left))) {
|
||||
if(msg->msg == CURLMSG_DONE) {
|
||||
while ((msg = curl_multi_info_read(g->multi, &msgs_left))) {
|
||||
if (msg->msg == CURLMSG_DONE) {
|
||||
easy = msg->easy_handle;
|
||||
res = msg->data.result;
|
||||
curl_easy_getinfo(easy, CURLINFO_PRIVATE, &conn);
|
||||
@ -138,6 +146,8 @@ static void check_multi_info(GlobalInfo *g)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Called by glib when our timeout expires */
|
||||
static gboolean timer_cb(gpointer data)
|
||||
{
|
||||
@ -145,12 +155,14 @@ static gboolean timer_cb(gpointer data)
|
||||
CURLMcode rc;
|
||||
|
||||
rc = curl_multi_socket_action(g->multi,
|
||||
CURL_SOCKET_TIMEOUT, 0, &g->still_running);
|
||||
CURL_SOCKET_TIMEOUT, 0, &g->still_running);
|
||||
mcode_or_die("timer_cb: curl_multi_socket_action", rc);
|
||||
check_multi_info(g);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Update the event timer after curl_multi library calls */
|
||||
static int update_timeout_cb(CURLM *multi, long timeout_ms, void *userp)
|
||||
{
|
||||
@ -160,12 +172,15 @@ static int update_timeout_cb(CURLM *multi, long timeout_ms, void *userp)
|
||||
timeout.tv_usec = (timeout_ms%1000)*1000;
|
||||
|
||||
MSG_OUT("*** update_timeout_cb %ld => %ld:%ld ***\n",
|
||||
timeout_ms, timeout.tv_sec, timeout.tv_usec);
|
||||
timeout_ms, timeout.tv_sec, timeout.tv_usec);
|
||||
|
||||
g->timer_event = g_timeout_add(timeout_ms, timer_cb, g);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* Called by glib when we get action on a multi socket */
|
||||
static gboolean event_cb(GIOChannel *ch, GIOCondition condition, gpointer data)
|
||||
{
|
||||
@ -183,43 +198,41 @@ static gboolean event_cb(GIOChannel *ch, GIOCondition condition, gpointer data)
|
||||
check_multi_info(g);
|
||||
if(g->still_running) {
|
||||
return TRUE;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
MSG_OUT("last transfer done, kill timeout\n");
|
||||
if(g->timer_event) {
|
||||
g_source_remove(g->timer_event);
|
||||
}
|
||||
if (g->timer_event) { g_source_remove(g->timer_event); }
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Clean up the SockInfo structure */
|
||||
static void remsock(SockInfo *f)
|
||||
{
|
||||
if(!f) {
|
||||
return;
|
||||
}
|
||||
if(f->ev) {
|
||||
g_source_remove(f->ev);
|
||||
}
|
||||
if (!f) { return; }
|
||||
if (f->ev) { g_source_remove(f->ev); }
|
||||
g_free(f);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Assign information to a SockInfo structure */
|
||||
static void setsock(SockInfo*f, curl_socket_t s, CURL*e, int act, GlobalInfo*g)
|
||||
{
|
||||
GIOCondition kind =
|
||||
(act&CURL_POLL_IN?G_IO_IN:0)|(act&CURL_POLL_OUT?G_IO_OUT:0);
|
||||
(act&CURL_POLL_IN?G_IO_IN:0)|(act&CURL_POLL_OUT?G_IO_OUT:0);
|
||||
|
||||
f->sockfd = s;
|
||||
f->action = act;
|
||||
f->easy = e;
|
||||
if(f->ev) {
|
||||
g_source_remove(f->ev);
|
||||
}
|
||||
f->ev=g_io_add_watch(f->ch, kind, event_cb, g);
|
||||
if (f->ev) { g_source_remove(f->ev); }
|
||||
f->ev=g_io_add_watch(f->ch, kind, event_cb,g);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Initialize a new SockInfo structure */
|
||||
static void addsock(curl_socket_t s, CURL *easy, int action, GlobalInfo *g)
|
||||
{
|
||||
@ -231,6 +244,8 @@ static void addsock(curl_socket_t s, CURL *easy, int action, GlobalInfo *g)
|
||||
curl_multi_assign(g->multi, s, fdp);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* CURLMOPT_SOCKETFUNCTION */
|
||||
static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
|
||||
{
|
||||
@ -239,15 +254,14 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
|
||||
static const char *whatstr[]={ "none", "IN", "OUT", "INOUT", "REMOVE" };
|
||||
|
||||
MSG_OUT("socket callback: s=%d e=%p what=%s ", s, e, whatstr[what]);
|
||||
if(what == CURL_POLL_REMOVE) {
|
||||
if (what == CURL_POLL_REMOVE) {
|
||||
MSG_OUT("\n");
|
||||
remsock(fdp);
|
||||
}
|
||||
else {
|
||||
if(!fdp) {
|
||||
} else {
|
||||
if (!fdp) {
|
||||
MSG_OUT("Adding data: %s%s\n",
|
||||
what&CURL_POLL_IN?"READ":"",
|
||||
what&CURL_POLL_OUT?"WRITE":"" );
|
||||
what&CURL_POLL_IN?"READ":"",
|
||||
what&CURL_POLL_OUT?"WRITE":"" );
|
||||
addsock(s, e, what, g);
|
||||
}
|
||||
else {
|
||||
@ -259,6 +273,8 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* CURLOPT_WRITEFUNCTION */
|
||||
static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data)
|
||||
{
|
||||
@ -269,15 +285,18 @@ static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data)
|
||||
return realsize;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* CURLOPT_PROGRESSFUNCTION */
|
||||
static int prog_cb (void *p, double dltotal, double dlnow, double ult,
|
||||
double uln)
|
||||
static int prog_cb (void *p, double dltotal, double dlnow, double ult, double uln)
|
||||
{
|
||||
ConnInfo *conn = (ConnInfo *)p;
|
||||
MSG_OUT("Progress: %s (%g/%g)\n", conn->url, dlnow, dltotal);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Create a new easy handle, and add it to the global curl_multi */
|
||||
static void new_conn(char *url, GlobalInfo *g )
|
||||
{
|
||||
@ -285,9 +304,11 @@ static void new_conn(char *url, GlobalInfo *g )
|
||||
CURLMcode rc;
|
||||
|
||||
conn = g_malloc0(sizeof(ConnInfo));
|
||||
|
||||
conn->error[0]='\0';
|
||||
|
||||
conn->easy = curl_easy_init();
|
||||
if(!conn->easy) {
|
||||
if (!conn->easy) {
|
||||
MSG_OUT("curl_easy_init() failed, exiting!\n");
|
||||
exit(2);
|
||||
}
|
||||
@ -315,90 +336,93 @@ static void new_conn(char *url, GlobalInfo *g )
|
||||
that the necessary socket_action() call will be called by this app */
|
||||
}
|
||||
|
||||
|
||||
/* This gets called by glib whenever data is received from the fifo */
|
||||
static gboolean fifo_cb (GIOChannel *ch, GIOCondition condition, gpointer data)
|
||||
{
|
||||
#define BUF_SIZE 1024
|
||||
#define BUF_SIZE 1024
|
||||
gsize len, tp;
|
||||
gchar *buf, *tmp, *all=NULL;
|
||||
GIOStatus rv;
|
||||
|
||||
do {
|
||||
GError *err=NULL;
|
||||
rv = g_io_channel_read_line(ch, &buf, &len, &tp, &err);
|
||||
if(buf) {
|
||||
if(tp) {
|
||||
buf[tp]='\0';
|
||||
}
|
||||
new_conn(buf, (GlobalInfo*)data);
|
||||
rv = g_io_channel_read_line (ch,&buf,&len,&tp,&err);
|
||||
if ( buf ) {
|
||||
if (tp) { buf[tp]='\0'; }
|
||||
new_conn(buf,(GlobalInfo*)data);
|
||||
g_free(buf);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
buf = g_malloc(BUF_SIZE+1);
|
||||
while(TRUE) {
|
||||
while (TRUE) {
|
||||
buf[BUF_SIZE]='\0';
|
||||
g_io_channel_read_chars(ch, buf, BUF_SIZE, &len, &err);
|
||||
if(len) {
|
||||
g_io_channel_read_chars(ch,buf,BUF_SIZE,&len,&err);
|
||||
if (len) {
|
||||
buf[len]='\0';
|
||||
if(all) {
|
||||
if (all) {
|
||||
tmp=all;
|
||||
all=g_strdup_printf("%s%s", tmp, buf);
|
||||
g_free(tmp);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
all = g_strdup(buf);
|
||||
}
|
||||
}
|
||||
else {
|
||||
break;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(all) {
|
||||
new_conn(all, (GlobalInfo*)data);
|
||||
if (all) {
|
||||
new_conn(all,(GlobalInfo*)data);
|
||||
g_free(all);
|
||||
}
|
||||
g_free(buf);
|
||||
}
|
||||
if(err) {
|
||||
if ( err ) {
|
||||
g_error("fifo_cb: %s", err->message);
|
||||
g_free(err);
|
||||
break;
|
||||
}
|
||||
} while((len) && (rv == G_IO_STATUS_NORMAL));
|
||||
} while ( (len) && (rv == G_IO_STATUS_NORMAL) );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int init_fifo(void)
|
||||
{
|
||||
struct stat st;
|
||||
const char *fifo = "hiper.fifo";
|
||||
int socket;
|
||||
struct stat st;
|
||||
const char *fifo = "hiper.fifo";
|
||||
int socket;
|
||||
|
||||
if(lstat (fifo, &st) == 0) {
|
||||
if((st.st_mode & S_IFMT) == S_IFREG) {
|
||||
errno = EEXIST;
|
||||
perror("lstat");
|
||||
exit (1);
|
||||
}
|
||||
if (lstat (fifo, &st) == 0) {
|
||||
if ((st.st_mode & S_IFMT) == S_IFREG) {
|
||||
errno = EEXIST;
|
||||
perror("lstat");
|
||||
exit (1);
|
||||
}
|
||||
}
|
||||
|
||||
unlink (fifo);
|
||||
if(mkfifo (fifo, 0600) == -1) {
|
||||
perror("mkfifo");
|
||||
exit (1);
|
||||
}
|
||||
unlink (fifo);
|
||||
if (mkfifo (fifo, 0600) == -1) {
|
||||
perror("mkfifo");
|
||||
exit (1);
|
||||
}
|
||||
|
||||
socket = open (fifo, O_RDWR | O_NONBLOCK, 0);
|
||||
socket = open (fifo, O_RDWR | O_NONBLOCK, 0);
|
||||
|
||||
if(socket == -1) {
|
||||
perror("open");
|
||||
exit (1);
|
||||
}
|
||||
MSG_OUT("Now, pipe some URL's into > %s\n", fifo);
|
||||
if (socket == -1) {
|
||||
perror("open");
|
||||
exit (1);
|
||||
}
|
||||
MSG_OUT("Now, pipe some URL's into > %s\n", fifo);
|
||||
|
||||
return socket;
|
||||
|
||||
return socket;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
GlobalInfo *g;
|
||||
@ -410,8 +434,8 @@ int main(int argc, char **argv)
|
||||
|
||||
fd=init_fifo();
|
||||
ch=g_io_channel_unix_new(fd);
|
||||
g_io_add_watch(ch, G_IO_IN, fifo_cb, g);
|
||||
gmain=g_main_loop_new(NULL, FALSE);
|
||||
g_io_add_watch(ch,G_IO_IN,fifo_cb,g);
|
||||
gmain=g_main_loop_new(NULL,FALSE);
|
||||
g->multi = curl_multi_init();
|
||||
curl_multi_setopt(g->multi, CURLMOPT_SOCKETFUNCTION, sock_cb);
|
||||
curl_multi_setopt(g->multi, CURLMOPT_SOCKETDATA, g);
|
||||
|
@ -5,11 +5,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@ -19,10 +19,6 @@
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
/* <DESC>
|
||||
* multi socket API usage with libevent 2
|
||||
* </DESC>
|
||||
*/
|
||||
/* Example application source code using the multi socket interface to
|
||||
download many files at once.
|
||||
|
||||
@ -126,7 +122,7 @@ static int multi_timer_cb(CURLM *multi, long timeout_ms, GlobalInfo *g)
|
||||
/* Die if we get a bad CURLMcode somewhere */
|
||||
static void mcode_or_die(const char *where, CURLMcode code)
|
||||
{
|
||||
if(CURLM_OK != code) {
|
||||
if ( CURLM_OK != code ) {
|
||||
const char *s;
|
||||
switch (code) {
|
||||
case CURLM_BAD_HANDLE: s="CURLM_BAD_HANDLE"; break;
|
||||
@ -160,8 +156,8 @@ static void check_multi_info(GlobalInfo *g)
|
||||
CURLcode res;
|
||||
|
||||
fprintf(MSG_OUT, "REMAINING: %d\n", g->still_running);
|
||||
while((msg = curl_multi_info_read(g->multi, &msgs_left))) {
|
||||
if(msg->msg == CURLMSG_DONE) {
|
||||
while ((msg = curl_multi_info_read(g->multi, &msgs_left))) {
|
||||
if (msg->msg == CURLMSG_DONE) {
|
||||
easy = msg->easy_handle;
|
||||
res = msg->data.result;
|
||||
curl_easy_getinfo(easy, CURLINFO_PRIVATE, &conn);
|
||||
@ -191,9 +187,9 @@ static void event_cb(int fd, short kind, void *userp)
|
||||
mcode_or_die("event_cb: curl_multi_socket_action", rc);
|
||||
|
||||
check_multi_info(g);
|
||||
if(g->still_running <= 0 ) {
|
||||
if ( g->still_running <= 0 ) {
|
||||
fprintf(MSG_OUT, "last transfer done, kill timeout\n");
|
||||
if(evtimer_pending(g->timer_event, NULL)) {
|
||||
if (evtimer_pending(g->timer_event, NULL)) {
|
||||
evtimer_del(g->timer_event);
|
||||
}
|
||||
}
|
||||
@ -220,8 +216,8 @@ static void timer_cb(int fd, short kind, void *userp)
|
||||
/* Clean up the SockInfo structure */
|
||||
static void remsock(SockInfo *f)
|
||||
{
|
||||
if(f) {
|
||||
if(f->evset)
|
||||
if (f) {
|
||||
if (f->evset)
|
||||
event_free(f->ev);
|
||||
free(f);
|
||||
}
|
||||
@ -238,7 +234,7 @@ static void setsock(SockInfo*f, curl_socket_t s, CURL*e, int act, GlobalInfo*g)
|
||||
f->sockfd = s;
|
||||
f->action = act;
|
||||
f->easy = e;
|
||||
if(f->evset)
|
||||
if (f->evset)
|
||||
event_free(f->ev);
|
||||
f->ev = event_new(g->evbase, f->sockfd, kind, event_cb, g);
|
||||
f->evset = 1;
|
||||
@ -266,12 +262,12 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
|
||||
|
||||
fprintf(MSG_OUT,
|
||||
"socket callback: s=%d e=%p what=%s ", s, e, whatstr[what]);
|
||||
if(what == CURL_POLL_REMOVE) {
|
||||
if (what == CURL_POLL_REMOVE) {
|
||||
fprintf(MSG_OUT, "\n");
|
||||
remsock(fdp);
|
||||
}
|
||||
else {
|
||||
if(!fdp) {
|
||||
if (!fdp) {
|
||||
fprintf(MSG_OUT, "Adding data: %s\n", whatstr[what]);
|
||||
addsock(s, e, what, g);
|
||||
}
|
||||
@ -322,7 +318,7 @@ static void new_conn(char *url, GlobalInfo *g )
|
||||
conn->error[0]='\0';
|
||||
|
||||
conn->easy = curl_easy_init();
|
||||
if(!conn->easy) {
|
||||
if (!conn->easy) {
|
||||
fprintf(MSG_OUT, "curl_easy_init() failed, exiting!\n");
|
||||
exit(2);
|
||||
}
|
||||
@ -330,7 +326,7 @@ static void new_conn(char *url, GlobalInfo *g )
|
||||
conn->url = strdup(url);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_URL, conn->url);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_WRITEFUNCTION, write_cb);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_WRITEDATA, conn);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_WRITEDATA, &conn);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_VERBOSE, 1L);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_ERRORBUFFER, conn->error);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_PRIVATE, conn);
|
||||
@ -360,12 +356,10 @@ static void fifo_cb(int fd, short event, void *arg)
|
||||
s[0]='\0';
|
||||
rv=fscanf(g->input, "%1023s%n", s, &n);
|
||||
s[n]='\0';
|
||||
if(n && s[0] ) {
|
||||
new_conn(s, arg); /* if we read a URL, go get it! */
|
||||
}
|
||||
else
|
||||
break;
|
||||
} while(rv != EOF);
|
||||
if ( n && s[0] ) {
|
||||
new_conn(s,arg); /* if we read a URL, go get it! */
|
||||
} else break;
|
||||
} while ( rv != EOF);
|
||||
}
|
||||
|
||||
/* Create a named pipe and tell libevent to monitor it */
|
||||
@ -376,20 +370,20 @@ static int init_fifo (GlobalInfo *g)
|
||||
curl_socket_t sockfd;
|
||||
|
||||
fprintf(MSG_OUT, "Creating named pipe \"%s\"\n", fifo);
|
||||
if(lstat (fifo, &st) == 0) {
|
||||
if((st.st_mode & S_IFMT) == S_IFREG) {
|
||||
if (lstat (fifo, &st) == 0) {
|
||||
if ((st.st_mode & S_IFMT) == S_IFREG) {
|
||||
errno = EEXIST;
|
||||
perror("lstat");
|
||||
exit (1);
|
||||
}
|
||||
}
|
||||
unlink(fifo);
|
||||
if(mkfifo (fifo, 0600) == -1) {
|
||||
if (mkfifo (fifo, 0600) == -1) {
|
||||
perror("mkfifo");
|
||||
exit (1);
|
||||
}
|
||||
sockfd = open(fifo, O_RDWR | O_NONBLOCK, 0);
|
||||
if(sockfd == -1) {
|
||||
if (sockfd == -1) {
|
||||
perror("open");
|
||||
exit (1);
|
||||
}
|
||||
|
@ -5,11 +5,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 2012 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 2012, 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.
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@ -20,13 +20,13 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* <DESC>
|
||||
* Uses the "Streaming HTML parser" to extract the href pieces in a streaming
|
||||
* manner from a downloaded HTML.
|
||||
* </DESC>
|
||||
*/
|
||||
/*
|
||||
* The HTML parser is found at http://code.google.com/p/htmlstreamparser/
|
||||
* This example uses the "Streaming HTML parser" to extract the href pieces in
|
||||
* a streaming manner from a downloaded HTML. Kindly donated by Michał
|
||||
* Kowalczyk.
|
||||
*
|
||||
* The parser is found at
|
||||
* http://code.google.com/p/htmlstreamparser/
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@ -38,11 +38,11 @@ static size_t write_callback(void *buffer, size_t size, size_t nmemb,
|
||||
void *hsp)
|
||||
{
|
||||
size_t realsize = size * nmemb, p;
|
||||
for(p = 0; p < realsize; p++) {
|
||||
for (p = 0; p < realsize; p++) {
|
||||
html_parser_char_parse(hsp, ((char *)buffer)[p]);
|
||||
if(html_parser_cmp_tag(hsp, "a", 1))
|
||||
if(html_parser_cmp_attr(hsp, "href", 4))
|
||||
if(html_parser_is_in(hsp, HTML_VALUE_ENDED)) {
|
||||
if (html_parser_cmp_tag(hsp, "a", 1))
|
||||
if (html_parser_cmp_attr(hsp, "href", 4))
|
||||
if (html_parser_is_in(hsp, HTML_VALUE_ENDED)) {
|
||||
html_parser_val(hsp)[html_parser_val_length(hsp)] = '\0';
|
||||
printf("%s\n", html_parser_val(hsp));
|
||||
}
|
||||
@ -56,7 +56,7 @@ int main(int argc, char *argv[])
|
||||
CURL *curl;
|
||||
HTMLSTREAMPARSER *hsp;
|
||||
|
||||
if(argc != 2) {
|
||||
if (argc != 2) {
|
||||
printf("Usage: %s URL\n", argv[0]);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
@ -5,11 +5,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@ -19,12 +19,13 @@
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
/* <DESC>
|
||||
* Download a document and use libtidy to parse the HTML.
|
||||
* </DESC>
|
||||
*/
|
||||
/*
|
||||
/* Download a document and use libtidy to parse the HTML.
|
||||
* Written by Jeff Pohlmeyer
|
||||
*
|
||||
* LibTidy => http://tidy.sourceforge.net
|
||||
*
|
||||
* gcc -Wall -I/usr/local/include tidycurl.c -lcurl -ltidy -o tidycurl
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@ -38,21 +39,23 @@ uint write_cb(char *in, uint size, uint nmemb, TidyBuffer *out)
|
||||
uint r;
|
||||
r = size * nmemb;
|
||||
tidyBufAppend( out, in, r );
|
||||
return r;
|
||||
return(r);
|
||||
}
|
||||
|
||||
/* Traverse the document tree */
|
||||
void dumpNode(TidyDoc doc, TidyNode tnod, int indent )
|
||||
{
|
||||
TidyNode child;
|
||||
for(child = tidyGetChild(tnod); child; child = tidyGetNext(child) ) {
|
||||
for ( child = tidyGetChild(tnod); child; child = tidyGetNext(child) )
|
||||
{
|
||||
ctmbstr name = tidyNodeGetName( child );
|
||||
if(name) {
|
||||
if ( name )
|
||||
{
|
||||
/* if it has a name, then it's an HTML tag ... */
|
||||
TidyAttr attr;
|
||||
printf( "%*.*s%s ", indent, indent, "<", name);
|
||||
/* walk the attribute list */
|
||||
for(attr=tidyAttrFirst(child); attr; attr=tidyAttrNext(attr) ) {
|
||||
for ( attr=tidyAttrFirst(child); attr; attr=tidyAttrNext(attr) ) {
|
||||
printf(tidyAttrName(attr));
|
||||
tidyAttrValue(attr)?printf("=\"%s\" ",
|
||||
tidyAttrValue(attr)):printf(" ");
|
||||
@ -80,7 +83,7 @@ int main(int argc, char **argv )
|
||||
TidyBuffer docbuf = {0};
|
||||
TidyBuffer tidy_errbuf = {0};
|
||||
int err;
|
||||
if(argc == 2) {
|
||||
if ( argc == 2) {
|
||||
curl = curl_easy_init();
|
||||
curl_easy_setopt(curl, CURLOPT_URL, argv[1]);
|
||||
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, curl_errbuf);
|
||||
@ -96,13 +99,13 @@ int main(int argc, char **argv )
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &docbuf);
|
||||
err=curl_easy_perform(curl);
|
||||
if(!err) {
|
||||
if ( !err ) {
|
||||
err = tidyParseBuffer(tdoc, &docbuf); /* parse the input */
|
||||
if(err >= 0) {
|
||||
if ( err >= 0 ) {
|
||||
err = tidyCleanAndRepair(tdoc); /* fix any problems */
|
||||
if(err >= 0) {
|
||||
if ( err >= 0 ) {
|
||||
err = tidyRunDiagnostics(tdoc); /* load tidy error buffer */
|
||||
if(err >= 0) {
|
||||
if ( err >= 0 ) {
|
||||
dumpNode( tdoc, tidyGetRoot(tdoc), 0 ); /* walk the tree */
|
||||
fprintf(stderr, "%s\n", tidy_errbuf.bp); /* show errors */
|
||||
}
|
||||
@ -117,11 +120,11 @@ int main(int argc, char **argv )
|
||||
tidyBufFree(&docbuf);
|
||||
tidyBufFree(&tidy_errbuf);
|
||||
tidyRelease(tdoc);
|
||||
return err;
|
||||
return(err);
|
||||
|
||||
}
|
||||
else
|
||||
printf( "usage: %s <url>\n", argv[0] );
|
||||
|
||||
return 0;
|
||||
return(0);
|
||||
}
|
||||
|
@ -5,11 +5,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@ -19,10 +19,8 @@
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
/* <DESC>
|
||||
* Get a web page, extract the title with libxml.
|
||||
* </DESC>
|
||||
*/
|
||||
// Get a web page, parse it with libxml.
|
||||
//
|
||||
// Written by Lars Nilsson
|
||||
//
|
||||
// GNU C++ compile command line suggestion (edit paths accordingly):
|
||||
@ -42,7 +40,7 @@
|
||||
//
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define COMPARE(a, b) (!_stricmp((a), (b)))
|
||||
#define COMPARE(a, b) (!stricmp((a), (b)))
|
||||
#else
|
||||
#define COMPARE(a, b) (!strcasecmp((a), (b)))
|
||||
#endif
|
||||
|
@ -5,11 +5,11 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
@ -19,10 +19,6 @@
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
/* <DESC>
|
||||
* simple HTTP POST using the easy interface
|
||||
* </DESC>
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <curl/curl.h>
|
||||
|
||||
|
@ -1,292 +0,0 @@
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
/* <DESC>
|
||||
* Multiplexed HTTP/2 downloads over a single connection
|
||||
* </DESC>
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
/* somewhat unix-specific */
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/* curl stuff */
|
||||
#include <curl/curl.h>
|
||||
|
||||
#ifndef CURLPIPE_MULTIPLEX
|
||||
/* This little trick will just make sure that we don't enable pipelining for
|
||||
libcurls old enough to not have this symbol. It is _not_ defined to zero in
|
||||
a recent libcurl header. */
|
||||
#define CURLPIPE_MULTIPLEX 0
|
||||
#endif
|
||||
|
||||
#define NUM_HANDLES 1000
|
||||
|
||||
void *curl_hnd[NUM_HANDLES];
|
||||
int num_transfers;
|
||||
|
||||
/* a handle to number lookup, highly ineffective when we do many
|
||||
transfers... */
|
||||
static int hnd2num(CURL *hnd)
|
||||
{
|
||||
int i;
|
||||
for(i=0; i< num_transfers; i++) {
|
||||
if(curl_hnd[i] == hnd)
|
||||
return i;
|
||||
}
|
||||
return 0; /* weird, but just a fail-safe */
|
||||
}
|
||||
|
||||
static
|
||||
void dump(const char *text, int num, unsigned char *ptr, size_t size,
|
||||
char nohex)
|
||||
{
|
||||
size_t i;
|
||||
size_t c;
|
||||
|
||||
unsigned int width=0x10;
|
||||
|
||||
if(nohex)
|
||||
/* without the hex output, we can fit more on screen */
|
||||
width = 0x40;
|
||||
|
||||
fprintf(stderr, "%d %s, %ld bytes (0x%lx)\n",
|
||||
num, text, (long)size, (long)size);
|
||||
|
||||
for(i=0; i<size; i+= width) {
|
||||
|
||||
fprintf(stderr, "%4.4lx: ", (long)i);
|
||||
|
||||
if(!nohex) {
|
||||
/* hex not disabled, show it */
|
||||
for(c = 0; c < width; c++)
|
||||
if(i+c < size)
|
||||
fprintf(stderr, "%02x ", ptr[i+c]);
|
||||
else
|
||||
fputs(" ", stderr);
|
||||
}
|
||||
|
||||
for(c = 0; (c < width) && (i+c < size); c++) {
|
||||
/* check for 0D0A; if found, skip past and start a new line of output */
|
||||
if(nohex && (i+c+1 < size) && ptr[i+c]==0x0D && ptr[i+c+1]==0x0A) {
|
||||
i+=(c+2-width);
|
||||
break;
|
||||
}
|
||||
fprintf(stderr, "%c",
|
||||
(ptr[i+c]>=0x20) && (ptr[i+c]<0x80)?ptr[i+c]:'.');
|
||||
/* check again for 0D0A, to avoid an extra \n if it's at width */
|
||||
if(nohex && (i+c+2 < size) && ptr[i+c+1]==0x0D && ptr[i+c+2]==0x0A) {
|
||||
i+=(c+3-width);
|
||||
break;
|
||||
}
|
||||
}
|
||||
fputc('\n', stderr); /* newline */
|
||||
}
|
||||
}
|
||||
|
||||
static
|
||||
int my_trace(CURL *handle, curl_infotype type,
|
||||
char *data, size_t size,
|
||||
void *userp)
|
||||
{
|
||||
const char *text;
|
||||
int num = hnd2num(handle);
|
||||
(void)handle; /* prevent compiler warning */
|
||||
(void)userp;
|
||||
switch (type) {
|
||||
case CURLINFO_TEXT:
|
||||
fprintf(stderr, "== %d Info: %s", num, data);
|
||||
default: /* in case a new one is introduced to shock us */
|
||||
return 0;
|
||||
|
||||
case CURLINFO_HEADER_OUT:
|
||||
text = "=> Send header";
|
||||
break;
|
||||
case CURLINFO_DATA_OUT:
|
||||
text = "=> Send data";
|
||||
break;
|
||||
case CURLINFO_SSL_DATA_OUT:
|
||||
text = "=> Send SSL data";
|
||||
break;
|
||||
case CURLINFO_HEADER_IN:
|
||||
text = "<= Recv header";
|
||||
break;
|
||||
case CURLINFO_DATA_IN:
|
||||
text = "<= Recv data";
|
||||
break;
|
||||
case CURLINFO_SSL_DATA_IN:
|
||||
text = "<= Recv SSL data";
|
||||
break;
|
||||
}
|
||||
|
||||
dump(text, num, (unsigned char *)data, size, 1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void setup(CURL *hnd, int num)
|
||||
{
|
||||
FILE *out;
|
||||
char filename[128];
|
||||
|
||||
snprintf(filename, 128, "dl-%d", num);
|
||||
|
||||
out = fopen(filename, "wb");
|
||||
|
||||
/* write to this file */
|
||||
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, out);
|
||||
|
||||
/* set the same URL */
|
||||
curl_easy_setopt(hnd, CURLOPT_URL, "https://localhost:8443/index.html");
|
||||
|
||||
/* send it verbose for max debuggaility */
|
||||
curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
|
||||
curl_easy_setopt(hnd, CURLOPT_DEBUGFUNCTION, my_trace);
|
||||
|
||||
/* HTTP/2 please */
|
||||
curl_easy_setopt(hnd, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
|
||||
|
||||
/* we use a self-signed test server, skip verification during debugging */
|
||||
curl_easy_setopt(hnd, CURLOPT_SSL_VERIFYPEER, 0L);
|
||||
curl_easy_setopt(hnd, CURLOPT_SSL_VERIFYHOST, 0L);
|
||||
|
||||
#if (CURLPIPE_MULTIPLEX > 0)
|
||||
/* wait for pipe connection to confirm */
|
||||
curl_easy_setopt(hnd, CURLOPT_PIPEWAIT, 1L);
|
||||
#endif
|
||||
|
||||
curl_hnd[num] = hnd;
|
||||
}
|
||||
|
||||
/*
|
||||
* Simply download two files over HTTP/2, using the same physical connection!
|
||||
*/
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
CURL *easy[NUM_HANDLES];
|
||||
CURLM *multi_handle;
|
||||
int i;
|
||||
int still_running; /* keep number of running handles */
|
||||
|
||||
if(argc > 1)
|
||||
/* if given a number, do that many transfers */
|
||||
num_transfers = atoi(argv[1]);
|
||||
|
||||
if(!num_transfers || (num_transfers > NUM_HANDLES))
|
||||
num_transfers = 3; /* a suitable low default */
|
||||
|
||||
/* init a multi stack */
|
||||
multi_handle = curl_multi_init();
|
||||
|
||||
for(i=0; i<num_transfers; i++) {
|
||||
easy[i] = curl_easy_init();
|
||||
/* set options */
|
||||
setup(easy[i], i);
|
||||
|
||||
/* add the individual transfer */
|
||||
curl_multi_add_handle(multi_handle, easy[i]);
|
||||
}
|
||||
|
||||
curl_multi_setopt(multi_handle, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX);
|
||||
|
||||
/* we start some action by calling perform right away */
|
||||
curl_multi_perform(multi_handle, &still_running);
|
||||
|
||||
do {
|
||||
struct timeval timeout;
|
||||
int rc; /* select() return code */
|
||||
CURLMcode mc; /* curl_multi_fdset() return code */
|
||||
|
||||
fd_set fdread;
|
||||
fd_set fdwrite;
|
||||
fd_set fdexcep;
|
||||
int maxfd = -1;
|
||||
|
||||
long curl_timeo = -1;
|
||||
|
||||
FD_ZERO(&fdread);
|
||||
FD_ZERO(&fdwrite);
|
||||
FD_ZERO(&fdexcep);
|
||||
|
||||
/* set a suitable timeout to play around with */
|
||||
timeout.tv_sec = 1;
|
||||
timeout.tv_usec = 0;
|
||||
|
||||
curl_multi_timeout(multi_handle, &curl_timeo);
|
||||
if(curl_timeo >= 0) {
|
||||
timeout.tv_sec = curl_timeo / 1000;
|
||||
if(timeout.tv_sec > 1)
|
||||
timeout.tv_sec = 1;
|
||||
else
|
||||
timeout.tv_usec = (curl_timeo % 1000) * 1000;
|
||||
}
|
||||
|
||||
/* get file descriptors from the transfers */
|
||||
mc = curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
|
||||
|
||||
if(mc != CURLM_OK) {
|
||||
fprintf(stderr, "curl_multi_fdset() failed, code %d.\n", mc);
|
||||
break;
|
||||
}
|
||||
|
||||
/* On success the value of maxfd is guaranteed to be >= -1. We call
|
||||
select(maxfd + 1, ...); specially in case of (maxfd == -1) there are
|
||||
no fds ready yet so we call select(0, ...) --or Sleep() on Windows--
|
||||
to sleep 100ms, which is the minimum suggested value in the
|
||||
curl_multi_fdset() doc. */
|
||||
|
||||
if(maxfd == -1) {
|
||||
#ifdef _WIN32
|
||||
Sleep(100);
|
||||
rc = 0;
|
||||
#else
|
||||
/* Portable sleep for platforms other than Windows. */
|
||||
struct timeval wait = { 0, 100 * 1000 }; /* 100ms */
|
||||
rc = select(0, NULL, NULL, NULL, &wait);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
/* Note that on some platforms 'timeout' may be modified by select().
|
||||
If you need access to the original value save a copy beforehand. */
|
||||
rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
|
||||
}
|
||||
|
||||
switch(rc) {
|
||||
case -1:
|
||||
/* select error */
|
||||
break;
|
||||
case 0:
|
||||
default:
|
||||
/* timeout or readable/writable sockets */
|
||||
curl_multi_perform(multi_handle, &still_running);
|
||||
break;
|
||||
}
|
||||
} while(still_running);
|
||||
|
||||
curl_multi_cleanup(multi_handle);
|
||||
|
||||
for(i=0; i<num_transfers; i++)
|
||||
curl_easy_cleanup(easy[i]);
|
||||
|
||||
return 0;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user