Skip to content

Commit 187d27f

Browse files
patrikjuvonensaml1er
authored andcommitted
#270: update curl from 7.59.0 to 7.61.0 (#271)
* curl: update from 7.59.0 to 7.61.0 * curl: update premake5 * curl: fix gcc compile errors * curl: fix gcc compile errors, part 2 * curl: fix gcc compile errors, part 3 * CRemoteCalls: set application/json Content-Type * CRemoteCalls: return errno as 0 instead of nil if JSON was valid * CRemoteCalls: addendum to previous commit, let's return 0 always The reason is that the request went through and everything, it should be considered as OK instead of nil upon success. Yes, the JSON might be invalid, but then responseData is nil, and that's ok. * curl: revert configure and Makefile changes * curl: revert autocrlf changes to ease diff My Windows PC Git did autocrlf which caused changes to almost all the files, lol * CRemoteCalls: revert change to callRemote errno behavior, see #294
1 parent 9ee294d commit 187d27f

File tree

1,744 files changed

+39309
-35624
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,744 files changed

+39309
-35624
lines changed

vendor/curl/CHANGES

Lines changed: 5065 additions & 4764 deletions
Large diffs are not rendered by default.

vendor/curl/CMakeLists.txt

Lines changed: 87 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# | (__| |_| | _ <| |___
66
# \___|\___/|_| \_\_____|
77
#
8-
# Copyright (C) 1998 - 2017, Daniel Stenberg, <[email protected]>, et al.
8+
# Copyright (C) 1998 - 2018, Daniel Stenberg, <[email protected]>, et al.
99
#
1010
# This software is licensed as described in the file COPYING, which
1111
# you should have received as part of this distribution. The terms
@@ -100,8 +100,8 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
100100
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_CCOPT}")
101101
endif()
102102
endforeach()
103-
endif(PICKY_COMPILER)
104-
endif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
103+
endif()
104+
endif()
105105

106106
if (ENABLE_DEBUG)
107107
# DEBUGBUILD will be defined only for Debug builds
@@ -118,7 +118,9 @@ if (ENABLE_CURLDEBUG)
118118
endif()
119119

120120
# For debug libs and exes, add "-d" postfix
121-
set(CMAKE_DEBUG_POSTFIX "-d" CACHE STRING "Set debug library postfix")
121+
if(NOT DEFINED CMAKE_DEBUG_POSTFIX)
122+
set(CMAKE_DEBUG_POSTFIX "-d")
123+
endif()
122124

123125
# initialize CURL_LIBS
124126
set(CURL_LIBS "")
@@ -230,22 +232,12 @@ endif()
230232
# Disable warnings on Borland to avoid changing 3rd party code.
231233
if(BORLAND)
232234
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w-")
233-
endif(BORLAND)
234-
235-
if(CURL_WERROR)
236-
if(MSVC_VERSION)
237-
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /WX")
238-
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /WX")
239-
else()
240-
# this assumes clang or gcc style options
241-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
242-
endif()
243-
endif(CURL_WERROR)
235+
endif()
244236

245237
# If we are on AIX, do the _ALL_SOURCE magic
246238
if(${CMAKE_SYSTEM_NAME} MATCHES AIX)
247239
set(_ALL_SOURCE 1)
248-
endif(${CMAKE_SYSTEM_NAME} MATCHES AIX)
240+
endif()
249241

