Commit 9e3ef40e authored by Brad King's avatar Brad King
Browse files

Merge branch 'upstream-curl' into update-curl

* upstream-curl:
  curl 2017-10-04 (3ea76790)
parents 2fad0e20 de7c21d6
......@@ -93,3 +93,32 @@ macro(CURL_INTERNAL_TEST_RUN CURL_TEST)
endif(${CURL_TEST}_COMPILE AND NOT ${CURL_TEST})
endif()
endmacro(CURL_INTERNAL_TEST_RUN)
macro(CURL_NROFF_CHECK)
find_program(NROFF NAMES gnroff nroff)
if(NROFF)
# Need a way to write to stdin, this will do
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/nroff-input.txt" "test")
# Tests for a valid nroff option to generate a manpage
foreach(_MANOPT "-man" "-mandoc")
execute_process(COMMAND "${NROFF}" ${_MANOPT}
OUTPUT_VARIABLE NROFF_MANOPT_OUTPUT
INPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/nroff-input.txt"
ERROR_QUIET)
# Save the option if it was valid
if(NROFF_MANOPT_OUTPUT)
message("Found *nroff option: -- ${_MANOPT}")
set(NROFF_MANOPT ${_MANOPT})
set(NROFF_USEFUL ON)
break()
endif()
endforeach()
# No need for the temporary file
file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/nroff-input.txt")
if(NOT NROFF_USEFUL)
message(WARNING "Found no *nroff option to get plaintext from man pages")
endif()
else()
message(WARNING "Found no *nroff program")
endif()
endmacro(CURL_NROFF_CHECK)
......@@ -32,9 +32,9 @@ int main(void) {
if(curl_cv_recv)
if(NOT DEFINED curl_cv_func_recv_args OR "${curl_cv_func_recv_args}" STREQUAL "unknown")
foreach(recv_retv "int" "ssize_t" )
foreach(recv_arg1 "int" "ssize_t" "SOCKET")
foreach(recv_arg2 "void *" "char *")
foreach(recv_arg3 "size_t" "int" "socklen_t" "unsigned int")
foreach(recv_arg1 "SOCKET" "int" )
foreach(recv_arg2 "char *" "void *" )
foreach(recv_arg3 "int" "size_t" "socklen_t" "unsigned int")
foreach(recv_arg4 "int" "unsigned int")
if(NOT curl_cv_func_recv_done)
unset(curl_cv_func_recv_test CACHE)
......@@ -96,9 +96,9 @@ int main(void) {
if(curl_cv_send)
if(NOT DEFINED curl_cv_func_send_args OR "${curl_cv_func_send_args}" STREQUAL "unknown")
foreach(send_retv "int" "ssize_t" )
foreach(send_arg1 "int" "ssize_t" "SOCKET")
foreach(send_arg2 "const void *" "void *" "char *" "const char *")
foreach(send_arg3 "size_t" "int" "socklen_t" "unsigned int")
foreach(send_arg1 "SOCKET" "int" "ssize_t" )
foreach(send_arg2 "const char *" "const void *" "void *" "char *")
foreach(send_arg3 "int" "size_t" "socklen_t" "unsigned int")
foreach(send_arg4 "int" "unsigned int")
if(NOT curl_cv_func_send_done)
unset(curl_cv_func_send_test CACHE)
......
if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
if (NOT DEFINED CMAKE_INSTALL_PREFIX)
set (CMAKE_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@")
endif ()
message(${CMAKE_INSTALL_PREFIX})
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
foreach(file ${files})
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
exec_program(
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
endif(NOT "${rm_retval}" STREQUAL 0)
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
endforeach(file)
......@@ -88,7 +88,7 @@ endif()
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
# Copyright (C) 1998 - 2017, 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
......@@ -126,6 +126,7 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake;${CMAKE_MODULE_PATH}")
include(Utilities)
include(Macros)
include(CMakeDependentOption)
include(CheckCCompilerFlag)
project( CURL C )
......@@ -159,20 +160,36 @@ set(OS "\"${CMAKE_SYSTEM_NAME}\"")
include_directories(${PROJECT_BINARY_DIR}/include/curl)
include_directories( ${CURL_SOURCE_DIR}/include )
option(CURL_WERROR "Turn compiler warnings into errors" OFF)
option(PICKY_COMPILER "Enable picky compiler options" ON)
option(BUILD_CURL_EXE "Set to ON to build curl executable." 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)
if(WIN32)
CMAKE_DEPENDENT_OPTION(ENABLE_THREADED_RESOLVER
"Set to ON to enable threaded DNS lookup"
ON "NOT ENABLE_ARES"
OFF)
else()
option(ENABLE_THREADED_RESOLVER "Set to ON to enable POSIX threaded DNS lookup" OFF)
option(CURL_STATIC_CRT "Set to ON to build libcurl with static CRT on Windows (/MT)." OFF)
option(ENABLE_INET_PTON "Set to OFF to prevent usage of inet_pton when building against modern SDKs while still requiring compatibility with older Windows versions, such as Windows XP, Windows Server 2003 etc." ON)
endif()
CMAKE_DEPENDENT_OPTION(ENABLE_THREADED_RESOLVER "Set to ON to enable threaded DNS lookup"
ON "NOT ENABLE_ARES"
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(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
if (PICKY_COMPILER)
foreach (_CCOPT -pedantic -Wall -W -Wpointer-arith -Wwrite-strings -Wunused -Wshadow -Winline -Wnested-externs -Wmissing-declarations -Wmissing-prototypes -Wno-long-long -Wfloat-equal -Wno-multichar -Wsign-compare -Wundef -Wno-format-nonliteral -Wendif-labels -Wstrict-prototypes -Wdeclaration-after-statement -Wstrict-aliasing=3 -Wcast-align -Wtype-limits -Wold-style-declaration -Wmissing-parameter-type -Wempty-body -Wclobbered -Wignored-qualifiers -Wconversion -Wno-sign-conversion -Wvla -Wdouble-promotion -Wno-system-headers)
# surprisingly, CHECK_C_COMPILER_FLAG needs a new variable to store each new
# test result in.
CHECK_C_COMPILER_FLAG(${_CCOPT} OPT${_CCOPT})
if(OPT${_CCOPT})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_CCOPT}")
endif()
endforeach()
endif(PICKY_COMPILER)
endif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
if (ENABLE_DEBUG)
# DEBUGBUILD will be defined only for Debug builds
if(NOT CMAKE_VERSION VERSION_LESS 3.0)
......@@ -187,13 +204,12 @@ if (ENABLE_CURLDEBUG)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS CURLDEBUG)
endif()
# For debug libs and exes, add "-d" postfix
set(CMAKE_DEBUG_POSTFIX "-d" CACHE STRING "Set debug library postfix")
# 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)
find_package(CARES REQUIRED)
......@@ -201,11 +217,6 @@ if(ENABLE_ARES)
set(CURL_LIBS ${CURL_LIBS} ${CARES_LIBRARY})
endif()
if(MSVC)
option(BUILD_RELEASE_DEBUG_DIRS "Set OFF to build each configuration to a separate directory" OFF)
mark_as_advanced(BUILD_RELEASE_DEBUG_DIRS)
endif()
if(0) # This code not needed for building within CMake.
include(CurlSymbolHiding)
endif()
......@@ -265,8 +276,6 @@ option(CURL_DISABLE_CRYPTO_AUTH "to disable cryptographic authentication" OFF)
mark_as_advanced(CURL_DISABLE_CRYPTO_AUTH)
option(CURL_DISABLE_VERBOSE_STRINGS "to disable verbose strings" OFF)
mark_as_advanced(CURL_DISABLE_VERBOSE_STRINGS)
option(DISABLED_THREADSAFE "Set to explicitly specify we don't want to use thread-safe functions" OFF)
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)
......@@ -283,51 +292,48 @@ if(ENABLE_IPV6 AND NOT WIN32)
endif()
endif()
option(ENABLE_MANUAL "to provide the built-in manual" ON)
unset(USE_MANUAL CACHE) # TODO: cache NROFF/NROFF_MANOPT/USE_MANUAL vars?
if(ENABLE_MANUAL)
find_program(NROFF NAMES gnroff nroff)
if(NROFF)
# Need a way to write to stdin, this will do
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/nroff-input.txt" "test")
# Tests for a valid nroff option to generate a manpage
foreach(_MANOPT "-man" "-mandoc")
execute_process(COMMAND "${NROFF}" ${_MANOPT}
OUTPUT_VARIABLE NROFF_MANOPT_OUTPUT
INPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/nroff-input.txt"
ERROR_QUIET)
# Save the option if it was valid
if(NROFF_MANOPT_OUTPUT)
message("Found *nroff option: -- ${_MANOPT}")
set(NROFF_MANOPT ${_MANOPT})
set(USE_MANUAL 1)
break()
endif()
endforeach()
# No need for the temporary file
file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/nroff-input.txt")
if(NOT USE_MANUAL)
message(WARNING "Found no *nroff option to get plaintext from man pages")
endif()
else()
message(WARNING "Found no *nroff program")
endif()
endif()
if(0) # This code not needed for building within CMake.
CURL_NROFF_CHECK()
# Required for building manual, docs, tests
find_package(Perl REQUIRED)
find_package(Perl)
CMAKE_DEPENDENT_OPTION(ENABLE_MANUAL "to provide the built-in manual"
ON "NROFF_USEFUL;PERL_FOUND"
OFF)
if(NOT PERL_FOUND)
message(STATUS "Perl not found, testing disabled.")
set(BUILD_TESTING OFF)
endif()
if(ENABLE_MANUAL)
set(USE_MANUAL ON)
endif()
endif()
# We need ansi c-flags, especially on HP
set(CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS}")
set(CMAKE_REQUIRED_FLAGS ${CMAKE_ANSI_CFLAGS})
if(CURL_STATIC_CRT)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
endif()
# Disable warnings on Borland to avoid changing 3rd party code.
if(BORLAND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w-")
endif(BORLAND)
if(CURL_WERROR)
if(MSVC_VERSION)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /WX")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /WX")
else()
# this assumes clang or gcc style options
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
endif()
endif(CURL_WERROR)
# If we are on AIX, do the _ALL_SOURCE magic
if(${CMAKE_SYSTEM_NAME} MATCHES AIX)
set(_ALL_SOURCE 1)
......@@ -349,19 +355,14 @@ if(WIN32)
endif(WIN32)
if(ENABLE_THREADED_RESOLVER)
find_package(Threads REQUIRED)
if(WIN32)
set(USE_THREADS_WIN32 ON)
else()
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()
set(USE_THREADS_POSIX ${CMAKE_USE_PTHREADS_INIT})
set(HAVE_PTHREAD_H ${CMAKE_USE_PTHREADS_INIT})
endif()
set(CURL_LIBS ${CURL_LIBS} ${CMAKE_THREAD_LIBS_INIT})
endif()
# Check for all needed libraries
......@@ -911,11 +912,6 @@ check_type_size("int" SIZEOF_INT)
check_type_size("__int64" SIZEOF___INT64)
check_type_size("time_t" SIZEOF_TIME_T)
# Make public versions of some type sizes for curlbuild.h.
foreach(t INT LONG LONG_LONG SSIZE_T)
string(REPLACE "SIZEOF_" "CURL_SIZEOF_" CURL_SIZEOF_${t}_CODE "${SIZEOF_${t}_CODE}")
endforeach()
if(HAVE_SIZEOF_LONG_LONG)
set(HAVE_LONGLONG 1)
set(HAVE_LL 1)
......@@ -1003,7 +999,18 @@ check_symbol_exists(ioctl "${CURL_INCLUDES}" HAVE_IOCTL)
check_symbol_exists(setsockopt "${CURL_INCLUDES}" HAVE_SETSOCKOPT)
# symbol exists in win32, but function does not.
check_function_exists(inet_pton HAVE_INET_PTON)
if(WIN32)
if(ENABLE_INET_PTON)
check_function_exists(inet_pton HAVE_INET_PTON)
# _WIN32_WINNT_VISTA (0x0600)
add_definitions(-D_WIN32_WINNT=0x0600)
else()
# _WIN32_WINNT_WINXP (0x0501)
add_definitions(-D_WIN32_WINNT=0x0501)
endif()
else()
check_function_exists(inet_pton HAVE_INET_PTON)
endif()
check_symbol_exists(fsetxattr "${CURL_INCLUDES}" HAVE_FSETXATTR)
if(HAVE_FSETXATTR)
......@@ -1075,6 +1082,13 @@ if(HAVE_FILE_OFFSET_BITS)
set(CMAKE_REQUIRED_FLAGS "-D_FILE_OFFSET_BITS=64")
endif(HAVE_FILE_OFFSET_BITS)
check_type_size("off_t" SIZEOF_OFF_T)
# include this header to get the type
set(CMAKE_REQUIRED_INCLUDES "${CURL_SOURCE_DIR}/include")
set(CMAKE_EXTRA_INCLUDE_FILES "curl/system.h")
check_type_size("curl_off_t" SIZEOF_CURL_OFF_T)
set(CMAKE_EXTRA_INCLUDE_FILES "")
set(CMAKE_REQUIRED_FLAGS)
foreach(CURL_TEST
......@@ -1190,7 +1204,7 @@ else()
set(CURL_HAVE_SOCKLEN_T 0)
endif()
# TODO test which of these headers are required for the typedefs used in curlbuild.h
# TODO test which of these headers are required
if(WIN32)
set(CURL_PULL_WS2TCPIP_H ${HAVE_WS2TCPIP_H})
else()
......@@ -1205,11 +1219,6 @@ include(CMake/OtherTests.cmake)
add_definitions(-DHAVE_CONFIG_H)
# For windows, do not allow the compiler to use default target (Vista).
if(WIN32)
add_definitions(-D_WIN32_WINNT=0x0501)
endif(WIN32)
# For windows, all compilers used by cmake should support large files
if(WIN32)
set(USE_WIN32_LARGE_FILES ON)
......@@ -1217,6 +1226,11 @@ endif(WIN32)
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
if(CMAKE_C_FLAGS MATCHES "/W[0-4]")
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
else(CMAKE_C_FLAGS MATCHES "/W[0-4]")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")
endif(CMAKE_C_FLAGS MATCHES "/W[0-4]")
endif(MSVC)
# Ugly (but functional) way to include "Makefile.inc" by transforming it (= regenerate it).
......@@ -1235,10 +1249,12 @@ function(TRANSFORM_MAKEFILE_INC INPUT_FILE OUTPUT_FILE)
endfunction()
if(0) # This code not needed for building within CMake.
add_subdirectory(docs)
if(USE_MANUAL)
add_subdirectory(docs)
endif()
add_subdirectory(lib)
if(BUILD_CURL_EXE)
add_subdirectory(src)
endif()
......@@ -1355,7 +1371,7 @@ set(LDFLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
set(LIBCURL_LIBS "")
set(libdir "${CMAKE_INSTALL_PREFIX}/lib")
foreach(_lib ${CMAKE_C_IMPLICIT_LINK_LIBRARIES} ${CURL_LIBS})
if(_lib MATCHES ".*/.*")
if(_lib MATCHES ".*/.*" OR _lib MATCHES "^-")
set(LIBCURL_LIBS "${LIBCURL_LIBS} ${_lib}")
else()
set(LIBCURL_LIBS "${LIBCURL_LIBS} -l${_lib}")
......@@ -1391,16 +1407,10 @@ if(NOT CURL_CONFIG_HAS_BEEN_RUN_BEFORE)
set(CURL_CONFIG_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL "Flag to track whether this is the first time running CMake or if CMake has been configured before")
endif()
# Installation.
# First, install generated curlbuild.h
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/include/curl/curlbuild.h"
DESTINATION include/curl )
# Next, install other headers excluding curlbuild.h
# install headers
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/curl"
DESTINATION include
FILES_MATCHING PATTERN "*.h"
PATTERN "curlbuild.h" EXCLUDE)
FILES_MATCHING PATTERN "*.h")
# Workaround for MSVS10 to avoid the Dialog Hell
# FIXME: This could be removed with future version of CMake.
......@@ -1410,4 +1420,15 @@ if(MSVC_VERSION EQUAL 1600)
file(APPEND "${CURL_SLN_FILENAME}" "\n# This should be regenerated!\n")
endif()
endif()
if(NOT TARGET uninstall)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/CMake/cmake_uninstall.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/CMake/cmake_uninstall.cmake
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P
${CMAKE_CURRENT_BINARY_DIR}/CMake/cmake_uninstall.cmake)
endif()
endif()
......@@ -36,8 +36,6 @@
#include "curlver.h" /* libcurl version defines */
#include "system.h" /* determine things run-time */
#include "cmcurl/include/curl/curlbuild.h" /* libcurl build definitions */
#include "curlrules.h" /* libcurl rules enforcement */
/*
* Define WIN32 when build target is Win32 API
......@@ -76,6 +74,7 @@
#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \
defined(ANDROID) || defined(__ANDROID__) || defined(__OpenBSD__) || \
defined(__CYGWIN__) || \
(defined(__FreeBSD_version) && (__FreeBSD_version < 800000))
#include <sys/select.h>
#endif
......@@ -134,6 +133,27 @@ typedef int curl_socket_t;
#define curl_socket_typedef
#endif /* curl_socket_typedef */
/* enum for the different supported SSL backends */
typedef enum {
CURLSSLBACKEND_NONE = 0,
CURLSSLBACKEND_OPENSSL = 1,
CURLSSLBACKEND_GNUTLS = 2,
CURLSSLBACKEND_NSS = 3,
CURLSSLBACKEND_OBSOLETE4 = 4, /* Was QSOSSL. */
CURLSSLBACKEND_GSKIT = 5,
CURLSSLBACKEND_POLARSSL = 6,
CURLSSLBACKEND_WOLFSSL = 7,
CURLSSLBACKEND_SCHANNEL = 8,
CURLSSLBACKEND_DARWINSSL = 9,
CURLSSLBACKEND_AXTLS = 10,
CURLSSLBACKEND_MBEDTLS = 11
} curl_sslbackend;
/* aliases for library clones and renames */
#define CURLSSLBACKEND_LIBRESSL CURLSSLBACKEND_OPENSSL
#define CURLSSLBACKEND_BORINGSSL CURLSSLBACKEND_OPENSSL
#define CURLSSLBACKEND_CYASSL CURLSSLBACKEND_WOLFSSL
struct curl_httppost {
struct curl_httppost *next; /* next entry in the list */
char *name; /* pointer to allocated name */
......@@ -337,7 +357,7 @@ typedef size_t (*curl_read_callback)(char *buffer,
size_t nitems,
void *instream);
typedef enum {
typedef enum {
CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */
CURLSOCKTYPE_ACCEPT, /* socket created by accept() call */
CURLSOCKTYPE_LAST /* never use */
......@@ -379,7 +399,7 @@ typedef enum {
CURLIOE_LAST /* never use */
} curlioerr;
typedef enum {
typedef enum {
CURLIOCMD_NOP, /* no operation */
CURLIOCMD_RESTARTREAD, /* restart the read stream from start */
CURLIOCMD_LAST /* never use */
......@@ -679,6 +699,8 @@ typedef enum {
#define CURLAUTH_NEGOTIATE (((unsigned long)1)<<2)
/* Deprecated since the advent of CURLAUTH_NEGOTIATE */
#define CURLAUTH_GSSNEGOTIATE CURLAUTH_NEGOTIATE
/* Used for CURLOPT_SOCKS5_AUTH to stay terminologically correct */
#define CURLAUTH_GSSAPI CURLAUTH_NEGOTIATE
#define CURLAUTH_NTLM (((unsigned long)1)<<3)
#define CURLAUTH_DIGEST_IE (((unsigned long)1)<<4)
#define CURLAUTH_NTLM_WB (((unsigned long)1)<<5)
......@@ -1782,6 +1804,18 @@ typedef enum {
/* Suppress proxy CONNECT response headers from user callbacks */
CINIT(SUPPRESS_CONNECT_HEADERS, LONG, 265),
/* The request target, instead of extracted from the URL */
CINIT(REQUEST_TARGET, STRINGPOINT, 266),
/* bitmask of allowed auth methods for connections to SOCKS5 proxies */
CINIT(SOCKS5_AUTH, LONG, 267),
/* Enable/disable SSH compression */
CINIT(SSH_COMPRESSION, LONG, 268),
/* Post MIME data. */
CINIT(MIMEPOST, OBJECTPOINT, 269),
CURLOPT_LASTENTRY /* the last unused */
} CURLoption;
......@@ -1928,15 +1962,140 @@ typedef enum {
CURL_TIMECOND_LAST
} curl_TimeCond;
/* Special size_t value signaling a zero-terminated string. */
#define CURL_ZERO_TERMINATED ((size_t) -1)
/* curl_strequal() and curl_strnequal() are subject for removal in a future
libcurl, see lib/README.curlx for details
release */
CURL_EXTERN int curl_strequal(const char *s1, const char *s2);
CURL_EXTERN int curl_strnequal(const char *s1, const char *s2, size_t n);
/* Mime/form handling support. */
typedef struct curl_mime_s curl_mime; /* Mime context. */
typedef struct curl_mimepart_s curl_mimepart; /* Mime part context. */
/*
* NAME curl_mime_init()
*
* DESCRIPTION
*
* Create a mime context and return its handle. The easy parameter is the
* target handle.
*/
CURL_EXTERN curl_mime *curl_mime_init(CURL *easy);
/*
* NAME curl_mime_free()
*
* DESCRIPTION
*
* release a mime handle and its substructures.
*/
CURL_EXTERN void curl_mime_free(curl_mime *mime);
/*
* NAME curl_mime_addpart()
*
* DESCRIPTION
*
* Append a new empty part to the given mime context and return a handle to
* the created part.
*/
CURL_EXTERN curl_mimepart *curl_mime_addpart(curl_mime *mime);
/*
* NAME curl_mime_name()
*
* DESCRIPTION
*
* Set mime/form part name.
*/
CURL_EXTERN CURLcode curl_mime_name(curl_mimepart *part, const char *name);
/*
* NAME curl_mime_filename()
*
* DESCRIPTION
*
* Set mime part remote file name.
*/
CURL_EXTERN CURLcode curl_mime_filename(curl_mimepart *part,
const char *filename);
/*
* NAME curl_mime_type()
*
* DESCRIPTION
*
* Set mime part type.
*/
CURL_EXTERN CURLcode curl_mime_type(curl_mimepart *part, const char *mimetype);
/*
* NAME curl_mime_encoder()
*
* DESCRIPTION
*
* Set mime data transfer encoder.
*/
CURL_EXTERN CURLcode curl_mime_encoder(curl_mimepart *part,
const char *encoding);
/*
* NAME curl_mime_data()
*
* DESCRIPTION
*
* Set mime part data source from memory data,
*/
CURL_EXTERN CURLcode curl_mime_data(curl_mimepart *part,
const char *data, size_t datasize);
/*
* NAME curl_mime_filedata()
*
* DESCRIPTION
*
* Set mime part data source from named file.
*/
CURL_EXTERN CURLcode curl_mime_filedata(curl_mimepart *part,
const char *filename);
/*
* NAME curl_mime_data_cb()
*
* DESCRIPTION
*
* Set mime part data source from callback function.
*/
CURL_EXTERN CURLcode curl_mime_data_cb(curl_mimepart *part,