250242
# Include all the necessary files for macros
251243
include (CheckFunctionExists)
@@ -261,7 +253,7 @@ include (CMakeDependentOption)
261253
if(WIN32)
262254
set(CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_WINSOCKAPI_=")
263255
include(${CMAKE_CURRENT_SOURCE_DIR}/CMake/Platforms/WindowsCache.cmake)
264-
endif(WIN32)
256+
endif()
265257

266258
if(ENABLE_THREADED_RESOLVER)
267259
find_package(Threads REQUIRED)
@@ -284,17 +276,18 @@ if(BEOS)
284276
set(NOT_NEED_LIBNSL 1)
285277
check_library_exists_concat("bind" gethostbyname HAVE_LIBBIND)
286278
check_library_exists_concat("bnetapi" closesocket HAVE_LIBBNETAPI)
287-
endif(BEOS)
279+
endif()
288280

289281
if(NOT NOT_NEED_LIBNSL)
290282
check_library_exists_concat("nsl" gethostbyname HAVE_LIBNSL)
291-
endif(NOT NOT_NEED_LIBNSL)
283+
endif()
292284

293285
check_function_exists(gethostname HAVE_GETHOSTNAME)
294286

295287
if(WIN32)
296288
check_library_exists_concat("ws2_32" getch HAVE_LIBWS2_32)
297289
check_library_exists_concat("winmm" getch HAVE_LIBWINMM)
290+
list(APPEND CURL_LIBS "advapi32")
298291
endif()
299292

300293
# check SSL libraries
@@ -316,14 +309,14 @@ if(WIN32 OR CMAKE_USE_DARWINSSL OR CMAKE_USE_WINSSL OR CMAKE_USE_MBEDTLS)
316309
endif()
317310
option(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" ${openssl_default})
318311

319-
collect_true(enabled_ssl_options enabled_ssl_options_count
312+
count_true(enabled_ssl_options_count
320313
CMAKE_USE_WINSSL
321314
CMAKE_USE_DARWINSSL
322315
CMAKE_USE_OPENSSL
323316
CMAKE_USE_MBEDTLS
324317
)
325-
if(enabled_ssl_options_count GREATER 1)
326-
message(FATAL_ERROR "Multiple SSL options specified: ${enabled_ssl_options}. Please pick at most one and disable the rest.")
318+
if(enabled_ssl_options_count GREATER "1")
319+
set(CURL_WITH_MULTI_SSL ON)
327320
endif()
328321

329322
if(CMAKE_USE_WINSSL)
@@ -363,7 +356,6 @@ if(CMAKE_USE_OPENSSL)
363356
include_directories(${OPENSSL_INCLUDE_DIR})
364357
set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
365358
check_include_file("openssl/crypto.h" HAVE_OPENSSL_CRYPTO_H)
366-
check_include_file("openssl/engine.h" HAVE_OPENSSL_ENGINE_H)
367359
check_include_file("openssl/err.h" HAVE_OPENSSL_ERR_H)
368360
check_include_file("openssl/pem.h" HAVE_OPENSSL_PEM_H)
369361
check_include_file("openssl/rsa.h" HAVE_OPENSSL_RSA_H)
@@ -521,6 +513,18 @@ if(CURL_ZLIB)
521513
endif()
522514
endif()
523515

516+
option(CURL_BROTLI "Set to ON to enable building curl with brotli support." OFF)
517+
set(HAVE_BROTLI OFF)
518+
if(CURL_BROTLI)
519+
find_package(BROTLI QUIET)
520+
if(BROTLI_FOUND)
521+
set(HAVE_BROTLI ON)
522+
list(APPEND CURL_LIBS ${BROTLI_LIBRARIES})
523+
include_directories(${BROTLI_INCLUDE_DIRS})
524+
list(APPEND CMAKE_REQUIRED_INCLUDES ${BROTLI_INCLUDE_DIRS})
525+
endif()
526+
endif()
527+
524528
#libSSH2
525529
option(CMAKE_USE_LIBSSH2 "Use libSSH2" ON)
526530
mark_as_advanced(CMAKE_USE_LIBSSH2)
@@ -551,9 +555,8 @@ if(CMAKE_USE_LIBSSH2)
551555
check_function_exists(libssh2_scp_send64 HAVE_LIBSSH2_SCP_SEND64)
552556
check_function_exists(libssh2_session_handshake HAVE_LIBSSH2_SESSION_HANDSHAKE)
553557
set(CMAKE_EXTRA_INCLUDE_FILES "")
554-
555-
endif(LIBSSH2_FOUND)
556-
endif(CMAKE_USE_LIBSSH2)
558+
endif()
559+
endif()
557560

558561
option(CMAKE_USE_GSSAPI "Use GSSAPI implementation (right now only Heimdal is supported with CMake build)" OFF)
559562
mark_as_advanced(CMAKE_USE_GSSAPI)
@@ -704,7 +707,7 @@ if(NOT UNIX)
704707
if(NOT CURL_WINDOWS_SSPI AND USE_OPENSSL)
705708
set(CURL_LIBS ${CURL_LIBS} "crypt32")
706709
endif()
707-
endif(NOT UNIX)
710+
endif()
708711

709712
check_include_file_concat("stdio.h" HAVE_STDIO_H)
710713
check_include_file_concat("inttypes.h" HAVE_INTTYPES_H)
@@ -787,17 +790,17 @@ check_type_size("time_t" SIZEOF_TIME_T)
787790
if(NOT HAVE_SIZEOF_SSIZE_T)
788791
if(SIZEOF_LONG EQUAL SIZEOF_SIZE_T)
789792
set(ssize_t long)
790-
endif(SIZEOF_LONG EQUAL SIZEOF_SIZE_T)
793+
endif()
791794
if(NOT ssize_t AND SIZEOF___INT64 EQUAL SIZEOF_SIZE_T)
792795
set(ssize_t __int64)
793-
endif(NOT ssize_t AND SIZEOF___INT64 EQUAL SIZEOF_SIZE_T)
794-
endif(NOT HAVE_SIZEOF_SSIZE_T)
796+
endif()
797+
endif()
795798
# off_t is sized later, after the HAVE_FILE_OFFSET_BITS test
796799

797800
if(HAVE_SIZEOF_LONG_LONG)
798801
set(HAVE_LONGLONG 1)
799802
set(HAVE_LL 1)
800-
endif(HAVE_SIZEOF_LONG_LONG)
803+
endif()
801804

802805
find_file(RANDOM_FILE urandom /dev)
803806
mark_as_advanced(RANDOM_FILE)
@@ -829,7 +832,7 @@ check_symbol_exists(strncmpi "${CURL_INCLUDES}" HAVE_STRNCMPI)
829832
check_symbol_exists(alarm "${CURL_INCLUDES}" HAVE_ALARM)
830833
if(NOT HAVE_STRNCMPI)
831834
set(HAVE_STRCMPI)
832-
endif(NOT HAVE_STRNCMPI)
835+
endif()
833836
check_symbol_exists(gethostbyaddr "${CURL_INCLUDES}" HAVE_GETHOSTBYADDR)
834837
check_symbol_exists(gethostbyaddr_r "${CURL_INCLUDES}" HAVE_GETHOSTBYADDR_R)
835838
check_symbol_exists(gettimeofday "${CURL_INCLUDES}" HAVE_GETTIMEOFDAY)
@@ -845,6 +848,7 @@ check_symbol_exists(sigsetjmp "${CURL_INCLUDES}" HAVE_SIGSETJMP)
845848
check_symbol_exists(getpass_r "${CURL_INCLUDES}" HAVE_GETPASS_R)
846849
check_symbol_exists(strlcat "${CURL_INCLUDES}" HAVE_STRLCAT)
847850
check_symbol_exists(getpwuid "${CURL_INCLUDES}" HAVE_GETPWUID)
851+
check_symbol_exists(getpwuid_r "${CURL_INCLUDES}" HAVE_GETPWUID_R)
848852
check_symbol_exists(geteuid "${CURL_INCLUDES}" HAVE_GETEUID)
849853
check_symbol_exists(utime "${CURL_INCLUDES}" HAVE_UTIME)
850854
check_symbol_exists(gmtime_r "${CURL_INCLUDES}" HAVE_GMTIME_R)
@@ -857,7 +861,7 @@ check_symbol_exists(signal "${CURL_INCLUDES}" HAVE_SIGNAL_FUNC)
857861
check_symbol_exists(SIGALRM "${CURL_INCLUDES}" HAVE_SIGNAL_MACRO)
858862
if(HAVE_SIGNAL_FUNC AND HAVE_SIGNAL_MACRO)
859863
set(HAVE_SIGNAL 1)
860-
endif(HAVE_SIGNAL_FUNC AND HAVE_SIGNAL_MACRO)
864+
endif()
861865
check_symbol_exists(uname "${CURL_INCLUDES}" HAVE_UNAME)
862866
check_symbol_exists(strtoll "${CURL_INCLUDES}" HAVE_STRTOLL)
863867
check_symbol_exists(_strtoi64 "${CURL_INCLUDES}" HAVE__STRTOI64)
@@ -897,29 +901,29 @@ endif()
897901
check_symbol_exists(fsetxattr "${CURL_INCLUDES}" HAVE_FSETXATTR)
898902
if(HAVE_FSETXATTR)
899903
foreach(CURL_TEST HAVE_FSETXATTR_5 HAVE_FSETXATTR_6)
900-
curl_internal_test_run(${CURL_TEST})
901-
endforeach(CURL_TEST)
902-
endif(HAVE_FSETXATTR)
904+
curl_internal_test(${CURL_TEST})
905+
endforeach()
906+
endif()
903907

904908
# sigaction and sigsetjmp are special. Use special mechanism for
905909
# detecting those, but only if previous attempt failed.
906910
if(HAVE_SIGNAL_H)
907911
check_symbol_exists(sigaction "signal.h" HAVE_SIGACTION)
908-
endif(HAVE_SIGNAL_H)
912+
endif()
909913

910914
if(NOT HAVE_SIGSETJMP)
911915
if(HAVE_SETJMP_H)
912916
check_symbol_exists(sigsetjmp "setjmp.h" HAVE_MACRO_SIGSETJMP)
913917
if(HAVE_MACRO_SIGSETJMP)
914918
set(HAVE_SIGSETJMP 1)
915-
endif(HAVE_MACRO_SIGSETJMP)
916-
endif(HAVE_SETJMP_H)
917-
endif(NOT HAVE_SIGSETJMP)
919+
endif()
920+
endif()
921+
endif()
918922

919923
# If there is no stricmp(), do not allow LDAP to parse URLs
920924
if(NOT HAVE_STRICMP)
921925
set(HAVE_LDAP_URL_PARSE 1)
922-
endif(NOT HAVE_STRICMP)
926+
endif()
923927

924928
# Do curl specific tests
925929
foreach(CURL_TEST
@@ -957,12 +961,12 @@ foreach(CURL_TEST
957961
HAVE_FILE_OFFSET_BITS
958962
)
959963
curl_internal_test(${CURL_TEST})
960-
endforeach(CURL_TEST)
964+
endforeach()
961965

962966
if(HAVE_FILE_OFFSET_BITS)
963967
set(_FILE_OFFSET_BITS 64)
964968
set(CMAKE_REQUIRED_FLAGS "-D_FILE_OFFSET_BITS=64")
965-
endif(HAVE_FILE_OFFSET_BITS)
969+
endif()
966970
check_type_size("off_t" SIZEOF_OFF_T)
967971

968972
# include this header to get the type
@@ -977,8 +981,8 @@ foreach(CURL_TEST
977981
HAVE_GLIBC_STRERROR_R
978982
HAVE_POSIX_STRERROR_R
979983
)
980-
curl_internal_test_run(${CURL_TEST})
981-
endforeach(CURL_TEST)
984+
curl_internal_test(${CURL_TEST})
985+
endforeach()
982986

983987
# Check for reentrant
984988
foreach(CURL_TEST
@@ -992,9 +996,9 @@ foreach(CURL_TEST
992996
if(NOT ${CURL_TEST})
993997
if(${CURL_TEST}_REENTRANT)
994998
set(NEED_REENTRANT 1)
995-
endif(${CURL_TEST}_REENTRANT)
996-
endif(NOT ${CURL_TEST})
997-
endforeach(CURL_TEST)
999+
endif()
1000+
endif()
1001+
endforeach()
9981002

9991003
if(NEED_REENTRANT)
10001004
foreach(CURL_TEST
@@ -1007,32 +1011,32 @@ if(NEED_REENTRANT)
10071011
set(${CURL_TEST} 0)
10081012
if(${CURL_TEST}_REENTRANT)
10091013
set(${CURL_TEST} 1)
1010-
endif(${CURL_TEST}_REENTRANT)
1011-
endforeach(CURL_TEST)
1012-
endif(NEED_REENTRANT)
1014+
endif()
1015+
endforeach()
1016+
endif()
10131017

10141018
if(HAVE_INET_NTOA_R_DECL_REENTRANT)
10151019
set(HAVE_INET_NTOA_R_DECL 1)
10161020
set(NEED_REENTRANT 1)
1017-
endif(HAVE_INET_NTOA_R_DECL_REENTRANT)
1021+
endif()
10181022

10191023
# Some other minor tests
10201024

10211025
if(NOT HAVE_IN_ADDR_T)
10221026
set(in_addr_t "unsigned long")
1023-
endif(NOT HAVE_IN_ADDR_T)
1027+
endif()
10241028

10251029
# Fix libz / zlib.h
10261030

10271031
if(NOT CURL_SPECIAL_LIBZ)
10281032
if(NOT HAVE_LIBZ)
10291033
set(HAVE_ZLIB_H 0)
1030-
endif(NOT HAVE_LIBZ)
1034+
endif()
10311035

10321036
if(NOT HAVE_ZLIB_H)
10331037
set(HAVE_LIBZ 0)
1034-
endif(NOT HAVE_ZLIB_H)
1035-
endif(NOT CURL_SPECIAL_LIBZ)
1038+
endif()
1039+
endif()
10361040

10371041
# Check for nonblocking
10381042
set(HAVE_DISABLED_NONBLOCKING 1)
@@ -1041,16 +1045,13 @@ if(HAVE_FIONBIO OR
10411045
HAVE_IOCTLSOCKET_CASE OR
10421046
HAVE_O_NONBLOCK)
10431047
set(HAVE_DISABLED_NONBLOCKING)
1044-
endif(HAVE_FIONBIO OR
1045-
HAVE_IOCTLSOCKET OR
1046-
HAVE_IOCTLSOCKET_CASE OR
1047-
HAVE_O_NONBLOCK)
1048+
endif()
10481049

10491050
if(RETSIGTYPE_TEST)
10501051
set(RETSIGTYPE void)
1051-
else(RETSIGTYPE_TEST)
1052+
else()
10521053
set(RETSIGTYPE int)
1053-
endif(RETSIGTYPE_TEST)
1054+
endif()
10541055

10551056
if(CMAKE_COMPILER_IS_GNUCC AND APPLE)
10561057
include(CheckCCompilerFlag)
@@ -1060,13 +1061,13 @@ if(CMAKE_COMPILER_IS_GNUCC AND APPLE)
10601061
get_source_file_property(MPRINTF_COMPILE_FLAGS mprintf.c COMPILE_FLAGS)
10611062
if(MPRINTF_COMPILE_FLAGS)
10621063
set(MPRINTF_COMPILE_FLAGS "${MPRINTF_COMPILE_FLAGS} -Wno-long-double")
1063-
else(MPRINTF_COMPILE_FLAGS)
1064+
else()
10641065
set(MPRINTF_COMPILE_FLAGS "-Wno-long-double")
1065-
endif(MPRINTF_COMPILE_FLAGS)
1066+
endif()
10661067
set_source_files_properties(mprintf.c PROPERTIES
10671068
COMPILE_FLAGS ${MPRINTF_COMPILE_FLAGS})
1068-
endif(HAVE_C_FLAG_Wno_long_double)
1069-
endif(CMAKE_COMPILER_IS_GNUCC AND APPLE)
1069+
endif()
1070+
endif()
10701071

10711072
if(HAVE_SOCKLEN_T)
10721073
set(CURL_TYPEOF_CURL_SOCKLEN_T "socklen_t")
@@ -1101,19 +1102,34 @@ include(CMake/OtherTests.cmake)
11011102

11021103
add_definitions(-DHAVE_CONFIG_H)
11031104

1104-
# For windows, all compilers used by cmake should support large files
1105+
# For Windows, all compilers used by CMake should support large files
11051106
if(WIN32)
11061107
set(USE_WIN32_LARGE_FILES ON)
1107-
endif(WIN32)
1108+
1109+
# Use the manifest embedded in the Windows Resource
1110+
set(CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS} -DCURL_EMBED_MANIFEST")
1111+
endif()
11081112

11091113
if(MSVC)
1114+
# Disable default manifest added by CMake
1115+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
1116+
11101117
add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
11111118
if(CMAKE_C_FLAGS MATCHES "/W[0-4]")
11121119
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
1113-
else(CMAKE_C_FLAGS MATCHES "/W[0-4]")
1120+
else()
11141121
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")
1115-
endif(CMAKE_C_FLAGS MATCHES "/W[0-4]")
1116-
endif(MSVC)
1122+
endif()
1123+
endif()
1124+
1125+
if(CURL_WERROR)
1126+
if(MSVC_VERSION)
1127+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
1128+
else()
1129+
# this assumes clang or gcc style options
1130+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
1131+
endif()
1132+
endif()
11171133

11181134
# Ugly (but functional) way to include "Makefile.inc" by transforming it (= regenerate it).
11191135
function(TRANSFORM_MAKEFILE_INC INPUT_FILE OUTPUT_FILE)

0 commit comments

Comments
 (0)