Update libcurl to 8.1.2
This commit is contained in:
parent
9ebfcebdde
commit
6f55e44365
|
@ -57,3 +57,6 @@
|
|||
[submodule "Externals/libadrenotools"]
|
||||
path = Externals/libadrenotools
|
||||
url = https://github.com/bylaws/libadrenotools.git
|
||||
[submodule "Externals/curl/curl"]
|
||||
path = Externals/curl/curl
|
||||
url = https://github.com/curl/curl.git
|
||||
|
|
|
@ -1,2 +1,62 @@
|
|||
include_directories(include/)
|
||||
add_subdirectory(lib)
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/curl/include)
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/curl/lib)
|
||||
|
||||
set(CURL_LIBS MbedTLS::mbedtls zlibstatic)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
set(use_core_foundation ON)
|
||||
|
||||
find_library(SYSTEMCONFIGURATION_FRAMEWORK "SystemConfiguration")
|
||||
if(NOT SYSTEMCONFIGURATION_FRAMEWORK)
|
||||
message(FATAL_ERROR "SystemConfiguration framework not found")
|
||||
endif()
|
||||
|
||||
list(APPEND CURL_LIBS "-framework SystemConfiguration")
|
||||
endif()
|
||||
|
||||
file(GLOB SRCS curl/lib/*.c curl/lib/vauth/*.c curl/lib/vquic/*.c curl/lib/vssh/*.c curl/lib/vtls/*.c)
|
||||
add_library(
|
||||
curl
|
||||
STATIC
|
||||
curl/include/curl/curl.h
|
||||
${SRCS}
|
||||
)
|
||||
|
||||
set(SEARCH_CA_BUNDLE_PATHS
|
||||
/etc/ssl/certs/ca-certificates.crt
|
||||
/etc/pki/tls/certs/ca-bundle.crt
|
||||
/usr/share/ssl/certs/ca-bundle.crt
|
||||
/usr/local/share/certs/ca-root-nss.crt
|
||||
/etc/ssl/cert.pem)
|
||||
|
||||
foreach(SEARCH_CA_BUNDLE_PATH ${SEARCH_CA_BUNDLE_PATHS})
|
||||
if(EXISTS "${SEARCH_CA_BUNDLE_PATH}")
|
||||
message(STATUS "Found CA bundle: ${SEARCH_CA_BUNDLE_PATH}")
|
||||
set(CURL_CA_BUNDLE "${SEARCH_CA_BUNDLE_PATH}")
|
||||
set(CURL_CA_BUNDLE_SET TRUE)
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(NOT CURL_CA_PATH_SET)
|
||||
if(EXISTS "/etc/ssl/certs")
|
||||
set(CURL_CA_PATH "/etc/ssl/certs")
|
||||
set(CURL_CA_PATH_SET TRUE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
dolphin_disable_warnings_msvc(curl)
|
||||
target_link_libraries(curl ${CURL_LIBS})
|
||||
target_include_directories(curl PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/curl/include")
|
||||
target_compile_definitions(curl PRIVATE "BUILDING_LIBCURL=1")
|
||||
if (WIN32)
|
||||
target_compile_definitions(curl PUBLIC "CURL_STATICLIB=1" "CURL_DISABLE_LDAP" "USE_WINDOWS_SSPI" "USE_SCHANNEL")
|
||||
target_link_libraries(curl Crypt32.lib)
|
||||
else()
|
||||
target_compile_definitions(curl PUBLIC "CURL_STATICLIB=1" "USE_MBEDTLS=1" "HAVE_CONFIG_H=1" "CURL_DISABLE_LDAP")
|
||||
if (CURL_CA_PATH_SET)
|
||||
target_compile_definitions(curl PUBLIC CURL_CA_PATH="${CURL_CA_PATH}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_library(CURL::libcurl ALIAS curl)
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 7ab9d43720bc34d9aa351c7ca683c1668ebf8335
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project>
|
||||
<Import Project="..\..\Source\VSProps\Base.Macros.props" />
|
||||
<Import Project="$(VSPropsDir)Base.Targets.props" />
|
||||
|
@ -17,345 +17,354 @@
|
|||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>include;lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>CURL_STATICLIB;CURL_DISABLE_LDAP;USE_WINDOWS_SSPI;USE_SCHANNEL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>curl\include;curl\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>BUILDING_LIBCURL;CURL_STATICLIB;CURL_DISABLE_LDAP;USE_WINDOWS_SSPI;USE_SCHANNEL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="lib\amigaos.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\asyn-ares.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\asyn-thread.c" />
|
||||
<ClCompile Include="lib\base64.c" />
|
||||
<ClCompile Include="lib\conncache.c" />
|
||||
<ClCompile Include="lib\connect.c" />
|
||||
<ClCompile Include="lib\content_encoding.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\cookie.c" />
|
||||
<ClCompile Include="lib\curl_addrinfo.c" />
|
||||
<ClCompile Include="lib\curl_des.c" />
|
||||
<ClCompile Include="lib\curl_endian.c" />
|
||||
<ClCompile Include="lib\curl_fnmatch.c" />
|
||||
<ClCompile Include="lib\curl_gethostname.c" />
|
||||
<ClCompile Include="lib\curl_gssapi.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\curl_memrchr.c" />
|
||||
<ClCompile Include="lib\curl_multibyte.c" />
|
||||
<ClCompile Include="lib\curl_ntlm_core.c" />
|
||||
<ClCompile Include="lib\curl_ntlm_wb.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\curl_rtmp.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\curl_sasl.c" />
|
||||
<ClCompile Include="lib\curl_sspi.c" />
|
||||
<ClCompile Include="lib\curl_threads.c" />
|
||||
<ClCompile Include="lib\dict.c" />
|
||||
<ClCompile Include="lib\dotdot.c" />
|
||||
<ClCompile Include="lib\easy.c" />
|
||||
<ClCompile Include="lib\escape.c" />
|
||||
<ClCompile Include="lib\file.c" />
|
||||
<ClCompile Include="lib\fileinfo.c" />
|
||||
<ClCompile Include="lib\formdata.c" />
|
||||
<ClCompile Include="lib\ftp.c" />
|
||||
<ClCompile Include="lib\ftplistparser.c" />
|
||||
<ClCompile Include="lib\getenv.c" />
|
||||
<ClCompile Include="lib\getinfo.c" />
|
||||
<ClCompile Include="lib\gopher.c" />
|
||||
<ClCompile Include="lib\hash.c" />
|
||||
<ClCompile Include="lib\hmac.c" />
|
||||
<ClCompile Include="lib\hostasyn.c" />
|
||||
<ClCompile Include="lib\hostcheck.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\hostip.c" />
|
||||
<ClCompile Include="lib\hostip4.c" />
|
||||
<ClCompile Include="lib\hostip6.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\hostsyn.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\http.c" />
|
||||
<ClCompile Include="lib\http2.c" />
|
||||
<ClCompile Include="lib\http_chunks.c" />
|
||||
<ClCompile Include="lib\http_digest.c" />
|
||||
<ClCompile Include="lib\http_negotiate.c" />
|
||||
<ClCompile Include="lib\http_ntlm.c" />
|
||||
<ClCompile Include="lib\http_proxy.c" />
|
||||
<ClCompile Include="lib\idn_win32.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\if2ip.c" />
|
||||
<ClCompile Include="lib\imap.c" />
|
||||
<ClCompile Include="lib\inet_ntop.c" />
|
||||
<ClCompile Include="lib\inet_pton.c" />
|
||||
<ClCompile Include="lib\krb5.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\ldap.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\llist.c" />
|
||||
<ClCompile Include="lib\md4.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\md5.c" />
|
||||
<ClCompile Include="lib\memdebug.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\mprintf.c" />
|
||||
<ClCompile Include="lib\multi.c" />
|
||||
<ClCompile Include="lib\netrc.c" />
|
||||
<ClCompile Include="lib\non-ascii.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\nonblock.c" />
|
||||
<ClCompile Include="lib\nwlib.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\nwos.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\openldap.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\parsedate.c" />
|
||||
<ClCompile Include="lib\pingpong.c" />
|
||||
<ClCompile Include="lib\pipeline.c" />
|
||||
<ClCompile Include="lib\pop3.c" />
|
||||
<ClCompile Include="lib\progress.c" />
|
||||
<ClCompile Include="lib\rawstr.c" />
|
||||
<ClCompile Include="lib\rtsp.c" />
|
||||
<ClCompile Include="lib\security.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\select.c" />
|
||||
<ClCompile Include="lib\sendf.c" />
|
||||
<ClCompile Include="lib\share.c" />
|
||||
<ClCompile Include="lib\slist.c" />
|
||||
<ClCompile Include="lib\smb.c" />
|
||||
<ClCompile Include="lib\smtp.c" />
|
||||
<ClCompile Include="lib\socks.c" />
|
||||
<ClCompile Include="lib\socks_gssapi.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\socks_sspi.c" />
|
||||
<ClCompile Include="lib\speedcheck.c" />
|
||||
<ClCompile Include="lib\splay.c" />
|
||||
<ClCompile Include="lib\ssh.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\strdup.c" />
|
||||
<ClCompile Include="lib\strequal.c" />
|
||||
<ClCompile Include="lib\strerror.c" />
|
||||
<ClCompile Include="lib\strtok.c" />
|
||||
<ClCompile Include="lib\strtoofft.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\system_win32.c" />
|
||||
<ClCompile Include="lib\telnet.c" />
|
||||
<ClCompile Include="lib\tftp.c" />
|
||||
<ClCompile Include="lib\timeval.c" />
|
||||
<ClCompile Include="lib\transfer.c" />
|
||||
<ClCompile Include="lib\url.c" />
|
||||
<ClCompile Include="lib\vauth\cleartext.c" />
|
||||
<ClCompile Include="lib\vauth\cram.c" />
|
||||
<ClCompile Include="lib\vauth\digest.c" />
|
||||
<ClCompile Include="lib\vauth\digest_sspi.c" />
|
||||
<ClCompile Include="lib\vauth\krb5_gssapi.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\vauth\krb5_sspi.c" />
|
||||
<ClCompile Include="lib\vauth\ntlm.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\vauth\ntlm_sspi.c" />
|
||||
<ClCompile Include="lib\vauth\oauth2.c" />
|
||||
<ClCompile Include="lib\vauth\spnego_gssapi.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\vauth\spnego_sspi.c" />
|
||||
<ClCompile Include="lib\vauth\vauth.c" />
|
||||
<ClCompile Include="lib\version.c" />
|
||||
<ClCompile Include="lib\vtls\axtls.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\vtls\cyassl.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\vtls\darwinssl.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\vtls\gskit.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\vtls\gtls.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\vtls\mbedtls.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\vtls\nss.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\vtls\openssl.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\vtls\polarssl.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\vtls\polarssl_threadlock.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\vtls\schannel.c" />
|
||||
<ClCompile Include="lib\vtls\vtls.c" />
|
||||
<ClCompile Include="lib\warnless.c" />
|
||||
<ClCompile Include="lib\wildcard.c" />
|
||||
<ClCompile Include="lib\x509asn1.c" />
|
||||
<ClCompile Include="curl\lib\altsvc.c" />
|
||||
<ClCompile Include="curl\lib\amigaos.c" />
|
||||
<ClCompile Include="curl\lib\asyn-ares.c" />
|
||||
<ClCompile Include="curl\lib\asyn-thread.c" />
|
||||
<ClCompile Include="curl\lib\base64.c" />
|
||||
<ClCompile Include="curl\lib\bufq.c" />
|
||||
<ClCompile Include="curl\lib\bufref.c" />
|
||||
<ClCompile Include="curl\lib\c-hyper.c" />
|
||||
<ClCompile Include="curl\lib\cf-h1-proxy.c" />
|
||||
<ClCompile Include="curl\lib\cf-h2-proxy.c" />
|
||||
<ClCompile Include="curl\lib\cf-haproxy.c" />
|
||||
<ClCompile Include="curl\lib\cf-https-connect.c" />
|
||||
<ClCompile Include="curl\lib\cf-socket.c" />
|
||||
<ClCompile Include="curl\lib\cfilters.c" />
|
||||
<ClCompile Include="curl\lib\conncache.c" />
|
||||
<ClCompile Include="curl\lib\connect.c" />
|
||||
<ClCompile Include="curl\lib\content_encoding.c" />
|
||||
<ClCompile Include="curl\lib\cookie.c" />
|
||||
<ClCompile Include="curl\lib\curl_addrinfo.c" />
|
||||
<ClCompile Include="curl\lib\curl_des.c" />
|
||||
<ClCompile Include="curl\lib\curl_endian.c" />
|
||||
<ClCompile Include="curl\lib\curl_fnmatch.c" />
|
||||
<ClCompile Include="curl\lib\curl_gethostname.c" />
|
||||
<ClCompile Include="curl\lib\curl_get_line.c" />
|
||||
<ClCompile Include="curl\lib\curl_gssapi.c" />
|
||||
<ClCompile Include="curl\lib\curl_log.c" />
|
||||
<ClCompile Include="curl\lib\curl_memrchr.c" />
|
||||
<ClCompile Include="curl\lib\curl_multibyte.c" />
|
||||
<ClCompile Include="curl\lib\curl_ntlm_core.c" />
|
||||
<ClCompile Include="curl\lib\curl_ntlm_wb.c" />
|
||||
<ClCompile Include="curl\lib\curl_path.c" />
|
||||
<ClCompile Include="curl\lib\curl_range.c" />
|
||||
<ClCompile Include="curl\lib\curl_rtmp.c" />
|
||||
<ClCompile Include="curl\lib\curl_sasl.c" />
|
||||
<ClCompile Include="curl\lib\curl_sspi.c" />
|
||||
<ClCompile Include="curl\lib\curl_threads.c" />
|
||||
<ClCompile Include="curl\lib\dict.c" />
|
||||
<ClCompile Include="curl\lib\doh.c" />
|
||||
<ClCompile Include="curl\lib\dynbuf.c" />
|
||||
<ClCompile Include="curl\lib\dynhds.c" />
|
||||
<ClCompile Include="curl\lib\easy.c" />
|
||||
<ClCompile Include="curl\lib\easygetopt.c" />
|
||||
<ClCompile Include="curl\lib\easyoptions.c" />
|
||||
<ClCompile Include="curl\lib\escape.c" />
|
||||
<ClCompile Include="curl\lib\file.c" />
|
||||
<ClCompile Include="curl\lib\fileinfo.c" />
|
||||
<ClCompile Include="curl\lib\fopen.c" />
|
||||
<ClCompile Include="curl\lib\formdata.c" />
|
||||
<ClCompile Include="curl\lib\ftp.c" />
|
||||
<ClCompile Include="curl\lib\ftplistparser.c" />
|
||||
<ClCompile Include="curl\lib\getenv.c" />
|
||||
<ClCompile Include="curl\lib\getinfo.c" />
|
||||
<ClCompile Include="curl\lib\gopher.c" />
|
||||
<ClCompile Include="curl\lib\hash.c" />
|
||||
<ClCompile Include="curl\lib\headers.c" />
|
||||
<ClCompile Include="curl\lib\hmac.c" />
|
||||
<ClCompile Include="curl\lib\hostasyn.c" />
|
||||
<ClCompile Include="curl\lib\hostip.c" />
|
||||
<ClCompile Include="curl\lib\hostip4.c" />
|
||||
<ClCompile Include="curl\lib\hostip6.c" />
|
||||
<ClCompile Include="curl\lib\hostsyn.c" />
|
||||
<ClCompile Include="curl\lib\hsts.c" />
|
||||
<ClCompile Include="curl\lib\http.c" />
|
||||
<ClCompile Include="curl\lib\http1.c" />
|
||||
<ClCompile Include="curl\lib\http2.c" />
|
||||
<ClCompile Include="curl\lib\http_aws_sigv4.c" />
|
||||
<ClCompile Include="curl\lib\http_chunks.c" />
|
||||
<ClCompile Include="curl\lib\http_digest.c" />
|
||||
<ClCompile Include="curl\lib\http_negotiate.c" />
|
||||
<ClCompile Include="curl\lib\http_ntlm.c" />
|
||||
<ClCompile Include="curl\lib\http_proxy.c" />
|
||||
<ClCompile Include="curl\lib\idn.c" />
|
||||
<ClCompile Include="curl\lib\if2ip.c" />
|
||||
<ClCompile Include="curl\lib\imap.c" />
|
||||
<ClCompile Include="curl\lib\inet_ntop.c" />
|
||||
<ClCompile Include="curl\lib\inet_pton.c" />
|
||||
<ClCompile Include="curl\lib\krb5.c" />
|
||||
<ClCompile Include="curl\lib\ldap.c" />
|
||||
<ClCompile Include="curl\lib\llist.c" />
|
||||
<ClCompile Include="curl\lib\md4.c" />
|
||||
<ClCompile Include="curl\lib\md5.c" />
|
||||
<ClCompile Include="curl\lib\memdebug.c" />
|
||||
<ClCompile Include="curl\lib\mime.c" />
|
||||
<ClCompile Include="curl\lib\mprintf.c" />
|
||||
<ClCompile Include="curl\lib\mqtt.c" />
|
||||
<ClCompile Include="curl\lib\multi.c" />
|
||||
<ClCompile Include="curl\lib\netrc.c" />
|
||||
<ClCompile Include="curl\lib\nonblock.c" />
|
||||
<ClCompile Include="curl\lib\noproxy.c" />
|
||||
<ClCompile Include="curl\lib\openldap.c" />
|
||||
<ClCompile Include="curl\lib\parsedate.c" />
|
||||
<ClCompile Include="curl\lib\pingpong.c" />
|
||||
<ClCompile Include="curl\lib\pop3.c" />
|
||||
<ClCompile Include="curl\lib\progress.c" />
|
||||
<ClCompile Include="curl\lib\psl.c" />
|
||||
<ClCompile Include="curl\lib\rand.c" />
|
||||
<ClCompile Include="curl\lib\rename.c" />
|
||||
<ClCompile Include="curl\lib\rtsp.c" />
|
||||
<ClCompile Include="curl\lib\select.c" />
|
||||
<ClCompile Include="curl\lib\sendf.c" />
|
||||
<ClCompile Include="curl\lib\setopt.c" />
|
||||
<ClCompile Include="curl\lib\sha256.c" />
|
||||
<ClCompile Include="curl\lib\share.c" />
|
||||
<ClCompile Include="curl\lib\slist.c" />
|
||||
<ClCompile Include="curl\lib\smb.c" />
|
||||
<ClCompile Include="curl\lib\smtp.c" />
|
||||
<ClCompile Include="curl\lib\socketpair.c" />
|
||||
<ClCompile Include="curl\lib\socks.c" />
|
||||
<ClCompile Include="curl\lib\socks_gssapi.c" />
|
||||
<ClCompile Include="curl\lib\socks_sspi.c" />
|
||||
<ClCompile Include="curl\lib\speedcheck.c" />
|
||||
<ClCompile Include="curl\lib\splay.c" />
|
||||
<ClCompile Include="curl\lib\strcase.c" />
|
||||
<ClCompile Include="curl\lib\strdup.c" />
|
||||
<ClCompile Include="curl\lib\strerror.c" />
|
||||
<ClCompile Include="curl\lib\strtok.c" />
|
||||
<ClCompile Include="curl\lib\strtoofft.c" />
|
||||
<ClCompile Include="curl\lib\system_win32.c" />
|
||||
<ClCompile Include="curl\lib\telnet.c" />
|
||||
<ClCompile Include="curl\lib\tftp.c" />
|
||||
<ClCompile Include="curl\lib\timediff.c" />
|
||||
<ClCompile Include="curl\lib\timeval.c" />
|
||||
<ClCompile Include="curl\lib\transfer.c" />
|
||||
<ClCompile Include="curl\lib\url.c" />
|
||||
<ClCompile Include="curl\lib\urlapi.c" />
|
||||
<ClCompile Include="curl\lib\vauth\gsasl.c" />
|
||||
<ClCompile Include="curl\lib\version.c" />
|
||||
<ClCompile Include="curl\lib\version_win32.c" />
|
||||
<ClCompile Include="curl\lib\vquic\curl_msh3.c" />
|
||||
<ClCompile Include="curl\lib\vquic\curl_ngtcp2.c" />
|
||||
<ClCompile Include="curl\lib\vquic\curl_quiche.c" />
|
||||
<ClCompile Include="curl\lib\vtls\hostcheck.c" />
|
||||
<ClCompile Include="curl\lib\vtls\rustls.c" />
|
||||
<ClCompile Include="curl\lib\vtls\x509asn1.c" />
|
||||
<ClCompile Include="curl\lib\warnless.c" />
|
||||
<ClCompile Include="curl\lib\vauth\cleartext.c" />
|
||||
<ClCompile Include="curl\lib\vauth\cram.c" />
|
||||
<ClCompile Include="curl\lib\vauth\digest.c" />
|
||||
<ClCompile Include="curl\lib\vauth\digest_sspi.c" />
|
||||
<ClCompile Include="curl\lib\vauth\krb5_gssapi.c" />
|
||||
<ClCompile Include="curl\lib\vauth\krb5_sspi.c" />
|
||||
<ClCompile Include="curl\lib\vauth\ntlm.c" />
|
||||
<ClCompile Include="curl\lib\vauth\ntlm_sspi.c" />
|
||||
<ClCompile Include="curl\lib\vauth\oauth2.c" />
|
||||
<ClCompile Include="curl\lib\vauth\spnego_gssapi.c" />
|
||||
<ClCompile Include="curl\lib\vauth\spnego_sspi.c" />
|
||||
<ClCompile Include="curl\lib\vauth\vauth.c" />
|
||||
<ClCompile Include="curl\lib\vquic\vquic.c" />
|
||||
<ClCompile Include="curl\lib\vssh\libssh.c" />
|
||||
<ClCompile Include="curl\lib\vssh\libssh2.c" />
|
||||
<ClCompile Include="curl\lib\vssh\wolfssh.c" />
|
||||
<ClCompile Include="curl\lib\vtls\bearssl.c" />
|
||||
<ClCompile Include="curl\lib\vtls\gskit.c" />
|
||||
<ClCompile Include="curl\lib\vtls\gtls.c" />
|
||||
<ClCompile Include="curl\lib\vtls\keylog.c" />
|
||||
<ClCompile Include="curl\lib\vtls\mbedtls.c" />
|
||||
<ClCompile Include="curl\lib\vtls\mbedtls_threadlock.c" />
|
||||
<ClCompile Include="curl\lib\vtls\nss.c" />
|
||||
<ClCompile Include="curl\lib\vtls\openssl.c" />
|
||||
<ClCompile Include="curl\lib\vtls\schannel.c" />
|
||||
<ClCompile Include="curl\lib\vtls\schannel_verify.c" />
|
||||
<ClCompile Include="curl\lib\vtls\sectransp.c" />
|
||||
<ClCompile Include="curl\lib\vtls\vtls.c" />
|
||||
<ClCompile Include="curl\lib\vtls\wolfssl.c" />
|
||||
<ClCompile Include="curl\lib\ws.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="include\curl\curl.h" />
|
||||
<ClInclude Include="include\curl\curlbuild.h" />
|
||||
<ClInclude Include="include\curl\curlrules.h" />
|
||||
<ClInclude Include="include\curl\curlver.h" />
|
||||
<ClInclude Include="include\curl\easy.h" />
|
||||
<ClInclude Include="include\curl\mprintf.h" />
|
||||
<ClInclude Include="include\curl\multi.h" />
|
||||
<ClInclude Include="include\curl\stdcheaders.h" />
|
||||
<ClInclude Include="include\curl\typecheck-gcc.h" />
|
||||
<ClInclude Include="lib\amigaos.h" />
|
||||
<ClInclude Include="lib\arpa_telnet.h" />
|
||||
<ClInclude Include="lib\asyn.h" />
|
||||
<ClInclude Include="lib\config-amigaos.h" />
|
||||
<ClInclude Include="lib\config-dos.h" />
|
||||
<ClInclude Include="lib\config-mac.h" />
|
||||
<ClInclude Include="lib\config-os400.h" />
|
||||
<ClInclude Include="lib\config-riscos.h" />
|
||||
<ClInclude Include="lib\config-symbian.h" />
|
||||
<ClInclude Include="lib\config-tpf.h" />
|
||||
<ClInclude Include="lib\config-vxworks.h" />
|
||||
<ClInclude Include="lib\config-win32.h" />
|
||||
<ClInclude Include="lib\config-win32ce.h" />
|
||||
<ClInclude Include="lib\conncache.h" />
|
||||
<ClInclude Include="lib\connect.h" />
|
||||
<ClInclude Include="lib\content_encoding.h" />
|
||||
<ClInclude Include="lib\cookie.h" />
|
||||
<ClInclude Include="lib\curlx.h" />
|
||||
<ClInclude Include="lib\curl_addrinfo.h" />
|
||||
<ClInclude Include="lib\curl_base64.h" />
|
||||
<ClInclude Include="lib\curl_config.h" />
|
||||
<ClInclude Include="lib\curl_des.h" />
|
||||
<ClInclude Include="lib\curl_endian.h" />
|
||||
<ClInclude Include="lib\curl_fnmatch.h" />
|
||||
<ClInclude Include="lib\curl_gethostname.h" />
|
||||
<ClInclude Include="lib\curl_gssapi.h" />
|
||||
<ClInclude Include="lib\curl_hmac.h" />
|
||||
<ClInclude Include="lib\curl_ldap.h" />
|
||||
<ClInclude Include="lib\curl_md4.h" />
|
||||
<ClInclude Include="lib\curl_md5.h" />
|
||||
<ClInclude Include="lib\curl_memory.h" />
|
||||
<ClInclude Include="lib\curl_memrchr.h" />
|
||||
<ClInclude Include="lib\curl_multibyte.h" />
|
||||
<ClInclude Include="lib\curl_ntlm_core.h" />
|
||||
<ClInclude Include="lib\curl_ntlm_wb.h" />
|
||||
<ClInclude Include="lib\curl_printf.h" />
|
||||
<ClInclude Include="lib\curl_rtmp.h" />
|
||||
<ClInclude Include="lib\curl_sasl.h" />
|
||||
<ClInclude Include="lib\curl_sec.h" />
|
||||
<ClInclude Include="lib\curl_setup.h" />
|
||||
<ClInclude Include="lib\curl_setup_once.h" />
|
||||
<ClInclude Include="lib\curl_sspi.h" />
|
||||
<ClInclude Include="lib\curl_threads.h" />
|
||||
<ClInclude Include="lib\dict.h" />
|
||||
<ClInclude Include="lib\dotdot.h" />
|
||||
<ClInclude Include="lib\easyif.h" />
|
||||
<ClInclude Include="lib\escape.h" />
|
||||
<ClInclude Include="lib\file.h" />
|
||||
<ClInclude Include="lib\fileinfo.h" />
|
||||
<ClInclude Include="lib\formdata.h" />
|
||||
<ClInclude Include="lib\ftp.h" />
|
||||
<ClInclude Include="lib\ftplistparser.h" />
|
||||
<ClInclude Include="lib\getinfo.h" />
|
||||
<ClInclude Include="lib\gopher.h" />
|
||||
<ClInclude Include="lib\hash.h" />
|
||||
<ClInclude Include="lib\hostcheck.h" />
|
||||
<ClInclude Include="lib\hostip.h" />
|
||||
<ClInclude Include="lib\http.h" />
|
||||
<ClInclude Include="lib\http2.h" />
|
||||
<ClInclude Include="lib\http_chunks.h" />
|
||||
<ClInclude Include="lib\http_digest.h" />
|
||||
<ClInclude Include="lib\http_negotiate.h" />
|
||||
<ClInclude Include="lib\http_ntlm.h" />
|
||||
<ClInclude Include="lib\http_proxy.h" />
|
||||
<ClInclude Include="lib\if2ip.h" />
|
||||
<ClInclude Include="lib\imap.h" />
|
||||
<ClInclude Include="lib\inet_ntop.h" />
|
||||
<ClInclude Include="lib\inet_pton.h" />
|
||||
<ClInclude Include="lib\llist.h" />
|
||||
<ClInclude Include="lib\memdebug.h" />
|
||||
<ClInclude Include="lib\multihandle.h" />
|
||||
<ClInclude Include="lib\multiif.h" />
|
||||
<ClInclude Include="lib\netrc.h" />
|
||||
<ClInclude Include="lib\non-ascii.h" />
|
||||
<ClInclude Include="lib\nonblock.h" />
|
||||
<ClInclude Include="lib\parsedate.h" />
|
||||
<ClInclude Include="lib\pingpong.h" />
|
||||
<ClInclude Include="lib\pipeline.h" />
|
||||
<ClInclude Include="lib\pop3.h" />
|
||||
<ClInclude Include="lib\progress.h" />
|
||||
<ClInclude Include="lib\rawstr.h" />
|
||||
<ClInclude Include="lib\rtsp.h" />
|
||||
<ClInclude Include="lib\select.h" />
|
||||
<ClInclude Include="lib\sendf.h" />
|
||||
<ClInclude Include="lib\setup-os400.h" />
|
||||
<ClInclude Include="lib\setup-vms.h" />
|
||||
<ClInclude Include="lib\share.h" />
|
||||
<ClInclude Include="lib\sigpipe.h" />
|
||||
<ClInclude Include="lib\slist.h" />
|
||||
<ClInclude Include="lib\smb.h" />
|
||||
<ClInclude Include="lib\smtp.h" />
|
||||
<ClInclude Include="lib\sockaddr.h" />
|
||||
<ClInclude Include="lib\socks.h" />
|
||||
<ClInclude Include="lib\speedcheck.h" />
|
||||
<ClInclude Include="lib\splay.h" />
|
||||
<ClInclude Include="lib\ssh.h" />
|
||||
<ClInclude Include="lib\strdup.h" />
|
||||
<ClInclude Include="lib\strequal.h" />
|
||||
<ClInclude Include="lib\strerror.h" />
|
||||
<ClInclude Include="lib\strtok.h" />
|
||||
<ClInclude Include="lib\strtoofft.h" />
|
||||
<ClInclude Include="lib\system_win32.h" />
|
||||
<ClInclude Include="lib\telnet.h" />
|
||||
<ClInclude Include="lib\tftp.h" />
|
||||
<ClInclude Include="lib\timeval.h" />
|
||||
<ClInclude Include="lib\transfer.h" />
|
||||
<ClInclude Include="lib\url.h" />
|
||||
<ClInclude Include="lib\urldata.h" />
|
||||
<ClInclude Include="lib\vauth\digest.h" />
|
||||
<ClInclude Include="lib\vauth\ntlm.h" />
|
||||
<ClInclude Include="lib\vauth\vauth.h" />
|
||||
<ClInclude Include="lib\vtls\axtls.h" />
|
||||
<ClInclude Include="lib\vtls\cyassl.h" />
|
||||
<ClInclude Include="lib\vtls\darwinssl.h" />
|
||||
<ClInclude Include="lib\vtls\gskit.h" />
|
||||
<ClInclude Include="lib\vtls\gtls.h" />
|
||||
<ClInclude Include="lib\vtls\mbedtls.h" />
|
||||
<ClInclude Include="lib\vtls\nssg.h" />
|
||||
<ClInclude Include="lib\vtls\openssl.h" />
|
||||
<ClInclude Include="lib\vtls\polarssl.h" />
|
||||
<ClInclude Include="lib\vtls\polarssl_threadlock.h" />
|
||||
<ClInclude Include="lib\vtls\schannel.h" />
|
||||
<ClInclude Include="lib\vtls\vtls.h" />
|
||||
<ClInclude Include="lib\warnless.h" />
|
||||
<ClInclude Include="lib\wildcard.h" />
|
||||
<ClInclude Include="lib\x509asn1.h" />
|
||||
<ClInclude Include="curl\include\curl\curl.h" />
|
||||
<ClInclude Include="curl\include\curl\curlver.h" />
|
||||
<ClInclude Include="curl\include\curl\easy.h" />
|
||||
<ClInclude Include="curl\include\curl\mprintf.h" />
|
||||
<ClInclude Include="curl\include\curl\multi.h" />
|
||||
<ClInclude Include="curl\include\curl\stdcheaders.h" />
|
||||
<ClInclude Include="curl\include\curl\system.h" />
|
||||
<ClInclude Include="curl\include\curl\typecheck-gcc.h" />
|
||||
<ClInclude Include="curl\include\curl\urlapi.h" />
|
||||
<ClInclude Include="curl\lib\altsvc.h" />
|
||||
<ClInclude Include="curl\lib\amigaos.h" />
|
||||
<ClInclude Include="curl\lib\arpa_telnet.h" />
|
||||
<ClInclude Include="curl\lib\asyn.h" />
|
||||
<ClInclude Include="curl\lib\bufq.h" />
|
||||
<ClInclude Include="curl\lib\bufref.h" />
|
||||
<ClInclude Include="curl\lib\c-hyper.h" />
|
||||
<ClInclude Include="curl\lib\cf-h1-proxy.h" />
|
||||
<ClInclude Include="curl\lib\cf-h2-proxy.h" />
|
||||
<ClInclude Include="curl\lib\cf-haproxy.h" />
|
||||
<ClInclude Include="curl\lib\cf-https-connect.h" />
|
||||
<ClInclude Include="curl\lib\cf-socket.h" />
|
||||
<ClInclude Include="curl\lib\cfilters.h" />
|
||||
<ClInclude Include="curl\lib\config-amigaos.h" />
|
||||
<ClInclude Include="curl\lib\config-dos.h" />
|
||||
<ClInclude Include="curl\lib\config-mac.h" />
|
||||
<ClInclude Include="curl\lib\config-os400.h" />
|
||||
<ClInclude Include="curl\lib\config-plan9.h" />
|
||||
<ClInclude Include="curl\lib\config-riscos.h" />
|
||||
<ClInclude Include="curl\lib\config-win32.h" />
|
||||
<ClInclude Include="curl\lib\config-win32ce.h" />
|
||||
<ClInclude Include="curl\lib\conncache.h" />
|
||||
<ClInclude Include="curl\lib\connect.h" />
|
||||
<ClInclude Include="curl\lib\content_encoding.h" />
|
||||
<ClInclude Include="curl\lib\cookie.h" />
|
||||
<ClInclude Include="curl\lib\curlx.h" />
|
||||
<ClInclude Include="curl\lib\curl_addrinfo.h" />
|
||||
<ClInclude Include="curl\lib\curl_base64.h" />
|
||||
<ClInclude Include="curl\lib\curl_ctype.h" />
|
||||
<ClInclude Include="curl\lib\curl_des.h" />
|
||||
<ClInclude Include="curl\lib\curl_endian.h" />
|
||||
<ClInclude Include="curl\lib\curl_fnmatch.h" />
|
||||
<ClInclude Include="curl\lib\curl_gethostname.h" />
|
||||
<ClInclude Include="curl\lib\curl_get_line.h" />
|
||||
<ClInclude Include="curl\lib\curl_gssapi.h" />
|
||||
<ClInclude Include="curl\lib\curl_hmac.h" />
|
||||
<ClInclude Include="curl\lib\curl_krb5.h" />
|
||||
<ClInclude Include="curl\lib\curl_ldap.h" />
|
||||
<ClInclude Include="curl\lib\curl_log.h" />
|
||||
<ClInclude Include="curl\lib\curl_md4.h" />
|
||||
<ClInclude Include="curl\lib\curl_md5.h" />
|
||||
<ClInclude Include="curl\lib\curl_memory.h" />
|
||||
<ClInclude Include="curl\lib\curl_memrchr.h" />
|
||||
<ClInclude Include="curl\lib\curl_multibyte.h" />
|
||||
<ClInclude Include="curl\lib\curl_ntlm_core.h" />
|
||||
<ClInclude Include="curl\lib\curl_ntlm_wb.h" />
|
||||
<ClInclude Include="curl\lib\curl_path.h" />
|
||||
<ClInclude Include="curl\lib\curl_printf.h" />
|
||||
<ClInclude Include="curl\lib\curl_range.h" />
|
||||
<ClInclude Include="curl\lib\curl_rtmp.h" />
|
||||
<ClInclude Include="curl\lib\curl_sasl.h" />
|
||||
<ClInclude Include="curl\lib\curl_setup.h" />
|
||||
<ClInclude Include="curl\lib\curl_setup_once.h" />
|
||||
<ClInclude Include="curl\lib\curl_sha256.h" />
|
||||
<ClInclude Include="curl\lib\curl_sspi.h" />
|
||||
<ClInclude Include="curl\lib\curl_threads.h" />
|
||||
<ClInclude Include="curl\lib\dict.h" />
|
||||
<ClInclude Include="curl\lib\doh.h" />
|
||||
<ClInclude Include="curl\lib\dotdot.h" />
|
||||
<ClInclude Include="curl\lib\dynbuf.h" />
|
||||
<ClInclude Include="curl\lib\dynhds.h" />
|
||||
<ClInclude Include="curl\lib\easyif.h" />
|
||||
<ClInclude Include="curl\lib\easyoptions.h" />
|
||||
<ClInclude Include="curl\lib\easy_lock.h" />
|
||||
<ClInclude Include="curl\lib\escape.h" />
|
||||
<ClInclude Include="curl\lib\file.h" />
|
||||
<ClInclude Include="curl\lib\fileinfo.h" />
|
||||
<ClInclude Include="curl\lib\fopen.h" />
|
||||
<ClInclude Include="curl\lib\formdata.h" />
|
||||
<ClInclude Include="curl\lib\ftp.h" />
|
||||
<ClInclude Include="curl\lib\ftplistparser.h" />
|
||||
<ClInclude Include="curl\lib\functypes.h" />
|
||||
<ClInclude Include="curl\lib\getinfo.h" />
|
||||
<ClInclude Include="curl\lib\gopher.h" />
|
||||
<ClInclude Include="curl\lib\hash.h" />
|
||||
<ClInclude Include="curl\lib\headers.h" />
|
||||
<ClInclude Include="curl\lib\hostip.h" />
|
||||
<ClInclude Include="curl\lib\hsts.h" />
|
||||
<ClInclude Include="curl\lib\http.h" />
|
||||
<ClInclude Include="curl\lib\http1.h" />
|
||||
<ClInclude Include="curl\lib\http2.h" />
|
||||
<ClInclude Include="curl\lib\http_aws_sigv4.h" />
|
||||
<ClInclude Include="curl\lib\http_chunks.h" />
|
||||
<ClInclude Include="curl\lib\http_digest.h" />
|
||||
<ClInclude Include="curl\lib\http_negotiate.h" />
|
||||
<ClInclude Include="curl\lib\http_ntlm.h" />
|
||||
<ClInclude Include="curl\lib\http_proxy.h" />
|
||||
<ClInclude Include="curl\lib\idn.h" />
|
||||
<ClInclude Include="curl\lib\if2ip.h" />
|
||||
<ClInclude Include="curl\lib\imap.h" />
|
||||
<ClInclude Include="curl\lib\inet_ntop.h" />
|
||||
<ClInclude Include="curl\lib\inet_pton.h" />
|
||||
<ClInclude Include="curl\lib\llist.h" />
|
||||
<ClInclude Include="curl\lib\memdebug.h" />
|
||||
<ClInclude Include="curl\lib\mime.h" />
|
||||
<ClInclude Include="curl\lib\mqtt.h" />
|
||||
<ClInclude Include="curl\lib\multihandle.h" />
|
||||
<ClInclude Include="curl\lib\multiif.h" />
|
||||
<ClInclude Include="curl\lib\netrc.h" />
|
||||
<ClInclude Include="curl\lib\nonblock.h" />
|
||||
<ClInclude Include="curl\lib\noproxy.h" />
|
||||
<ClInclude Include="curl\lib\parsedate.h" />
|
||||
<ClInclude Include="curl\lib\pingpong.h" />
|
||||
<ClInclude Include="curl\lib\pop3.h" />
|
||||
<ClInclude Include="curl\lib\progress.h" />
|
||||
<ClInclude Include="curl\lib\psl.h" />
|
||||
<ClInclude Include="curl\lib\rand.h" />
|
||||
<ClInclude Include="curl\lib\rename.h" />
|
||||
<ClInclude Include="curl\lib\rtsp.h" />
|
||||
<ClInclude Include="curl\lib\select.h" />
|
||||
<ClInclude Include="curl\lib\sendf.h" />
|
||||
<ClInclude Include="curl\lib\setopt.h" />
|
||||
<ClInclude Include="curl\lib\setup-os400.h" />
|
||||
<ClInclude Include="curl\lib\setup-vms.h" />
|
||||
<ClInclude Include="curl\lib\setup-win32.h" />
|
||||
<ClInclude Include="curl\lib\share.h" />
|
||||
<ClInclude Include="curl\lib\sigpipe.h" />
|
||||
<ClInclude Include="curl\lib\slist.h" />
|
||||
<ClInclude Include="curl\lib\smb.h" />
|
||||
<ClInclude Include="curl\lib\smtp.h" />
|
||||
<ClInclude Include="curl\lib\sockaddr.h" />
|
||||
<ClInclude Include="curl\lib\socketpair.h" />
|
||||
<ClInclude Include="curl\lib\socks.h" />
|
||||
<ClInclude Include="curl\lib\speedcheck.h" />
|
||||
<ClInclude Include="curl\lib\splay.h" />
|
||||
<ClInclude Include="curl\lib\strcase.h" />
|
||||
<ClInclude Include="curl\lib\strdup.h" />
|
||||
<ClInclude Include="curl\lib\strerror.h" />
|
||||
<ClInclude Include="curl\lib\strtok.h" />
|
||||
<ClInclude Include="curl\lib\strtoofft.h" />
|
||||
<ClInclude Include="curl\lib\system_win32.h" />
|
||||
<ClInclude Include="curl\lib\telnet.h" />
|
||||
<ClInclude Include="curl\lib\tftp.h" />
|
||||
<ClInclude Include="curl\lib\timediff.h" />
|
||||
<ClInclude Include="curl\lib\timeval.h" />
|
||||
<ClInclude Include="curl\lib\transfer.h" />
|
||||
<ClInclude Include="curl\lib\url.h" />
|
||||
<ClInclude Include="curl\lib\urlapi-int.h" />
|
||||
<ClInclude Include="curl\lib\urldata.h" />
|
||||
<ClInclude Include="curl\lib\version_win32.h" />
|
||||
<ClInclude Include="curl\lib\vquic\curl_msh3.h" />
|
||||
<ClInclude Include="curl\lib\vquic\curl_ngtcp2.h" />
|
||||
<ClInclude Include="curl\lib\vquic\curl_quiche.h" />
|
||||
<ClInclude Include="curl\lib\vquic\vquic_int.h" />
|
||||
<ClInclude Include="curl\lib\vtls\hostcheck.h" />
|
||||
<ClInclude Include="curl\lib\vtls\rustls.h" />
|
||||
<ClInclude Include="curl\lib\vtls\x509asn1.h" />
|
||||
<ClInclude Include="curl\lib\warnless.h" />
|
||||
<ClInclude Include="curl\lib\vauth\digest.h" />
|
||||
<ClInclude Include="curl\lib\vauth\ntlm.h" />
|
||||
<ClInclude Include="curl\lib\vauth\vauth.h" />
|
||||
<ClInclude Include="curl\lib\vquic\vquic.h" />
|
||||
<ClInclude Include="curl\lib\vssh\ssh.h" />
|
||||
<ClInclude Include="curl\lib\vssh\wolfssh.h" />
|
||||
<ClInclude Include="curl\lib\vtls\bearssl.h" />
|
||||
<ClInclude Include="curl\lib\vtls\gskit.h" />
|
||||
<ClInclude Include="curl\lib\vtls\gtls.h" />
|
||||
<ClInclude Include="curl\lib\vtls\keylog.h" />
|
||||
<ClInclude Include="curl\lib\vtls\mbedtls.h" />
|
||||
<ClInclude Include="curl\lib\vtls\mbedtls_threadlock.h" />
|
||||
<ClInclude Include="curl\lib\vtls\nssg.h" />
|
||||
<ClInclude Include="curl\lib\vtls\openssl.h" />
|
||||
<ClInclude Include="curl\lib\vtls\schannel.h" />
|
||||
<ClInclude Include="curl\lib\vtls\sectransp.h" />
|
||||
<ClInclude Include="curl\lib\vtls\vtls.h" />
|
||||
<ClInclude Include="curl\lib\vtls\wolfssl.h" />
|
||||
<ClInclude Include="curl\lib\ws.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
/* lib/curl_config.h. Generated from curl_config.h.in by configure. */
|
||||
/* lib/curl_config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Location of default ca bundle */
|
||||
#define CURL_CA_BUNDLE "/etc/ssl/certs/ca-certificates.crt"
|
||||
|
||||
/* define "1" to use built in CA store of SSL library */
|
||||
/* #undef CURL_CA_FALLBACK */
|
||||
|
@ -860,7 +858,7 @@
|
|||
#define RETSIGTYPE void
|
||||
|
||||
/* Define to the type qualifier of arg 5 for select. */
|
||||
#define SELECT_QUAL_ARG5
|
||||
#define SELECT_QUAL_ARG5
|
||||
|
||||
/* Define to the type of arg 1 for select. */
|
||||
#define SELECT_TYPE_ARG1 int
|
||||
|
@ -958,6 +956,8 @@
|
|||
/* if mbedTLS is enabled */
|
||||
#define USE_MBEDTLS 1
|
||||
|
||||
#define SIZEOF_CURL_OFF_T 8
|
||||
|
||||
/* Define to enable metalink support */
|
||||
/* #undef USE_METALINK */
|
||||
|
||||
|
@ -1046,4 +1046,4 @@
|
|||
/* #undef size_t */
|
||||
|
||||
/* the signed version of size_t */
|
||||
/* #undef ssize_t */
|
||||
/* #undef ssize_t */
|
|
@ -2,7 +2,7 @@
|
|||
<Project>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(ExternalsDir)curl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ExternalsDir)curl\curl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
|
|
|
@ -1,55 +0,0 @@
|
|||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
| (__| |_| | _ <| |___
|
||||
\___|\___/|_| \_\_____|
|
||||
|
||||
Include files for libcurl, external users.
|
||||
|
||||
They're all placed in the curl subdirectory here for better fit in any kind
|
||||
of environment. You must include files from here using...
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
... style and point the compiler's include path to the directory holding the
|
||||
curl subdirectory. It makes it more likely to survive future modifications.
|
||||
|
||||
NOTE FOR LIBCURL HACKERS
|
||||
|
||||
The following notes apply to libcurl version 7.19.0 and later.
|
||||
|
||||
* The distributed curl/curlbuild.h file is only intended to be used on systems
|
||||
which can not run the also distributed configure script.
|
||||
|
||||
* The distributed curlbuild.h file is generated as a copy of curlbuild.h.dist
|
||||
when the libcurl source code distribution archive file is originally created.
|
||||
|
||||
* If you check out from git on a non-configure platform, you must run the
|
||||
appropriate buildconf* script to set up curlbuild.h and other local files
|
||||
before being able of compiling the library.
|
||||
|
||||
* On systems capable of running the configure script, the configure process
|
||||
will overwrite the distributed include/curl/curlbuild.h file with one that
|
||||
is suitable and specific to the library being configured and built, which
|
||||
is generated from the include/curl/curlbuild.h.in template file.
|
||||
|
||||
* If you intend to distribute an already compiled libcurl library you _MUST_
|
||||
also distribute along with it the generated curl/curlbuild.h which has been
|
||||
used to compile it. Otherwise the library will be of no use for the users of
|
||||
the library that you have built. It is _your_ responsibility to provide this
|
||||
file. No one at the cURL project can know how you have built the library.
|
||||
|
||||
* File curl/curlbuild.h includes platform and configuration dependent info,
|
||||
and must not be modified by anyone. Configure script generates it for you.
|
||||
|
||||
* We cannot assume anything else but very basic compiler features being
|
||||
present. While libcurl requires an ANSI C compiler to build, some of the
|
||||
earlier ANSI compilers clearly can't deal with some preprocessor operators.
|
||||
|
||||
* Newlines must remain unix-style for older compilers' sake.
|
||||
|
||||
* Comments must be written in the old-style /* unnested C-fashion */
|
||||
|
||||
To figure out how to do good and portable checks for features, operating
|
||||
systems or specific hardwarare, a very good resource is Bjorn Reese's
|
||||
collection at http://predef.sf.net/
|
|
@ -1,53 +0,0 @@
|
|||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
###########################################################################
|
||||
pkginclude_HEADERS = \
|
||||
curl.h curlver.h easy.h mprintf.h stdcheaders.h multi.h \
|
||||
typecheck-gcc.h curlbuild.h curlrules.h
|
||||
|
||||
pkgincludedir= $(includedir)/curl
|
||||
|
||||
# curlbuild.h does not exist in the git tree. When the original libcurl
|
||||
# source code distribution archive file is created, curlbuild.h.dist is
|
||||
# renamed to curlbuild.h and included in the tarball so that it can be
|
||||
# used directly on non-configure systems.
|
||||
#
|
||||
# The distributed curlbuild.h will be overwritten on configure systems
|
||||
# when the configure script runs, with one that is suitable and specific
|
||||
# to the library being configured and built.
|
||||
#
|
||||
# curlbuild.h.in is the distributed template file from which the configure
|
||||
# script creates curlbuild.h at library configuration time, overwiting the
|
||||
# one included in the distribution archive.
|
||||
#
|
||||
# curlbuild.h.dist is not included in the source code distribution archive.
|
||||
|
||||
EXTRA_DIST = curlbuild.h.in
|
||||
|
||||
DISTCLEANFILES = curlbuild.h
|
||||
|
||||
checksrc:
|
||||
@@PERL@ $(top_srcdir)/lib/checksrc.pl -Wcurlbuild.h -D$(top_srcdir)/include/curl $(pkginclude_HEADERS) $(EXTRA_DIST)
|
||||
|
||||
if CURLDEBUG
|
||||
# for debug builds, we scan the sources on all regular make invokes
|
||||
all-local: checksrc
|
||||
endif
|
|
@ -1,707 +0,0 @@
|
|||
# Makefile.in generated by automake 1.15 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__is_gnu_make = { \
|
||||
if test -z '$(MAKELEVEL)'; then \
|
||||
false; \
|
||||
elif test -n '$(MAKE_HOST)'; then \
|
||||
true; \
|
||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
||||
true; \
|
||||
else \
|
||||
false; \
|
||||
fi; \
|
||||
}
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = include/curl
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/curl-compilers.m4 \
|
||||
$(top_srcdir)/m4/curl-confopts.m4 \
|
||||
$(top_srcdir)/m4/curl-functions.m4 \
|
||||
$(top_srcdir)/m4/curl-openssl.m4 \
|
||||
$(top_srcdir)/m4/curl-override.m4 \
|
||||
$(top_srcdir)/m4/curl-reentrant.m4 $(top_srcdir)/m4/libtool.m4 \
|
||||
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
|
||||
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
|
||||
$(top_srcdir)/m4/xc-am-iface.m4 \
|
||||
$(top_srcdir)/m4/xc-cc-check.m4 \
|
||||
$(top_srcdir)/m4/xc-lt-iface.m4 \
|
||||
$(top_srcdir)/m4/xc-translit.m4 \
|
||||
$(top_srcdir)/m4/xc-val-flgs.m4 \
|
||||
$(top_srcdir)/m4/zz40-xc-ovr.m4 \
|
||||
$(top_srcdir)/m4/zz50-xc-ovr.m4 \
|
||||
$(top_srcdir)/m4/zz60-xc-ovr.m4 $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(pkginclude_HEADERS) \
|
||||
$(am__DIST_COMMON)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/lib/curl_config.h curlbuild.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
||||
am__install_max = 40
|
||||
am__nobase_strip_setup = \
|
||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
||||
am__nobase_strip = \
|
||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
||||
am__nobase_list = $(am__nobase_strip_setup); \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
||||
if (++n[$$2] == $(am__install_max)) \
|
||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
||||
END { for (dir in files) print dir, files[dir] }'
|
||||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__uninstall_files_from_dir = { \
|
||||
test -z "$$files" \
|
||||
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
||||
$(am__cd) "$$dir" && rm -f $$files; }; \
|
||||
}
|
||||
am__installdirs = "$(DESTDIR)$(pkgincludedir)"
|
||||
HEADERS = $(pkginclude_HEADERS)
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
|
||||
$(LISP)curlbuild.h.in
|
||||
# Read a list of newline-separated strings from the standard input,
|
||||
# and print each of them once, without duplicates. Input order is
|
||||
# *not* preserved.
|
||||
am__uniquify_input = $(AWK) '\
|
||||
BEGIN { nonempty = 0; } \
|
||||
{ items[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in items) print i; }; } \
|
||||
'
|
||||
# Make sure the list of sources is unique. This is necessary because,
|
||||
# e.g., the same source file might be shared among _SOURCES variables
|
||||
# for different programs/libraries.
|
||||
am__define_uniq_tagged_files = \
|
||||
list='$(am__tagged_files)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/curlbuild.h.in
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
pkgincludedir = $(includedir)/curl
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BLANK_AT_MAKETIME = @BLANK_AT_MAKETIME@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CFLAG_CURL_SYMBOL_HIDING = @CFLAG_CURL_SYMBOL_HIDING@
|
||||
CONFIGURE_OPTIONS = @CONFIGURE_OPTIONS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CPPFLAG_CURL_STATICLIB = @CPPFLAG_CURL_STATICLIB@
|
||||
CURLVERSION = @CURLVERSION@
|
||||
CURL_CA_BUNDLE = @CURL_CA_BUNDLE@
|
||||
CURL_CFLAG_EXTRAS = @CURL_CFLAG_EXTRAS@
|
||||
CURL_DISABLE_DICT = @CURL_DISABLE_DICT@
|
||||
CURL_DISABLE_FILE = @CURL_DISABLE_FILE@
|
||||
CURL_DISABLE_FTP = @CURL_DISABLE_FTP@
|
||||
CURL_DISABLE_GOPHER = @CURL_DISABLE_GOPHER@
|
||||
CURL_DISABLE_HTTP = @CURL_DISABLE_HTTP@
|
||||
CURL_DISABLE_IMAP = @CURL_DISABLE_IMAP@
|
||||
CURL_DISABLE_LDAP = @CURL_DISABLE_LDAP@
|
||||
CURL_DISABLE_LDAPS = @CURL_DISABLE_LDAPS@
|
||||
CURL_DISABLE_POP3 = @CURL_DISABLE_POP3@
|
||||
CURL_DISABLE_PROXY = @CURL_DISABLE_PROXY@
|
||||
CURL_DISABLE_RTSP = @CURL_DISABLE_RTSP@
|
||||
CURL_DISABLE_SMB = @CURL_DISABLE_SMB@
|
||||
CURL_DISABLE_SMTP = @CURL_DISABLE_SMTP@
|
||||
CURL_DISABLE_TELNET = @CURL_DISABLE_TELNET@
|
||||
CURL_DISABLE_TFTP = @CURL_DISABLE_TFTP@
|
||||
CURL_LT_SHLIB_VERSIONED_FLAVOUR = @CURL_LT_SHLIB_VERSIONED_FLAVOUR@
|
||||
CURL_NETWORK_AND_TIME_LIBS = @CURL_NETWORK_AND_TIME_LIBS@
|
||||
CURL_NETWORK_LIBS = @CURL_NETWORK_LIBS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
ENABLE_SHARED = @ENABLE_SHARED@
|
||||
ENABLE_STATIC = @ENABLE_STATIC@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
GREP = @GREP@
|
||||
HAVE_GNUTLS_SRP = @HAVE_GNUTLS_SRP@
|
||||
HAVE_LDAP_SSL = @HAVE_LDAP_SSL@
|
||||
HAVE_LIBZ = @HAVE_LIBZ@
|
||||
HAVE_OPENSSL_SRP = @HAVE_OPENSSL_SRP@
|
||||
IDN_ENABLED = @IDN_ENABLED@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
IPV6_ENABLED = @IPV6_ENABLED@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBCURL_LIBS = @LIBCURL_LIBS@
|
||||
LIBMETALINK_CPPFLAGS = @LIBMETALINK_CPPFLAGS@
|
||||
LIBMETALINK_LDFLAGS = @LIBMETALINK_LDFLAGS@
|
||||
LIBMETALINK_LIBS = @LIBMETALINK_LIBS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MANOPT = @MANOPT@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
NROFF = @NROFF@
|
||||
NSS_LIBS = @NSS_LIBS@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PERL = @PERL@
|
||||
PKGADD_NAME = @PKGADD_NAME@
|
||||
PKGADD_PKG = @PKGADD_PKG@
|
||||
PKGADD_VENDOR = @PKGADD_VENDOR@
|
||||
PKGCONFIG = @PKGCONFIG@
|
||||
RANDOM_FILE = @RANDOM_FILE@
|
||||
RANLIB = @RANLIB@
|
||||
REQUIRE_LIB_DEPS = @REQUIRE_LIB_DEPS@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SSL_ENABLED = @SSL_ENABLED@
|
||||
SSL_LIBS = @SSL_LIBS@
|
||||
STRIP = @STRIP@
|
||||
SUPPORT_FEATURES = @SUPPORT_FEATURES@
|
||||
SUPPORT_PROTOCOLS = @SUPPORT_PROTOCOLS@
|
||||
USE_ARES = @USE_ARES@
|
||||
USE_AXTLS = @USE_AXTLS@
|
||||
USE_CYASSL = @USE_CYASSL@
|
||||
USE_DARWINSSL = @USE_DARWINSSL@
|
||||
USE_GNUTLS = @USE_GNUTLS@
|
||||
USE_GNUTLS_NETTLE = @USE_GNUTLS_NETTLE@
|
||||
USE_LIBRTMP = @USE_LIBRTMP@
|
||||
USE_LIBSSH2 = @USE_LIBSSH2@
|
||||
USE_MBEDTLS = @USE_MBEDTLS@
|
||||
USE_NGHTTP2 = @USE_NGHTTP2@
|
||||
USE_NSS = @USE_NSS@
|
||||
USE_OPENLDAP = @USE_OPENLDAP@
|
||||
USE_POLARSSL = @USE_POLARSSL@
|
||||
USE_SCHANNEL = @USE_SCHANNEL@
|
||||
USE_UNIX_SOCKETS = @USE_UNIX_SOCKETS@
|
||||
USE_WINDOWS_SSPI = @USE_WINDOWS_SSPI@
|
||||
VERSION = @VERSION@
|
||||
VERSIONNUM = @VERSIONNUM@
|
||||
ZLIB_LIBS = @ZLIB_LIBS@
|
||||
ZSH_FUNCTIONS_DIR = @ZSH_FUNCTIONS_DIR@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
libext = @libext@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
subdirs = @subdirs@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
###########################################################################
|
||||
pkginclude_HEADERS = \
|
||||
curl.h curlver.h easy.h mprintf.h stdcheaders.h multi.h \
|
||||
typecheck-gcc.h curlbuild.h curlrules.h
|
||||
|
||||
|
||||
# curlbuild.h does not exist in the git tree. When the original libcurl
|
||||
# source code distribution archive file is created, curlbuild.h.dist is
|
||||
# renamed to curlbuild.h and included in the tarball so that it can be
|
||||
# used directly on non-configure systems.
|
||||
#
|
||||
# The distributed curlbuild.h will be overwritten on configure systems
|
||||
# when the configure script runs, with one that is suitable and specific
|
||||
# to the library being configured and built.
|
||||
#
|
||||
# curlbuild.h.in is the distributed template file from which the configure
|
||||
# script creates curlbuild.h at library configuration time, overwiting the
|
||||
# one included in the distribution archive.
|
||||
#
|
||||
# curlbuild.h.dist is not included in the source code distribution archive.
|
||||
EXTRA_DIST = curlbuild.h.in
|
||||
DISTCLEANFILES = curlbuild.h
|
||||
all: curlbuild.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/curl/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu include/curl/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
curlbuild.h: stamp-h2
|
||||
@test -f $@ || rm -f stamp-h2
|
||||
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h2
|
||||
|
||||
stamp-h2: $(srcdir)/curlbuild.h.in $(top_builddir)/config.status
|
||||
@rm -f stamp-h2
|
||||
cd $(top_builddir) && $(SHELL) ./config.status include/curl/curlbuild.h
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f curlbuild.h stamp-h2
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
install-pkgincludeHEADERS: $(pkginclude_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \
|
||||
$(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \
|
||||
done
|
||||
|
||||
uninstall-pkgincludeHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir)
|
||||
|
||||
ID: $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
||||
tags: tags-am
|
||||
TAGS: tags
|
||||
|
||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
$(am__define_uniq_tagged_files); \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: ctags-am
|
||||
|
||||
CTAGS: ctags
|
||||
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
cscopelist: cscopelist-am
|
||||
|
||||
cscopelist-am: $(am__tagged_files)
|
||||
list='$(am__tagged_files)'; \
|
||||
case "$(srcdir)" in \
|
||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||
esac; \
|
||||
for i in $$list; do \
|
||||
if test -f "$$i"; then \
|
||||
echo "$(subdir)/$$i"; \
|
||||
else \
|
||||
echo "$$sdir/$$i"; \
|
||||
fi; \
|
||||
done >> $(top_builddir)/cscope.files
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
@CURLDEBUG_FALSE@all-local:
|
||||
all-am: Makefile $(HEADERS) curlbuild.h all-local
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(pkgincludedir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-pkgincludeHEADERS
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-pkgincludeHEADERS
|
||||
|
||||
.MAKE: all install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS TAGS all all-am all-local check check-am clean \
|
||||
clean-generic clean-libtool cscopelist-am ctags ctags-am \
|
||||
distclean distclean-generic distclean-hdr distclean-libtool \
|
||||
distclean-tags distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am install-man \
|
||||
install-pdf install-pdf-am install-pkgincludeHEADERS \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
|
||||
uninstall-am uninstall-pkgincludeHEADERS
|
||||
|
||||
.PRECIOUS: Makefile
|
||||
|
||||
|
||||
checksrc:
|
||||
@@PERL@ $(top_srcdir)/lib/checksrc.pl -Wcurlbuild.h -D$(top_srcdir)/include/curl $(pkginclude_HEADERS) $(EXTRA_DIST)
|
||||
|
||||
# for debug builds, we scan the sources on all regular make invokes
|
||||
@CURLDEBUG_TRUE@all-local: checksrc
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
File diff suppressed because it is too large
Load Diff
|
@ -1,586 +0,0 @@
|
|||
#ifndef __CURL_CURLBUILD_H
|
||||
#define __CURL_CURLBUILD_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* ================================================================ */
|
||||
/* NOTES FOR CONFIGURE CAPABLE SYSTEMS */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* NOTE 1:
|
||||
* -------
|
||||
*
|
||||
* See file include/curl/curlbuild.h.in, run configure, and forget
|
||||
* that this file exists it is only used for non-configure systems.
|
||||
* But you can keep reading if you want ;-)
|
||||
*
|
||||
*/
|
||||
|
||||
/* ================================================================ */
|
||||
/* NOTES FOR NON-CONFIGURE SYSTEMS */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* NOTE 1:
|
||||
* -------
|
||||
*
|
||||
* Nothing in this file is intended to be modified or adjusted by the
|
||||
* curl library user nor by the curl library builder.
|
||||
*
|
||||
* If you think that something actually needs to be changed, adjusted
|
||||
* or fixed in this file, then, report it on the libcurl development
|
||||
* mailing list: https://cool.haxx.se/mailman/listinfo/curl-library/
|
||||
*
|
||||
* Try to keep one section per platform, compiler and architecture,
|
||||
* otherwise, if an existing section is reused for a different one and
|
||||
* later on the original is adjusted, probably the piggybacking one can
|
||||
* be adversely changed.
|
||||
*
|
||||
* In order to differentiate between platforms/compilers/architectures
|
||||
* use only compiler built in predefined preprocessor symbols.
|
||||
*
|
||||
* This header file shall only export symbols which are 'curl' or 'CURL'
|
||||
* prefixed, otherwise public name space would be polluted.
|
||||
*
|
||||
* NOTE 2:
|
||||
* -------
|
||||
*
|
||||
* For any given platform/compiler curl_off_t must be typedef'ed to a
|
||||
* 64-bit wide signed integral data type. The width of this data type
|
||||
* must remain constant and independent of any possible large file
|
||||
* support settings.
|
||||
*
|
||||
* As an exception to the above, curl_off_t shall be typedef'ed to a
|
||||
* 32-bit wide signed integral data type if there is no 64-bit type.
|
||||
*
|
||||
* As a general rule, curl_off_t shall not be mapped to off_t. This
|
||||
* rule shall only be violated if off_t is the only 64-bit data type
|
||||
* available and the size of off_t is independent of large file support
|
||||
* settings. Keep your build on the safe side avoiding an off_t gating.
|
||||
* If you have a 64-bit off_t then take for sure that another 64-bit
|
||||
* data type exists, dig deeper and you will find it.
|
||||
*
|
||||
* NOTE 3:
|
||||
* -------
|
||||
*
|
||||
* Right now you might be staring at file include/curl/curlbuild.h.dist or
|
||||
* at file include/curl/curlbuild.h, this is due to the following reason:
|
||||
* file include/curl/curlbuild.h.dist is renamed to include/curl/curlbuild.h
|
||||
* when the libcurl source code distribution archive file is created.
|
||||
*
|
||||
* File include/curl/curlbuild.h.dist is not included in the distribution
|
||||
* archive. File include/curl/curlbuild.h is not present in the git tree.
|
||||
*
|
||||
* The distributed include/curl/curlbuild.h file is only intended to be used
|
||||
* on systems which can not run the also distributed configure script.
|
||||
*
|
||||
* On systems capable of running the configure script, the configure process
|
||||
* will overwrite the distributed include/curl/curlbuild.h file with one that
|
||||
* is suitable and specific to the library being configured and built, which
|
||||
* is generated from the include/curl/curlbuild.h.in template file.
|
||||
*
|
||||
* If you check out from git on a non-configure platform, you must run the
|
||||
* appropriate buildconf* script to set up curlbuild.h and other local files.
|
||||
*
|
||||
*/
|
||||
|
||||
/* ================================================================ */
|
||||
/* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */
|
||||
/* ================================================================ */
|
||||
|
||||
#ifdef CURL_SIZEOF_LONG
|
||||
# error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_TYPEOF_CURL_SOCKLEN_T
|
||||
# error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SIZEOF_CURL_SOCKLEN_T
|
||||
# error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_TYPEOF_CURL_OFF_T
|
||||
# error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_FORMAT_CURL_OFF_T
|
||||
# error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_FORMAT_CURL_OFF_TU
|
||||
# error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_FORMAT_OFF_T
|
||||
# error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SIZEOF_CURL_OFF_T
|
||||
# error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SUFFIX_CURL_OFF_T
|
||||
# error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SUFFIX_CURL_OFF_TU
|
||||
# error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined
|
||||
#endif
|
||||
|
||||
/* ================================================================ */
|
||||
/* EXTERNAL INTERFACE SETTINGS FOR NON-CONFIGURE SYSTEMS ONLY */
|
||||
/* ================================================================ */
|
||||
|
||||
#if defined(__DJGPP__) || defined(__GO32__)
|
||||
# if defined(__DJGPP__) && (__DJGPP__ > 1)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# else
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__SALFORDC__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__BORLANDC__)
|
||||
# if (__BORLANDC__ < 0x520)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# else
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T __int64
|
||||
# define CURL_FORMAT_CURL_OFF_T "I64d"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u"
|
||||
# define CURL_FORMAT_OFF_T "%I64d"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T i64
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__TURBOC__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
# if defined(__386__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T __int64
|
||||
# define CURL_FORMAT_CURL_OFF_T "I64d"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u"
|
||||
# define CURL_FORMAT_OFF_T "%I64d"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T i64
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64
|
||||
# else
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__POCC__)
|
||||
# if (__POCC__ < 280)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# elif defined(_MSC_VER)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T __int64
|
||||
# define CURL_FORMAT_CURL_OFF_T "I64d"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u"
|
||||
# define CURL_FORMAT_OFF_T "%I64d"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T i64
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64
|
||||
# else
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__LCC__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__SYMBIAN32__)
|
||||
# if defined(__EABI__) /* Treat all ARM compilers equally */
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# elif defined(__CW32__)
|
||||
# pragma longlong on
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# elif defined(__VC32__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T __int64
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__MWERKS__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(_WIN32_WCE)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T __int64
|
||||
# define CURL_FORMAT_CURL_OFF_T "I64d"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u"
|
||||
# define CURL_FORMAT_OFF_T "%I64d"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T i64
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__MINGW32__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "I64d"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u"
|
||||
# define CURL_FORMAT_OFF_T "%I64d"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__VMS)
|
||||
# if defined(__VAX)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# else
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__OS400__)
|
||||
# if defined(__ILEC400__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
# define CURL_PULL_SYS_TYPES_H 1
|
||||
# define CURL_PULL_SYS_SOCKET_H 1
|
||||
# endif
|
||||
|
||||
#elif defined(__MVS__)
|
||||
# if defined(__IBMC__) || defined(__IBMCPP__)
|
||||
# if defined(_ILP32)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# elif defined(_LP64)
|
||||
# define CURL_SIZEOF_LONG 8
|
||||
# endif
|
||||
# if defined(_LONG_LONG)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# elif defined(_LP64)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# else
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
# define CURL_PULL_SYS_TYPES_H 1
|
||||
# define CURL_PULL_SYS_SOCKET_H 1
|
||||
# endif
|
||||
|
||||
#elif defined(__370__)
|
||||
# if defined(__IBMC__) || defined(__IBMCPP__)
|
||||
# if defined(_ILP32)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# elif defined(_LP64)
|
||||
# define CURL_SIZEOF_LONG 8
|
||||
# endif
|
||||
# if defined(_LONG_LONG)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# elif defined(_LP64)
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# else
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
# define CURL_PULL_SYS_TYPES_H 1
|
||||
# define CURL_PULL_SYS_SOCKET_H 1
|
||||
# endif
|
||||
|
||||
#elif defined(TPF)
|
||||
# define CURL_SIZEOF_LONG 8
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
/* ===================================== */
|
||||
/* KEEP MSVC THE PENULTIMATE ENTRY */
|
||||
/* ===================================== */
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
# if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T __int64
|
||||
# define CURL_FORMAT_CURL_OFF_T "I64d"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "I64u"
|
||||
# define CURL_FORMAT_OFF_T "%I64d"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T i64
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ui64
|
||||
# else
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 4
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T int
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
|
||||
/* ===================================== */
|
||||
/* KEEP GENERIC GCC THE LAST ENTRY */
|
||||
/* ===================================== */
|
||||
|
||||
#elif defined(__GNUC__)
|
||||
# if !defined(__LP64__) && (defined(__ILP32__) || \
|
||||
defined(__i386__) || defined(__ppc__) || defined(__arm__) || \
|
||||
defined(__sparc__) || defined(__mips__) || defined(__sh__))
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# elif defined(__LP64__) || \
|
||||
defined(__x86_64__) || defined(__ppc64__) || defined(__sparc64__)
|
||||
# define CURL_SIZEOF_LONG 8
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# endif
|
||||
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
|
||||
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
|
||||
# define CURL_PULL_SYS_TYPES_H 1
|
||||
# define CURL_PULL_SYS_SOCKET_H 1
|
||||
|
||||
#else
|
||||
# error "Unknown non-configure build target!"
|
||||
Error Compilation_aborted_Unknown_non_configure_build_target
|
||||
#endif
|
||||
|
||||
/* CURL_PULL_SYS_TYPES_H is defined above when inclusion of header file */
|
||||
/* sys/types.h is required here to properly make type definitions below. */
|
||||
#ifdef CURL_PULL_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
/* CURL_PULL_SYS_SOCKET_H is defined above when inclusion of header file */
|
||||
/* sys/socket.h is required here to properly make type definitions below. */
|
||||
#ifdef CURL_PULL_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
/* Data type definition of curl_socklen_t. */
|
||||
|
||||
#ifdef CURL_TYPEOF_CURL_SOCKLEN_T
|
||||
typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
|
||||
#endif
|
||||
|
||||
/* Data type definition of curl_off_t. */
|
||||
|
||||
#ifdef CURL_TYPEOF_CURL_OFF_T
|
||||
typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;
|
||||
#endif
|
||||
|
||||
#endif /* __CURL_CURLBUILD_H */
|
|
@ -1,197 +0,0 @@
|
|||
#ifndef __CURL_CURLBUILD_H
|
||||
#define __CURL_CURLBUILD_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2008, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* ================================================================ */
|
||||
/* NOTES FOR CONFIGURE CAPABLE SYSTEMS */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* NOTE 1:
|
||||
* -------
|
||||
*
|
||||
* Nothing in this file is intended to be modified or adjusted by the
|
||||
* curl library user nor by the curl library builder.
|
||||
*
|
||||
* If you think that something actually needs to be changed, adjusted
|
||||
* or fixed in this file, then, report it on the libcurl development
|
||||
* mailing list: https://cool.haxx.se/mailman/listinfo/curl-library/
|
||||
*
|
||||
* This header file shall only export symbols which are 'curl' or 'CURL'
|
||||
* prefixed, otherwise public name space would be polluted.
|
||||
*
|
||||
* NOTE 2:
|
||||
* -------
|
||||
*
|
||||
* Right now you might be staring at file include/curl/curlbuild.h.in or
|
||||
* at file include/curl/curlbuild.h, this is due to the following reason:
|
||||
*
|
||||
* On systems capable of running the configure script, the configure process
|
||||
* will overwrite the distributed include/curl/curlbuild.h file with one that
|
||||
* is suitable and specific to the library being configured and built, which
|
||||
* is generated from the include/curl/curlbuild.h.in template file.
|
||||
*
|
||||
*/
|
||||
|
||||
/* ================================================================ */
|
||||
/* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */
|
||||
/* ================================================================ */
|
||||
|
||||
#ifdef CURL_SIZEOF_LONG
|
||||
#error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_TYPEOF_CURL_SOCKLEN_T
|
||||
#error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SIZEOF_CURL_SOCKLEN_T
|
||||
#error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_TYPEOF_CURL_OFF_T
|
||||
#error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_FORMAT_CURL_OFF_T
|
||||
#error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_FORMAT_CURL_OFF_TU
|
||||
#error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_FORMAT_OFF_T
|
||||
#error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SIZEOF_CURL_OFF_T
|
||||
#error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SUFFIX_CURL_OFF_T
|
||||
#error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SUFFIX_CURL_OFF_TU
|
||||
#error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined
|
||||
#endif
|
||||
|
||||
/* ================================================================ */
|
||||
/* EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY */
|
||||
/* ================================================================ */
|
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */
|
||||
/* header file ws2tcpip.h must be included by the external interface. */
|
||||
#cmakedefine CURL_PULL_WS2TCPIP_H
|
||||
#ifdef CURL_PULL_WS2TCPIP_H
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# endif
|
||||
# include <windows.h>
|
||||
# include <winsock2.h>
|
||||
# include <ws2tcpip.h>
|
||||
#endif
|
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */
|
||||
/* header file sys/types.h must be included by the external interface. */
|
||||
#cmakedefine CURL_PULL_SYS_TYPES_H
|
||||
#ifdef CURL_PULL_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */
|
||||
/* header file stdint.h must be included by the external interface. */
|
||||
#cmakedefine CURL_PULL_STDINT_H
|
||||
#ifdef CURL_PULL_STDINT_H
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */
|
||||
/* header file inttypes.h must be included by the external interface. */
|
||||
#cmakedefine CURL_PULL_INTTYPES_H
|
||||
#ifdef CURL_PULL_INTTYPES_H
|
||||
# include <inttypes.h>
|
||||
#endif
|
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */
|
||||
/* header file sys/socket.h must be included by the external interface. */
|
||||
#cmakedefine CURL_PULL_SYS_SOCKET_H
|
||||
#ifdef CURL_PULL_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */
|
||||
/* header file sys/poll.h must be included by the external interface. */
|
||||
#cmakedefine CURL_PULL_SYS_POLL_H
|
||||
#ifdef CURL_PULL_SYS_POLL_H
|
||||
# include <sys/poll.h>
|
||||
#endif
|
||||
|
||||
/* The size of `long', as computed by sizeof. */
|
||||
#define CURL_SIZEOF_LONG ${CURL_SIZEOF_LONG}
|
||||
|
||||
/* Integral data type used for curl_socklen_t. */
|
||||
#define CURL_TYPEOF_CURL_SOCKLEN_T ${CURL_TYPEOF_CURL_SOCKLEN_T}
|
||||
|
||||
/* The size of `curl_socklen_t', as computed by sizeof. */
|
||||
#define CURL_SIZEOF_CURL_SOCKLEN_T ${CURL_SIZEOF_CURL_SOCKLEN_T}
|
||||
|
||||
/* Data type definition of curl_socklen_t. */
|
||||
typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
|
||||
|
||||
/* Signed integral data type used for curl_off_t. */
|
||||
#define CURL_TYPEOF_CURL_OFF_T ${CURL_TYPEOF_CURL_OFF_T}
|
||||
|
||||
/* Data type definition of curl_off_t. */
|
||||
typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;
|
||||
|
||||
/* curl_off_t formatting string directive without "%" conversion specifier. */
|
||||
#define CURL_FORMAT_CURL_OFF_T "${CURL_FORMAT_CURL_OFF_T}"
|
||||
|
||||
/* unsigned curl_off_t formatting string without "%" conversion specifier. */
|
||||
#define CURL_FORMAT_CURL_OFF_TU "${CURL_FORMAT_CURL_OFF_TU}"
|
||||
|
||||
/* curl_off_t formatting string directive with "%" conversion specifier. */
|
||||
#define CURL_FORMAT_OFF_T "${CURL_FORMAT_OFF_T}"
|
||||
|
||||
/* The size of `curl_off_t', as computed by sizeof. */
|
||||
#define CURL_SIZEOF_CURL_OFF_T ${CURL_SIZEOF_CURL_OFF_T}
|
||||
|
||||
/* curl_off_t constant suffix. */
|
||||
#define CURL_SUFFIX_CURL_OFF_T ${CURL_SUFFIX_CURL_OFF_T}
|
||||
|
||||
/* unsigned curl_off_t constant suffix. */
|
||||
#define CURL_SUFFIX_CURL_OFF_TU ${CURL_SUFFIX_CURL_OFF_TU}
|
||||
|
||||
#endif /* __CURL_CURLBUILD_H */
|
|
@ -1,197 +0,0 @@
|
|||
#ifndef __CURL_CURLBUILD_H
|
||||
#define __CURL_CURLBUILD_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* ================================================================ */
|
||||
/* NOTES FOR CONFIGURE CAPABLE SYSTEMS */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* NOTE 1:
|
||||
* -------
|
||||
*
|
||||
* Nothing in this file is intended to be modified or adjusted by the
|
||||
* curl library user nor by the curl library builder.
|
||||
*
|
||||
* If you think that something actually needs to be changed, adjusted
|
||||
* or fixed in this file, then, report it on the libcurl development
|
||||
* mailing list: https://cool.haxx.se/mailman/listinfo/curl-library/
|
||||
*
|
||||
* This header file shall only export symbols which are 'curl' or 'CURL'
|
||||
* prefixed, otherwise public name space would be polluted.
|
||||
*
|
||||
* NOTE 2:
|
||||
* -------
|
||||
*
|
||||
* Right now you might be staring at file include/curl/curlbuild.h.in or
|
||||
* at file include/curl/curlbuild.h, this is due to the following reason:
|
||||
*
|
||||
* On systems capable of running the configure script, the configure process
|
||||
* will overwrite the distributed include/curl/curlbuild.h file with one that
|
||||
* is suitable and specific to the library being configured and built, which
|
||||
* is generated from the include/curl/curlbuild.h.in template file.
|
||||
*
|
||||
*/
|
||||
|
||||
/* ================================================================ */
|
||||
/* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */
|
||||
/* ================================================================ */
|
||||
|
||||
#ifdef CURL_SIZEOF_LONG
|
||||
#error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_TYPEOF_CURL_SOCKLEN_T
|
||||
#error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SIZEOF_CURL_SOCKLEN_T
|
||||
#error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_TYPEOF_CURL_OFF_T
|
||||
#error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_FORMAT_CURL_OFF_T
|
||||
#error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_FORMAT_CURL_OFF_TU
|
||||
#error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_FORMAT_OFF_T
|
||||
#error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SIZEOF_CURL_OFF_T
|
||||
#error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SUFFIX_CURL_OFF_T
|
||||
#error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CURL_SUFFIX_CURL_OFF_TU
|
||||
#error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h"
|
||||
Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined
|
||||
#endif
|
||||
|
||||
/* ================================================================ */
|
||||
/* EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY */
|
||||
/* ================================================================ */
|
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */
|
||||
/* header file ws2tcpip.h must be included by the external interface. */
|
||||
#undef CURL_PULL_WS2TCPIP_H
|
||||
#ifdef CURL_PULL_WS2TCPIP_H
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# endif
|
||||
# include <windows.h>
|
||||
# include <winsock2.h>
|
||||
# include <ws2tcpip.h>
|
||||
#endif
|
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */
|
||||
/* header file sys/types.h must be included by the external interface. */
|
||||
#undef CURL_PULL_SYS_TYPES_H
|
||||
#ifdef CURL_PULL_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */
|
||||
/* header file stdint.h must be included by the external interface. */
|
||||
#undef CURL_PULL_STDINT_H
|
||||
#ifdef CURL_PULL_STDINT_H
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */
|
||||
/* header file inttypes.h must be included by the external interface. */
|
||||
#undef CURL_PULL_INTTYPES_H
|
||||
#ifdef CURL_PULL_INTTYPES_H
|
||||
# include <inttypes.h>
|
||||
#endif
|
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */
|
||||
/* header file sys/socket.h must be included by the external interface. */
|
||||
#undef CURL_PULL_SYS_SOCKET_H
|
||||
#ifdef CURL_PULL_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */
|
||||
/* header file sys/poll.h must be included by the external interface. */
|
||||
#undef CURL_PULL_SYS_POLL_H
|
||||
#ifdef CURL_PULL_SYS_POLL_H
|
||||
# include <sys/poll.h>
|
||||
#endif
|
||||
|
||||
/* The size of `long', as computed by sizeof. */
|
||||
#undef CURL_SIZEOF_LONG
|
||||
|
||||
/* Integral data type used for curl_socklen_t. */
|
||||
#undef CURL_TYPEOF_CURL_SOCKLEN_T
|
||||
|
||||
/* The size of `curl_socklen_t', as computed by sizeof. */
|
||||
#undef CURL_SIZEOF_CURL_SOCKLEN_T
|
||||
|
||||
/* Data type definition of curl_socklen_t. */
|
||||
typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
|
||||
|
||||
/* Signed integral data type used for curl_off_t. */
|
||||
#undef CURL_TYPEOF_CURL_OFF_T
|
||||
|
||||
/* Data type definition of curl_off_t. */
|
||||
typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;
|
||||
|
||||
/* curl_off_t formatting string directive without "%" conversion specifier. */
|
||||
#undef CURL_FORMAT_CURL_OFF_T
|
||||
|
||||
/* unsigned curl_off_t formatting string without "%" conversion specifier. */
|
||||
#undef CURL_FORMAT_CURL_OFF_TU
|
||||
|
||||
/* curl_off_t formatting string directive with "%" conversion specifier. */
|
||||
#undef CURL_FORMAT_OFF_T
|
||||
|
||||
/* The size of `curl_off_t', as computed by sizeof. */
|
||||
#undef CURL_SIZEOF_CURL_OFF_T
|
||||
|
||||
/* curl_off_t constant suffix. */
|
||||
#undef CURL_SUFFIX_CURL_OFF_T
|
||||
|
||||
/* unsigned curl_off_t constant suffix. */
|
||||
#undef CURL_SUFFIX_CURL_OFF_TU
|
||||
|
||||
#endif /* __CURL_CURLBUILD_H */
|
|
@ -1,262 +0,0 @@
|
|||
#ifndef __CURL_CURLRULES_H
|
||||
#define __CURL_CURLRULES_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* ================================================================ */
|
||||
/* COMPILE TIME SANITY CHECKS */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* NOTE 1:
|
||||
* -------
|
||||
*
|
||||
* All checks done in this file are intentionally placed in a public
|
||||
* header file which is pulled by curl/curl.h when an application is
|
||||
* being built using an already built libcurl library. Additionally
|
||||
* this file is also included and used when building the library.
|
||||
*
|
||||
* If compilation fails on this file it is certainly sure that the
|
||||
* problem is elsewhere. It could be a problem in the curlbuild.h
|
||||
* header file, or simply that you are using different compilation
|
||||
* settings than those used to build the library.
|
||||
*
|
||||
* Nothing in this file is intended to be modified or adjusted by the
|
||||
* curl library user nor by the curl library builder.
|
||||
*
|
||||
* Do not deactivate any check, these are done to make sure that the
|
||||
* library is properly built and used.
|
||||
*
|
||||
* You can find further help on the libcurl development mailing list:
|
||||
* https://cool.haxx.se/mailman/listinfo/curl-library/
|
||||
*
|
||||
* NOTE 2
|
||||
* ------
|
||||
*
|
||||
* Some of the following compile time checks are based on the fact
|
||||
* that the dimension of a constant array can not be a negative one.
|
||||
* In this way if the compile time verification fails, the compilation
|
||||
* will fail issuing an error. The error description wording is compiler
|
||||
* dependent but it will be quite similar to one of the following:
|
||||
*
|
||||
* "negative subscript or subscript is too large"
|
||||
* "array must have at least one element"
|
||||
* "-1 is an illegal array size"
|
||||
* "size of array is negative"
|
||||
*
|
||||
* If you are building an application which tries to use an already
|
||||
* built libcurl library and you are getting this kind of errors on
|
||||
* this file, it is a clear indication that there is a mismatch between
|
||||
* how the library was built and how you are trying to use it for your
|
||||
* application. Your already compiled or binary library provider is the
|
||||
* only one who can give you the details you need to properly use it.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Verify that some macros are actually defined.
|
||||
*/
|
||||
|
||||
#ifndef CURL_SIZEOF_LONG
|
||||
# error "CURL_SIZEOF_LONG definition is missing!"
|
||||
Error Compilation_aborted_CURL_SIZEOF_LONG_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_TYPEOF_CURL_SOCKLEN_T
|
||||
# error "CURL_TYPEOF_CURL_SOCKLEN_T definition is missing!"
|
||||
Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_SIZEOF_CURL_SOCKLEN_T
|
||||
# error "CURL_SIZEOF_CURL_SOCKLEN_T definition is missing!"
|
||||
Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_TYPEOF_CURL_OFF_T
|
||||
# error "CURL_TYPEOF_CURL_OFF_T definition is missing!"
|
||||
Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_FORMAT_CURL_OFF_T
|
||||
# error "CURL_FORMAT_CURL_OFF_T definition is missing!"
|
||||
Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_FORMAT_CURL_OFF_TU
|
||||
# error "CURL_FORMAT_CURL_OFF_TU definition is missing!"
|
||||
Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_FORMAT_OFF_T
|
||||
# error "CURL_FORMAT_OFF_T definition is missing!"
|
||||
Error Compilation_aborted_CURL_FORMAT_OFF_T_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_SIZEOF_CURL_OFF_T
|
||||
# error "CURL_SIZEOF_CURL_OFF_T definition is missing!"
|
||||
Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_SUFFIX_CURL_OFF_T
|
||||
# error "CURL_SUFFIX_CURL_OFF_T definition is missing!"
|
||||
Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CURL_SUFFIX_CURL_OFF_TU
|
||||
# error "CURL_SUFFIX_CURL_OFF_TU definition is missing!"
|
||||
Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_is_missing
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Macros private to this header file.
|
||||
*/
|
||||
|
||||
#define CurlchkszEQ(t, s) sizeof(t) == s ? 1 : -1
|
||||
|
||||
#define CurlchkszGE(t1, t2) sizeof(t1) >= sizeof(t2) ? 1 : -1
|
||||
|
||||
/*
|
||||
* Verify that the size previously defined and expected for long
|
||||
* is the same as the one reported by sizeof() at compile time.
|
||||
*/
|
||||
|
||||
typedef char
|
||||
__curl_rule_01__
|
||||
[CurlchkszEQ(long, CURL_SIZEOF_LONG)];
|
||||
|
||||
/*
|
||||
* Verify that the size previously defined and expected for
|
||||
* curl_off_t is actually the the same as the one reported
|
||||
* by sizeof() at compile time.
|
||||
*/
|
||||
|
||||
typedef char
|
||||
__curl_rule_02__
|
||||
[CurlchkszEQ(curl_off_t, CURL_SIZEOF_CURL_OFF_T)];
|
||||
|
||||
/*
|
||||
* Verify at compile time that the size of curl_off_t as reported
|
||||
* by sizeof() is greater or equal than the one reported for long
|
||||
* for the current compilation.
|
||||
*/
|
||||
|
||||
typedef char
|
||||
__curl_rule_03__
|
||||
[CurlchkszGE(curl_off_t, long)];
|
||||
|
||||
/*
|
||||
* Verify that the size previously defined and expected for
|
||||
* curl_socklen_t is actually the the same as the one reported
|
||||
* by sizeof() at compile time.
|
||||
*/
|
||||
|
||||
typedef char
|
||||
__curl_rule_04__
|
||||
[CurlchkszEQ(curl_socklen_t, CURL_SIZEOF_CURL_SOCKLEN_T)];
|
||||
|
||||
/*
|
||||
* Verify at compile time that the size of curl_socklen_t as reported
|
||||
* by sizeof() is greater or equal than the one reported for int for
|
||||
* the current compilation.
|
||||
*/
|
||||
|
||||
typedef char
|
||||
__curl_rule_05__
|
||||
[CurlchkszGE(curl_socklen_t, int)];
|
||||
|
||||
/* ================================================================ */
|
||||
/* EXTERNALLY AND INTERNALLY VISIBLE DEFINITIONS */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow
|
||||
* these to be visible and exported by the external libcurl interface API,
|
||||
* while also making them visible to the library internals, simply including
|
||||
* curl_setup.h, without actually needing to include curl.h internally.
|
||||
* If some day this section would grow big enough, all this should be moved
|
||||
* to its own header file.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Figure out if we can use the ## preprocessor operator, which is supported
|
||||
* by ISO/ANSI C and C++. Some compilers support it without setting __STDC__
|
||||
* or __cplusplus so we need to carefully check for them too.
|
||||
*/
|
||||
|
||||
#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \
|
||||
defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \
|
||||
defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \
|
||||
defined(__ILEC400__)
|
||||
/* This compiler is believed to have an ISO compatible preprocessor */
|
||||
#define CURL_ISOCPP
|
||||
#else
|
||||
/* This compiler is believed NOT to have an ISO compatible preprocessor */
|
||||
#undef CURL_ISOCPP
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Macros for minimum-width signed and unsigned curl_off_t integer constants.
|
||||
*/
|
||||
|
||||
#if defined(__BORLANDC__) && (__BORLANDC__ == 0x0551)
|
||||
# define __CURL_OFF_T_C_HLPR2(x) x
|
||||
# define __CURL_OFF_T_C_HLPR1(x) __CURL_OFF_T_C_HLPR2(x)
|
||||
# define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \
|
||||
__CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T)
|
||||
# define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \
|
||||
__CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU)
|
||||
#else
|
||||
# ifdef CURL_ISOCPP
|
||||
# define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix
|
||||
# else
|
||||
# define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix
|
||||
# endif
|
||||
# define __CURL_OFF_T_C_HLPR1(Val,Suffix) __CURL_OFF_T_C_HLPR2(Val,Suffix)
|
||||
# define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T)
|
||||
# define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Get rid of macros private to this header file.
|
||||
*/
|
||||
|
||||
#undef CurlchkszEQ
|
||||
#undef CurlchkszGE
|
||||
|
||||
/*
|
||||
* Get rid of macros not intended to exist beyond this point.
|
||||
*/
|
||||
|
||||
#undef CURL_PULL_WS2TCPIP_H
|
||||
#undef CURL_PULL_SYS_TYPES_H
|
||||
#undef CURL_PULL_SYS_SOCKET_H
|
||||
#undef CURL_PULL_SYS_POLL_H
|
||||
#undef CURL_PULL_STDINT_H
|
||||
#undef CURL_PULL_INTTYPES_H
|
||||
|
||||
#undef CURL_TYPEOF_CURL_SOCKLEN_T
|
||||
#undef CURL_TYPEOF_CURL_OFF_T
|
||||
|
||||
#ifdef CURL_NO_OLDIES
|
||||
#undef CURL_FORMAT_OFF_T /* not required since 7.19.0 - obsoleted in 7.20.0 */
|
||||
#endif
|
||||
|
||||
#endif /* __CURL_CURLRULES_H */
|
|
@ -1,77 +0,0 @@
|
|||
#ifndef __CURL_CURLVER_H
|
||||
#define __CURL_CURLVER_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* This header file contains nothing but libcurl version info, generated by
|
||||
a script at release-time. This was made its own header file in 7.11.2 */
|
||||
|
||||
/* This is the global package copyright */
|
||||
#define LIBCURL_COPYRIGHT "1996 - 2016 Daniel Stenberg, <daniel@haxx.se>."
|
||||
|
||||
/* This is the version number of the libcurl package from which this header
|
||||
file origins: */
|
||||
#define LIBCURL_VERSION "7.49.1"
|
||||
|
||||
/* The numeric version number is also available "in parts" by using these
|
||||
defines: */
|
||||
#define LIBCURL_VERSION_MAJOR 7
|
||||
#define LIBCURL_VERSION_MINOR 49
|
||||
#define LIBCURL_VERSION_PATCH 1
|
||||
|
||||
/* This is the numeric version of the libcurl version number, meant for easier
|
||||
parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
|
||||
always follow this syntax:
|
||||
|
||||
0xXXYYZZ
|
||||
|
||||
Where XX, YY and ZZ are the main version, release and patch numbers in
|
||||
hexadecimal (using 8 bits each). All three numbers are always represented
|
||||
using two digits. 1.2 would appear as "0x010200" while version 9.11.7
|
||||
appears as "0x090b07".
|
||||
|
||||
This 6-digit (24 bits) hexadecimal number does not show pre-release number,
|
||||
and it is always a greater number in a more recent release. It makes
|
||||
comparisons with greater than and less than work.
|
||||
|
||||
Note: This define is the full hex number and _does not_ use the
|
||||
CURL_VERSION_BITS() macro since curl's own configure script greps for it
|
||||
and needs it to contain the full number.
|
||||
*/
|
||||
#define LIBCURL_VERSION_NUM 0x073101
|
||||
|
||||
/*
|
||||
* This is the date and time when the full source package was created. The
|
||||
* timestamp is not stored in git, as the timestamp is properly set in the
|
||||
* tarballs by the maketgz script.
|
||||
*
|
||||
* The format of the date should follow this template:
|
||||
*
|
||||
* "Mon Feb 12 11:35:33 UTC 2007"
|
||||
*/
|
||||
#define LIBCURL_TIMESTAMP "Mon May 30 06:15:46 UTC 2016"
|
||||
|
||||
#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|z)
|
||||
#define CURL_AT_LEAST_VERSION(x,y,z) \
|
||||
(LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z))
|
||||
|
||||
#endif /* __CURL_CURLVER_H */
|
|
@ -1,102 +0,0 @@
|
|||
#ifndef __CURL_EASY_H
|
||||
#define __CURL_EASY_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2008, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
CURL_EXTERN CURL *curl_easy_init(void);
|
||||
CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);
|
||||
CURL_EXTERN CURLcode curl_easy_perform(CURL *curl);
|
||||
CURL_EXTERN void curl_easy_cleanup(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_getinfo()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Request internal information from the curl session with this function. The
|
||||
* third argument MUST be a pointer to a long, a pointer to a char * or a
|
||||
* pointer to a double (as the documentation describes elsewhere). The data
|
||||
* pointed to will be filled in accordingly and can be relied upon only if the
|
||||
* function returns CURLE_OK. This function is intended to get used *AFTER* a
|
||||
* performed transfer, all results from this function are undefined until the
|
||||
* transfer is completed.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
|
||||
|
||||
|
||||
/*
|
||||
* NAME curl_easy_duphandle()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Creates a new curl session handle with the same options set for the handle
|
||||
* passed in. Duplicating a handle could only be a matter of cloning data and
|
||||
* options, internal state info and things like persistent connections cannot
|
||||
* be transferred. It is useful in multithreaded applications when you can run
|
||||
* curl_easy_duphandle() for each new thread to avoid a series of identical
|
||||
* curl_easy_setopt() invokes in every thread.
|
||||
*/
|
||||
CURL_EXTERN CURL* curl_easy_duphandle(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_reset()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Re-initializes a CURL handle to the default values. This puts back the
|
||||
* handle to the same state as it was in when it was just created.
|
||||
*
|
||||
* It does keep: live connections, the Session ID cache, the DNS cache and the
|
||||
* cookies.
|
||||
*/
|
||||
CURL_EXTERN void curl_easy_reset(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_recv()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Receives data from the connected socket. Use after successful
|
||||
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen,
|
||||
size_t *n);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_send()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Sends data over the connected socket. Use after successful
|
||||
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
|
||||
*/
|
||||
CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,
|
||||
size_t buflen, size_t *n);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,50 +0,0 @@
|
|||
#ifndef __CURL_MPRINTF_H
|
||||
#define __CURL_MPRINTF_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h> /* needed for FILE */
|
||||
#include "curl.h" /* for CURL_EXTERN */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
CURL_EXTERN int curl_mprintf(const char *format, ...);
|
||||
CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...);
|
||||
CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...);
|
||||
CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength,
|
||||
const char *format, ...);
|
||||
CURL_EXTERN int curl_mvprintf(const char *format, va_list args);
|
||||
CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args);
|
||||
CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args);
|
||||
CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength,
|
||||
const char *format, va_list args);
|
||||
CURL_EXTERN char *curl_maprintf(const char *format, ...);
|
||||
CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __CURL_MPRINTF_H */
|
|
@ -1,435 +0,0 @@
|
|||
#ifndef __CURL_MULTI_H
|
||||
#define __CURL_MULTI_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
/*
|
||||
This is an "external" header file. Don't give away any internals here!
|
||||
|
||||
GOALS
|
||||
|
||||
o Enable a "pull" interface. The application that uses libcurl decides where
|
||||
and when to ask libcurl to get/send data.
|
||||
|
||||
o Enable multiple simultaneous transfers in the same thread without making it
|
||||
complicated for the application.
|
||||
|
||||
o Enable the application to select() on its own file descriptors and curl's
|
||||
file descriptors simultaneous easily.
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
* This header file should not really need to include "curl.h" since curl.h
|
||||
* itself includes this file and we expect user applications to do #include
|
||||
* <curl/curl.h> without the need for especially including multi.h.
|
||||
*
|
||||
* For some reason we added this include here at one point, and rather than to
|
||||
* break existing (wrongly written) libcurl applications, we leave it as-is
|
||||
* but with this warning attached.
|
||||
*/
|
||||
#include "curl.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void CURLM;
|
||||
|
||||
typedef enum {
|
||||
CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or
|
||||
curl_multi_socket*() soon */
|
||||
CURLM_OK,
|
||||
CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */
|
||||
CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */
|
||||
CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */
|
||||
CURLM_INTERNAL_ERROR, /* this is a libcurl bug */
|
||||
CURLM_BAD_SOCKET, /* the passed in socket argument did not match */
|
||||
CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */
|
||||
CURLM_ADDED_ALREADY, /* an easy handle already added to a multi handle was
|
||||
attempted to get added - again */
|
||||
CURLM_LAST
|
||||
} CURLMcode;
|
||||
|
||||
/* just to make code nicer when using curl_multi_socket() you can now check
|
||||
for CURLM_CALL_MULTI_SOCKET too in the same style it works for
|
||||
curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */
|
||||
#define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM
|
||||
|
||||
/* bitmask bits for CURLMOPT_PIPELINING */
|
||||
#define CURLPIPE_NOTHING 0L
|
||||
#define CURLPIPE_HTTP1 1L
|
||||
#define CURLPIPE_MULTIPLEX 2L
|
||||
|
||||
typedef enum {
|
||||
CURLMSG_NONE, /* first, not used */
|
||||
CURLMSG_DONE, /* This easy handle has completed. 'result' contains
|
||||
the CURLcode of the transfer */
|
||||
CURLMSG_LAST /* last, not used */
|
||||
} CURLMSG;
|
||||
|
||||
struct CURLMsg {
|
||||
CURLMSG msg; /* what this message means */
|
||||
CURL *easy_handle; /* the handle it concerns */
|
||||
union {
|
||||
void *whatever; /* message-specific data */
|
||||
CURLcode result; /* return code for transfer */
|
||||
} data;
|
||||
};
|
||||
typedef struct CURLMsg CURLMsg;
|
||||
|
||||
/* Based on poll(2) structure and values.
|
||||
* We don't use pollfd and POLL* constants explicitly
|
||||
* to cover platforms without poll(). */
|
||||
#define CURL_WAIT_POLLIN 0x0001
|
||||
#define CURL_WAIT_POLLPRI 0x0002
|
||||
#define CURL_WAIT_POLLOUT 0x0004
|
||||
|
||||
struct curl_waitfd {
|
||||
curl_socket_t fd;
|
||||
short events;
|
||||
short revents; /* not supported yet */
|
||||
};
|
||||
|
||||
/*
|
||||
* Name: curl_multi_init()
|
||||
*
|
||||
* Desc: inititalize multi-style curl usage
|
||||
*
|
||||
* Returns: a new CURLM handle to use in all 'curl_multi' functions.
|
||||
*/
|
||||
CURL_EXTERN CURLM *curl_multi_init(void);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_add_handle()
|
||||
*
|
||||
* Desc: add a standard curl handle to the multi stack
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle,
|
||||
CURL *curl_handle);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_remove_handle()
|
||||
*
|
||||
* Desc: removes a curl handle from the multi stack again
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
|
||||
CURL *curl_handle);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_fdset()
|
||||
*
|
||||
* Desc: Ask curl for its fd_set sets. The app can use these to select() or
|
||||
* poll() on. We want curl_multi_perform() called as soon as one of
|
||||
* them are ready.
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle,
|
||||
fd_set *read_fd_set,
|
||||
fd_set *write_fd_set,
|
||||
fd_set *exc_fd_set,
|
||||
int *max_fd);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_wait()
|
||||
*
|
||||
* Desc: Poll on all fds within a CURLM set as well as any
|
||||
* additional fds passed to the function.
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle,
|
||||
struct curl_waitfd extra_fds[],
|
||||
unsigned int extra_nfds,
|
||||
int timeout_ms,
|
||||
int *ret);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_perform()
|
||||
*
|
||||
* Desc: When the app thinks there's data available for curl it calls this
|
||||
* function to read/write whatever there is right now. This returns
|
||||
* as soon as the reads and writes are done. This function does not
|
||||
* require that there actually is data available for reading or that
|
||||
* data can be written, it can be called just in case. It returns
|
||||
* the number of handles that still transfer data in the second
|
||||
* argument's integer-pointer.
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code. *NOTE* that this only
|
||||
* returns errors etc regarding the whole multi stack. There might
|
||||
* still have occurred problems on invidual transfers even when this
|
||||
* returns OK.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle,
|
||||
int *running_handles);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_cleanup()
|
||||
*
|
||||
* Desc: Cleans up and removes a whole multi stack. It does not free or
|
||||
* touch any individual easy handles in any way. We need to define
|
||||
* in what state those handles will be if this function is called
|
||||
* in the middle of a transfer.
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_info_read()
|
||||
*
|
||||
* Desc: Ask the multi handle if there's any messages/informationals from
|
||||
* the individual transfers. Messages include informationals such as
|
||||
* error code from the transfer or just the fact that a transfer is
|
||||
* completed. More details on these should be written down as well.
|
||||
*
|
||||
* Repeated calls to this function will return a new struct each
|
||||
* time, until a special "end of msgs" struct is returned as a signal
|
||||
* that there is no more to get at this point.
|
||||
*
|
||||
* The data the returned pointer points to will not survive calling
|
||||
* curl_multi_cleanup().
|
||||
*
|
||||
* The 'CURLMsg' struct is meant to be very simple and only contain
|
||||
* very basic informations. If more involved information is wanted,
|
||||
* we will provide the particular "transfer handle" in that struct
|
||||
* and that should/could/would be used in subsequent
|
||||
* curl_easy_getinfo() calls (or similar). The point being that we
|
||||
* must never expose complex structs to applications, as then we'll
|
||||
* undoubtably get backwards compatibility problems in the future.
|
||||
*
|
||||
* Returns: A pointer to a filled-in struct, or NULL if it failed or ran out
|
||||
* of structs. It also writes the number of messages left in the
|
||||
* queue (after this read) in the integer the second argument points
|
||||
* to.
|
||||
*/
|
||||
CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle,
|
||||
int *msgs_in_queue);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_strerror()
|
||||
*
|
||||
* Desc: The curl_multi_strerror function may be used to turn a CURLMcode
|
||||
* value into the equivalent human readable error string. This is
|
||||
* useful for printing meaningful error messages.
|
||||
*
|
||||
* Returns: A pointer to a zero-terminated error message.
|
||||
*/
|
||||
CURL_EXTERN const char *curl_multi_strerror(CURLMcode);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_socket() and
|
||||
* curl_multi_socket_all()
|
||||
*
|
||||
* Desc: An alternative version of curl_multi_perform() that allows the
|
||||
* application to pass in one of the file descriptors that have been
|
||||
* detected to have "action" on them and let libcurl perform.
|
||||
* See man page for details.
|
||||
*/
|
||||
#define CURL_POLL_NONE 0
|
||||
#define CURL_POLL_IN 1
|
||||
#define CURL_POLL_OUT 2
|
||||
#define CURL_POLL_INOUT 3
|
||||
#define CURL_POLL_REMOVE 4
|
||||
|
||||
#define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD
|
||||
|
||||
#define CURL_CSELECT_IN 0x01
|
||||
#define CURL_CSELECT_OUT 0x02
|
||||
#define CURL_CSELECT_ERR 0x04
|
||||
|
||||
typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */
|
||||
curl_socket_t s, /* socket */
|
||||
int what, /* see above */
|
||||
void *userp, /* private callback
|
||||
pointer */
|
||||
void *socketp); /* private socket
|
||||
pointer */
|
||||
/*
|
||||
* Name: curl_multi_timer_callback
|
||||
*
|
||||
* Desc: Called by libcurl whenever the library detects a change in the
|
||||
* maximum number of milliseconds the app is allowed to wait before
|
||||
* curl_multi_socket() or curl_multi_perform() must be called
|
||||
* (to allow libcurl's timed events to take place).
|
||||
*
|
||||
* Returns: The callback should return zero.
|
||||
*/
|
||||
typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */
|
||||
long timeout_ms, /* see above */
|
||||
void *userp); /* private callback
|
||||
pointer */
|
||||
|
||||
CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s,
|
||||
int *running_handles);
|
||||
|
||||
CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle,
|
||||
curl_socket_t s,
|
||||
int ev_bitmask,
|
||||
int *running_handles);
|
||||
|
||||
CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle,
|
||||
int *running_handles);
|
||||
|
||||
#ifndef CURL_ALLOW_OLD_MULTI_SOCKET
|
||||
/* This macro below was added in 7.16.3 to push users who recompile to use
|
||||
the new curl_multi_socket_action() instead of the old curl_multi_socket()
|
||||
*/
|
||||
#define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Name: curl_multi_timeout()
|
||||
*
|
||||
* Desc: Returns the maximum number of milliseconds the app is allowed to
|
||||
* wait before curl_multi_socket() or curl_multi_perform() must be
|
||||
* called (to allow libcurl's timed events to take place).
|
||||
*
|
||||
* Returns: CURLM error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle,
|
||||
long *milliseconds);
|
||||
|
||||
#undef CINIT /* re-using the same name as in curl.h */
|
||||
|
||||
#ifdef CURL_ISOCPP
|
||||
#define CINIT(name,type,num) CURLMOPT_ ## name = CURLOPTTYPE_ ## type + num
|
||||
#else
|
||||
/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
|
||||
#define LONG CURLOPTTYPE_LONG
|
||||
#define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT
|
||||
#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT
|
||||
#define OFF_T CURLOPTTYPE_OFF_T
|
||||
#define CINIT(name,type,number) CURLMOPT_/**/name = type + number
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
/* This is the socket callback function pointer */
|
||||
CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1),
|
||||
|
||||
/* This is the argument passed to the socket callback */
|
||||
CINIT(SOCKETDATA, OBJECTPOINT, 2),
|
||||
|
||||
/* set to 1 to enable pipelining for this multi handle */
|
||||
CINIT(PIPELINING, LONG, 3),
|
||||
|
||||
/* This is the timer callback function pointer */
|
||||
CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4),
|
||||
|
||||
/* This is the argument passed to the timer callback */
|
||||
CINIT(TIMERDATA, OBJECTPOINT, 5),
|
||||
|
||||
/* maximum number of entries in the connection cache */
|
||||
CINIT(MAXCONNECTS, LONG, 6),
|
||||
|
||||
/* maximum number of (pipelining) connections to one host */
|
||||
CINIT(MAX_HOST_CONNECTIONS, LONG, 7),
|
||||
|
||||
/* maximum number of requests in a pipeline */
|
||||
CINIT(MAX_PIPELINE_LENGTH, LONG, 8),
|
||||
|
||||
/* a connection with a content-length longer than this
|
||||
will not be considered for pipelining */
|
||||
CINIT(CONTENT_LENGTH_PENALTY_SIZE, OFF_T, 9),
|
||||
|
||||
/* a connection with a chunk length longer than this
|
||||
will not be considered for pipelining */
|
||||
CINIT(CHUNK_LENGTH_PENALTY_SIZE, OFF_T, 10),
|
||||
|
||||
/* a list of site names(+port) that are blacklisted from
|
||||
pipelining */
|
||||
CINIT(PIPELINING_SITE_BL, OBJECTPOINT, 11),
|
||||
|
||||
/* a list of server types that are blacklisted from
|
||||
pipelining */
|
||||
CINIT(PIPELINING_SERVER_BL, OBJECTPOINT, 12),
|
||||
|
||||
/* maximum number of open connections in total */
|
||||
CINIT(MAX_TOTAL_CONNECTIONS, LONG, 13),
|
||||
|
||||
/* This is the server push callback function pointer */
|
||||
CINIT(PUSHFUNCTION, FUNCTIONPOINT, 14),
|
||||
|
||||
/* This is the argument passed to the server push callback */
|
||||
CINIT(PUSHDATA, OBJECTPOINT, 15),
|
||||
|
||||
CURLMOPT_LASTENTRY /* the last unused */
|
||||
} CURLMoption;
|
||||
|
||||
|
||||
/*
|
||||
* Name: curl_multi_setopt()
|
||||
*
|
||||
* Desc: Sets options for the multi handle.
|
||||
*
|
||||
* Returns: CURLM error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle,
|
||||
CURLMoption option, ...);
|
||||
|
||||
|
||||
/*
|
||||
* Name: curl_multi_assign()
|
||||
*
|
||||
* Desc: This function sets an association in the multi handle between the
|
||||
* given socket and a private pointer of the application. This is
|
||||
* (only) useful for curl_multi_socket uses.
|
||||
*
|
||||
* Returns: CURLM error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle,
|
||||
curl_socket_t sockfd, void *sockp);
|
||||
|
||||
|
||||
/*
|
||||
* Name: curl_push_callback
|
||||
*
|
||||
* Desc: This callback gets called when a new stream is being pushed by the
|
||||
* server. It approves or denies the new stream.
|
||||
*
|
||||
* Returns: CURL_PUSH_OK or CURL_PUSH_DENY.
|
||||
*/
|
||||
#define CURL_PUSH_OK 0
|
||||
#define CURL_PUSH_DENY 1
|
||||
|
||||
struct curl_pushheaders; /* forward declaration only */
|
||||
|
||||
CURL_EXTERN char *curl_pushheader_bynum(struct curl_pushheaders *h,
|
||||
size_t num);
|
||||
CURL_EXTERN char *curl_pushheader_byname(struct curl_pushheaders *h,
|
||||
const char *name);
|
||||
|
||||
typedef int (*curl_push_callback)(CURL *parent,
|
||||
CURL *easy,
|
||||
size_t num_headers,
|
||||
struct curl_pushheaders *headers,
|
||||
void *userp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end of extern "C" */
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,33 +0,0 @@
|
|||
#ifndef __STDC_HEADERS_H
|
||||
#define __STDC_HEADERS_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2010, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
size_t fread (void *, size_t, size_t, FILE *);
|
||||
size_t fwrite (const void *, size_t, size_t, FILE *);
|
||||
|
||||
int strcasecmp(const char *, const char *);
|
||||
int strncasecmp(const char *, const char *, size_t);
|
||||
|
||||
#endif /* __STDC_HEADERS_H */
|
|
@ -1,622 +0,0 @@
|
|||
#ifndef __CURL_TYPECHECK_GCC_H
|
||||
#define __CURL_TYPECHECK_GCC_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* wraps curl_easy_setopt() with typechecking */
|
||||
|
||||
/* To add a new kind of warning, add an
|
||||
* if(_curl_is_sometype_option(_curl_opt))
|
||||
* if(!_curl_is_sometype(value))
|
||||
* _curl_easy_setopt_err_sometype();
|
||||
* block and define _curl_is_sometype_option, _curl_is_sometype and
|
||||
* _curl_easy_setopt_err_sometype below
|
||||
*
|
||||
* NOTE: We use two nested 'if' statements here instead of the && operator, in
|
||||
* order to work around gcc bug #32061. It affects only gcc 4.3.x/4.4.x
|
||||
* when compiling with -Wlogical-op.
|
||||
*
|
||||
* To add an option that uses the same type as an existing option, you'll just
|
||||
* need to extend the appropriate _curl_*_option macro
|
||||
*/
|
||||
#define curl_easy_setopt(handle, option, value) \
|
||||
__extension__ ({ \
|
||||
__typeof__ (option) _curl_opt = option; \
|
||||
if(__builtin_constant_p(_curl_opt)) { \
|
||||
if(_curl_is_long_option(_curl_opt)) \
|
||||
if(!_curl_is_long(value)) \
|
||||
_curl_easy_setopt_err_long(); \
|
||||
if(_curl_is_off_t_option(_curl_opt)) \
|
||||
if(!_curl_is_off_t(value)) \
|
||||
_curl_easy_setopt_err_curl_off_t(); \
|
||||
if(_curl_is_string_option(_curl_opt)) \
|
||||
if(!_curl_is_string(value)) \
|
||||
_curl_easy_setopt_err_string(); \
|
||||
if(_curl_is_write_cb_option(_curl_opt)) \
|
||||
if(!_curl_is_write_cb(value)) \
|
||||
_curl_easy_setopt_err_write_callback(); \
|
||||
if((_curl_opt) == CURLOPT_READFUNCTION) \
|
||||
if(!_curl_is_read_cb(value)) \
|
||||
_curl_easy_setopt_err_read_cb(); \
|
||||
if((_curl_opt) == CURLOPT_IOCTLFUNCTION) \
|
||||
if(!_curl_is_ioctl_cb(value)) \
|
||||
_curl_easy_setopt_err_ioctl_cb(); \
|
||||
if((_curl_opt) == CURLOPT_SOCKOPTFUNCTION) \
|
||||
if(!_curl_is_sockopt_cb(value)) \
|
||||
_curl_easy_setopt_err_sockopt_cb(); \
|
||||
if((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION) \
|
||||
if(!_curl_is_opensocket_cb(value)) \
|
||||
_curl_easy_setopt_err_opensocket_cb(); \
|
||||
if((_curl_opt) == CURLOPT_PROGRESSFUNCTION) \
|
||||
if(!_curl_is_progress_cb(value)) \
|
||||
_curl_easy_setopt_err_progress_cb(); \
|
||||
if((_curl_opt) == CURLOPT_DEBUGFUNCTION) \
|
||||
if(!_curl_is_debug_cb(value)) \
|
||||
_curl_easy_setopt_err_debug_cb(); \
|
||||
if((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION) \
|
||||
if(!_curl_is_ssl_ctx_cb(value)) \
|
||||
_curl_easy_setopt_err_ssl_ctx_cb(); \
|
||||
if(_curl_is_conv_cb_option(_curl_opt)) \
|
||||
if(!_curl_is_conv_cb(value)) \
|
||||
_curl_easy_setopt_err_conv_cb(); \
|
||||
if((_curl_opt) == CURLOPT_SEEKFUNCTION) \
|
||||
if(!_curl_is_seek_cb(value)) \
|
||||
_curl_easy_setopt_err_seek_cb(); \
|
||||
if(_curl_is_cb_data_option(_curl_opt)) \
|
||||
if(!_curl_is_cb_data(value)) \
|
||||
_curl_easy_setopt_err_cb_data(); \
|
||||
if((_curl_opt) == CURLOPT_ERRORBUFFER) \
|
||||
if(!_curl_is_error_buffer(value)) \
|
||||
_curl_easy_setopt_err_error_buffer(); \
|
||||
if((_curl_opt) == CURLOPT_STDERR) \
|
||||
if(!_curl_is_FILE(value)) \
|
||||
_curl_easy_setopt_err_FILE(); \
|
||||
if(_curl_is_postfields_option(_curl_opt)) \
|
||||
if(!_curl_is_postfields(value)) \
|
||||
_curl_easy_setopt_err_postfields(); \
|
||||
if((_curl_opt) == CURLOPT_HTTPPOST) \
|
||||
if(!_curl_is_arr((value), struct curl_httppost)) \
|
||||
_curl_easy_setopt_err_curl_httpost(); \
|
||||
if(_curl_is_slist_option(_curl_opt)) \
|
||||
if(!_curl_is_arr((value), struct curl_slist)) \
|
||||
_curl_easy_setopt_err_curl_slist(); \
|
||||
if((_curl_opt) == CURLOPT_SHARE) \
|
||||
if(!_curl_is_ptr((value), CURLSH)) \
|
||||
_curl_easy_setopt_err_CURLSH(); \
|
||||
} \
|
||||
curl_easy_setopt(handle, _curl_opt, value); \
|
||||
})
|
||||
|
||||
/* wraps curl_easy_getinfo() with typechecking */
|
||||
/* FIXME: don't allow const pointers */
|
||||
#define curl_easy_getinfo(handle, info, arg) \
|
||||
__extension__ ({ \
|
||||
__typeof__ (info) _curl_info = info; \
|
||||
if(__builtin_constant_p(_curl_info)) { \
|
||||
if(_curl_is_string_info(_curl_info)) \
|
||||
if(!_curl_is_arr((arg), char *)) \
|
||||
_curl_easy_getinfo_err_string(); \
|
||||
if(_curl_is_long_info(_curl_info)) \
|
||||
if(!_curl_is_arr((arg), long)) \
|
||||
_curl_easy_getinfo_err_long(); \
|
||||
if(_curl_is_double_info(_curl_info)) \
|
||||
if(!_curl_is_arr((arg), double)) \
|
||||
_curl_easy_getinfo_err_double(); \
|
||||
if(_curl_is_slist_info(_curl_info)) \
|
||||
if(!_curl_is_arr((arg), struct curl_slist *)) \
|
||||
_curl_easy_getinfo_err_curl_slist(); \
|
||||
} \
|
||||
curl_easy_getinfo(handle, _curl_info, arg); \
|
||||
})
|
||||
|
||||
/* TODO: typechecking for curl_share_setopt() and curl_multi_setopt(),
|
||||
* for now just make sure that the functions are called with three
|
||||
* arguments
|
||||
*/
|
||||
#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)
|
||||
#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)
|
||||
|
||||
|
||||
/* the actual warnings, triggered by calling the _curl_easy_setopt_err*
|
||||
* functions */
|
||||
|
||||
/* To define a new warning, use _CURL_WARNING(identifier, "message") */
|
||||
#define _CURL_WARNING(id, message) \
|
||||
static void __attribute__((__warning__(message))) \
|
||||
__attribute__((__unused__)) __attribute__((__noinline__)) \
|
||||
id(void) { __asm__(""); }
|
||||
|
||||
_CURL_WARNING(_curl_easy_setopt_err_long,
|
||||
"curl_easy_setopt expects a long argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_curl_off_t,
|
||||
"curl_easy_setopt expects a curl_off_t argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_string,
|
||||
"curl_easy_setopt expects a "
|
||||
"string (char* or char[]) argument for this option"
|
||||
)
|
||||
_CURL_WARNING(_curl_easy_setopt_err_write_callback,
|
||||
"curl_easy_setopt expects a curl_write_callback argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_read_cb,
|
||||
"curl_easy_setopt expects a curl_read_callback argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_ioctl_cb,
|
||||
"curl_easy_setopt expects a curl_ioctl_callback argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_sockopt_cb,
|
||||
"curl_easy_setopt expects a curl_sockopt_callback argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_opensocket_cb,
|
||||
"curl_easy_setopt expects a "
|
||||
"curl_opensocket_callback argument for this option"
|
||||
)
|
||||
_CURL_WARNING(_curl_easy_setopt_err_progress_cb,
|
||||
"curl_easy_setopt expects a curl_progress_callback argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_debug_cb,
|
||||
"curl_easy_setopt expects a curl_debug_callback argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_ssl_ctx_cb,
|
||||
"curl_easy_setopt expects a curl_ssl_ctx_callback argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_conv_cb,
|
||||
"curl_easy_setopt expects a curl_conv_callback argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_seek_cb,
|
||||
"curl_easy_setopt expects a curl_seek_callback argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_cb_data,
|
||||
"curl_easy_setopt expects a "
|
||||
"private data pointer as argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_error_buffer,
|
||||
"curl_easy_setopt expects a "
|
||||
"char buffer of CURL_ERROR_SIZE as argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_FILE,
|
||||
"curl_easy_setopt expects a FILE* argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_postfields,
|
||||
"curl_easy_setopt expects a void* or char* argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_curl_httpost,
|
||||
"curl_easy_setopt expects a struct curl_httppost* argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_curl_slist,
|
||||
"curl_easy_setopt expects a struct curl_slist* argument for this option")
|
||||
_CURL_WARNING(_curl_easy_setopt_err_CURLSH,
|
||||
"curl_easy_setopt expects a CURLSH* argument for this option")
|
||||
|
||||
_CURL_WARNING(_curl_easy_getinfo_err_string,
|
||||
"curl_easy_getinfo expects a pointer to char * for this info")
|
||||
_CURL_WARNING(_curl_easy_getinfo_err_long,
|
||||
"curl_easy_getinfo expects a pointer to long for this info")
|
||||
_CURL_WARNING(_curl_easy_getinfo_err_double,
|
||||
"curl_easy_getinfo expects a pointer to double for this info")
|
||||
_CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
|
||||
"curl_easy_getinfo expects a pointer to struct curl_slist * for this info")
|
||||
|
||||
/* groups of curl_easy_setops options that take the same type of argument */
|
||||
|
||||
/* To add a new option to one of the groups, just add
|
||||
* (option) == CURLOPT_SOMETHING
|
||||
* to the or-expression. If the option takes a long or curl_off_t, you don't
|
||||
* have to do anything
|
||||
*/
|
||||
|
||||
/* evaluates to true if option takes a long argument */
|
||||
#define _curl_is_long_option(option) \
|
||||
(0 < (option) && (option) < CURLOPTTYPE_OBJECTPOINT)
|
||||
|
||||
#define _curl_is_off_t_option(option) \
|
||||
((option) > CURLOPTTYPE_OFF_T)
|
||||
|
||||
/* evaluates to true if option takes a char* argument */
|
||||
#define _curl_is_string_option(option) \
|
||||
((option) == CURLOPT_ACCEPT_ENCODING || \
|
||||
(option) == CURLOPT_CAINFO || \
|
||||
(option) == CURLOPT_CAPATH || \
|
||||
(option) == CURLOPT_COOKIE || \
|
||||
(option) == CURLOPT_COOKIEFILE || \
|
||||
(option) == CURLOPT_COOKIEJAR || \
|
||||
(option) == CURLOPT_COOKIELIST || \
|
||||
(option) == CURLOPT_CRLFILE || \
|
||||
(option) == CURLOPT_CUSTOMREQUEST || \
|
||||
(option) == CURLOPT_DEFAULT_PROTOCOL || \
|
||||
(option) == CURLOPT_DNS_INTERFACE || \
|
||||
(option) == CURLOPT_DNS_LOCAL_IP4 || \
|
||||
(option) == CURLOPT_DNS_LOCAL_IP6 || \
|
||||
(option) == CURLOPT_DNS_SERVERS || \
|
||||
(option) == CURLOPT_EGDSOCKET || \
|
||||
(option) == CURLOPT_FTPPORT || \
|
||||
(option) == CURLOPT_FTP_ACCOUNT || \
|
||||
(option) == CURLOPT_FTP_ALTERNATIVE_TO_USER || \
|
||||
(option) == CURLOPT_INTERFACE || \
|
||||
(option) == CURLOPT_ISSUERCERT || \
|
||||
(option) == CURLOPT_KEYPASSWD || \
|
||||
(option) == CURLOPT_KRBLEVEL || \
|
||||
(option) == CURLOPT_LOGIN_OPTIONS || \
|
||||
(option) == CURLOPT_MAIL_AUTH || \
|
||||
(option) == CURLOPT_MAIL_FROM || \
|
||||
(option) == CURLOPT_NETRC_FILE || \
|
||||
(option) == CURLOPT_NOPROXY || \
|
||||
(option) == CURLOPT_PASSWORD || \
|
||||
(option) == CURLOPT_PINNEDPUBLICKEY || \
|
||||
(option) == CURLOPT_PROXY || \
|
||||
(option) == CURLOPT_PROXYPASSWORD || \
|
||||
(option) == CURLOPT_PROXYUSERNAME || \
|
||||
(option) == CURLOPT_PROXYUSERPWD || \
|
||||
(option) == CURLOPT_PROXY_SERVICE_NAME || \
|
||||
(option) == CURLOPT_RANDOM_FILE || \
|
||||
(option) == CURLOPT_RANGE || \
|
||||
(option) == CURLOPT_REFERER || \
|
||||
(option) == CURLOPT_RTSP_SESSION_ID || \
|
||||
(option) == CURLOPT_RTSP_STREAM_URI || \
|
||||
(option) == CURLOPT_RTSP_TRANSPORT || \
|
||||
(option) == CURLOPT_SERVICE_NAME || \
|
||||
(option) == CURLOPT_SOCKS5_GSSAPI_SERVICE || \
|
||||
(option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 || \
|
||||
(option) == CURLOPT_SSH_KNOWNHOSTS || \
|
||||
(option) == CURLOPT_SSH_PRIVATE_KEYFILE || \
|
||||
(option) == CURLOPT_SSH_PUBLIC_KEYFILE || \
|
||||
(option) == CURLOPT_SSLCERT || \
|
||||
(option) == CURLOPT_SSLCERTTYPE || \
|
||||
(option) == CURLOPT_SSLENGINE || \
|
||||
(option) == CURLOPT_SSLKEY || \
|
||||
(option) == CURLOPT_SSLKEYTYPE || \
|
||||
(option) == CURLOPT_SSL_CIPHER_LIST || \
|
||||
(option) == CURLOPT_TLSAUTH_PASSWORD || \
|
||||
(option) == CURLOPT_TLSAUTH_TYPE || \
|
||||
(option) == CURLOPT_TLSAUTH_USERNAME || \
|
||||
(option) == CURLOPT_UNIX_SOCKET_PATH || \
|
||||
(option) == CURLOPT_URL || \
|
||||
(option) == CURLOPT_USERAGENT || \
|
||||
(option) == CURLOPT_USERNAME || \
|
||||
(option) == CURLOPT_USERPWD || \
|
||||
(option) == CURLOPT_XOAUTH2_BEARER || \
|
||||
0)
|
||||
|
||||
/* evaluates to true if option takes a curl_write_callback argument */
|
||||
#define _curl_is_write_cb_option(option) \
|
||||
((option) == CURLOPT_HEADERFUNCTION || \
|
||||
(option) == CURLOPT_WRITEFUNCTION)
|
||||
|
||||
/* evaluates to true if option takes a curl_conv_callback argument */
|
||||
#define _curl_is_conv_cb_option(option) \
|
||||
((option) == CURLOPT_CONV_TO_NETWORK_FUNCTION || \
|
||||
(option) == CURLOPT_CONV_FROM_NETWORK_FUNCTION || \
|
||||
(option) == CURLOPT_CONV_FROM_UTF8_FUNCTION)
|
||||
|
||||
/* evaluates to true if option takes a data argument to pass to a callback */
|
||||
#define _curl_is_cb_data_option(option) \
|
||||
((option) == CURLOPT_CHUNK_DATA || \
|
||||
(option) == CURLOPT_CLOSESOCKETDATA || \
|
||||
(option) == CURLOPT_DEBUGDATA || \
|
||||
(option) == CURLOPT_FNMATCH_DATA || \
|
||||
(option) == CURLOPT_HEADERDATA || \
|
||||
(option) == CURLOPT_INTERLEAVEDATA || \
|
||||
(option) == CURLOPT_IOCTLDATA || \
|
||||
(option) == CURLOPT_OPENSOCKETDATA || \
|
||||
(option) == CURLOPT_PRIVATE || \
|
||||
(option) == CURLOPT_PROGRESSDATA || \
|
||||
(option) == CURLOPT_READDATA || \
|
||||
(option) == CURLOPT_SEEKDATA || \
|
||||
(option) == CURLOPT_SOCKOPTDATA || \
|
||||
(option) == CURLOPT_SSH_KEYDATA || \
|
||||
(option) == CURLOPT_SSL_CTX_DATA || \
|
||||
(option) == CURLOPT_WRITEDATA || \
|
||||
0)
|
||||
|
||||
/* evaluates to true if option takes a POST data argument (void* or char*) */
|
||||
#define _curl_is_postfields_option(option) \
|
||||
((option) == CURLOPT_POSTFIELDS || \
|
||||
(option) == CURLOPT_COPYPOSTFIELDS || \
|
||||
0)
|
||||
|
||||
/* evaluates to true if option takes a struct curl_slist * argument */
|
||||
#define _curl_is_slist_option(option) \
|
||||
((option) == CURLOPT_HTTP200ALIASES || \
|
||||
(option) == CURLOPT_HTTPHEADER || \
|
||||
(option) == CURLOPT_MAIL_RCPT || \
|
||||
(option) == CURLOPT_POSTQUOTE || \
|
||||
(option) == CURLOPT_PREQUOTE || \
|
||||
(option) == CURLOPT_PROXYHEADER || \
|
||||
(option) == CURLOPT_QUOTE || \
|
||||
(option) == CURLOPT_RESOLVE || \
|
||||
(option) == CURLOPT_TELNETOPTIONS || \
|
||||
0)
|
||||
|
||||
/* groups of curl_easy_getinfo infos that take the same type of argument */
|
||||
|
||||
/* evaluates to true if info expects a pointer to char * argument */
|
||||
#define _curl_is_string_info(info) \
|
||||
(CURLINFO_STRING < (info) && (info) < CURLINFO_LONG)
|
||||
|
||||
/* evaluates to true if info expects a pointer to long argument */
|
||||
#define _curl_is_long_info(info) \
|
||||
(CURLINFO_LONG < (info) && (info) < CURLINFO_DOUBLE)
|
||||
|
||||
/* evaluates to true if info expects a pointer to double argument */
|
||||
#define _curl_is_double_info(info) \
|
||||
(CURLINFO_DOUBLE < (info) && (info) < CURLINFO_SLIST)
|
||||
|
||||
/* true if info expects a pointer to struct curl_slist * argument */
|
||||
#define _curl_is_slist_info(info) \
|
||||
(CURLINFO_SLIST < (info))
|
||||
|
||||
|
||||
/* typecheck helpers -- check whether given expression has requested type*/
|
||||
|
||||
/* For pointers, you can use the _curl_is_ptr/_curl_is_arr macros,
|
||||
* otherwise define a new macro. Search for __builtin_types_compatible_p
|
||||
* in the GCC manual.
|
||||
* NOTE: these macros MUST NOT EVALUATE their arguments! The argument is
|
||||
* the actual expression passed to the curl_easy_setopt macro. This
|
||||
* means that you can only apply the sizeof and __typeof__ operators, no
|
||||
* == or whatsoever.
|
||||
*/
|
||||
|
||||
/* XXX: should evaluate to true iff expr is a pointer */
|
||||
#define _curl_is_any_ptr(expr) \
|
||||
(sizeof(expr) == sizeof(void*))
|
||||
|
||||
/* evaluates to true if expr is NULL */
|
||||
/* XXX: must not evaluate expr, so this check is not accurate */
|
||||
#define _curl_is_NULL(expr) \
|
||||
(__builtin_types_compatible_p(__typeof__(expr), __typeof__(NULL)))
|
||||
|
||||
/* evaluates to true if expr is type*, const type* or NULL */
|
||||
#define _curl_is_ptr(expr, type) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), type *) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), const type *))
|
||||
|
||||
/* evaluates to true if expr is one of type[], type*, NULL or const type* */
|
||||
#define _curl_is_arr(expr, type) \
|
||||
(_curl_is_ptr((expr), type) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), type []))
|
||||
|
||||
/* evaluates to true if expr is a string */
|
||||
#define _curl_is_string(expr) \
|
||||
(_curl_is_arr((expr), char) || \
|
||||
_curl_is_arr((expr), signed char) || \
|
||||
_curl_is_arr((expr), unsigned char))
|
||||
|
||||
/* evaluates to true if expr is a long (no matter the signedness)
|
||||
* XXX: for now, int is also accepted (and therefore short and char, which
|
||||
* are promoted to int when passed to a variadic function) */
|
||||
#define _curl_is_long(expr) \
|
||||
(__builtin_types_compatible_p(__typeof__(expr), long) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), signed long) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), unsigned long) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), int) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), signed int) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), unsigned int) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), short) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), signed short) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), unsigned short) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), char) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), signed char) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), unsigned char))
|
||||
|
||||
/* evaluates to true if expr is of type curl_off_t */
|
||||
#define _curl_is_off_t(expr) \
|
||||
(__builtin_types_compatible_p(__typeof__(expr), curl_off_t))
|
||||
|
||||
/* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */
|
||||
/* XXX: also check size of an char[] array? */
|
||||
#define _curl_is_error_buffer(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), char *) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), char[]))
|
||||
|
||||
/* evaluates to true if expr is of type (const) void* or (const) FILE* */
|
||||
#if 0
|
||||
#define _curl_is_cb_data(expr) \
|
||||
(_curl_is_ptr((expr), void) || \
|
||||
_curl_is_ptr((expr), FILE))
|
||||
#else /* be less strict */
|
||||
#define _curl_is_cb_data(expr) \
|
||||
_curl_is_any_ptr(expr)
|
||||
#endif
|
||||
|
||||
/* evaluates to true if expr is of type FILE* */
|
||||
#define _curl_is_FILE(expr) \
|
||||
(__builtin_types_compatible_p(__typeof__(expr), FILE *))
|
||||
|
||||
/* evaluates to true if expr can be passed as POST data (void* or char*) */
|
||||
#define _curl_is_postfields(expr) \
|
||||
(_curl_is_ptr((expr), void) || \
|
||||
_curl_is_arr((expr), char))
|
||||
|
||||
/* FIXME: the whole callback checking is messy...
|
||||
* The idea is to tolerate char vs. void and const vs. not const
|
||||
* pointers in arguments at least
|
||||
*/
|
||||
/* helper: __builtin_types_compatible_p distinguishes between functions and
|
||||
* function pointers, hide it */
|
||||
#define _curl_callback_compatible(func, type) \
|
||||
(__builtin_types_compatible_p(__typeof__(func), type) || \
|
||||
__builtin_types_compatible_p(__typeof__(func), type*))
|
||||
|
||||
/* evaluates to true if expr is of type curl_read_callback or "similar" */
|
||||
#define _curl_is_read_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), __typeof__(fread)) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_read_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback4) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback5) || \
|
||||
_curl_callback_compatible((expr), _curl_read_callback6))
|
||||
typedef size_t (_curl_read_callback1)(char *, size_t, size_t, void*);
|
||||
typedef size_t (_curl_read_callback2)(char *, size_t, size_t, const void*);
|
||||
typedef size_t (_curl_read_callback3)(char *, size_t, size_t, FILE*);
|
||||
typedef size_t (_curl_read_callback4)(void *, size_t, size_t, void*);
|
||||
typedef size_t (_curl_read_callback5)(void *, size_t, size_t, const void*);
|
||||
typedef size_t (_curl_read_callback6)(void *, size_t, size_t, FILE*);
|
||||
|
||||
/* evaluates to true if expr is of type curl_write_callback or "similar" */
|
||||
#define _curl_is_write_cb(expr) \
|
||||
(_curl_is_read_cb(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), __typeof__(fwrite)) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_write_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback4) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback5) || \
|
||||
_curl_callback_compatible((expr), _curl_write_callback6))
|
||||
typedef size_t (_curl_write_callback1)(const char *, size_t, size_t, void*);
|
||||
typedef size_t (_curl_write_callback2)(const char *, size_t, size_t,
|
||||
const void*);
|
||||
typedef size_t (_curl_write_callback3)(const char *, size_t, size_t, FILE*);
|
||||
typedef size_t (_curl_write_callback4)(const void *, size_t, size_t, void*);
|
||||
typedef size_t (_curl_write_callback5)(const void *, size_t, size_t,
|
||||
const void*);
|
||||
typedef size_t (_curl_write_callback6)(const void *, size_t, size_t, FILE*);
|
||||
|
||||
/* evaluates to true if expr is of type curl_ioctl_callback or "similar" */
|
||||
#define _curl_is_ioctl_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_ioctl_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_ioctl_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_ioctl_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_ioctl_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_ioctl_callback4))
|
||||
typedef curlioerr (_curl_ioctl_callback1)(CURL *, int, void*);
|
||||
typedef curlioerr (_curl_ioctl_callback2)(CURL *, int, const void*);
|
||||
typedef curlioerr (_curl_ioctl_callback3)(CURL *, curliocmd, void*);
|
||||
typedef curlioerr (_curl_ioctl_callback4)(CURL *, curliocmd, const void*);
|
||||
|
||||
/* evaluates to true if expr is of type curl_sockopt_callback or "similar" */
|
||||
#define _curl_is_sockopt_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_sockopt_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_sockopt_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_sockopt_callback2))
|
||||
typedef int (_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype);
|
||||
typedef int (_curl_sockopt_callback2)(const void *, curl_socket_t,
|
||||
curlsocktype);
|
||||
|
||||
/* evaluates to true if expr is of type curl_opensocket_callback or
|
||||
"similar" */
|
||||
#define _curl_is_opensocket_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_opensocket_callback) ||\
|
||||
_curl_callback_compatible((expr), _curl_opensocket_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_opensocket_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_opensocket_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_opensocket_callback4))
|
||||
typedef curl_socket_t (_curl_opensocket_callback1)
|
||||
(void *, curlsocktype, struct curl_sockaddr *);
|
||||
typedef curl_socket_t (_curl_opensocket_callback2)
|
||||
(void *, curlsocktype, const struct curl_sockaddr *);
|
||||
typedef curl_socket_t (_curl_opensocket_callback3)
|
||||
(const void *, curlsocktype, struct curl_sockaddr *);
|
||||
typedef curl_socket_t (_curl_opensocket_callback4)
|
||||
(const void *, curlsocktype, const struct curl_sockaddr *);
|
||||
|
||||
/* evaluates to true if expr is of type curl_progress_callback or "similar" */
|
||||
#define _curl_is_progress_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_progress_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_progress_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_progress_callback2))
|
||||
typedef int (_curl_progress_callback1)(void *,
|
||||
double, double, double, double);
|
||||
typedef int (_curl_progress_callback2)(const void *,
|
||||
double, double, double, double);
|
||||
|
||||
/* evaluates to true if expr is of type curl_debug_callback or "similar" */
|
||||
#define _curl_is_debug_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_debug_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback4) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback5) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback6) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback7) || \
|
||||
_curl_callback_compatible((expr), _curl_debug_callback8))
|
||||
typedef int (_curl_debug_callback1) (CURL *,
|
||||
curl_infotype, char *, size_t, void *);
|
||||
typedef int (_curl_debug_callback2) (CURL *,
|
||||
curl_infotype, char *, size_t, const void *);
|
||||
typedef int (_curl_debug_callback3) (CURL *,
|
||||
curl_infotype, const char *, size_t, void *);
|
||||
typedef int (_curl_debug_callback4) (CURL *,
|
||||
curl_infotype, const char *, size_t, const void *);
|
||||
typedef int (_curl_debug_callback5) (CURL *,
|
||||
curl_infotype, unsigned char *, size_t, void *);
|
||||
typedef int (_curl_debug_callback6) (CURL *,
|
||||
curl_infotype, unsigned char *, size_t, const void *);
|
||||
typedef int (_curl_debug_callback7) (CURL *,
|
||||
curl_infotype, const unsigned char *, size_t, void *);
|
||||
typedef int (_curl_debug_callback8) (CURL *,
|
||||
curl_infotype, const unsigned char *, size_t, const void *);
|
||||
|
||||
/* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */
|
||||
/* this is getting even messier... */
|
||||
#define _curl_is_ssl_ctx_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_ssl_ctx_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback4) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback5) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback6) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback7) || \
|
||||
_curl_callback_compatible((expr), _curl_ssl_ctx_callback8))
|
||||
typedef CURLcode (_curl_ssl_ctx_callback1)(CURL *, void *, void *);
|
||||
typedef CURLcode (_curl_ssl_ctx_callback2)(CURL *, void *, const void *);
|
||||
typedef CURLcode (_curl_ssl_ctx_callback3)(CURL *, const void *, void *);
|
||||
typedef CURLcode (_curl_ssl_ctx_callback4)(CURL *, const void *, const void *);
|
||||
#ifdef HEADER_SSL_H
|
||||
/* hack: if we included OpenSSL's ssl.h, we know about SSL_CTX
|
||||
* this will of course break if we're included before OpenSSL headers...
|
||||
*/
|
||||
typedef CURLcode (_curl_ssl_ctx_callback5)(CURL *, SSL_CTX, void *);
|
||||
typedef CURLcode (_curl_ssl_ctx_callback6)(CURL *, SSL_CTX, const void *);
|
||||
typedef CURLcode (_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX, void *);
|
||||
typedef CURLcode (_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX,
|
||||
const void *);
|
||||
#else
|
||||
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5;
|
||||
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6;
|
||||
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback7;
|
||||
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback8;
|
||||
#endif
|
||||
|
||||
/* evaluates to true if expr is of type curl_conv_callback or "similar" */
|
||||
#define _curl_is_conv_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_conv_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_conv_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_conv_callback2) || \
|
||||
_curl_callback_compatible((expr), _curl_conv_callback3) || \
|
||||
_curl_callback_compatible((expr), _curl_conv_callback4))
|
||||
typedef CURLcode (*_curl_conv_callback1)(char *, size_t length);
|
||||
typedef CURLcode (*_curl_conv_callback2)(const char *, size_t length);
|
||||
typedef CURLcode (*_curl_conv_callback3)(void *, size_t length);
|
||||
typedef CURLcode (*_curl_conv_callback4)(const void *, size_t length);
|
||||
|
||||
/* evaluates to true if expr is of type curl_seek_callback or "similar" */
|
||||
#define _curl_is_seek_cb(expr) \
|
||||
(_curl_is_NULL(expr) || \
|
||||
__builtin_types_compatible_p(__typeof__(expr), curl_seek_callback) || \
|
||||
_curl_callback_compatible((expr), _curl_seek_callback1) || \
|
||||
_curl_callback_compatible((expr), _curl_seek_callback2))
|
||||
typedef CURLcode (*_curl_seek_callback1)(void *, curl_off_t, int);
|
||||
typedef CURLcode (*_curl_seek_callback2)(const void *, curl_off_t, int);
|
||||
|
||||
|
||||
#endif /* __CURL_TYPECHECK_GCC_H */
|
|
@ -1,18 +0,0 @@
|
|||
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
add_definitions(-DUSE_SCHANNEL -DUSE_WINDOWS_SSPI)
|
||||
else()
|
||||
add_definitions(-DHAVE_CONFIG_H)
|
||||
endif()
|
||||
|
||||
file(GLOB SRCS *.c vauth/*.c vtls/*.c)
|
||||
add_library(
|
||||
curl
|
||||
STATIC
|
||||
${SRCS}
|
||||
)
|
||||
dolphin_disable_warnings_msvc(curl)
|
||||
|
||||
target_include_directories(curl PRIVATE . INTERFACE ../include)
|
||||
target_link_libraries(curl MbedTLS::mbedtls zlibstatic)
|
||||
target_compile_definitions(curl PUBLIC CURL_STATICLIB PRIVATE CURL_DISABLE_LDAP)
|
||||
add_library(CURL::libcurl ALIAS curl)
|
|
@ -1,77 +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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#if defined(__AMIGA__) && !defined(__ixemul__)
|
||||
|
||||
#include <amitcp/socketbasetags.h>
|
||||
|
||||
#include "amigaos.h"
|
||||
|
||||
struct Library *SocketBase = NULL;
|
||||
extern int errno, h_errno;
|
||||
|
||||
#ifdef __libnix__
|
||||
#include <stabs.h>
|
||||
void __request(const char *msg);
|
||||
#else
|
||||
# define __request(msg) Printf(msg "\n\a")
|
||||
#endif
|
||||
|
||||
void Curl_amiga_cleanup()
|
||||
{
|
||||
if(SocketBase) {
|
||||
CloseLibrary(SocketBase);
|
||||
SocketBase = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
bool Curl_amiga_init()
|
||||
{
|
||||
if(!SocketBase)
|
||||
SocketBase = OpenLibrary("bsdsocket.library", 4);
|
||||
|
||||
if(!SocketBase) {
|
||||
__request("No TCP/IP Stack running!");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if(SocketBaseTags(SBTM_SETVAL(SBTC_ERRNOPTR(sizeof(errno))), (ULONG) &errno,
|
||||
SBTM_SETVAL(SBTC_LOGTAGPTR), (ULONG) "cURL",
|
||||
TAG_DONE)) {
|
||||
__request("SocketBaseTags ERROR");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#ifndef __libnix__
|
||||
atexit(Curl_amiga_cleanup);
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#ifdef __libnix__
|
||||
ADD2EXIT(Curl_amiga_cleanup, -50);
|
||||
#endif
|
||||
|
||||
#endif /* __AMIGA__ && ! __ixemul__ */
|
|
@ -1,39 +0,0 @@
|
|||
#ifndef HEADER_CURL_AMIGAOS_H
|
||||
#define HEADER_CURL_AMIGAOS_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
#include "curl_setup.h"
|
||||
|
||||
#if defined(__AMIGA__) && !defined(__ixemul__)
|
||||
|
||||
bool Curl_amiga_init();
|
||||
void Curl_amiga_cleanup();
|
||||
|
||||
#else
|
||||
|
||||
#define Curl_amiga_init() 1
|
||||
#define Curl_amiga_cleanup() Curl_nop_stmt
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* HEADER_CURL_AMIGAOS_H */
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
#ifndef HEADER_CURL_ARPA_TELNET_H
|
||||
#define HEADER_CURL_ARPA_TELNET_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
#ifndef CURL_DISABLE_TELNET
|
||||
/*
|
||||
* Telnet option defines. Add more here if in need.
|
||||
*/
|
||||
#define CURL_TELOPT_BINARY 0 /* binary 8bit data */
|
||||
#define CURL_TELOPT_ECHO 1 /* just echo! */
|
||||
#define CURL_TELOPT_SGA 3 /* Suppress Go Ahead */
|
||||
#define CURL_TELOPT_EXOPL 255 /* EXtended OPtions List */
|
||||
#define CURL_TELOPT_TTYPE 24 /* Terminal TYPE */
|
||||
#define CURL_TELOPT_NAWS 31 /* Negotiate About Window Size */
|
||||
#define CURL_TELOPT_XDISPLOC 35 /* X DISPlay LOCation */
|
||||
|
||||
#define CURL_TELOPT_NEW_ENVIRON 39 /* NEW ENVIRONment variables */
|
||||
#define CURL_NEW_ENV_VAR 0
|
||||
#define CURL_NEW_ENV_VALUE 1
|
||||
|
||||
/*
|
||||
* The telnet options represented as strings
|
||||
*/
|
||||
static const char * const telnetoptions[]=
|
||||
{
|
||||
"BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD",
|
||||
"NAME", "STATUS", "TIMING MARK", "RCTE",
|
||||
"NAOL", "NAOP", "NAOCRD", "NAOHTS",
|
||||
"NAOHTD", "NAOFFD", "NAOVTS", "NAOVTD",
|
||||
"NAOLFD", "EXTEND ASCII", "LOGOUT", "BYTE MACRO",
|
||||
"DE TERMINAL", "SUPDUP", "SUPDUP OUTPUT", "SEND LOCATION",
|
||||
"TERM TYPE", "END OF RECORD", "TACACS UID", "OUTPUT MARKING",
|
||||
"TTYLOC", "3270 REGIME", "X3 PAD", "NAWS",
|
||||
"TERM SPEED", "LFLOW", "LINEMODE", "XDISPLOC",
|
||||
"OLD-ENVIRON", "AUTHENTICATION", "ENCRYPT", "NEW-ENVIRON"
|
||||
};
|
||||
|
||||
#define CURL_TELOPT_MAXIMUM CURL_TELOPT_NEW_ENVIRON
|
||||
|
||||
#define CURL_TELOPT_OK(x) ((x) <= CURL_TELOPT_MAXIMUM)
|
||||
#define CURL_TELOPT(x) telnetoptions[x]
|
||||
|
||||
#define CURL_NTELOPTS 40
|
||||
|
||||
/*
|
||||
* First some defines
|
||||
*/
|
||||
#define CURL_xEOF 236 /* End Of File */
|
||||
#define CURL_SE 240 /* Sub negotiation End */
|
||||
#define CURL_NOP 241 /* No OPeration */
|
||||
#define CURL_DM 242 /* Data Mark */
|
||||
#define CURL_GA 249 /* Go Ahead, reverse the line */
|
||||
#define CURL_SB 250 /* SuBnegotiation */
|
||||
#define CURL_WILL 251 /* Our side WILL use this option */
|
||||
#define CURL_WONT 252 /* Our side WON'T use this option */
|
||||
#define CURL_DO 253 /* DO use this option! */
|
||||
#define CURL_DONT 254 /* DON'T use this option! */
|
||||
#define CURL_IAC 255 /* Interpret As Command */
|
||||
|
||||
/*
|
||||
* Then those numbers represented as strings:
|
||||
*/
|
||||
static const char * const telnetcmds[]=
|
||||
{
|
||||
"EOF", "SUSP", "ABORT", "EOR", "SE",
|
||||
"NOP", "DMARK", "BRK", "IP", "AO",
|
||||
"AYT", "EC", "EL", "GA", "SB",
|
||||
"WILL", "WONT", "DO", "DONT", "IAC"
|
||||
};
|
||||
|
||||
#define CURL_TELCMD_MINIMUM CURL_xEOF /* the first one */
|
||||
#define CURL_TELCMD_MAXIMUM CURL_IAC /* surprise, 255 is the last one! ;-) */
|
||||
|
||||
#define CURL_TELQUAL_IS 0
|
||||
#define CURL_TELQUAL_SEND 1
|
||||
#define CURL_TELQUAL_INFO 2
|
||||
#define CURL_TELQUAL_NAME 3
|
||||
|
||||
#define CURL_TELCMD_OK(x) ( ((unsigned int)(x) >= CURL_TELCMD_MINIMUM) && \
|
||||
((unsigned int)(x) <= CURL_TELCMD_MAXIMUM) )
|
||||
#define CURL_TELCMD(x) telnetcmds[(x)-CURL_TELCMD_MINIMUM]
|
||||
|
||||
#endif /* CURL_DISABLE_TELNET */
|
||||
|
||||
#endif /* HEADER_CURL_ARPA_TELNET_H */
|
|
@ -1,691 +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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#ifdef HAVE_LIMITS_H
|
||||
#include <limits.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef __VMS
|
||||
#include <in.h>
|
||||
#include <inet.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PROCESS_H
|
||||
#include <process.h>
|
||||
#endif
|
||||
|
||||
#if (defined(NETWARE) && defined(__NOVELL_LIBC__))
|
||||
#undef in_addr_t
|
||||
#define in_addr_t unsigned long
|
||||
#endif
|
||||
|
||||
/***********************************************************************
|
||||
* Only for ares-enabled builds
|
||||
* And only for functions that fulfill the asynch resolver backend API
|
||||
* as defined in asyn.h, nothing else belongs in this file!
|
||||
**********************************************************************/
|
||||
|
||||
#ifdef CURLRES_ARES
|
||||
|
||||
#include "urldata.h"
|
||||
#include "sendf.h"
|
||||
#include "hostip.h"
|
||||
#include "hash.h"
|
||||
#include "share.h"
|
||||
#include "strerror.h"
|
||||
#include "url.h"
|
||||
#include "multiif.h"
|
||||
#include "inet_pton.h"
|
||||
#include "connect.h"
|
||||
#include "select.h"
|
||||
#include "progress.h"
|
||||
|
||||
# if defined(CURL_STATICLIB) && !defined(CARES_STATICLIB) && \
|
||||
(defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__))
|
||||
# define CARES_STATICLIB
|
||||
# endif
|
||||
# include <ares.h>
|
||||
# include <ares_version.h> /* really old c-ares didn't include this by
|
||||
itself */
|
||||
|
||||
#if ARES_VERSION >= 0x010500
|
||||
/* c-ares 1.5.0 or later, the callback proto is modified */
|
||||
#define HAVE_CARES_CALLBACK_TIMEOUTS 1
|
||||
#endif
|
||||
|
||||
/* The last 3 #include files should be in this order */
|
||||
#include "curl_printf.h"
|
||||
#include "curl_memory.h"
|
||||
#include "memdebug.h"
|
||||
|
||||
struct ResolverResults {
|
||||
int num_pending; /* number of ares_gethostbyname() requests */
|
||||
Curl_addrinfo *temp_ai; /* intermediary result while fetching c-ares parts */
|
||||
int last_status;
|
||||
};
|
||||
|
||||
/*
|
||||
* Curl_resolver_global_init() - the generic low-level asynchronous name
|
||||
* resolve API. Called from curl_global_init() to initialize global resolver
|
||||
* environment. Initializes ares library.
|
||||
*/
|
||||
int Curl_resolver_global_init(void)
|
||||
{
|
||||
#ifdef CARES_HAVE_ARES_LIBRARY_INIT
|
||||
if(ares_library_init(ARES_LIB_INIT_ALL)) {
|
||||
return CURLE_FAILED_INIT;
|
||||
}
|
||||
#endif
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_resolver_global_cleanup()
|
||||
*
|
||||
* Called from curl_global_cleanup() to destroy global resolver environment.
|
||||
* Deinitializes ares library.
|
||||
*/
|
||||
void Curl_resolver_global_cleanup(void)
|
||||
{
|
||||
#ifdef CARES_HAVE_ARES_LIBRARY_CLEANUP
|
||||
ares_library_cleanup();
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_resolver_init()
|
||||
*
|
||||
* Called from curl_easy_init() -> Curl_open() to initialize resolver
|
||||
* URL-state specific environment ('resolver' member of the UrlState
|
||||
* structure). Fills the passed pointer by the initialized ares_channel.
|
||||
*/
|
||||
CURLcode Curl_resolver_init(void **resolver)
|
||||
{
|
||||
int status = ares_init((ares_channel*)resolver);
|
||||
if(status != ARES_SUCCESS) {
|
||||
if(status == ARES_ENOMEM)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
else
|
||||
return CURLE_FAILED_INIT;
|
||||
}
|
||||
return CURLE_OK;
|
||||
/* make sure that all other returns from this function should destroy the
|
||||
ares channel before returning error! */
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_resolver_cleanup()
|
||||
*
|
||||
* Called from curl_easy_cleanup() -> Curl_close() to cleanup resolver
|
||||
* URL-state specific environment ('resolver' member of the UrlState
|
||||
* structure). Destroys the ares channel.
|
||||
*/
|
||||
void Curl_resolver_cleanup(void *resolver)
|
||||
{
|
||||
ares_destroy((ares_channel)resolver);
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_resolver_duphandle()
|
||||
*
|
||||
* Called from curl_easy_duphandle() to duplicate resolver URL-state specific
|
||||
* environment ('resolver' member of the UrlState structure). Duplicates the
|
||||
* 'from' ares channel and passes the resulting channel to the 'to' pointer.
|
||||
*/
|
||||
int Curl_resolver_duphandle(void **to, void *from)
|
||||
{
|
||||
/* Clone the ares channel for the new handle */
|
||||
if(ARES_SUCCESS != ares_dup((ares_channel*)to, (ares_channel)from))
|
||||
return CURLE_FAILED_INIT;
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static void destroy_async_data (struct Curl_async *async);
|
||||
|
||||
/*
|
||||
* Cancel all possibly still on-going resolves for this connection.
|
||||
*/
|
||||
void Curl_resolver_cancel(struct connectdata *conn)
|
||||
{
|
||||
if(conn->data && conn->data->state.resolver)
|
||||
ares_cancel((ares_channel)conn->data->state.resolver);
|
||||
destroy_async_data(&conn->async);
|
||||
}
|
||||
|
||||
/*
|
||||
* destroy_async_data() cleans up async resolver data.
|
||||
*/
|
||||
static void destroy_async_data (struct Curl_async *async)
|
||||
{
|
||||
free(async->hostname);
|
||||
|
||||
if(async->os_specific) {
|
||||
struct ResolverResults *res = (struct ResolverResults *)async->os_specific;
|
||||
if(res) {
|
||||
if(res->temp_ai) {
|
||||
Curl_freeaddrinfo(res->temp_ai);
|
||||
res->temp_ai = NULL;
|
||||
}
|
||||
free(res);
|
||||
}
|
||||
async->os_specific = NULL;
|
||||
}
|
||||
|
||||
async->hostname = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_resolver_getsock() is called when someone from the outside world
|
||||
* (using curl_multi_fdset()) wants to get our fd_set setup and we're talking
|
||||
* with ares. The caller must make sure that this function is only called when
|
||||
* we have a working ares channel.
|
||||
*
|
||||
* Returns: sockets-in-use-bitmap
|
||||
*/
|
||||
|
||||
int Curl_resolver_getsock(struct connectdata *conn,
|
||||
curl_socket_t *socks,
|
||||
int numsocks)
|
||||
|
||||
{
|
||||
struct timeval maxtime;
|
||||
struct timeval timebuf;
|
||||
struct timeval *timeout;
|
||||
long milli;
|
||||
int max = ares_getsock((ares_channel)conn->data->state.resolver,
|
||||
(ares_socket_t *)socks, numsocks);
|
||||
|
||||
maxtime.tv_sec = CURL_TIMEOUT_RESOLVE;
|
||||
maxtime.tv_usec = 0;
|
||||
|
||||
timeout = ares_timeout((ares_channel)conn->data->state.resolver, &maxtime,
|
||||
&timebuf);
|
||||
milli = (timeout->tv_sec * 1000) + (timeout->tv_usec/1000);
|
||||
if(milli == 0)
|
||||
milli += 10;
|
||||
Curl_expire_latest(conn->data, milli);
|
||||
|
||||
return max;
|
||||
}
|
||||
|
||||
/*
|
||||
* waitperform()
|
||||
*
|
||||
* 1) Ask ares what sockets it currently plays with, then
|
||||
* 2) wait for the timeout period to check for action on ares' sockets.
|
||||
* 3) tell ares to act on all the sockets marked as "with action"
|
||||
*
|
||||
* return number of sockets it worked on
|
||||
*/
|
||||
|
||||
static int waitperform(struct connectdata *conn, int timeout_ms)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
int nfds;
|
||||
int bitmask;
|
||||
ares_socket_t socks[ARES_GETSOCK_MAXNUM];
|
||||
struct pollfd pfd[ARES_GETSOCK_MAXNUM];
|
||||
int i;
|
||||
int num = 0;
|
||||
|
||||
bitmask = ares_getsock((ares_channel)data->state.resolver, socks,
|
||||
ARES_GETSOCK_MAXNUM);
|
||||
|
||||
for(i=0; i < ARES_GETSOCK_MAXNUM; i++) {
|
||||
pfd[i].events = 0;
|
||||
pfd[i].revents = 0;
|
||||
if(ARES_GETSOCK_READABLE(bitmask, i)) {
|
||||
pfd[i].fd = socks[i];
|
||||
pfd[i].events |= POLLRDNORM|POLLIN;
|
||||
}
|
||||
if(ARES_GETSOCK_WRITABLE(bitmask, i)) {
|
||||
pfd[i].fd = socks[i];
|
||||
pfd[i].events |= POLLWRNORM|POLLOUT;
|
||||
}
|
||||
if(pfd[i].events != 0)
|
||||
num++;
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
if(num)
|
||||
nfds = Curl_poll(pfd, num, timeout_ms);
|
||||
else
|
||||
nfds = 0;
|
||||
|
||||
if(!nfds)
|
||||
/* Call ares_process() unconditonally here, even if we simply timed out
|
||||
above, as otherwise the ares name resolve won't timeout! */
|
||||
ares_process_fd((ares_channel)data->state.resolver, ARES_SOCKET_BAD,
|
||||
ARES_SOCKET_BAD);
|
||||
else {
|
||||
/* move through the descriptors and ask for processing on them */
|
||||
for(i=0; i < num; i++)
|
||||
ares_process_fd((ares_channel)data->state.resolver,
|
||||
pfd[i].revents & (POLLRDNORM|POLLIN)?
|
||||
pfd[i].fd:ARES_SOCKET_BAD,
|
||||
pfd[i].revents & (POLLWRNORM|POLLOUT)?
|
||||
pfd[i].fd:ARES_SOCKET_BAD);
|
||||
}
|
||||
return nfds;
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_resolver_is_resolved() is called repeatedly to check if a previous
|
||||
* name resolve request has completed. It should also make sure to time-out if
|
||||
* the operation seems to take too long.
|
||||
*
|
||||
* Returns normal CURLcode errors.
|
||||
*/
|
||||
CURLcode Curl_resolver_is_resolved(struct connectdata *conn,
|
||||
struct Curl_dns_entry **dns)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct ResolverResults *res = (struct ResolverResults *)
|
||||
conn->async.os_specific;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
*dns = NULL;
|
||||
|
||||
waitperform(conn, 0);
|
||||
|
||||
if(res && !res->num_pending) {
|
||||
(void)Curl_addrinfo_callback(conn, res->last_status, res->temp_ai);
|
||||
/* temp_ai ownership is moved to the connection, so we need not free-up
|
||||
them */
|
||||
res->temp_ai = NULL;
|
||||
if(!conn->async.dns) {
|
||||
failf(data, "Could not resolve: %s (%s)",
|
||||
conn->async.hostname, ares_strerror(conn->async.status));
|
||||
result = conn->bits.proxy?CURLE_COULDNT_RESOLVE_PROXY:
|
||||
CURLE_COULDNT_RESOLVE_HOST;
|
||||
}
|
||||
else
|
||||
*dns = conn->async.dns;
|
||||
|
||||
destroy_async_data(&conn->async);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_resolver_wait_resolv()
|
||||
*
|
||||
* waits for a resolve to finish. This function should be avoided since using
|
||||
* this risk getting the multi interface to "hang".
|
||||
*
|
||||
* If 'entry' is non-NULL, make it point to the resolved dns entry
|
||||
*
|
||||
* Returns CURLE_COULDNT_RESOLVE_HOST if the host was not resolved, and
|
||||
* CURLE_OPERATION_TIMEDOUT if a time-out occurred.
|
||||
*/
|
||||
CURLcode Curl_resolver_wait_resolv(struct connectdata *conn,
|
||||
struct Curl_dns_entry **entry)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
long timeout;
|
||||
struct timeval now = Curl_tvnow();
|
||||
struct Curl_dns_entry *temp_entry;
|
||||
|
||||
timeout = Curl_timeleft(data, &now, TRUE);
|
||||
if(!timeout)
|
||||
timeout = CURL_TIMEOUT_RESOLVE * 1000; /* default name resolve timeout */
|
||||
|
||||
/* Wait for the name resolve query to complete. */
|
||||
for(;;) {
|
||||
struct timeval *tvp, tv, store;
|
||||
long timediff;
|
||||
int itimeout;
|
||||
int timeout_ms;
|
||||
|
||||
itimeout = (timeout > (long)INT_MAX) ? INT_MAX : (int)timeout;
|
||||
|
||||
store.tv_sec = itimeout/1000;
|
||||
store.tv_usec = (itimeout%1000)*1000;
|
||||
|
||||
tvp = ares_timeout((ares_channel)data->state.resolver, &store, &tv);
|
||||
|
||||
/* use the timeout period ares returned to us above if less than one
|
||||
second is left, otherwise just use 1000ms to make sure the progress
|
||||
callback gets called frequent enough */
|
||||
if(!tvp->tv_sec)
|
||||
timeout_ms = (int)(tvp->tv_usec/1000);
|
||||
else
|
||||
timeout_ms = 1000;
|
||||
|
||||
waitperform(conn, timeout_ms);
|
||||
Curl_resolver_is_resolved(conn, &temp_entry);
|
||||
|
||||
if(conn->async.done)
|
||||
break;
|
||||
|
||||
if(Curl_pgrsUpdate(conn)) {
|
||||
result = CURLE_ABORTED_BY_CALLBACK;
|
||||
timeout = -1; /* trigger the cancel below */
|
||||
}
|
||||
else {
|
||||
struct timeval now2 = Curl_tvnow();
|
||||
timediff = Curl_tvdiff(now2, now); /* spent time */
|
||||
timeout -= timediff?timediff:1; /* always deduct at least 1 */
|
||||
now = now2; /* for next loop */
|
||||
}
|
||||
|
||||
if(timeout < 0) {
|
||||
/* our timeout, so we cancel the ares operation */
|
||||
ares_cancel((ares_channel)data->state.resolver);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Operation complete, if the lookup was successful we now have the entry
|
||||
in the cache. */
|
||||
if(entry)
|
||||
*entry = conn->async.dns;
|
||||
|
||||
if(result)
|
||||
/* close the connection, since we can't return failure here without
|
||||
cleaning up this connection properly.
|
||||
TODO: remove this action from here, it is not a name resolver decision.
|
||||
*/
|
||||
connclose(conn, "c-ares resolve failed");
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Connects results to the list */
|
||||
static void compound_results(struct ResolverResults *res,
|
||||
Curl_addrinfo *ai)
|
||||
{
|
||||
Curl_addrinfo *ai_tail;
|
||||
if(!ai)
|
||||
return;
|
||||
ai_tail = ai;
|
||||
|
||||
while(ai_tail->ai_next)
|
||||
ai_tail = ai_tail->ai_next;
|
||||
|
||||
/* Add the new results to the list of old results. */
|
||||
ai_tail->ai_next = res->temp_ai;
|
||||
res->temp_ai = ai;
|
||||
}
|
||||
|
||||
/*
|
||||
* ares_query_completed_cb() is the callback that ares will call when
|
||||
* the host query initiated by ares_gethostbyname() from Curl_getaddrinfo(),
|
||||
* when using ares, is completed either successfully or with failure.
|
||||
*/
|
||||
static void query_completed_cb(void *arg, /* (struct connectdata *) */
|
||||
int status,
|
||||
#ifdef HAVE_CARES_CALLBACK_TIMEOUTS
|
||||
int timeouts,
|
||||
#endif
|
||||
struct hostent *hostent)
|
||||
{
|
||||
struct connectdata *conn = (struct connectdata *)arg;
|
||||
struct ResolverResults *res;
|
||||
|
||||
#ifdef HAVE_CARES_CALLBACK_TIMEOUTS
|
||||
(void)timeouts; /* ignored */
|
||||
#endif
|
||||
|
||||
if(ARES_EDESTRUCTION == status)
|
||||
/* when this ares handle is getting destroyed, the 'arg' pointer may not
|
||||
be valid so only defer it when we know the 'status' says its fine! */
|
||||
return;
|
||||
|
||||
res = (struct ResolverResults *)conn->async.os_specific;
|
||||
res->num_pending--;
|
||||
|
||||
if(CURL_ASYNC_SUCCESS == status) {
|
||||
Curl_addrinfo *ai = Curl_he2ai(hostent, conn->async.port);
|
||||
if(ai) {
|
||||
compound_results(res, ai);
|
||||
}
|
||||
}
|
||||
/* A successful result overwrites any previous error */
|
||||
if(res->last_status != ARES_SUCCESS)
|
||||
res->last_status = status;
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_resolver_getaddrinfo() - when using ares
|
||||
*
|
||||
* Returns name information about the given hostname and port number. If
|
||||
* successful, the 'hostent' is returned and the forth argument will point to
|
||||
* memory we need to free after use. That memory *MUST* be freed with
|
||||
* Curl_freeaddrinfo(), nothing else.
|
||||
*/
|
||||
Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn,
|
||||
const char *hostname,
|
||||
int port,
|
||||
int *waitp)
|
||||
{
|
||||
char *bufp;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct in_addr in;
|
||||
int family = PF_INET;
|
||||
#ifdef ENABLE_IPV6 /* CURLRES_IPV6 */
|
||||
struct in6_addr in6;
|
||||
#endif /* CURLRES_IPV6 */
|
||||
|
||||
*waitp = 0; /* default to synchronous response */
|
||||
|
||||
/* First check if this is an IPv4 address string */
|
||||
if(Curl_inet_pton(AF_INET, hostname, &in) > 0) {
|
||||
/* This is a dotted IP address 123.123.123.123-style */
|
||||
return Curl_ip2addr(AF_INET, &in, hostname, port);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_IPV6 /* CURLRES_IPV6 */
|
||||
/* Otherwise, check if this is an IPv6 address string */
|
||||
if(Curl_inet_pton (AF_INET6, hostname, &in6) > 0)
|
||||
/* This must be an IPv6 address literal. */
|
||||
return Curl_ip2addr(AF_INET6, &in6, hostname, port);
|
||||
|
||||
switch(conn->ip_version) {
|
||||
default:
|
||||
#if ARES_VERSION >= 0x010601
|
||||
family = PF_UNSPEC; /* supported by c-ares since 1.6.1, so for older
|
||||
c-ares versions this just falls through and defaults
|
||||
to PF_INET */
|
||||
break;
|
||||
#endif
|
||||
case CURL_IPRESOLVE_V4:
|
||||
family = PF_INET;
|
||||
break;
|
||||
case CURL_IPRESOLVE_V6:
|
||||
family = PF_INET6;
|
||||
break;
|
||||
}
|
||||
#endif /* CURLRES_IPV6 */
|
||||
|
||||
bufp = strdup(hostname);
|
||||
if(bufp) {
|
||||
struct ResolverResults *res = NULL;
|
||||
free(conn->async.hostname);
|
||||
conn->async.hostname = bufp;
|
||||
conn->async.port = port;
|
||||
conn->async.done = FALSE; /* not done */
|
||||
conn->async.status = 0; /* clear */
|
||||
conn->async.dns = NULL; /* clear */
|
||||
res = calloc(sizeof(struct ResolverResults), 1);
|
||||
if(!res) {
|
||||
free(conn->async.hostname);
|
||||
conn->async.hostname = NULL;
|
||||
return NULL;
|
||||
}
|
||||
conn->async.os_specific = res;
|
||||
|
||||
/* initial status - failed */
|
||||
res->last_status = ARES_ENOTFOUND;
|
||||
#ifdef ENABLE_IPV6 /* CURLRES_IPV6 */
|
||||
if(family == PF_UNSPEC) {
|
||||
if(Curl_ipv6works()) {
|
||||
res->num_pending = 2;
|
||||
|
||||
/* areschannel is already setup in the Curl_open() function */
|
||||
ares_gethostbyname((ares_channel)data->state.resolver, hostname,
|
||||
PF_INET, query_completed_cb, conn);
|
||||
ares_gethostbyname((ares_channel)data->state.resolver, hostname,
|
||||
PF_INET6, query_completed_cb, conn);
|
||||
}
|
||||
else {
|
||||
res->num_pending = 1;
|
||||
|
||||
/* areschannel is already setup in the Curl_open() function */
|
||||
ares_gethostbyname((ares_channel)data->state.resolver, hostname,
|
||||
PF_INET, query_completed_cb, conn);
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif /* CURLRES_IPV6 */
|
||||
{
|
||||
res->num_pending = 1;
|
||||
|
||||
/* areschannel is already setup in the Curl_open() function */
|
||||
ares_gethostbyname((ares_channel)data->state.resolver, hostname, family,
|
||||
query_completed_cb, conn);
|
||||
}
|
||||
|
||||
*waitp = 1; /* expect asynchronous response */
|
||||
}
|
||||
return NULL; /* no struct yet */
|
||||
}
|
||||
|
||||
CURLcode Curl_set_dns_servers(struct SessionHandle *data,
|
||||
char *servers)
|
||||
{
|
||||
CURLcode result = CURLE_NOT_BUILT_IN;
|
||||
int ares_result;
|
||||
|
||||
/* If server is NULL or empty, this would purge all DNS servers
|
||||
* from ares library, which will cause any and all queries to fail.
|
||||
* So, just return OK if none are configured and don't actually make
|
||||
* any changes to c-ares. This lets c-ares use it's defaults, which
|
||||
* it gets from the OS (for instance from /etc/resolv.conf on Linux).
|
||||
*/
|
||||
if(!(servers && servers[0]))
|
||||
return CURLE_OK;
|
||||
|
||||
#if (ARES_VERSION >= 0x010704)
|
||||
ares_result = ares_set_servers_csv(data->state.resolver, servers);
|
||||
switch(ares_result) {
|
||||
case ARES_SUCCESS:
|
||||
result = CURLE_OK;
|
||||
break;
|
||||
case ARES_ENOMEM:
|
||||
result = CURLE_OUT_OF_MEMORY;
|
||||
break;
|
||||
case ARES_ENOTINITIALIZED:
|
||||
case ARES_ENODATA:
|
||||
case ARES_EBADSTR:
|
||||
default:
|
||||
result = CURLE_BAD_FUNCTION_ARGUMENT;
|
||||
break;
|
||||
}
|
||||
#else /* too old c-ares version! */
|
||||
(void)data;
|
||||
(void)(ares_result);
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
CURLcode Curl_set_dns_interface(struct SessionHandle *data,
|
||||
const char *interf)
|
||||
{
|
||||
#if (ARES_VERSION >= 0x010704)
|
||||
if(!interf)
|
||||
interf = "";
|
||||
|
||||
ares_set_local_dev((ares_channel)data->state.resolver, interf);
|
||||
|
||||
return CURLE_OK;
|
||||
#else /* c-ares version too old! */
|
||||
(void)data;
|
||||
(void)interf;
|
||||
return CURLE_NOT_BUILT_IN;
|
||||
#endif
|
||||
}
|
||||
|
||||
CURLcode Curl_set_dns_local_ip4(struct SessionHandle *data,
|
||||
const char *local_ip4)
|
||||
{
|
||||
#if (ARES_VERSION >= 0x010704)
|
||||
struct in_addr a4;
|
||||
|
||||
if((!local_ip4) || (local_ip4[0] == 0)) {
|
||||
a4.s_addr = 0; /* disabled: do not bind to a specific address */
|
||||
}
|
||||
else {
|
||||
if(Curl_inet_pton(AF_INET, local_ip4, &a4) != 1) {
|
||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||
}
|
||||
}
|
||||
|
||||
ares_set_local_ip4((ares_channel)data->state.resolver, ntohl(a4.s_addr));
|
||||
|
||||
return CURLE_OK;
|
||||
#else /* c-ares version too old! */
|
||||
(void)data;
|
||||
(void)local_ip4;
|
||||
return CURLE_NOT_BUILT_IN;
|
||||
#endif
|
||||
}
|
||||
|
||||
CURLcode Curl_set_dns_local_ip6(struct SessionHandle *data,
|
||||
const char *local_ip6)
|
||||
{
|
||||
#if (ARES_VERSION >= 0x010704) && defined(ENABLE_IPV6)
|
||||
unsigned char a6[INET6_ADDRSTRLEN];
|
||||
|
||||
if((!local_ip6) || (local_ip6[0] == 0)) {
|
||||
/* disabled: do not bind to a specific address */
|
||||
memset(a6, 0, sizeof(a6));
|
||||
}
|
||||
else {
|
||||
if(Curl_inet_pton(AF_INET6, local_ip6, a6) != 1) {
|
||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||
}
|
||||
}
|
||||
|
||||
ares_set_local_ip6((ares_channel)data->state.resolver, a6);
|
||||
|
||||
return CURLE_OK;
|
||||
#else /* c-ares version too old! */
|
||||
(void)data;
|
||||
(void)local_ip6;
|
||||
return CURLE_NOT_BUILT_IN;
|
||||
#endif
|
||||
}
|
||||
#endif /* CURLRES_ARES */
|
|
@ -1,697 +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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef __VMS
|
||||
#include <in.h>
|
||||
#include <inet.h>
|
||||
#endif
|
||||
|
||||
#if defined(USE_THREADS_POSIX)
|
||||
# ifdef HAVE_PTHREAD_H
|
||||
# include <pthread.h>
|
||||
# endif
|
||||
#elif defined(USE_THREADS_WIN32)
|
||||
# ifdef HAVE_PROCESS_H
|
||||
# include <process.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if (defined(NETWARE) && defined(__NOVELL_LIBC__))
|
||||
#undef in_addr_t
|
||||
#define in_addr_t unsigned long
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GETADDRINFO
|
||||
# define RESOLVER_ENOMEM EAI_MEMORY
|
||||
#else
|
||||
# define RESOLVER_ENOMEM ENOMEM
|
||||
#endif
|
||||
|
||||
#include "urldata.h"
|
||||
#include "sendf.h"
|
||||
#include "hostip.h"
|
||||
#include "hash.h"
|
||||
#include "share.h"
|
||||
#include "strerror.h"
|
||||
#include "url.h"
|
||||
#include "multiif.h"
|
||||
#include "inet_pton.h"
|
||||
#include "inet_ntop.h"
|
||||
#include "curl_threads.h"
|
||||
#include "connect.h"
|
||||
/* The last 3 #include files should be in this order */
|
||||
#include "curl_printf.h"
|
||||
#include "curl_memory.h"
|
||||
#include "memdebug.h"
|
||||
|
||||
/***********************************************************************
|
||||
* Only for threaded name resolves builds
|
||||
**********************************************************************/
|
||||
#ifdef CURLRES_THREADED
|
||||
|
||||
/*
|
||||
* Curl_resolver_global_init()
|
||||
* Called from curl_global_init() to initialize global resolver environment.
|
||||
* Does nothing here.
|
||||
*/
|
||||
int Curl_resolver_global_init(void)
|
||||
{
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_resolver_global_cleanup()
|
||||
* Called from curl_global_cleanup() to destroy global resolver environment.
|
||||
* Does nothing here.
|
||||
*/
|
||||
void Curl_resolver_global_cleanup(void)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_resolver_init()
|
||||
* Called from curl_easy_init() -> Curl_open() to initialize resolver
|
||||
* URL-state specific environment ('resolver' member of the UrlState
|
||||
* structure). Does nothing here.
|
||||
*/
|
||||
CURLcode Curl_resolver_init(void **resolver)
|
||||
{
|
||||
(void)resolver;
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_resolver_cleanup()
|
||||
* Called from curl_easy_cleanup() -> Curl_close() to cleanup resolver
|
||||
* URL-state specific environment ('resolver' member of the UrlState
|
||||
* structure). Does nothing here.
|
||||
*/
|
||||
void Curl_resolver_cleanup(void *resolver)
|
||||
{
|
||||
(void)resolver;
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_resolver_duphandle()
|
||||
* Called from curl_easy_duphandle() to duplicate resolver URL state-specific
|
||||
* environment ('resolver' member of the UrlState structure). Does nothing
|
||||
* here.
|
||||
*/
|
||||
int Curl_resolver_duphandle(void **to, void *from)
|
||||
{
|
||||
(void)to;
|
||||
(void)from;
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static void destroy_async_data(struct Curl_async *);
|
||||
|
||||
/*
|
||||
* Cancel all possibly still on-going resolves for this connection.
|
||||
*/
|
||||
void Curl_resolver_cancel(struct connectdata *conn)
|
||||
{
|
||||
destroy_async_data(&conn->async);
|
||||
}
|
||||
|
||||
/* This function is used to init a threaded resolve */
|
||||
static bool init_resolve_thread(struct connectdata *conn,
|
||||
const char *hostname, int port,
|
||||
const struct addrinfo *hints);
|
||||
|
||||
|
||||
/* Data for synchronization between resolver thread and its parent */
|
||||
struct thread_sync_data {
|
||||
curl_mutex_t * mtx;
|
||||
int done;
|
||||
|
||||
char * hostname; /* hostname to resolve, Curl_async.hostname
|
||||
duplicate */
|
||||
int port;
|
||||
int sock_error;
|
||||
Curl_addrinfo *res;
|
||||
#ifdef HAVE_GETADDRINFO
|
||||
struct addrinfo hints;
|
||||
#endif
|
||||
struct thread_data *td; /* for thread-self cleanup */
|
||||
};
|
||||
|
||||
struct thread_data {
|
||||
curl_thread_t thread_hnd;
|
||||
unsigned int poll_interval;
|
||||
long interval_end;
|
||||
struct thread_sync_data tsd;
|
||||
};
|
||||
|
||||
static struct thread_sync_data *conn_thread_sync_data(struct connectdata *conn)
|
||||
{
|
||||
return &(((struct thread_data *)conn->async.os_specific)->tsd);
|
||||
}
|
||||
|
||||
#define CONN_THREAD_SYNC_DATA(conn) &(((conn)->async.os_specific)->tsd);
|
||||
|
||||
/* Destroy resolver thread synchronization data */
|
||||
static
|
||||
void destroy_thread_sync_data(struct thread_sync_data * tsd)
|
||||
{
|
||||
if(tsd->mtx) {
|
||||
Curl_mutex_destroy(tsd->mtx);
|
||||
free(tsd->mtx);
|
||||
}
|
||||
|
||||
free(tsd->hostname);
|
||||
|
||||
if(tsd->res)
|
||||
Curl_freeaddrinfo(tsd->res);
|
||||
|
||||
memset(tsd, 0, sizeof(*tsd));
|
||||
}
|
||||
|
||||
/* Initialize resolver thread synchronization data */
|
||||
static
|
||||
int init_thread_sync_data(struct thread_data * td,
|
||||
const char * hostname,
|
||||
int port,
|
||||
const struct addrinfo *hints)
|
||||
{
|
||||
struct thread_sync_data *tsd = &td->tsd;
|
||||
|
||||
memset(tsd, 0, sizeof(*tsd));
|
||||
|
||||
tsd->td = td;
|
||||
tsd->port = port;
|
||||
#ifdef HAVE_GETADDRINFO
|
||||
DEBUGASSERT(hints);
|
||||
tsd->hints = *hints;
|
||||
#else
|
||||
(void) hints;
|
||||
#endif
|
||||
|
||||
tsd->mtx = malloc(sizeof(curl_mutex_t));
|
||||
if(tsd->mtx == NULL)
|
||||
goto err_exit;
|
||||
|
||||
Curl_mutex_init(tsd->mtx);
|
||||
|
||||
tsd->sock_error = CURL_ASYNC_SUCCESS;
|
||||
|
||||
/* Copying hostname string because original can be destroyed by parent
|
||||
* thread during gethostbyname execution.
|
||||
*/
|
||||
tsd->hostname = strdup(hostname);
|
||||
if(!tsd->hostname)
|
||||
goto err_exit;
|
||||
|
||||
return 1;
|
||||
|
||||
err_exit:
|
||||
/* Memory allocation failed */
|
||||
destroy_thread_sync_data(tsd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int getaddrinfo_complete(struct connectdata *conn)
|
||||
{
|
||||
struct thread_sync_data *tsd = conn_thread_sync_data(conn);
|
||||
int rc;
|
||||
|
||||
rc = Curl_addrinfo_callback(conn, tsd->sock_error, tsd->res);
|
||||
/* The tsd->res structure has been copied to async.dns and perhaps the DNS
|
||||
cache. Set our copy to NULL so destroy_thread_sync_data doesn't free it.
|
||||
*/
|
||||
tsd->res = NULL;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_GETADDRINFO
|
||||
|
||||
/*
|
||||
* getaddrinfo_thread() resolves a name and then exits.
|
||||
*
|
||||
* For builds without ARES, but with ENABLE_IPV6, create a resolver thread
|
||||
* and wait on it.
|
||||
*/
|
||||
static unsigned int CURL_STDCALL getaddrinfo_thread (void *arg)
|
||||
{
|
||||
struct thread_sync_data *tsd = (struct thread_sync_data*)arg;
|
||||
struct thread_data *td = tsd->td;
|
||||
char service[12];
|
||||
int rc;
|
||||
|
||||
snprintf(service, sizeof(service), "%d", tsd->port);
|
||||
|
||||
rc = Curl_getaddrinfo_ex(tsd->hostname, service, &tsd->hints, &tsd->res);
|
||||
|
||||
if(rc != 0) {
|
||||
tsd->sock_error = SOCKERRNO?SOCKERRNO:rc;
|
||||
if(tsd->sock_error == 0)
|
||||
tsd->sock_error = RESOLVER_ENOMEM;
|
||||
}
|
||||
|
||||
Curl_mutex_acquire(tsd->mtx);
|
||||
if(tsd->done) {
|
||||
/* too late, gotta clean up the mess */
|
||||
Curl_mutex_release(tsd->mtx);
|
||||
destroy_thread_sync_data(tsd);
|
||||
free(td);
|
||||
}
|
||||
else {
|
||||
tsd->done = 1;
|
||||
Curl_mutex_release(tsd->mtx);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else /* HAVE_GETADDRINFO */
|
||||
|
||||
/*
|
||||
* gethostbyname_thread() resolves a name and then exits.
|
||||
*/
|
||||
static unsigned int CURL_STDCALL gethostbyname_thread (void *arg)
|
||||
{
|
||||
struct thread_sync_data *tsd = (struct thread_sync_data *)arg;
|
||||
struct thread_data *td = tsd->td;
|
||||
|
||||
tsd->res = Curl_ipv4_resolve_r(tsd->hostname, tsd->port);
|
||||
|
||||
if(!tsd->res) {
|
||||
tsd->sock_error = SOCKERRNO;
|
||||
if(tsd->sock_error == 0)
|
||||
tsd->sock_error = RESOLVER_ENOMEM;
|
||||
}
|
||||
|
||||
Curl_mutex_acquire(tsd->mtx);
|
||||
if(tsd->done) {
|
||||
/* too late, gotta clean up the mess */
|
||||
Curl_mutex_release(tsd->mtx);
|
||||
destroy_thread_sync_data(tsd);
|
||||
free(td);
|
||||
}
|
||||
else {
|
||||
tsd->done = 1;
|
||||
Curl_mutex_release(tsd->mtx);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* HAVE_GETADDRINFO */
|
||||
|
||||
/*
|
||||
* destroy_async_data() cleans up async resolver data and thread handle.
|
||||
*/
|
||||
static void destroy_async_data (struct Curl_async *async)
|
||||
{
|
||||
if(async->os_specific) {
|
||||
struct thread_data *td = (struct thread_data*) async->os_specific;
|
||||
int done;
|
||||
|
||||
/*
|
||||
* if the thread is still blocking in the resolve syscall, detach it and
|
||||
* let the thread do the cleanup...
|
||||
*/
|
||||
Curl_mutex_acquire(td->tsd.mtx);
|
||||
done = td->tsd.done;
|
||||
td->tsd.done = 1;
|
||||
Curl_mutex_release(td->tsd.mtx);
|
||||
|
||||
if(!done) {
|
||||
Curl_thread_destroy(td->thread_hnd);
|
||||
}
|
||||
else {
|
||||
if(td->thread_hnd != curl_thread_t_null)
|
||||
Curl_thread_join(&td->thread_hnd);
|
||||
|
||||
destroy_thread_sync_data(&td->tsd);
|
||||
|
||||
free(async->os_specific);
|
||||
}
|
||||
}
|
||||
async->os_specific = NULL;
|
||||
|
||||
free(async->hostname);
|
||||
async->hostname = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* init_resolve_thread() starts a new thread that performs the actual
|
||||
* resolve. This function returns before the resolve is done.
|
||||
*
|
||||
* Returns FALSE in case of failure, otherwise TRUE.
|
||||
*/
|
||||
static bool init_resolve_thread (struct connectdata *conn,
|
||||
const char *hostname, int port,
|
||||
const struct addrinfo *hints)
|
||||
{
|
||||
struct thread_data *td = calloc(1, sizeof(struct thread_data));
|
||||
int err = RESOLVER_ENOMEM;
|
||||
|
||||
conn->async.os_specific = (void*) td;
|
||||
if(!td)
|
||||
goto err_exit;
|
||||
|
||||
conn->async.port = port;
|
||||
conn->async.done = FALSE;
|
||||
conn->async.status = 0;
|
||||
conn->async.dns = NULL;
|
||||
td->thread_hnd = curl_thread_t_null;
|
||||
|
||||
if(!init_thread_sync_data(td, hostname, port, hints))
|
||||
goto err_exit;
|
||||
|
||||
free(conn->async.hostname);
|
||||
conn->async.hostname = strdup(hostname);
|
||||
if(!conn->async.hostname)
|
||||
goto err_exit;
|
||||
|
||||
#ifdef HAVE_GETADDRINFO
|
||||
td->thread_hnd = Curl_thread_create(getaddrinfo_thread, &td->tsd);
|
||||
#else
|
||||
td->thread_hnd = Curl_thread_create(gethostbyname_thread, &td->tsd);
|
||||
#endif
|
||||
|
||||
if(!td->thread_hnd) {
|
||||
#ifndef _WIN32_WCE
|
||||
err = errno;
|
||||
#endif
|
||||
goto err_exit;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
||||
err_exit:
|
||||
destroy_async_data(&conn->async);
|
||||
|
||||
SET_ERRNO(err);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* resolver_error() calls failf() with the appropriate message after a resolve
|
||||
* error
|
||||
*/
|
||||
|
||||
static CURLcode resolver_error(struct connectdata *conn)
|
||||
{
|
||||
const char *host_or_proxy;
|
||||
CURLcode result;
|
||||
|
||||
if(conn->bits.httpproxy) {
|
||||
host_or_proxy = "proxy";
|
||||
result = CURLE_COULDNT_RESOLVE_PROXY;
|
||||
}
|
||||
else {
|
||||
host_or_proxy = "host";
|
||||
result = CURLE_COULDNT_RESOLVE_HOST;
|
||||
}
|
||||
|
||||
failf(conn->data, "Could not resolve %s: %s", host_or_proxy,
|
||||
conn->async.hostname);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_resolver_wait_resolv()
|
||||
*
|
||||
* waits for a resolve to finish. This function should be avoided since using
|
||||
* this risk getting the multi interface to "hang".
|
||||
*
|
||||
* If 'entry' is non-NULL, make it point to the resolved dns entry
|
||||
*
|
||||
* This is the version for resolves-in-a-thread.
|
||||
*/
|
||||
CURLcode Curl_resolver_wait_resolv(struct connectdata *conn,
|
||||
struct Curl_dns_entry **entry)
|
||||
{
|
||||
struct thread_data *td = (struct thread_data*) conn->async.os_specific;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
DEBUGASSERT(conn && td);
|
||||
|
||||
/* wait for the thread to resolve the name */
|
||||
if(Curl_thread_join(&td->thread_hnd))
|
||||
result = getaddrinfo_complete(conn);
|
||||
else
|
||||
DEBUGASSERT(0);
|
||||
|
||||
conn->async.done = TRUE;
|
||||
|
||||
if(entry)
|
||||
*entry = conn->async.dns;
|
||||
|
||||
if(!conn->async.dns)
|
||||
/* a name was not resolved, report error */
|
||||
result = resolver_error(conn);
|
||||
|
||||
destroy_async_data(&conn->async);
|
||||
|
||||
if(!conn->async.dns)
|
||||
connclose(conn, "asynch resolve failed");
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_resolver_is_resolved() is called repeatedly to check if a previous
|
||||
* name resolve request has completed. It should also make sure to time-out if
|
||||
* the operation seems to take too long.
|
||||
*/
|
||||
CURLcode Curl_resolver_is_resolved(struct connectdata *conn,
|
||||
struct Curl_dns_entry **entry)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct thread_data *td = (struct thread_data*) conn->async.os_specific;
|
||||
int done = 0;
|
||||
|
||||
*entry = NULL;
|
||||
|
||||
if(!td) {
|
||||
DEBUGASSERT(td);
|
||||
return CURLE_COULDNT_RESOLVE_HOST;
|
||||
}
|
||||
|
||||
Curl_mutex_acquire(td->tsd.mtx);
|
||||
done = td->tsd.done;
|
||||
Curl_mutex_release(td->tsd.mtx);
|
||||
|
||||
if(done) {
|
||||
getaddrinfo_complete(conn);
|
||||
|
||||
if(!conn->async.dns) {
|
||||
CURLcode result = resolver_error(conn);
|
||||
destroy_async_data(&conn->async);
|
||||
return result;
|
||||
}
|
||||
destroy_async_data(&conn->async);
|
||||
*entry = conn->async.dns;
|
||||
}
|
||||
else {
|
||||
/* poll for name lookup done with exponential backoff up to 250ms */
|
||||
long elapsed = Curl_tvdiff(Curl_tvnow(), data->progress.t_startsingle);
|
||||
if(elapsed < 0)
|
||||
elapsed = 0;
|
||||
|
||||
if(td->poll_interval == 0)
|
||||
/* Start at 1ms poll interval */
|
||||
td->poll_interval = 1;
|
||||
else if(elapsed >= td->interval_end)
|
||||
/* Back-off exponentially if last interval expired */
|
||||
td->poll_interval *= 2;
|
||||
|
||||
if(td->poll_interval > 250)
|
||||
td->poll_interval = 250;
|
||||
|
||||
td->interval_end = elapsed + td->poll_interval;
|
||||
Curl_expire(conn->data, td->poll_interval);
|
||||
}
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
int Curl_resolver_getsock(struct connectdata *conn,
|
||||
curl_socket_t *socks,
|
||||
int numsocks)
|
||||
{
|
||||
(void)conn;
|
||||
(void)socks;
|
||||
(void)numsocks;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef HAVE_GETADDRINFO
|
||||
/*
|
||||
* Curl_getaddrinfo() - for platforms without getaddrinfo
|
||||
*/
|
||||
Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn,
|
||||
const char *hostname,
|
||||
int port,
|
||||
int *waitp)
|
||||
{
|
||||
struct in_addr in;
|
||||
|
||||
*waitp = 0; /* default to synchronous response */
|
||||
|
||||
if(Curl_inet_pton(AF_INET, hostname, &in) > 0)
|
||||
/* This is a dotted IP address 123.123.123.123-style */
|
||||
return Curl_ip2addr(AF_INET, &in, hostname, port);
|
||||
|
||||
/* fire up a new resolver thread! */
|
||||
if(init_resolve_thread(conn, hostname, port, NULL)) {
|
||||
*waitp = 1; /* expect asynchronous response */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* fall-back to blocking version */
|
||||
return Curl_ipv4_resolve_r(hostname, port);
|
||||
}
|
||||
|
||||
#else /* !HAVE_GETADDRINFO */
|
||||
|
||||
/*
|
||||
* Curl_resolver_getaddrinfo() - for getaddrinfo
|
||||
*/
|
||||
Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn,
|
||||
const char *hostname,
|
||||
int port,
|
||||
int *waitp)
|
||||
{
|
||||
struct addrinfo hints;
|
||||
struct in_addr in;
|
||||
Curl_addrinfo *res;
|
||||
int error;
|
||||
char sbuf[12];
|
||||
int pf = PF_INET;
|
||||
#ifdef CURLRES_IPV6
|
||||
struct in6_addr in6;
|
||||
#endif /* CURLRES_IPV6 */
|
||||
|
||||
*waitp = 0; /* default to synchronous response */
|
||||
|
||||
/* First check if this is an IPv4 address string */
|
||||
if(Curl_inet_pton(AF_INET, hostname, &in) > 0)
|
||||
/* This is a dotted IP address 123.123.123.123-style */
|
||||
return Curl_ip2addr(AF_INET, &in, hostname, port);
|
||||
|
||||
#ifdef CURLRES_IPV6
|
||||
/* check if this is an IPv6 address string */
|
||||
if(Curl_inet_pton (AF_INET6, hostname, &in6) > 0)
|
||||
/* This is an IPv6 address literal */
|
||||
return Curl_ip2addr(AF_INET6, &in6, hostname, port);
|
||||
|
||||
/*
|
||||
* Check if a limited name resolve has been requested.
|
||||
*/
|
||||
switch(conn->ip_version) {
|
||||
case CURL_IPRESOLVE_V4:
|
||||
pf = PF_INET;
|
||||
break;
|
||||
case CURL_IPRESOLVE_V6:
|
||||
pf = PF_INET6;
|
||||
break;
|
||||
default:
|
||||
pf = PF_UNSPEC;
|
||||
break;
|
||||
}
|
||||
|
||||
if((pf != PF_INET) && !Curl_ipv6works())
|
||||
/* The stack seems to be a non-IPv6 one */
|
||||
pf = PF_INET;
|
||||
|
||||
#endif /* CURLRES_IPV6 */
|
||||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_family = pf;
|
||||
hints.ai_socktype = conn->socktype;
|
||||
|
||||
snprintf(sbuf, sizeof(sbuf), "%d", port);
|
||||
|
||||
/* fire up a new resolver thread! */
|
||||
if(init_resolve_thread(conn, hostname, port, &hints)) {
|
||||
*waitp = 1; /* expect asynchronous response */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* fall-back to blocking version */
|
||||
infof(conn->data, "init_resolve_thread() failed for %s; %s\n",
|
||||
hostname, Curl_strerror(conn, ERRNO));
|
||||
|
||||
error = Curl_getaddrinfo_ex(hostname, sbuf, &hints, &res);
|
||||
if(error) {
|
||||
infof(conn->data, "getaddrinfo() failed for %s:%d; %s\n",
|
||||
hostname, port, Curl_strerror(conn, SOCKERRNO));
|
||||
return NULL;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
#endif /* !HAVE_GETADDRINFO */
|
||||
|
||||
CURLcode Curl_set_dns_servers(struct SessionHandle *data,
|
||||
char *servers)
|
||||
{
|
||||
(void)data;
|
||||
(void)servers;
|
||||
return CURLE_NOT_BUILT_IN;
|
||||
|
||||
}
|
||||
|
||||
CURLcode Curl_set_dns_interface(struct SessionHandle *data,
|
||||
const char *interf)
|
||||
{
|
||||
(void)data;
|
||||
(void)interf;
|
||||
return CURLE_NOT_BUILT_IN;
|
||||
}
|
||||
|
||||
CURLcode Curl_set_dns_local_ip4(struct SessionHandle *data,
|
||||
const char *local_ip4)
|
||||
{
|
||||
(void)data;
|
||||
(void)local_ip4;
|
||||
return CURLE_NOT_BUILT_IN;
|
||||
}
|
||||
|
||||
CURLcode Curl_set_dns_local_ip6(struct SessionHandle *data,
|
||||
const char *local_ip6)
|
||||
{
|
||||
(void)data;
|
||||
(void)local_ip6;
|
||||
return CURLE_NOT_BUILT_IN;
|
||||
}
|
||||
|
||||
#endif /* CURLRES_THREADED */
|
|
@ -1,168 +0,0 @@
|
|||
#ifndef HEADER_CURL_ASYN_H
|
||||
#define HEADER_CURL_ASYN_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
#include "curl_addrinfo.h"
|
||||
|
||||
struct addrinfo;
|
||||
struct hostent;
|
||||
struct SessionHandle;
|
||||
struct connectdata;
|
||||
struct Curl_dns_entry;
|
||||
|
||||
/*
|
||||
* This header defines all functions in the internal asynch resolver interface.
|
||||
* All asynch resolvers need to provide these functions.
|
||||
* asyn-ares.c and asyn-thread.c are the current implementations of asynch
|
||||
* resolver backends.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Curl_resolver_global_init()
|
||||
*
|
||||
* Called from curl_global_init() to initialize global resolver environment.
|
||||
* Returning anything else than CURLE_OK fails curl_global_init().
|
||||
*/
|
||||
int Curl_resolver_global_init(void);
|
||||
|
||||
/*
|
||||
* Curl_resolver_global_cleanup()
|
||||
* Called from curl_global_cleanup() to destroy global resolver environment.
|
||||
*/
|
||||
void Curl_resolver_global_cleanup(void);
|
||||
|
||||
/*
|
||||
* Curl_resolver_init()
|
||||
* Called from curl_easy_init() -> Curl_open() to initialize resolver
|
||||
* URL-state specific environment ('resolver' member of the UrlState
|
||||
* structure). Should fill the passed pointer by the initialized handler.
|
||||
* Returning anything else than CURLE_OK fails curl_easy_init() with the
|
||||
* correspondent code.
|
||||
*/
|
||||
CURLcode Curl_resolver_init(void **resolver);
|
||||
|
||||
/*
|
||||
* Curl_resolver_cleanup()
|
||||
* Called from curl_easy_cleanup() -> Curl_close() to cleanup resolver
|
||||
* URL-state specific environment ('resolver' member of the UrlState
|
||||
* structure). Should destroy the handler and free all resources connected to
|
||||
* it.
|
||||
*/
|
||||
void Curl_resolver_cleanup(void *resolver);
|
||||
|
||||
/*
|
||||
* Curl_resolver_duphandle()
|
||||
* Called from curl_easy_duphandle() to duplicate resolver URL-state specific
|
||||
* environment ('resolver' member of the UrlState structure). Should
|
||||
* duplicate the 'from' handle and pass the resulting handle to the 'to'
|
||||
* pointer. Returning anything else than CURLE_OK causes failed
|
||||
* curl_easy_duphandle() call.
|
||||
*/
|
||||
int Curl_resolver_duphandle(void **to, void *from);
|
||||
|
||||
/*
|
||||
* Curl_resolver_cancel().
|
||||
*
|
||||
* It is called from inside other functions to cancel currently performing
|
||||
* resolver request. Should also free any temporary resources allocated to
|
||||
* perform a request.
|
||||
*/
|
||||
void Curl_resolver_cancel(struct connectdata *conn);
|
||||
|
||||
/* Curl_resolver_getsock()
|
||||
*
|
||||
* This function is called from the multi_getsock() function. 'sock' is a
|
||||
* pointer to an array to hold the file descriptors, with 'numsock' being the
|
||||
* size of that array (in number of entries). This function is supposed to
|
||||
* return bitmask indicating what file descriptors (referring to array indexes
|
||||
* in the 'sock' array) to wait for, read/write.
|
||||
*/
|
||||
int Curl_resolver_getsock(struct connectdata *conn, curl_socket_t *sock,
|
||||
int numsocks);
|
||||
|
||||
/*
|
||||
* Curl_resolver_is_resolved()
|
||||
*
|
||||
* Called repeatedly to check if a previous name resolve request has
|
||||
* completed. It should also make sure to time-out if the operation seems to
|
||||
* take too long.
|
||||
*
|
||||
* Returns normal CURLcode errors.
|
||||
*/
|
||||
CURLcode Curl_resolver_is_resolved(struct connectdata *conn,
|
||||
struct Curl_dns_entry **dns);
|
||||
|
||||
/*
|
||||
* Curl_resolver_wait_resolv()
|
||||
*
|
||||
* waits for a resolve to finish. This function should be avoided since using
|
||||
* this risk getting the multi interface to "hang".
|
||||
*
|
||||
* If 'entry' is non-NULL, make it point to the resolved dns entry
|
||||
*
|
||||
* Returns CURLE_COULDNT_RESOLVE_HOST if the host was not resolved, and
|
||||
* CURLE_OPERATION_TIMEDOUT if a time-out occurred.
|
||||
|
||||
*/
|
||||
CURLcode Curl_resolver_wait_resolv(struct connectdata *conn,
|
||||
struct Curl_dns_entry **dnsentry);
|
||||
|
||||
/*
|
||||
* Curl_resolver_getaddrinfo() - when using this resolver
|
||||
*
|
||||
* Returns name information about the given hostname and port number. If
|
||||
* successful, the 'hostent' is returned and the forth argument will point to
|
||||
* memory we need to free after use. That memory *MUST* be freed with
|
||||
* Curl_freeaddrinfo(), nothing else.
|
||||
*
|
||||
* Each resolver backend must of course make sure to return data in the
|
||||
* correct format to comply with this.
|
||||
*/
|
||||
Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn,
|
||||
const char *hostname,
|
||||
int port,
|
||||
int *waitp);
|
||||
|
||||
#ifndef CURLRES_ASYNCH
|
||||
/* convert these functions if an asynch resolver isn't used */
|
||||
#define Curl_resolver_cancel(x) Curl_nop_stmt
|
||||
#define Curl_resolver_is_resolved(x,y) CURLE_COULDNT_RESOLVE_HOST
|
||||
#define Curl_resolver_wait_resolv(x,y) CURLE_COULDNT_RESOLVE_HOST
|
||||
#define Curl_resolver_getsock(x,y,z) 0
|
||||
#define Curl_resolver_duphandle(x,y) CURLE_OK
|
||||
#define Curl_resolver_init(x) CURLE_OK
|
||||
#define Curl_resolver_global_init() CURLE_OK
|
||||
#define Curl_resolver_global_cleanup() Curl_nop_stmt
|
||||
#define Curl_resolver_cleanup(x) Curl_nop_stmt
|
||||
#endif
|
||||
|
||||
#ifdef CURLRES_ASYNCH
|
||||
#define Curl_resolver_asynch() 1
|
||||
#else
|
||||
#define Curl_resolver_asynch() 0
|
||||
#endif
|
||||
|
||||
|
||||
/********** end of generic resolver interface functions *****************/
|
||||
#endif /* HEADER_CURL_ASYN_H */
|
|
@ -1,315 +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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* Base64 encoding/decoding */
|
||||
|
||||
#include "curl_setup.h"
|
||||
#include "urldata.h" /* for the SessionHandle definition */
|
||||
#include "warnless.h"
|
||||
#include "curl_base64.h"
|
||||
#include "non-ascii.h"
|
||||
|
||||
/* The last 3 #include files should be in this order */
|
||||
#include "curl_printf.h"
|
||||
#include "curl_memory.h"
|
||||
#include "memdebug.h"
|
||||
|
||||
/* ---- Base64 Encoding/Decoding Table --- */
|
||||
static const char base64[]=
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
|
||||
/* The Base 64 encoding with an URL and filename safe alphabet, RFC 4648
|
||||
section 5 */
|
||||
static const char base64url[]=
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
|
||||
|
||||
static size_t decodeQuantum(unsigned char *dest, const char *src)
|
||||
{
|
||||
size_t padding = 0;
|
||||
const char *s, *p;
|
||||
unsigned long i, x = 0;
|
||||
|
||||
for(i = 0, s = src; i < 4; i++, s++) {
|
||||
unsigned long v = 0;
|
||||
|
||||
if(*s == '=') {
|
||||
x = (x << 6);
|
||||
padding++;
|
||||
}
|
||||
else {
|
||||
p = base64;
|
||||
|
||||
while(*p && (*p != *s)) {
|
||||
v++;
|
||||
p++;
|
||||
}
|
||||
|
||||
if(*p == *s)
|
||||
x = (x << 6) + v;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(padding < 1)
|
||||
dest[2] = curlx_ultouc(x & 0xFFUL);
|
||||
|
||||
x >>= 8;
|
||||
if(padding < 2)
|
||||
dest[1] = curlx_ultouc(x & 0xFFUL);
|
||||
|
||||
x >>= 8;
|
||||
dest[0] = curlx_ultouc(x & 0xFFUL);
|
||||
|
||||
return 3 - padding;
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_base64_decode()
|
||||
*
|
||||
* Given a base64 NUL-terminated string at src, decode it and return a
|
||||
* pointer in *outptr to a newly allocated memory area holding decoded
|
||||
* data. Size of decoded data is returned in variable pointed by outlen.
|
||||
*
|
||||
* Returns CURLE_OK on success, otherwise specific error code. Function
|
||||
* output shall not be considered valid unless CURLE_OK is returned.
|
||||
*
|
||||
* When decoded data length is 0, returns NULL in *outptr.
|
||||
*
|
||||
* @unittest: 1302
|
||||
*/
|
||||
CURLcode Curl_base64_decode(const char *src,
|
||||
unsigned char **outptr, size_t *outlen)
|
||||
{
|
||||
size_t srclen = 0;
|
||||
size_t length = 0;
|
||||
size_t padding = 0;
|
||||
size_t i;
|
||||
size_t numQuantums;
|
||||
size_t rawlen = 0;
|
||||
unsigned char *pos;
|
||||
unsigned char *newstr;
|
||||
|
||||
*outptr = NULL;
|
||||
*outlen = 0;
|
||||
srclen = strlen(src);
|
||||
|
||||
/* Check the length of the input string is valid */
|
||||
if(!srclen || srclen % 4)
|
||||
return CURLE_BAD_CONTENT_ENCODING;
|
||||
|
||||
/* Find the position of any = padding characters */
|
||||
while((src[length] != '=') && src[length])
|
||||
length++;
|
||||
|
||||
/* A maximum of two = padding characters is allowed */
|
||||
if(src[length] == '=') {
|
||||
padding++;
|
||||
if(src[length + 1] == '=')
|
||||
padding++;
|
||||
}
|
||||
|
||||
/* Check the = padding characters weren't part way through the input */
|
||||
if(length + padding != srclen)
|
||||
return CURLE_BAD_CONTENT_ENCODING;
|
||||
|
||||
/* Calculate the number of quantums */
|
||||
numQuantums = srclen / 4;
|
||||
|
||||
/* Calculate the size of the decoded string */
|
||||
rawlen = (numQuantums * 3) - padding;
|
||||
|
||||
/* Allocate our buffer including room for a zero terminator */
|
||||
newstr = malloc(rawlen + 1);
|
||||
if(!newstr)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
pos = newstr;
|
||||
|
||||
/* Decode the quantums */
|
||||
for(i = 0; i < numQuantums; i++) {
|
||||
size_t result = decodeQuantum(pos, src);
|
||||
if(!result) {
|
||||
free(newstr);
|
||||
|
||||
return CURLE_BAD_CONTENT_ENCODING;
|
||||
}
|
||||
|
||||
pos += result;
|
||||
src += 4;
|
||||
}
|
||||
|
||||
/* Zero terminate */
|
||||
*pos = '\0';
|
||||
|
||||
/* Return the decoded data */
|
||||
*outptr = newstr;
|
||||
*outlen = rawlen;
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static CURLcode base64_encode(const char *table64,
|
||||
struct SessionHandle *data,
|
||||
const char *inputbuff, size_t insize,
|
||||
char **outptr, size_t *outlen)
|
||||
{
|
||||
CURLcode result;
|
||||
unsigned char ibuf[3];
|
||||
unsigned char obuf[4];
|
||||
int i;
|
||||
int inputparts;
|
||||
char *output;
|
||||
char *base64data;
|
||||
char *convbuf = NULL;
|
||||
|
||||
const char *indata = inputbuff;
|
||||
|
||||
*outptr = NULL;
|
||||
*outlen = 0;
|
||||
|
||||
if(!insize)
|
||||
insize = strlen(indata);
|
||||
|
||||
base64data = output = malloc(insize * 4 / 3 + 4);
|
||||
if(!output)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
/*
|
||||
* The base64 data needs to be created using the network encoding
|
||||
* not the host encoding. And we can't change the actual input
|
||||
* so we copy it to a buffer, translate it, and use that instead.
|
||||
*/
|
||||
result = Curl_convert_clone(data, indata, insize, &convbuf);
|
||||
if(result) {
|
||||
free(output);
|
||||
return result;
|
||||
}
|
||||
|
||||
if(convbuf)
|
||||
indata = (char *)convbuf;
|
||||
|
||||
while(insize > 0) {
|
||||
for(i = inputparts = 0; i < 3; i++) {
|
||||
if(insize > 0) {
|
||||
inputparts++;
|
||||
ibuf[i] = (unsigned char) *indata;
|
||||
indata++;
|
||||
insize--;
|
||||
}
|
||||
else
|
||||
ibuf[i] = 0;
|
||||
}
|
||||
|
||||
obuf[0] = (unsigned char) ((ibuf[0] & 0xFC) >> 2);
|
||||
obuf[1] = (unsigned char) (((ibuf[0] & 0x03) << 4) | \
|
||||
((ibuf[1] & 0xF0) >> 4));
|
||||
obuf[2] = (unsigned char) (((ibuf[1] & 0x0F) << 2) | \
|
||||
((ibuf[2] & 0xC0) >> 6));
|
||||
obuf[3] = (unsigned char) (ibuf[2] & 0x3F);
|
||||
|
||||
switch(inputparts) {
|
||||
case 1: /* only one byte read */
|
||||
snprintf(output, 5, "%c%c==",
|
||||
table64[obuf[0]],
|
||||
table64[obuf[1]]);
|
||||
break;
|
||||
|
||||
case 2: /* two bytes read */
|
||||
snprintf(output, 5, "%c%c%c=",
|
||||
table64[obuf[0]],
|
||||
table64[obuf[1]],
|
||||
table64[obuf[2]]);
|
||||
break;
|
||||
|
||||
default:
|
||||
snprintf(output, 5, "%c%c%c%c",
|
||||
table64[obuf[0]],
|
||||
table64[obuf[1]],
|
||||
table64[obuf[2]],
|
||||
table64[obuf[3]]);
|
||||
break;
|
||||
}
|
||||
output += 4;
|
||||
}
|
||||
|
||||
/* Zero terminate */
|
||||
*output = '\0';
|
||||
|
||||
/* Return the pointer to the new data (allocated memory) */
|
||||
*outptr = base64data;
|
||||
|
||||
free(convbuf);
|
||||
|
||||
/* Return the length of the new data */
|
||||
*outlen = strlen(base64data);
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_base64_encode()
|
||||
*
|
||||
* Given a pointer to an input buffer and an input size, encode it and
|
||||
* return a pointer in *outptr to a newly allocated memory area holding
|
||||
* encoded data. Size of encoded data is returned in variable pointed by
|
||||
* outlen.
|
||||
*
|
||||
* Input length of 0 indicates input buffer holds a NUL-terminated string.
|
||||
*
|
||||
* Returns CURLE_OK on success, otherwise specific error code. Function
|
||||
* output shall not be considered valid unless CURLE_OK is returned.
|
||||
*
|
||||
* When encoded data length is 0, returns NULL in *outptr.
|
||||
*
|
||||
* @unittest: 1302
|
||||
*/
|
||||
CURLcode Curl_base64_encode(struct SessionHandle *data,
|
||||
const char *inputbuff, size_t insize,
|
||||
char **outptr, size_t *outlen)
|
||||
{
|
||||
return base64_encode(base64, data, inputbuff, insize, outptr, outlen);
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_base64url_encode()
|
||||
*
|
||||
* Given a pointer to an input buffer and an input size, encode it and
|
||||
* return a pointer in *outptr to a newly allocated memory area holding
|
||||
* encoded data. Size of encoded data is returned in variable pointed by
|
||||
* outlen.
|
||||
*
|
||||
* Input length of 0 indicates input buffer holds a NUL-terminated string.
|
||||
*
|
||||
* Returns CURLE_OK on success, otherwise specific error code. Function
|
||||
* output shall not be considered valid unless CURLE_OK is returned.
|
||||
*
|
||||
* When encoded data length is 0, returns NULL in *outptr.
|
||||
*
|
||||
* @unittest: 1302
|
||||
*/
|
||||
CURLcode Curl_base64url_encode(struct SessionHandle *data,
|
||||
const char *inputbuff, size_t insize,
|
||||
char **outptr, size_t *outlen)
|
||||
{
|
||||
return base64_encode(base64url, data, inputbuff, insize, outptr, outlen);
|
||||
}
|
|
@ -1,493 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 2011 - 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.
|
||||
#
|
||||
###########################################################################
|
||||
|
||||
my $max_column = 79;
|
||||
my $indent = 2;
|
||||
|
||||
my $warnings;
|
||||
my $errors;
|
||||
my $supressed; # whitelisted problems
|
||||
my $file;
|
||||
my $dir=".";
|
||||
my $wlist;
|
||||
my $windows_os = $^O eq 'MSWin32' || $^O eq 'msys' || $^O eq 'cygwin';
|
||||
my $verbose;
|
||||
my %whitelist;
|
||||
|
||||
my %warnings = (
|
||||
'LONGLINE' => "Line longer than $max_column",
|
||||
'TABS' => 'TAB characters not allowed',
|
||||
'TRAILINGSPACE' => 'Trailing white space on the line',
|
||||
'CPPCOMMENTS' => '// comment detected',
|
||||
'SPACEBEFOREPAREN' => 'space before an open parenthesis',
|
||||
'SPACEAFTERPAREN' => 'space after open parenthesis',
|
||||
'SPACEBEFORECLOSE' => 'space before a close parenthesis',
|
||||
'SPACEBEFORECOMMA' => 'space before a comma',
|
||||
'RETURNNOSPACE' => 'return without space',
|
||||
'COMMANOSPACE' => 'comma without following space',
|
||||
'BRACEELSE' => '} else on the same line',
|
||||
'PARENBRACE' => '){ without sufficient space',
|
||||
'SPACESEMILCOLON' => 'space before semicolon',
|
||||
'BANNEDFUNC' => 'a banned function was used',
|
||||
'FOPENMODE' => 'fopen needs a macro for the mode string',
|
||||
'BRACEPOS' => 'wrong position for an open brace',
|
||||
'INDENTATION' => 'wrong start column for code',
|
||||
'COPYRIGHT' => 'file missing a copyright statement',
|
||||
'BADCOMMAND' => 'bad !checksrc! instruction',
|
||||
'UNUSEDIGNORE' => 'a warning ignore was not used',
|
||||
'OPENCOMMENT' => 'file ended with a /* comment still "open"'
|
||||
);
|
||||
|
||||
sub readwhitelist {
|
||||
open(W, "<$dir/checksrc.whitelist");
|
||||
my @all=<W>;
|
||||
for(@all) {
|
||||
$windows_os ? $_ =~ s/\r?\n$// : chomp;
|
||||
$whitelist{$_}=1;
|
||||
}
|
||||
close(W);
|
||||
}
|
||||
|
||||
sub checkwarn {
|
||||
my ($name, $num, $col, $file, $line, $msg, $error) = @_;
|
||||
|
||||
my $w=$error?"error":"warning";
|
||||
my $nowarn=0;
|
||||
|
||||
#if(!$warnings{$name}) {
|
||||
# print STDERR "Dev! there's no description for $name!\n";
|
||||
#}
|
||||
|
||||
# checksrc.whitelist
|
||||
if($whitelist{$line}) {
|
||||
$nowarn = 1;
|
||||
}
|
||||
# !checksrc! controlled
|
||||
elsif($ignore{$name}) {
|
||||
$ignore{$name}--;
|
||||
$ignore_used{$name}++;
|
||||
$nowarn = 1;
|
||||
if(!$ignore{$name}) {
|
||||
# reached zero, enable again
|
||||
enable_warn($name, $line, $file, $l);
|
||||
}
|
||||
}
|
||||
|
||||
if($nowarn) {
|
||||
$supressed++;
|
||||
if($w) {
|
||||
$swarnings++;
|
||||
}
|
||||
else {
|
||||
$serrors++;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if($w) {
|
||||
$warnings++;
|
||||
}
|
||||
else {
|
||||
$errors++;
|
||||
}
|
||||
|
||||
$col++;
|
||||
print "$file:$num:$col: $w: $msg ($name)\n";
|
||||
print " $line\n";
|
||||
|
||||
if($col < 80) {
|
||||
my $pref = (' ' x $col);
|
||||
print "${pref}^\n";
|
||||
}
|
||||
}
|
||||
|
||||
$file = shift @ARGV;
|
||||
|
||||
while(1) {
|
||||
|
||||
if($file =~ /-D(.*)/) {
|
||||
$dir = $1;
|
||||
$file = shift @ARGV;
|
||||
next;
|
||||
}
|
||||
elsif($file =~ /-W(.*)/) {
|
||||
$wlist .= " $1 ";
|
||||
$file = shift @ARGV;
|
||||
next;
|
||||
}
|
||||
elsif($file =~ /^(-h|--help)/) {
|
||||
undef $file;
|
||||
last;
|
||||
}
|
||||
|
||||
last;
|
||||
}
|
||||
|
||||
if(!$file) {
|
||||
print "checksrc.pl [option] <file1> [file2] ...\n";
|
||||
print " Options:\n";
|
||||
print " -D[DIR] Directory to prepend file names\n";
|
||||
print " -h Show help output\n";
|
||||
print " -W[file] Whitelist the given file - ignore all its flaws\n";
|
||||
print "\nDetects and warns for these problems:\n";
|
||||
for(sort keys %warnings) {
|
||||
printf (" %-18s: %s\n", $_, $warnings{$_});
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
readwhitelist();
|
||||
|
||||
do {
|
||||
if("$wlist" !~ / $file /) {
|
||||
my $fullname = $file;
|
||||
$fullname = "$dir/$file" if ($fullname !~ '^\.?\.?/');
|
||||
scanfile($fullname);
|
||||
}
|
||||
$file = shift @ARGV;
|
||||
|
||||
} while($file);
|
||||
|
||||
sub checksrc_clear {
|
||||
undef %ignore;
|
||||
undef %ignore_set;
|
||||
undef @ignore_line;
|
||||
}
|
||||
|
||||
sub checksrc_endoffile {
|
||||
my ($file) = @_;
|
||||
for(keys %ignore_set) {
|
||||
if($ignore_set{$_} && !$ignore_used{$_}) {
|
||||
checkwarn("UNUSEDIGNORE", $ignore_set{$_},
|
||||
length($_)+11, $file,
|
||||
$ignore_line[$ignore_set{$_}],
|
||||
"Unused ignore: $_");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub enable_warn {
|
||||
my ($what, $line, $file, $l) = @_;
|
||||
|
||||
# switch it back on, but warn if not triggered!
|
||||
if(!$ignore_used{$what}) {
|
||||
checkwarn("UNUSEDIGNORE",
|
||||
$line, length($what) + 11, $file, $l,
|
||||
"No warning was inhibited!");
|
||||
}
|
||||
$ignore_set{$what}=0;
|
||||
$ignore_used{$what}=0;
|
||||
$ignore{$what}=0;
|
||||
}
|
||||
sub checksrc {
|
||||
my ($cmd, $line, $file, $l) = @_;
|
||||
if($cmd =~ / *([^ ]*) *(.*)/) {
|
||||
my ($enable, $what) = ($1, $2);
|
||||
$what =~ s: *\*/$::; # cut off end of C comment
|
||||
# print "ENABLE $enable WHAT $what\n";
|
||||
if($enable eq "disable") {
|
||||
my ($warn, $scope)=($1, $2);
|
||||
if($what =~ /([^ ]*) +(.*)/) {
|
||||
($warn, $scope)=($1, $2);
|
||||
}
|
||||
else {
|
||||
$warn = $what;
|
||||
$scope = 1;
|
||||
}
|
||||
# print "IGNORE $warn for SCOPE $scope\n";
|
||||
if($scope eq "all") {
|
||||
$scope=999999;
|
||||
}
|
||||
|
||||
if($ignore_set{$warn}) {
|
||||
checkwarn("BADCOMMAND",
|
||||
$line, 0, $file, $l,
|
||||
"$warn already disabled from line $ignore_set{$warn}");
|
||||
}
|
||||
else {
|
||||
$ignore{$warn}=$scope;
|
||||
$ignore_set{$warn}=$line;
|
||||
$ignore_line[$line]=$l;
|
||||
}
|
||||
}
|
||||
elsif($enable eq "enable") {
|
||||
enable_warn($what, $line, $file, $l);
|
||||
}
|
||||
else {
|
||||
checkwarn("BADCOMMAND",
|
||||
$line, 0, $file, $l,
|
||||
"Illegal !checksrc! command");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub scanfile {
|
||||
my ($file) = @_;
|
||||
|
||||
my $line = 1;
|
||||
my $prevl;
|
||||
my $l;
|
||||
open(R, "<$file") || die "failed to open $file";
|
||||
|
||||
my $incomment=0;
|
||||
my $copyright=0;
|
||||
checksrc_clear(); # for file based ignores
|
||||
|
||||
while(<R>) {
|
||||
$windows_os ? $_ =~ s/\r?\n$// : chomp;
|
||||
my $l = $_;
|
||||
my $ol = $l; # keep the unmodified line for error reporting
|
||||
my $column = 0;
|
||||
|
||||
# check for !checksrc! commands
|
||||
if($l =~ /\!checksrc\! (.*)/) {
|
||||
my $cmd = $1;
|
||||
checksrc($cmd, $line, $file, $l)
|
||||
}
|
||||
|
||||
# check for a copyright statement
|
||||
if(!$copyright && ($l =~ /copyright .* \d\d\d\d/i)) {
|
||||
$copyright=1;
|
||||
}
|
||||
|
||||
# detect long lines
|
||||
if(length($l) > $max_column) {
|
||||
checkwarn("LONGLINE", $line, length($l), $file, $l,
|
||||
"Longer than $max_column columns");
|
||||
}
|
||||
# detect TAB characters
|
||||
if($l =~ /^(.*)\t/) {
|
||||
checkwarn("TABS",
|
||||
$line, length($1), $file, $l, "Contains TAB character", 1);
|
||||
}
|
||||
# detect trailing white space
|
||||
if($l =~ /^(.*)[ \t]+\z/) {
|
||||
checkwarn("TRAILINGSPACE",
|
||||
$line, length($1), $file, $l, "Trailing whitespace");
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Above this marker, the checks were done on lines *including*
|
||||
# comments
|
||||
# ------------------------------------------------------------
|
||||
|
||||
# strip off C89 comments
|
||||
|
||||
comment:
|
||||
if(!$incomment) {
|
||||
if($l =~ s/\/\*.*\*\// /g) {
|
||||
# full /* comments */ were removed!
|
||||
}
|
||||
if($l =~ s/\/\*.*//) {
|
||||
# start of /* comment was removed
|
||||
$incomment = 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if($l =~ s/.*\*\///) {
|
||||
# end of comment */ was removed
|
||||
$incomment = 0;
|
||||
goto comment;
|
||||
}
|
||||
else {
|
||||
# still within a comment
|
||||
$l="";
|
||||
}
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Below this marker, the checks were done on lines *without*
|
||||
# comments
|
||||
# ------------------------------------------------------------
|
||||
|
||||
# crude attempt to detect // comments without too many false
|
||||
# positives
|
||||
if($l =~ /^([^"\*]*)[^:"]\/\//) {
|
||||
checkwarn("CPPCOMMENTS",
|
||||
$line, length($1), $file, $l, "\/\/ comment");
|
||||
}
|
||||
|
||||
# check spaces after for/if/while
|
||||
if($l =~ /^(.*)(for|if|while) \(/) {
|
||||
if($1 =~ / *\#/) {
|
||||
# this is a #if, treat it differently
|
||||
}
|
||||
else {
|
||||
checkwarn("SPACEBEFOREPAREN", $line, length($1)+length($2), $file, $l,
|
||||
"$2 with space");
|
||||
}
|
||||
}
|
||||
|
||||
# check spaces after open parentheses
|
||||
if($l =~ /^(.*[a-z])\( /i) {
|
||||
checkwarn("SPACEAFTERPAREN",
|
||||
$line, length($1)+1, $file, $l,
|
||||
"space after open parenthesis");
|
||||
}
|
||||
|
||||
# check spaces before close parentheses, unless it was a space or a
|
||||
# close parenthesis!
|
||||
if($l =~ /(.*[^\) ]) \)/) {
|
||||
checkwarn("SPACEBEFORECLOSE",
|
||||
$line, length($1)+1, $file, $l,
|
||||
"space before close parenthesis");
|
||||
}
|
||||
|
||||
# check spaces before comma!
|
||||
if($l =~ /(.*[^ ]) ,/) {
|
||||
checkwarn("SPACEBEFORECOMMA",
|
||||
$line, length($1)+1, $file, $l,
|
||||
"space before comma");
|
||||
}
|
||||
|
||||
# check for "return(" without space
|
||||
if($l =~ /^(.*)return\(/) {
|
||||
if($1 =~ / *\#/) {
|
||||
# this is a #if, treat it differently
|
||||
}
|
||||
else {
|
||||
checkwarn("RETURNNOSPACE", $line, length($1)+6, $file, $l,
|
||||
"return without space before paren");
|
||||
}
|
||||
}
|
||||
|
||||
# check for comma without space
|
||||
if($l =~ /^(.*),[^ \n]/) {
|
||||
my $pref=$1;
|
||||
my $ign=0;
|
||||
if($pref =~ / *\#/) {
|
||||
# this is a #if, treat it differently
|
||||
$ign=1;
|
||||
}
|
||||
elsif($pref =~ /\/\*/) {
|
||||
# this is a comment
|
||||
$ign=1;
|
||||
}
|
||||
elsif($pref =~ /[\"\']/) {
|
||||
$ign = 1;
|
||||
# There is a quote here, figure out whether the comma is
|
||||
# within a string or '' or not.
|
||||
if($pref =~ /\"/) {
|
||||
# withing a string
|
||||
}
|
||||
elsif($pref =~ /\'$/) {
|
||||
# a single letter
|
||||
}
|
||||
else {
|
||||
$ign = 0;
|
||||
}
|
||||
}
|
||||
if(!$ign) {
|
||||
checkwarn("COMMANOSPACE", $line, length($pref)+1, $file, $l,
|
||||
"comma without following space");
|
||||
}
|
||||
}
|
||||
|
||||
# check for "} else"
|
||||
if($l =~ /^(.*)\} *else/) {
|
||||
checkwarn("BRACEELSE",
|
||||
$line, length($1), $file, $l, "else after closing brace on same line");
|
||||
}
|
||||
# check for "){"
|
||||
if($l =~ /^(.*)\)\{/) {
|
||||
checkwarn("PARENBRACE",
|
||||
$line, length($1)+1, $file, $l, "missing space after close paren");
|
||||
}
|
||||
|
||||
# check for space before the semicolon last in a line
|
||||
if($l =~ /^(.*[^ ].*) ;$/) {
|
||||
checkwarn("SPACESEMILCOLON",
|
||||
$line, length($1), $file, $ol, "space before last semicolon");
|
||||
}
|
||||
|
||||
# scan for use of banned functions
|
||||
if($l =~ /^(.*\W)(sprintf|vsprintf|strcat|strncat|_mbscat|_mbsncat|_tcscat|_tcsncat|wcscat|wcsncat|gets)\s*\(/) {
|
||||
checkwarn("BANNEDFUNC",
|
||||
$line, length($1), $file, $ol,
|
||||
"use of $2 is banned");
|
||||
}
|
||||
|
||||
# scan for use of non-binary fopen without the macro
|
||||
if($l =~ /^(.*\W)fopen\s*\([^,]*, *\"([^"]*)/) {
|
||||
my $mode = $2;
|
||||
if($mode !~ /b/) {
|
||||
checkwarn("FOPENMODE",
|
||||
$line, length($1), $file, $ol,
|
||||
"use of non-binary fopen without FOPEN_* macro: $mode");
|
||||
}
|
||||
}
|
||||
|
||||
# check for open brace first on line but not first column
|
||||
# only alert if previous line ended with a close paren and wasn't a cpp
|
||||
# line
|
||||
if((($prevl =~ /\)\z/) && ($prevl !~ /^ *#/)) && ($l =~ /^( +)\{/)) {
|
||||
checkwarn("BRACEPOS",
|
||||
$line, length($1), $file, $ol, "badly placed open brace");
|
||||
}
|
||||
|
||||
# if the previous line starts with if/while/for AND ends with an open
|
||||
# brace, check that this line is indented $indent more steps, if not
|
||||
# a cpp line
|
||||
if($prevl =~ /^( *)(if|while|for)\(.*\{\z/) {
|
||||
my $first = length($1);
|
||||
|
||||
# this line has some character besides spaces
|
||||
if(($l !~ /^ *#/) && ($l =~ /^( *)[^ ]/)) {
|
||||
my $second = length($1);
|
||||
my $expect = $first+$indent;
|
||||
if($expect != $second) {
|
||||
my $diff = $second - $first;
|
||||
checkwarn("INDENTATION", $line, length($1), $file, $ol,
|
||||
"not indented $indent steps, uses $diff)");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$line++;
|
||||
$prevl = $ol;
|
||||
}
|
||||
|
||||
if(!$copyright) {
|
||||
checkwarn("COPYRIGHT", 1, 0, $file, "", "Missing copyright statement", 1);
|
||||
}
|
||||
if($incomment) {
|
||||
checkwarn("OPENCOMMENT", 1, 0, $file, "", "Missing closing comment", 1);
|
||||
}
|
||||
|
||||
checksrc_endoffile($file);
|
||||
|
||||
close(R);
|
||||
|
||||
}
|
||||
|
||||
|
||||
if($errors || $warnings || $verbose) {
|
||||
printf "checksrc: %d errors and %d warnings\n", $errors, $warnings;
|
||||
if($supressed) {
|
||||
printf "checksrc: %d errors and %d warnings suppressed\n",
|
||||
$serrors,
|
||||
$swarnings;
|
||||
}
|
||||
exit 5; # return failure
|
||||
}
|
|
@ -1,166 +0,0 @@
|
|||
#ifndef HEADER_CURL_CONFIG_AMIGAOS_H
|
||||
#define HEADER_CURL_CONFIG_AMIGAOS_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* ================================================================ */
|
||||
/* Hand crafted config file for AmigaOS */
|
||||
/* ================================================================ */
|
||||
|
||||
#ifdef __AMIGA__ /* Any AmigaOS flavour */
|
||||
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
#define HAVE_CLOSESOCKET_CAMEL 1
|
||||
#define HAVE_ERRNO_H 1
|
||||
#define HAVE_GETHOSTBYADDR 1
|
||||
#define HAVE_INET_ADDR 1
|
||||
#define HAVE_INTTYPES_H 1
|
||||
#define HAVE_IOCTLSOCKET_CAMEL 1
|
||||
#define HAVE_IOCTLSOCKET_CAMEL_FIONBIO 1
|
||||
#define HAVE_LIBCRYPTO 1
|
||||
#define HAVE_LIBSSL 1
|
||||
#define HAVE_LIBZ 1
|
||||
#define HAVE_LONGLONG 1
|
||||
#define HAVE_MALLOC_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define HAVE_NETDB_H 1
|
||||
#define HAVE_NETINET_IN_H 1
|
||||
#define HAVE_NET_IF_H 1
|
||||
#define HAVE_OPENSSL_CRYPTO_H 1
|
||||
#define HAVE_OPENSSL_ERR_H 1
|
||||
#define HAVE_OPENSSL_PEM_H 1
|
||||
#define HAVE_OPENSSL_RSA_H 1
|
||||
#define HAVE_OPENSSL_SSL_H 1
|
||||
#define HAVE_OPENSSL_X509_H 1
|
||||
#define HAVE_PERROR 1
|
||||
#define HAVE_PWD_H 1
|
||||
#define HAVE_RAND_EGD 1
|
||||
#define HAVE_RAND_STATUS 1
|
||||
#define HAVE_SELECT 1
|
||||
#define HAVE_SETJMP_H 1
|
||||
#define HAVE_SGTTY_H 1
|
||||
#define HAVE_SIGNAL 1
|
||||
#define HAVE_SIGNAL_H 1
|
||||
#define HAVE_SIG_ATOMIC_T 1
|
||||
#define HAVE_SOCKET 1
|
||||
#define HAVE_STRCASECMP 1
|
||||
#define HAVE_STRDUP 1
|
||||
#define HAVE_STRFTIME 1
|
||||
#define HAVE_STRICMP 1
|
||||
#define HAVE_STRINGS_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_STRSTR 1
|
||||
#define HAVE_STRUCT_TIMEVAL 1
|
||||
#define HAVE_SYS_PARAM_H 1
|
||||
#define HAVE_SYS_SOCKET_H 1
|
||||
#define HAVE_SYS_SOCKIO_H 1
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_TIME_H 1
|
||||
#define HAVE_UNAME 1
|
||||
#define HAVE_UNISTD_H 1
|
||||
#define HAVE_UTIME 1
|
||||
#define HAVE_UTIME_H 1
|
||||
#define HAVE_WRITABLE_ARGV 1
|
||||
#define HAVE_ZLIB_H 1
|
||||
#define HAVE_SYS_IOCTL_H 1
|
||||
|
||||
#define NEED_MALLOC_H 1
|
||||
|
||||
#define SIZEOF_INT 4
|
||||
#define SIZEOF_SHORT 2
|
||||
#define SIZEOF_SIZE_T 4
|
||||
|
||||
#define USE_MANUAL 1
|
||||
#define USE_OPENSSL 1
|
||||
#define CURL_DISABLE_LDAP 1
|
||||
|
||||
#define OS "AmigaOS"
|
||||
|
||||
#define PACKAGE "curl"
|
||||
#define PACKAGE_BUGREPORT "curl-bug@haxx.se"
|
||||
#define PACKAGE_NAME "curl"
|
||||
#define PACKAGE_STRING "curl -"
|
||||
#define PACKAGE_TARNAME "curl"
|
||||
#define PACKAGE_VERSION "-"
|
||||
#define CURL_CA_BUNDLE "s:curl-ca-bundle.crt"
|
||||
|
||||
#define RETSIGTYPE void
|
||||
#define SELECT_TYPE_ARG1 int
|
||||
#define SELECT_TYPE_ARG234 (fd_set *)
|
||||
#define SELECT_TYPE_ARG5 (struct timeval *)
|
||||
|
||||
#define STDC_HEADERS 1
|
||||
#define TIME_WITH_SYS_TIME 1
|
||||
|
||||
#define in_addr_t int
|
||||
|
||||
#ifndef F_OK
|
||||
# define F_OK 0
|
||||
#endif
|
||||
|
||||
#ifndef O_RDONLY
|
||||
# define O_RDONLY 0x0000
|
||||
#endif
|
||||
|
||||
#ifndef LONG_MAX
|
||||
# define LONG_MAX 0x7fffffffL
|
||||
#endif
|
||||
|
||||
#ifndef LONG_MIN
|
||||
# define LONG_MIN (-0x7fffffffL-1)
|
||||
#endif
|
||||
|
||||
#define HAVE_GETNAMEINFO 1
|
||||
#define GETNAMEINFO_QUAL_ARG1 const
|
||||
#define GETNAMEINFO_TYPE_ARG1 struct sockaddr *
|
||||
#define GETNAMEINFO_TYPE_ARG2 int
|
||||
#define GETNAMEINFO_TYPE_ARG46 size_t
|
||||
#define GETNAMEINFO_TYPE_ARG7 int
|
||||
|
||||
#define HAVE_RECV 1
|
||||
#define RECV_TYPE_ARG1 long
|
||||
#define RECV_TYPE_ARG2 char *
|
||||
#define RECV_TYPE_ARG3 long
|
||||
#define RECV_TYPE_ARG4 long
|
||||
#define RECV_TYPE_RETV long
|
||||
|
||||
#define HAVE_RECVFROM 1
|
||||
#define RECVFROM_TYPE_ARG1 long
|
||||
#define RECVFROM_TYPE_ARG2 char
|
||||
#define RECVFROM_TYPE_ARG3 long
|
||||
#define RECVFROM_TYPE_ARG4 long
|
||||
#define RECVFROM_TYPE_ARG5 struct sockaddr
|
||||
#define RECVFROM_TYPE_ARG6 long
|
||||
#define RECVFROM_TYPE_RETV long
|
||||
|
||||
#define HAVE_SEND 1
|
||||
#define SEND_TYPE_ARG1 int
|
||||
#define SEND_QUAL_ARG2 const
|
||||
#define SEND_TYPE_ARG2 char *
|
||||
#define SEND_TYPE_ARG3 int
|
||||
#define SEND_TYPE_ARG4 int
|
||||
#define SEND_TYPE_RETV int
|
||||
|
||||
#endif /* __AMIGA__ */
|
||||
#endif /* HEADER_CURL_CONFIG_AMIGAOS_H */
|
|
@ -1,181 +0,0 @@
|
|||
#ifndef HEADER_CURL_CONFIG_DOS_H
|
||||
#define HEADER_CURL_CONFIG_DOS_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
/* ================================================================ */
|
||||
/* lib/config-dos.h - Hand crafted config file for DOS */
|
||||
/* ================================================================ */
|
||||
|
||||
#if defined(DJGPP)
|
||||
#define OS "MSDOS/djgpp"
|
||||
#elif defined(__HIGHC__)
|
||||
#define OS "MSDOS/HighC"
|
||||
#elif defined(__WATCOMC__)
|
||||
#define OS "MSDOS/Watcom"
|
||||
#else
|
||||
#define OS "MSDOS/?"
|
||||
#endif
|
||||
|
||||
#define PACKAGE "curl"
|
||||
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
#define HAVE_ERRNO_H 1
|
||||
#define HAVE_FCNTL_H 1
|
||||
#define HAVE_GETADDRINFO 1
|
||||
#define HAVE_GETNAMEINFO 1
|
||||
#define HAVE_GETPROTOBYNAME 1
|
||||
#define HAVE_GETTIMEOFDAY 1
|
||||
#define HAVE_IO_H 1
|
||||
#define HAVE_IOCTL 1
|
||||
#define HAVE_IOCTL_FIONBIO 1
|
||||
#define HAVE_IOCTLSOCKET 1
|
||||
#define HAVE_IOCTLSOCKET_FIONBIO 1
|
||||
#define HAVE_LIMITS_H 1
|
||||
#define HAVE_LOCALE_H 1
|
||||
#define HAVE_LONGLONG 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
#define HAVE_NETDB_H 1
|
||||
#define HAVE_NETINET_IN_H 1
|
||||
#define HAVE_NETINET_TCP_H 1
|
||||
#define HAVE_NET_IF_H 1
|
||||
#define HAVE_PROCESS_H 1
|
||||
#define HAVE_RECV 1
|
||||
#define HAVE_RECVFROM 1
|
||||
#define HAVE_SELECT 1
|
||||
#define HAVE_SEND 1
|
||||
#define HAVE_SETJMP_H 1
|
||||
#define HAVE_SETLOCALE 1
|
||||
#define HAVE_SETMODE 1
|
||||
#define HAVE_SIGNAL 1
|
||||
#define HAVE_SOCKET 1
|
||||
#define HAVE_STRDUP 1
|
||||
#define HAVE_STRICMP 1
|
||||
#define HAVE_STRTOLL 1
|
||||
#define HAVE_STRUCT_TIMEVAL 1
|
||||
#define HAVE_STRUCT_IN6_ADDR 1
|
||||
#define HAVE_SYS_IOCTL_H 1
|
||||
#define HAVE_SYS_SOCKET_H 1
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_TIME_H 1
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
#define NEED_MALLOC_H 1
|
||||
|
||||
#define RETSIGTYPE void
|
||||
#define SIZEOF_INT 4
|
||||
#define SIZEOF_LONG_DOUBLE 16
|
||||
#define SIZEOF_SHORT 2
|
||||
#define SIZEOF_SIZE_T 4
|
||||
#define STDC_HEADERS 1
|
||||
#define TIME_WITH_SYS_TIME 1
|
||||
|
||||
/* Qualifiers for send(), recv(), recvfrom() and getnameinfo(). */
|
||||
|
||||
#define SEND_TYPE_ARG1 int
|
||||
#define SEND_QUAL_ARG2 const
|
||||
#define SEND_TYPE_ARG2 void *
|
||||
#define SEND_TYPE_ARG3 int
|
||||
#define SEND_TYPE_ARG4 int
|
||||
#define SEND_TYPE_RETV int
|
||||
|
||||
#define RECV_TYPE_ARG1 int
|
||||
#define RECV_TYPE_ARG2 void *
|
||||
#define RECV_TYPE_ARG3 int
|
||||
#define RECV_TYPE_ARG4 int
|
||||
#define RECV_TYPE_RETV int
|
||||
|
||||
#define RECVFROM_TYPE_ARG1 int
|
||||
#define RECVFROM_TYPE_ARG2 void
|
||||
#define RECVFROM_TYPE_ARG3 int
|
||||
#define RECVFROM_TYPE_ARG4 int
|
||||
#define RECVFROM_TYPE_ARG5 struct sockaddr
|
||||
#define RECVFROM_TYPE_ARG6 int
|
||||
#define RECVFROM_TYPE_RETV int
|
||||
#define RECVFROM_TYPE_ARG2_IS_VOID 1
|
||||
|
||||
#define GETNAMEINFO_QUAL_ARG1 const
|
||||
#define GETNAMEINFO_TYPE_ARG1 struct sockaddr *
|
||||
#define GETNAMEINFO_TYPE_ARG2 int
|
||||
#define GETNAMEINFO_TYPE_ARG46 int
|
||||
#define GETNAMEINFO_TYPE_ARG7 int
|
||||
|
||||
#define BSD
|
||||
|
||||
/* CURLDEBUG definition enables memory tracking */
|
||||
/* #define CURLDEBUG */
|
||||
|
||||
/* USE_ZLIB on cmd-line */
|
||||
#ifdef USE_ZLIB
|
||||
#define HAVE_ZLIB_H 1
|
||||
#define HAVE_LIBZ 1
|
||||
#endif
|
||||
|
||||
/* USE_OPENSSL on cmd-line */
|
||||
#ifdef USE_OPENSSL
|
||||
#define HAVE_CRYPTO_CLEANUP_ALL_EX_DATA 1
|
||||
#define HAVE_OPENSSL_ENGINE_H 1
|
||||
#define OPENSSL_NO_KRB5 1
|
||||
#endif
|
||||
|
||||
/* to disable LDAP */
|
||||
#define CURL_DISABLE_LDAP 1
|
||||
|
||||
#define in_addr_t u_long
|
||||
|
||||
#if defined(__HIGHC__) || \
|
||||
(defined(__GNUC__) && (__GNUC__ < 4))
|
||||
#define ssize_t int
|
||||
#endif
|
||||
|
||||
#define CURL_CA_BUNDLE getenv("CURL_CA_BUNDLE")
|
||||
|
||||
/* Target HAVE_x section */
|
||||
|
||||
#if defined(DJGPP)
|
||||
#define HAVE_BASENAME 1
|
||||
#define HAVE_STRCASECMP 1
|
||||
#define HAVE_SIGACTION 1
|
||||
#define HAVE_SIGSETJMP 1
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
#define HAVE_TERMIOS_H 1
|
||||
#define HAVE_VARIADIC_MACROS_GCC 1
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
#define HAVE_STRCASECMP 1
|
||||
|
||||
#elif defined(__HIGHC__)
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
#define strerror(e) strerror_s_((e))
|
||||
#endif
|
||||
|
||||
#ifdef MSDOS /* Watt-32 */
|
||||
#define HAVE_CLOSE_S 1
|
||||
#endif
|
||||
|
||||
#undef word
|
||||
#undef byte
|
||||
|
||||
#endif /* HEADER_CURL_CONFIG_DOS_H */
|
||||
|
|
@ -1,125 +0,0 @@
|
|||
#ifndef HEADER_CURL_CONFIG_MAC_H
|
||||
#define HEADER_CURL_CONFIG_MAC_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* =================================================================== */
|
||||
/* Hand crafted config file for Mac OS 9 */
|
||||
/* =================================================================== */
|
||||
/* On Mac OS X you must run configure to generate curl_config.h file */
|
||||
/* =================================================================== */
|
||||
|
||||
#define OS "mac"
|
||||
|
||||
/* Define if you want the built-in manual */
|
||||
#define USE_MANUAL 1
|
||||
|
||||
#define HAVE_ERRNO_H 1
|
||||
#define HAVE_NETINET_IN_H 1
|
||||
#define HAVE_SYS_SOCKET_H 1
|
||||
#define HAVE_SYS_SELECT_H 1
|
||||
#define HAVE_NETDB_H 1
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
#define HAVE_UNISTD_H 1
|
||||
#define HAVE_NET_IF_H 1
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_GETTIMEOFDAY 1
|
||||
#define HAVE_FCNTL_H 1
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
#define HAVE_ALLOCA_H 1
|
||||
#define HAVE_STDLIB_H 1
|
||||
#define HAVE_TIME_H 1
|
||||
#define HAVE_UTIME_H 1
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
#define HAVE_SYS_UTIME_H 1
|
||||
|
||||
#define TIME_WITH_SYS_TIME 1
|
||||
|
||||
#define HAVE_ALARM 1
|
||||
#define HAVE_FTRUNCATE 1
|
||||
#define HAVE_UTIME 1
|
||||
#define HAVE_SETVBUF 1
|
||||
#define HAVE_STRFTIME 1
|
||||
#define HAVE_INET_ADDR 1
|
||||
#define HAVE_MEMCPY 1
|
||||
#define HAVE_SELECT 1
|
||||
#define HAVE_SOCKET 1
|
||||
#define HAVE_STRUCT_TIMEVAL 1
|
||||
|
||||
#define HAVE_SIGACTION 1
|
||||
#define HAVE_SIGNAL_H 1
|
||||
#define HAVE_SIG_ATOMIC_T 1
|
||||
|
||||
#ifdef MACOS_SSL_SUPPORT
|
||||
# define USE_OPENSSL 1
|
||||
#endif
|
||||
|
||||
#define CURL_DISABLE_LDAP 1
|
||||
|
||||
#define HAVE_RAND_STATUS 1
|
||||
#define HAVE_RAND_EGD 1
|
||||
|
||||
#define HAVE_IOCTL 1
|
||||
#define HAVE_IOCTL_FIONBIO 1
|
||||
|
||||
#define RETSIGTYPE void
|
||||
|
||||
#define SIZEOF_INT 4
|
||||
#define SIZEOF_SHORT 2
|
||||
#define SIZEOF_SIZE_T 4
|
||||
|
||||
#define HAVE_GETNAMEINFO 1
|
||||
#define GETNAMEINFO_QUAL_ARG1 const
|
||||
#define GETNAMEINFO_TYPE_ARG1 struct sockaddr *
|
||||
#define GETNAMEINFO_TYPE_ARG2 socklen_t
|
||||
#define GETNAMEINFO_TYPE_ARG46 size_t
|
||||
#define GETNAMEINFO_TYPE_ARG7 int
|
||||
|
||||
#define HAVE_RECV 1
|
||||
#define RECV_TYPE_ARG1 int
|
||||
#define RECV_TYPE_ARG2 void *
|
||||
#define RECV_TYPE_ARG3 size_t
|
||||
#define RECV_TYPE_ARG4 int
|
||||
#define RECV_TYPE_RETV ssize_t
|
||||
|
||||
#define HAVE_RECVFROM 1
|
||||
#define RECVFROM_TYPE_ARG1 int
|
||||
#define RECVFROM_TYPE_ARG2 void
|
||||
#define RECVFROM_TYPE_ARG3 size_t
|
||||
#define RECVFROM_TYPE_ARG4 int
|
||||
#define RECVFROM_TYPE_ARG5 struct sockaddr
|
||||
#define RECVFROM_TYPE_ARG6 int
|
||||
#define RECVFROM_TYPE_RETV ssize_t
|
||||
#define RECVFROM_TYPE_ARG2_IS_VOID 1
|
||||
|
||||
#define HAVE_SEND 1
|
||||
#define SEND_TYPE_ARG1 int
|
||||
#define SEND_QUAL_ARG2 const
|
||||
#define SEND_TYPE_ARG2 void *
|
||||
#define SEND_TYPE_ARG3 size_T
|
||||
#define SEND_TYPE_ARG4 int
|
||||
#define SEND_TYPE_RETV ssize_t
|
||||
|
||||
#define HAVE_EXTRA_STRICMP_H 1
|
||||
#define HAVE_EXTRA_STRDUP_H 1
|
||||
|
||||
#endif /* HEADER_CURL_CONFIG_MAC_H */
|
|
@ -1,563 +0,0 @@
|
|||
#ifndef HEADER_CURL_CONFIG_OS400_H
|
||||
#define HEADER_CURL_CONFIG_OS400_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* ================================================================ */
|
||||
/* Hand crafted config file for OS/400 */
|
||||
/* ================================================================ */
|
||||
|
||||
#pragma enum(int)
|
||||
|
||||
#undef PACKAGE
|
||||
|
||||
/* Version number of this archive. */
|
||||
#undef VERSION
|
||||
|
||||
/* Define if you have the getpass function. */
|
||||
#undef HAVE_GETPASS
|
||||
|
||||
/* Define cpu-machine-OS */
|
||||
#define OS "OS/400"
|
||||
|
||||
/* Define if you have the gethostbyaddr_r() function with 5 arguments */
|
||||
#define HAVE_GETHOSTBYADDR_R_5
|
||||
|
||||
/* Define if you have the gethostbyaddr_r() function with 7 arguments */
|
||||
#undef HAVE_GETHOSTBYADDR_R_7
|
||||
|
||||
/* Define if you have the gethostbyaddr_r() function with 8 arguments */
|
||||
#undef HAVE_GETHOSTBYADDR_R_8
|
||||
|
||||
/* OS400 supports a 3-argument ASCII version of gethostbyaddr_r(), but its
|
||||
* prototype is incompatible with the "standard" one (1st argument is not
|
||||
* const). However, getaddrinfo() is supported (ASCII version defined as
|
||||
* a local wrapper in setup-os400.h) in a threadsafe way: we can then
|
||||
* configure getaddrinfo() as such and get rid of gethostbyname_r() without
|
||||
* loss of threadsafeness. */
|
||||
#undef HAVE_GETHOSTBYNAME_R
|
||||
#undef HAVE_GETHOSTBYNAME_R_3
|
||||
#undef HAVE_GETHOSTBYNAME_R_5
|
||||
#undef HAVE_GETHOSTBYNAME_R_6
|
||||
#define HAVE_GETADDRINFO
|
||||
#define HAVE_GETADDRINFO_THREADSAFE
|
||||
|
||||
/* Define if you need the _REENTRANT define for some functions */
|
||||
#undef NEED_REENTRANT
|
||||
|
||||
/* Define if you have the Kerberos4 libraries (including -ldes) */
|
||||
#undef HAVE_KRB4
|
||||
|
||||
/* Define if you want to enable IPv6 support */
|
||||
#define ENABLE_IPV6
|
||||
|
||||
/* Define if struct sockaddr_in6 has the sin6_scope_id member */
|
||||
#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
|
||||
|
||||
/* Define this to 'int' if ssize_t is not an available typedefed type */
|
||||
#undef ssize_t
|
||||
|
||||
/* Define this as a suitable file to read random data from */
|
||||
#undef RANDOM_FILE
|
||||
|
||||
/* Define this to your Entropy Gathering Daemon socket pathname */
|
||||
#undef EGD_SOCKET
|
||||
|
||||
/* Define to 1 if you have the alarm function. */
|
||||
#define HAVE_ALARM 1
|
||||
|
||||
/* Define if you have the <alloca.h> header file. */
|
||||
#undef HAVE_ALLOCA_H
|
||||
|
||||
/* Define if you have the <arpa/inet.h> header file. */
|
||||
#define HAVE_ARPA_INET_H
|
||||
|
||||
/* Define if you have the `closesocket' function. */
|
||||
#undef HAVE_CLOSESOCKET
|
||||
|
||||
/* Define if you have the <crypto.h> header file. */
|
||||
#undef HAVE_CRYPTO_H
|
||||
|
||||
/* Define if you have the <des.h> header file. */
|
||||
#undef HAVE_DES_H
|
||||
|
||||
/* Define if you have the <errno.h> header file. */
|
||||
#define HAVE_ERRNO_H
|
||||
|
||||
/* Define if you have the <err.h> header file. */
|
||||
#undef HAVE_ERR_H
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#define HAVE_FCNTL_H
|
||||
|
||||
/* Define if you have the `geteuid' function. */
|
||||
#define HAVE_GETEUID
|
||||
|
||||
/* Define if you have the `gethostbyaddr' function. */
|
||||
#define HAVE_GETHOSTBYADDR
|
||||
|
||||
/* Define if you have the `gethostbyaddr_r' function. */
|
||||
#define HAVE_GETHOSTBYADDR_R
|
||||
|
||||
/* Define if you have the `gethostname' function. */
|
||||
#define HAVE_GETHOSTNAME
|
||||
|
||||
/* Define if you have the <getopt.h> header file. */
|
||||
#undef HAVE_GETOPT_H
|
||||
|
||||
/* Define if you have the `getpass_r' function. */
|
||||
#undef HAVE_GETPASS_R
|
||||
|
||||
/* Define if you have the `getpwuid' function. */
|
||||
#define HAVE_GETPWUID
|
||||
|
||||
/* Define if you have the `getservbyname' function. */
|
||||
#define HAVE_GETSERVBYNAME
|
||||
|
||||
/* Define if you have the `gettimeofday' function. */
|
||||
#define HAVE_GETTIMEOFDAY
|
||||
|
||||
/* Define if you have the `timeval' struct. */
|
||||
#define HAVE_STRUCT_TIMEVAL
|
||||
|
||||
/* Define if you have the `inet_addr' function. */
|
||||
#define HAVE_INET_ADDR
|
||||
|
||||
/* Define if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H
|
||||
|
||||
/* Define if you have the <io.h> header file. */
|
||||
#undef HAVE_IO_H
|
||||
|
||||
/* Define if you have the `krb_get_our_ip_for_realm' function. */
|
||||
#undef HAVE_KRB_GET_OUR_IP_FOR_REALM
|
||||
|
||||
/* Define if you have the <krb.h> header file. */
|
||||
#undef HAVE_KRB_H
|
||||
|
||||
/* Define if you have the `crypto' library (-lcrypto). */
|
||||
#undef HAVE_LIBCRYPTO
|
||||
|
||||
/* Define if you have the `nsl' library (-lnsl). */
|
||||
#undef HAVE_LIBNSL
|
||||
|
||||
/* Define if you have the `resolv' library (-lresolv). */
|
||||
#undef HAVE_LIBRESOLV
|
||||
|
||||
/* Define if you have the `resolve' library (-lresolve). */
|
||||
#undef HAVE_LIBRESOLVE
|
||||
|
||||
/* Define if you have the `socket' library (-lsocket). */
|
||||
#undef HAVE_LIBSOCKET
|
||||
|
||||
/* Define if you have the `ssl' library (-lssl). */
|
||||
#undef HAVE_LIBSSL
|
||||
|
||||
/* Define if you have GSS API. */
|
||||
#define HAVE_GSSAPI
|
||||
|
||||
/* Define if you have the GNU gssapi libraries */
|
||||
#undef HAVE_GSSGNU
|
||||
|
||||
/* Define if you have the Heimdal gssapi libraries */
|
||||
#define HAVE_GSSHEIMDAL
|
||||
|
||||
/* Define if you have the MIT gssapi libraries */
|
||||
#undef HAVE_GSSMIT
|
||||
|
||||
/* Define if you have the `ucb' library (-lucb). */
|
||||
#undef HAVE_LIBUCB
|
||||
|
||||
/* Define if you have the `localtime_r' function. */
|
||||
#define HAVE_LOCALTIME_R
|
||||
|
||||
/* Define if you have the <malloc.h> header file. */
|
||||
#define HAVE_MALLOC_H
|
||||
|
||||
/* Define if you need the malloc.h header file even with stdlib.h */
|
||||
/* #define NEED_MALLOC_H 1 */
|
||||
|
||||
/* Define if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define if you have the <netdb.h> header file. */
|
||||
#define HAVE_NETDB_H
|
||||
|
||||
/* Define if you have the <netinet/if_ether.h> header file. */
|
||||
#undef HAVE_NETINET_IF_ETHER_H
|
||||
|
||||
/* Define if you have the <netinet/in.h> header file. */
|
||||
#define HAVE_NETINET_IN_H
|
||||
|
||||
/* Define if you have the <net/if.h> header file. */
|
||||
#define HAVE_NET_IF_H
|
||||
|
||||
/* Define if you have the <openssl/crypto.h> header file. */
|
||||
#undef HAVE_OPENSSL_CRYPTO_H
|
||||
|
||||
/* Define if you have the <openssl/err.h> header file. */
|
||||
#undef HAVE_OPENSSL_ERR_H
|
||||
|
||||
/* Define if you have the <openssl/pem.h> header file. */
|
||||
#undef HAVE_OPENSSL_PEM_H
|
||||
|
||||
/* Define if you have the <openssl/rsa.h> header file. */
|
||||
#undef HAVE_OPENSSL_RSA_H
|
||||
|
||||
/* Define if you have the <openssl/ssl.h> header file. */
|
||||
#undef HAVE_OPENSSL_SSL_H
|
||||
|
||||
/* Define if you have the <openssl/x509.h> header file. */
|
||||
#undef HAVE_OPENSSL_X509_H
|
||||
|
||||
/* Define if you have the <pem.h> header file. */
|
||||
#undef HAVE_PEM_H
|
||||
|
||||
/* Define if you have the `perror' function. */
|
||||
#define HAVE_PERROR
|
||||
|
||||
/* Define if you have the <pwd.h> header file. */
|
||||
#define HAVE_PWD_H
|
||||
|
||||
/* Define if you have the `RAND_egd' function. */
|
||||
#undef HAVE_RAND_EGD
|
||||
|
||||
/* Define if you have the `RAND_screen' function. */
|
||||
#undef HAVE_RAND_SCREEN
|
||||
|
||||
/* Define if you have the `RAND_status' function. */
|
||||
#undef HAVE_RAND_STATUS
|
||||
|
||||
/* Define if you have the <rsa.h> header file. */
|
||||
#undef HAVE_RSA_H
|
||||
|
||||
/* Define if you have the `select' function. */
|
||||
#define HAVE_SELECT
|
||||
|
||||
/* Define if you have the `setvbuf' function. */
|
||||
#define HAVE_SETVBUF
|
||||
|
||||
/* Define if you have the <sgtty.h> header file. */
|
||||
#undef HAVE_SGTTY_H
|
||||
|
||||
/* Define if you have the `sigaction' function. */
|
||||
#define HAVE_SIGACTION
|
||||
|
||||
/* Define if you have the `signal' function. */
|
||||
#undef HAVE_SIGNAL
|
||||
|
||||
/* Define if you have the <signal.h> header file. */
|
||||
#define HAVE_SIGNAL_H
|
||||
|
||||
/* Define if sig_atomic_t is an available typedef. */
|
||||
#define HAVE_SIG_ATOMIC_T
|
||||
|
||||
/* Define if sig_atomic_t is already defined as volatile. */
|
||||
#undef HAVE_SIG_ATOMIC_T_VOLATILE
|
||||
|
||||
/* Define if you have the `socket' function. */
|
||||
#define HAVE_SOCKET
|
||||
|
||||
/* Define if you have the <ssl.h> header file. */
|
||||
#undef HAVE_SSL_H
|
||||
|
||||
/* Define if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H
|
||||
|
||||
|
||||
/* The following define is needed on OS400 to enable strcmpi(), stricmp() and
|
||||
strdup(). */
|
||||
#define __cplusplus__strings__
|
||||
|
||||
/* Define if you have the `strcasecmp' function. */
|
||||
#undef HAVE_STRCASECMP
|
||||
|
||||
/* Define if you have the `strcmpi' function. */
|
||||
#define HAVE_STRCMPI
|
||||
|
||||
/* Define if you have the `stricmp' function. */
|
||||
#define HAVE_STRICMP
|
||||
|
||||
/* Define if you have the `strdup' function. */
|
||||
#define HAVE_STRDUP
|
||||
|
||||
|
||||
/* Define if you have the `strftime' function. */
|
||||
#define HAVE_STRFTIME
|
||||
|
||||
/* Define if you have the <strings.h> header file. */
|
||||
#define HAVE_STRINGS_H
|
||||
|
||||
/* Define if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H
|
||||
|
||||
/* Define if you have the `strlcpy' function. */
|
||||
#undef HAVE_STRLCPY
|
||||
|
||||
/* Define if you have the <stropts.h> header file. */
|
||||
#undef HAVE_STROPTS_H
|
||||
|
||||
/* Define if you have the `strstr' function. */
|
||||
#define HAVE_STRSTR
|
||||
|
||||
/* Define if you have the `strtok_r' function. */
|
||||
#define HAVE_STRTOK_R
|
||||
|
||||
/* Define if you have the `strtoll' function. */
|
||||
#undef HAVE_STRTOLL /* Allows ASCII compile on V5R1. */
|
||||
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
#define HAVE_SYS_PARAM_H
|
||||
|
||||
/* Define if you have the <sys/select.h> header file. */
|
||||
#undef HAVE_SYS_SELECT_H
|
||||
|
||||
/* Define if you have the <sys/socket.h> header file. */
|
||||
#define HAVE_SYS_SOCKET_H
|
||||
|
||||
/* Define if you have the <sys/sockio.h> header file. */
|
||||
#undef HAVE_SYS_SOCKIO_H
|
||||
|
||||
/* Define if you have the <sys/stat.h> header file. */
|
||||
#define HAVE_SYS_STAT_H
|
||||
|
||||
/* Define if you have the <sys/time.h> header file. */
|
||||
#define HAVE_SYS_TIME_H
|
||||
|
||||
/* Define if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define if you have the <sys/un.h> header file. */
|
||||
#define HAVE_SYS_UN_H
|
||||
|
||||
/* Define if you have the <sys/ioctl.h> header file. */
|
||||
#define HAVE_SYS_IOCTL_H
|
||||
|
||||
/* Define if you have the `tcgetattr' function. */
|
||||
#undef HAVE_TCGETATTR
|
||||
|
||||
/* Define if you have the `tcsetattr' function. */
|
||||
#undef HAVE_TCSETATTR
|
||||
|
||||
/* Define if you have the <termios.h> header file. */
|
||||
#undef HAVE_TERMIOS_H
|
||||
|
||||
/* Define if you have the <termio.h> header file. */
|
||||
#undef HAVE_TERMIO_H
|
||||
|
||||
/* Define if you have the <time.h> header file. */
|
||||
#define HAVE_TIME_H
|
||||
|
||||
/* Define if you have the `uname' function. */
|
||||
#undef HAVE_UNAME
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H
|
||||
|
||||
/* Define if you have the <winsock.h> header file. */
|
||||
#undef HAVE_WINSOCK_H
|
||||
|
||||
/* Define if you have the <x509.h> header file. */
|
||||
#undef HAVE_X509_H
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define as the return type of signal handlers (`int' or `void'). */
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* The size of `int', as computed by sizeof. */
|
||||
#define SIZEOF_INT 4
|
||||
|
||||
/* The size of a `long double', as computed by sizeof. */
|
||||
#define SIZEOF_LONG_DOUBLE 8
|
||||
|
||||
/* Define if the compiler supports the 'long long' data type. */
|
||||
#define HAVE_LONGLONG
|
||||
|
||||
/* The size of a `long long', as computed by sizeof. */
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
|
||||
/* The size of `short', as computed by sizeof. */
|
||||
#define SIZEOF_SHORT 2
|
||||
|
||||
/* The size of `size_t', as computed by sizeof. */
|
||||
#define SIZEOF_SIZE_T 8
|
||||
|
||||
/* Whether long long constants must be suffixed by LL. */
|
||||
|
||||
#define HAVE_LL
|
||||
|
||||
/* Define this if you have struct sockaddr_storage */
|
||||
#define HAVE_STRUCT_SOCKADDR_STORAGE
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS
|
||||
|
||||
/* Define if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#define TIME_WITH_SYS_TIME
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
#undef _FILE_OFFSET_BITS
|
||||
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
#define _LARGE_FILES
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
#undef const
|
||||
|
||||
/* type to use in place of in_addr_t if not defined */
|
||||
#define in_addr_t unsigned long
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> does not define. */
|
||||
#undef size_t
|
||||
|
||||
/* Define if you have the ioctl function. */
|
||||
#define HAVE_IOCTL
|
||||
|
||||
/* Define if you have a working ioctl FIONBIO function. */
|
||||
#define HAVE_IOCTL_FIONBIO
|
||||
|
||||
/* Define if you have a working ioctl SIOCGIFADDR function. */
|
||||
#define HAVE_IOCTL_SIOCGIFADDR
|
||||
|
||||
/* To disable LDAP */
|
||||
#undef CURL_DISABLE_LDAP
|
||||
|
||||
/* Definition to make a library symbol externally visible. */
|
||||
#define CURL_EXTERN_SYMBOL
|
||||
|
||||
/* Define if you have the ldap_url_parse procedure. */
|
||||
/* #define HAVE_LDAP_URL_PARSE */ /* Disabled because of an IBM bug. */
|
||||
|
||||
/* Define if you have the getnameinfo function. */
|
||||
/* OS400 has no ASCII version of this procedure: wrapped in setup-os400.h. */
|
||||
#define HAVE_GETNAMEINFO
|
||||
|
||||
/* Define to the type qualifier of arg 1 for getnameinfo. */
|
||||
#define GETNAMEINFO_QUAL_ARG1 const
|
||||
|
||||
/* Define to the type of arg 1 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG1 struct sockaddr *
|
||||
|
||||
/* Define to the type of arg 2 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG2 socklen_t
|
||||
|
||||
/* Define to the type of args 4 and 6 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG46 socklen_t
|
||||
|
||||
/* Define to the type of arg 7 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG7 int
|
||||
|
||||
/* Define if you have the recv function. */
|
||||
#define HAVE_RECV
|
||||
|
||||
/* Define to the type of arg 1 for recv. */
|
||||
#define RECV_TYPE_ARG1 int
|
||||
|
||||
/* Define to the type of arg 2 for recv. */
|
||||
#define RECV_TYPE_ARG2 char *
|
||||
|
||||
/* Define to the type of arg 3 for recv. */
|
||||
#define RECV_TYPE_ARG3 int
|
||||
|
||||
/* Define to the type of arg 4 for recv. */
|
||||
#define RECV_TYPE_ARG4 int
|
||||
|
||||
/* Define to the function return type for recv. */
|
||||
#define RECV_TYPE_RETV int
|
||||
|
||||
/* Define if you have the recvfrom function. */
|
||||
#define HAVE_RECVFROM
|
||||
|
||||
/* Define to the type of arg 1 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG1 int
|
||||
|
||||
/* Define to the type pointed by arg 2 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG2 char
|
||||
|
||||
/* Define to the type of arg 3 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG3 int
|
||||
|
||||
/* Define to the type of arg 4 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG4 int
|
||||
|
||||
/* Define to the type pointed by arg 5 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG5 struct sockaddr
|
||||
|
||||
/* Define to the type pointed by arg 6 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG6 int
|
||||
|
||||
/* Define to the function return type for recvfrom. */
|
||||
#define RECVFROM_TYPE_RETV int
|
||||
|
||||
/* Define if you have the send function. */
|
||||
#define HAVE_SEND
|
||||
|
||||
/* Define to the type of arg 1 for send. */
|
||||
#define SEND_TYPE_ARG1 int
|
||||
|
||||
/* Define to the type qualifier of arg 2 for send. */
|
||||
#define SEND_QUAL_ARG2
|
||||
|
||||
/* Define to the type of arg 2 for send. */
|
||||
#define SEND_TYPE_ARG2 char *
|
||||
|
||||
/* Define to the type of arg 3 for send. */
|
||||
#define SEND_TYPE_ARG3 int
|
||||
|
||||
/* Define to the type of arg 4 for send. */
|
||||
#define SEND_TYPE_ARG4 int
|
||||
|
||||
/* Define to the function return type for send. */
|
||||
#define SEND_TYPE_RETV int
|
||||
|
||||
/* Define to use the GSKit package. */
|
||||
#define USE_GSKIT
|
||||
|
||||
/* Define to use the OS/400 crypto library. */
|
||||
#define USE_OS400CRYPTO
|
||||
|
||||
/* Define to use Unix sockets. */
|
||||
#define USE_UNIX_SOCKETS
|
||||
|
||||
/* Use the system keyring as the default CA bundle. */
|
||||
#define CURL_CA_BUNDLE "/QIBM/UserData/ICSS/Cert/Server/DEFAULT.KDB"
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* ADDITIONAL DEFINITIONS */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* The following must be defined BEFORE system header files inclusion. */
|
||||
|
||||
#define __ptr128 /* No teraspace. */
|
||||
#define qadrt_use_fputc_inline /* Generate fputc() wrapper inline. */
|
||||
#define qadrt_use_fread_inline /* Generate fread() wrapper inline. */
|
||||
#define qadrt_use_fwrite_inline /* Generate fwrite() wrapper inline. */
|
||||
|
||||
#endif /* HEADER_CURL_CONFIG_OS400_H */
|
|
@ -1,513 +0,0 @@
|
|||
#ifndef HEADER_CURL_CONFIG_RISCOS_H
|
||||
#define HEADER_CURL_CONFIG_RISCOS_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* ================================================================ */
|
||||
/* Hand crafted config file for RISC OS */
|
||||
/* ================================================================ */
|
||||
|
||||
/* Name of this package! */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Version number of this archive. */
|
||||
#undef VERSION
|
||||
|
||||
/* Define if you have the getpass function. */
|
||||
#undef HAVE_GETPASS
|
||||
|
||||
/* Define cpu-machine-OS */
|
||||
#define OS "ARM-RISC OS"
|
||||
|
||||
/* Define if you want the built-in manual */
|
||||
#define USE_MANUAL
|
||||
|
||||
/* Define if you have the gethostbyaddr_r() function with 5 arguments */
|
||||
#undef HAVE_GETHOSTBYADDR_R_5
|
||||
|
||||
/* Define if you have the gethostbyaddr_r() function with 7 arguments */
|
||||
#undef HAVE_GETHOSTBYADDR_R_7
|
||||
|
||||
/* Define if you have the gethostbyaddr_r() function with 8 arguments */
|
||||
#undef HAVE_GETHOSTBYADDR_R_8
|
||||
|
||||
/* Define if you have the gethostbyname_r() function with 3 arguments */
|
||||
#undef HAVE_GETHOSTBYNAME_R_3
|
||||
|
||||
/* Define if you have the gethostbyname_r() function with 5 arguments */
|
||||
#undef HAVE_GETHOSTBYNAME_R_5
|
||||
|
||||
/* Define if you have the gethostbyname_r() function with 6 arguments */
|
||||
#undef HAVE_GETHOSTBYNAME_R_6
|
||||
|
||||
/* Define if you need the _REENTRANT define for some functions */
|
||||
#undef NEED_REENTRANT
|
||||
|
||||
/* Define if you have the Kerberos4 libraries (including -ldes) */
|
||||
#undef HAVE_KRB4
|
||||
|
||||
/* Define if you want to enable IPv6 support */
|
||||
#undef ENABLE_IPV6
|
||||
|
||||
/* Define if struct sockaddr_in6 has the sin6_scope_id member */
|
||||
#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
|
||||
|
||||
/* Define this to 'int' if ssize_t is not an available typedefed type */
|
||||
#undef ssize_t
|
||||
|
||||
/* Define this as a suitable file to read random data from */
|
||||
#undef RANDOM_FILE
|
||||
|
||||
/* Define this to your Entropy Gathering Daemon socket pathname */
|
||||
#undef EGD_SOCKET
|
||||
|
||||
/* Define if you want to enable IPv6 support */
|
||||
#undef ENABLE_IPV6
|
||||
|
||||
/* Define if you have the alarm function. */
|
||||
#define HAVE_ALARM
|
||||
|
||||
/* Define if you have the <alloca.h> header file. */
|
||||
#define HAVE_ALLOCA_H
|
||||
|
||||
/* Define if you have the <arpa/inet.h> header file. */
|
||||
#define HAVE_ARPA_INET_H
|
||||
|
||||
/* Define if you have the `closesocket' function. */
|
||||
#undef HAVE_CLOSESOCKET
|
||||
|
||||
/* Define if you have the <crypto.h> header file. */
|
||||
#undef HAVE_CRYPTO_H
|
||||
|
||||
/* Define if you have the <des.h> header file. */
|
||||
#undef HAVE_DES_H
|
||||
|
||||
/* Define if you have the <errno.h> header file. */
|
||||
#define HAVE_ERRNO_H
|
||||
|
||||
/* Define if you have the <err.h> header file. */
|
||||
#undef HAVE_ERR_H
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#define HAVE_FCNTL_H
|
||||
|
||||
/* Define if you have the `ftruncate' function. */
|
||||
#define HAVE_FTRUNCATE
|
||||
|
||||
/* Define if getaddrinfo exists and works */
|
||||
#define HAVE_GETADDRINFO
|
||||
|
||||
/* Define if you have the `geteuid' function. */
|
||||
#undef HAVE_GETEUID
|
||||
|
||||
/* Define if you have the `gethostbyaddr' function. */
|
||||
#define HAVE_GETHOSTBYADDR
|
||||
|
||||
/* Define if you have the `gethostbyaddr_r' function. */
|
||||
#undef HAVE_GETHOSTBYADDR_R
|
||||
|
||||
/* Define if you have the `gethostbyname_r' function. */
|
||||
#undef HAVE_GETHOSTBYNAME_R
|
||||
|
||||
/* Define if you have the `gethostname' function. */
|
||||
#define HAVE_GETHOSTNAME
|
||||
|
||||
/* Define if you have the <getopt.h> header file. */
|
||||
#define HAVE_GETOPT_H
|
||||
|
||||
/* Define if you have the `getpass_r' function. */
|
||||
#undef HAVE_GETPASS_R
|
||||
|
||||
/* Define if you have the `getpwuid' function. */
|
||||
#undef HAVE_GETPWUID
|
||||
|
||||
/* Define if you have the `getservbyname' function. */
|
||||
#undef HAVE_GETSERVBYNAME
|
||||
|
||||
/* Define if you have the `gettimeofday' function. */
|
||||
#define HAVE_GETTIMEOFDAY
|
||||
|
||||
/* Define if you have the `timeval' struct. */
|
||||
#define HAVE_STRUCT_TIMEVAL
|
||||
|
||||
/* Define if you have the `inet_addr' function. */
|
||||
#undef HAVE_INET_ADDR
|
||||
|
||||
/* Define if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H
|
||||
|
||||
/* Define if you have the <io.h> header file. */
|
||||
#undef HAVE_IO_H
|
||||
|
||||
/* Define if you have the `krb_get_our_ip_for_realm' function. */
|
||||
#undef HAVE_KRB_GET_OUR_IP_FOR_REALM
|
||||
|
||||
/* Define if you have the <krb.h> header file. */
|
||||
#undef HAVE_KRB_H
|
||||
|
||||
/* Define if you have the `crypto' library (-lcrypto). */
|
||||
#undef HAVE_LIBCRYPTO
|
||||
|
||||
/* Define if you have the `nsl' library (-lnsl). */
|
||||
#undef HAVE_LIBNSL
|
||||
|
||||
/* Define if you have the `resolv' library (-lresolv). */
|
||||
#undef HAVE_LIBRESOLV
|
||||
|
||||
/* Define if you have the `resolve' library (-lresolve). */
|
||||
#undef HAVE_LIBRESOLVE
|
||||
|
||||
/* Define if you have the `socket' library (-lsocket). */
|
||||
#undef HAVE_LIBSOCKET
|
||||
|
||||
/* Define if you have the `ssl' library (-lssl). */
|
||||
#undef HAVE_LIBSSL
|
||||
|
||||
/* Define if you have the `ucb' library (-lucb). */
|
||||
#undef HAVE_LIBUCB
|
||||
|
||||
/* Define if you have the `localtime_r' function. */
|
||||
#undef HAVE_LOCALTIME_R
|
||||
|
||||
/* Define if you have the <malloc.h> header file. */
|
||||
#define HAVE_MALLOC_H
|
||||
|
||||
/* Define if you need the malloc.h header file even with stdlib.h */
|
||||
/* #define NEED_MALLOC_H 1 */
|
||||
|
||||
/* Define if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define if you have the <netdb.h> header file. */
|
||||
#define HAVE_NETDB_H
|
||||
|
||||
/* Define if you have the <netinet/if_ether.h> header file. */
|
||||
#undef HAVE_NETINET_IF_ETHER_H
|
||||
|
||||
/* Define if you have the <netinet/in.h> header file. */
|
||||
#define HAVE_NETINET_IN_H
|
||||
|
||||
/* Define if you have the <net/if.h> header file. */
|
||||
#define HAVE_NET_IF_H
|
||||
|
||||
/* Define if you have the <openssl/crypto.h> header file. */
|
||||
#undef HAVE_OPENSSL_CRYPTO_H
|
||||
|
||||
/* Define if you have the <openssl/err.h> header file. */
|
||||
#undef HAVE_OPENSSL_ERR_H
|
||||
|
||||
/* Define if you have the <openssl/pem.h> header file. */
|
||||
#undef HAVE_OPENSSL_PEM_H
|
||||
|
||||
/* Define if you have the <openssl/rsa.h> header file. */
|
||||
#undef HAVE_OPENSSL_RSA_H
|
||||
|
||||
/* Define if you have the <openssl/ssl.h> header file. */
|
||||
#undef HAVE_OPENSSL_SSL_H
|
||||
|
||||
/* Define if you have the <openssl/x509.h> header file. */
|
||||
#undef HAVE_OPENSSL_X509_H
|
||||
|
||||
/* Define if you have the <pem.h> header file. */
|
||||
#undef HAVE_PEM_H
|
||||
|
||||
/* Define if you have the `perror' function. */
|
||||
#undef HAVE_PERROR
|
||||
|
||||
/* Define if you have the <pwd.h> header file. */
|
||||
#undef HAVE_PWD_H
|
||||
|
||||
/* Define if you have the `RAND_egd' function. */
|
||||
#undef HAVE_RAND_EGD
|
||||
|
||||
/* Define if you have the `RAND_screen' function. */
|
||||
#undef HAVE_RAND_SCREEN
|
||||
|
||||
/* Define if you have the `RAND_status' function. */
|
||||
#undef HAVE_RAND_STATUS
|
||||
|
||||
/* Define if you have the <rsa.h> header file. */
|
||||
#undef HAVE_RSA_H
|
||||
|
||||
/* Define if you have the `select' function. */
|
||||
#define HAVE_SELECT
|
||||
|
||||
/* Define if you have the `setvbuf' function. */
|
||||
#undef HAVE_SETVBUF
|
||||
|
||||
/* Define if you have the <sgtty.h> header file. */
|
||||
#define HAVE_SGTTY_H
|
||||
|
||||
/* Define if you have the `sigaction' function. */
|
||||
#undef HAVE_SIGACTION
|
||||
|
||||
/* Define if you have the `signal' function. */
|
||||
#define HAVE_SIGNAL
|
||||
|
||||
/* Define if you have the <signal.h> header file. */
|
||||
#define HAVE_SIGNAL_H
|
||||
|
||||
/* Define if sig_atomic_t is an available typedef. */
|
||||
#define HAVE_SIG_ATOMIC_T
|
||||
|
||||
/* Define if sig_atomic_t is already defined as volatile. */
|
||||
#undef HAVE_SIG_ATOMIC_T_VOLATILE
|
||||
|
||||
/* Define if you have the `socket' function. */
|
||||
#define HAVE_SOCKET
|
||||
|
||||
/* Define if you have the <ssl.h> header file. */
|
||||
#undef HAVE_SSL_H
|
||||
|
||||
/* Define if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H
|
||||
|
||||
/* Define if you have the `strcasecmp' function. */
|
||||
#undef HAVE_STRCASECMP
|
||||
|
||||
/* Define if you have the `strcmpi' function. */
|
||||
#undef HAVE_STRCMPI
|
||||
|
||||
/* Define if you have the `strdup' function. */
|
||||
#define HAVE_STRDUP
|
||||
|
||||
/* Define if you have the `strftime' function. */
|
||||
#define HAVE_STRFTIME
|
||||
|
||||
/* Define if you have the `stricmp' function. */
|
||||
#define HAVE_STRICMP
|
||||
|
||||
/* Define if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H
|
||||
|
||||
/* Define if you have the `strlcpy' function. */
|
||||
#undef HAVE_STRLCPY
|
||||
|
||||
/* Define if you have the `strstr' function. */
|
||||
#define HAVE_STRSTR
|
||||
|
||||
/* Define if you have the `strtok_r' function. */
|
||||
#undef HAVE_STRTOK_R
|
||||
|
||||
/* Define if you have the `strtoll' function. */
|
||||
#undef HAVE_STRTOLL
|
||||
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
/* Define if you have the <sys/select.h> header file. */
|
||||
#undef HAVE_SYS_SELECT_H
|
||||
|
||||
/* Define if you have the <sys/socket.h> header file. */
|
||||
#define HAVE_SYS_SOCKET_H
|
||||
|
||||
/* Define if you have the <sys/sockio.h> header file. */
|
||||
#undef HAVE_SYS_SOCKIO_H
|
||||
|
||||
/* Define if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define if you have the <sys/time.h> header file. */
|
||||
#define HAVE_SYS_TIME_H
|
||||
|
||||
/* Define if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define if you have the `tcgetattr' function. */
|
||||
#define HAVE_TCGETATTR
|
||||
|
||||
/* Define if you have the `tcsetattr' function. */
|
||||
#define HAVE_TCSETATTR
|
||||
|
||||
/* Define if you have the <termios.h> header file. */
|
||||
#define HAVE_TERMIOS_H
|
||||
|
||||
/* Define if you have the <termio.h> header file. */
|
||||
#undef HAVE_TERMIO_H
|
||||
|
||||
/* Define if you have the <time.h> header file. */
|
||||
#undef HAVE_TIME_H
|
||||
|
||||
/* Define if you have the `uname' function. */
|
||||
#define HAVE_UNAME
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H
|
||||
|
||||
/* Define if you have the <winsock.h> header file. */
|
||||
#undef HAVE_WINSOCK_H
|
||||
|
||||
/* Define if you have the <x509.h> header file. */
|
||||
#undef HAVE_X509_H
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define as the return type of signal handlers (`int' or `void'). */
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* The size of `int', as computed by sizeof. */
|
||||
#define SIZEOF_INT 4
|
||||
|
||||
/* The size of `long double', as computed by sizeof. */
|
||||
#undef SIZEOF_LONG_DOUBLE
|
||||
|
||||
/* The size of `long long', as computed by sizeof. */
|
||||
#undef SIZEOF_LONG_LONG
|
||||
|
||||
/* The size of `short', as computed by sizeof. */
|
||||
#define SIZEOF_SHORT 2
|
||||
|
||||
/* The size of `size_t', as computed by sizeof. */
|
||||
#define SIZEOF_SIZE_T 4
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#undef TIME_WITH_SYS_TIME
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Define if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
We just want to avoid a redefinition error message. */
|
||||
#ifndef _ALL_SOURCE
|
||||
# undef _ALL_SOURCE
|
||||
#endif
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
#undef _FILE_OFFSET_BITS
|
||||
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
#undef _LARGE_FILES
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
#undef const
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> does not define. */
|
||||
#undef size_t
|
||||
|
||||
/* Define to `int' if <sys/types.h> does not define. */
|
||||
#undef ssize_t
|
||||
|
||||
/* Define if you have the ioctl function. */
|
||||
#define HAVE_IOCTL
|
||||
|
||||
/* Define if you have a working ioctl FIONBIO function. */
|
||||
#define HAVE_IOCTL_FIONBIO
|
||||
|
||||
/* to disable LDAP */
|
||||
#define CURL_DISABLE_LDAP
|
||||
|
||||
/* Define if you have the getnameinfo function. */
|
||||
#define HAVE_GETNAMEINFO 1
|
||||
|
||||
/* Define to the type qualifier of arg 1 for getnameinfo. */
|
||||
#define GETNAMEINFO_QUAL_ARG1 const
|
||||
|
||||
/* Define to the type of arg 1 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG1 struct sockaddr *
|
||||
|
||||
/* Define to the type of arg 2 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG2 socklen_t
|
||||
|
||||
/* Define to the type of args 4 and 6 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG46 size_t
|
||||
|
||||
/* Define to the type of arg 7 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG7 int
|
||||
|
||||
/* Define if you have the recv function. */
|
||||
#define HAVE_RECV 1
|
||||
|
||||
/* Define to the type of arg 1 for recv. */
|
||||
#define RECV_TYPE_ARG1 int
|
||||
|
||||
/* Define to the type of arg 2 for recv. */
|
||||
#define RECV_TYPE_ARG2 void *
|
||||
|
||||
/* Define to the type of arg 3 for recv. */
|
||||
#define RECV_TYPE_ARG3 size_t
|
||||
|
||||
/* Define to the type of arg 4 for recv. */
|
||||
#define RECV_TYPE_ARG4 int
|
||||
|
||||
/* Define to the function return type for recv. */
|
||||
#define RECV_TYPE_RETV ssize_t
|
||||
|
||||
/* Define 1 if you have the recvfrom function. */
|
||||
#define HAVE_RECVFROM 1
|
||||
|
||||
/* Define to the type of arg 1 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG1 int
|
||||
|
||||
/* Define to the type pointed by arg 2 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG2 void
|
||||
|
||||
/* Define if the type pointed by arg 2 for recvfrom is void. */
|
||||
#define RECVFROM_TYPE_ARG2_IS_VOID
|
||||
|
||||
/* Define to the type of arg 3 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG3 size_t
|
||||
|
||||
/* Define to the type of arg 4 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG4 int
|
||||
|
||||
/* Define to the type pointed by arg 5 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG5 struct sockaddr
|
||||
|
||||
/* Define to the type pointed by arg 6 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG6 int
|
||||
|
||||
/* Define to the function return type for recvfrom. */
|
||||
#define RECVFROM_TYPE_RETV ssize_t
|
||||
|
||||
/* Define if you have the send function. */
|
||||
#define HAVE_SEND 1
|
||||
|
||||
/* Define to the type of arg 1 for send. */
|
||||
#define SEND_TYPE_ARG1 int
|
||||
|
||||
/* Define to the type qualifier of arg 2 for send. */
|
||||
#define SEND_QUAL_ARG2 const
|
||||
|
||||
/* Define to the type of arg 2 for send. */
|
||||
#define SEND_TYPE_ARG2 void *
|
||||
|
||||
/* Define to the type of arg 3 for send. */
|
||||
#define SEND_TYPE_ARG3 size_t
|
||||
|
||||
/* Define to the type of arg 4 for send. */
|
||||
#define SEND_TYPE_ARG4 int
|
||||
|
||||
/* Define to the function return type for send. */
|
||||
#define SEND_TYPE_RETV ssize_t
|
||||
|
||||
#endif /* HEADER_CURL_CONFIG_RISCOS_H */
|
|
@ -1,811 +0,0 @@
|
|||
#ifndef HEADER_CURL_CONFIG_SYMBIAN_H
|
||||
#define HEADER_CURL_CONFIG_SYMBIAN_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* ================================================================ */
|
||||
/* Hand crafted config file for Symbian */
|
||||
/* ================================================================ */
|
||||
|
||||
/* Location of default ca bundle */
|
||||
/* #define CURL_CA_BUNDLE "/etc/pki/tls/certs/ca-bundle.crt"*/
|
||||
|
||||
/* Location of default ca path */
|
||||
/* #undef CURL_CA_PATH */
|
||||
|
||||
/* to disable cookies support */
|
||||
/* #undef CURL_DISABLE_COOKIES */
|
||||
|
||||
/* to disable cryptographic authentication */
|
||||
/* #undef CURL_DISABLE_CRYPTO_AUTH */
|
||||
|
||||
/* to disable DICT */
|
||||
/* #undef CURL_DISABLE_DICT */
|
||||
|
||||
/* to disable FILE */
|
||||
/* #undef CURL_DISABLE_FILE */
|
||||
|
||||
/* to disable FTP */
|
||||
/* #undef CURL_DISABLE_FTP */
|
||||
|
||||
/* to disable HTTP */
|
||||
/* #undef CURL_DISABLE_HTTP */
|
||||
|
||||
/* to disable LDAP */
|
||||
#define CURL_DISABLE_LDAP 1
|
||||
|
||||
/* to disable LDAPS */
|
||||
#define CURL_DISABLE_LDAPS 1
|
||||
|
||||
/* to disable TELNET */
|
||||
/* #undef CURL_DISABLE_TELNET */
|
||||
|
||||
/* to disable TFTP */
|
||||
/* #undef CURL_DISABLE_TFTP */
|
||||
|
||||
/* to disable verbose strings */
|
||||
/* #define CURL_DISABLE_VERBOSE_STRINGS 1*/
|
||||
|
||||
/* Definition to make a library symbol externally visible. */
|
||||
/* #undef CURL_EXTERN_SYMBOL */
|
||||
|
||||
/* Use Windows LDAP implementation */
|
||||
/* #undef USE_WIN32_LDAP */
|
||||
|
||||
/* your Entropy Gathering Daemon socket pathname */
|
||||
/* #undef EGD_SOCKET */
|
||||
|
||||
/* Define if you want to enable IPv6 support */
|
||||
#define ENABLE_IPV6 1
|
||||
|
||||
/* Define if struct sockaddr_in6 has the sin6_scope_id member */
|
||||
#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
|
||||
|
||||
/* Define to the type qualifier of arg 1 for getnameinfo. */
|
||||
#define GETNAMEINFO_QUAL_ARG1 const
|
||||
|
||||
/* Define to the type of arg 1 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG1 struct sockaddr *
|
||||
|
||||
/* Define to the type of arg 2 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG2 socklen_t
|
||||
|
||||
/* Define to the type of args 4 and 6 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG46 size_t
|
||||
|
||||
/* Define to the type of arg 7 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG7 int
|
||||
|
||||
/* Define to 1 if you have the <alloca.h> header file. */
|
||||
/*#define HAVE_ALLOCA_H 1*/
|
||||
|
||||
/* Define to 1 if you have the <arpa/inet.h> header file. */
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
|
||||
/* Define to 1 if you have the <arpa/tftp.h> header file. */
|
||||
/*#define HAVE_ARPA_TFTP_H 1*/
|
||||
|
||||
/* Define to 1 if you have the <assert.h> header file. */
|
||||
#define HAVE_ASSERT_H 1
|
||||
|
||||
/* Define to 1 if you have the `basename' function. */
|
||||
/*#define HAVE_BASENAME 1*/
|
||||
|
||||
/* Define to 1 if bool is an available type. */
|
||||
/*#define HAVE_BOOL_T 1*/
|
||||
|
||||
/* Define to 1 if you have the `closesocket' function. */
|
||||
/* #undef HAVE_CLOSESOCKET */
|
||||
|
||||
/* Define to 1 if you have the `CRYPTO_cleanup_all_ex_data' function. */
|
||||
/*#define HAVE_CRYPTO_CLEANUP_ALL_EX_DATA 1*/
|
||||
|
||||
/* Define to 1 if you have the <crypto.h> header file. */
|
||||
/* #undef HAVE_CRYPTO_H */
|
||||
|
||||
/* Define to 1 if you have the <des.h> header file. */
|
||||
/* #undef HAVE_DES_H */
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#define HAVE_DLFCN_H 1
|
||||
|
||||
/* Define to 1 if you have the `ENGINE_load_builtin_engines' function. */
|
||||
/*#define HAVE_ENGINE_LOAD_BUILTIN_ENGINES 1*/
|
||||
|
||||
/* Define to 1 if you have the <errno.h> header file. */
|
||||
#define HAVE_ERRNO_H 1
|
||||
|
||||
/* Define to 1 if you have the <err.h> header file. */
|
||||
#define HAVE_ERR_H 1
|
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#define HAVE_FCNTL_H 1
|
||||
|
||||
/* Define to 1 if you have the fcntl function. */
|
||||
#define HAVE_FCNTL 1
|
||||
|
||||
/* Define to 1 if you have a working fcntl O_NONBLOCK function. */
|
||||
#define HAVE_FCNTL_O_NONBLOCK 1
|
||||
|
||||
/* Define to 1 if you have the `fork' function. */
|
||||
/*#define HAVE_FORK 1*/
|
||||
|
||||
/* Define to 1 if you have the `ftruncate' function. */
|
||||
#define HAVE_FTRUNCATE 1
|
||||
|
||||
/* Define if getaddrinfo exists and works */
|
||||
#define HAVE_GETADDRINFO 1
|
||||
|
||||
/* Define to 1 if you have the `geteuid' function. */
|
||||
#define HAVE_GETEUID 1
|
||||
|
||||
/* Define to 1 if you have the `gethostbyaddr' function. */
|
||||
#define HAVE_GETHOSTBYADDR 1
|
||||
|
||||
/* If you have gethostbyname */
|
||||
#define HAVE_GETHOSTBYNAME 1
|
||||
|
||||
/* Define to 1 if you have the `gethostbyname_r' function. */
|
||||
/* #undef HAVE_GETHOSTBYNAME_R */
|
||||
|
||||
/* gethostbyname_r() takes 3 args */
|
||||
/* #undef HAVE_GETHOSTBYNAME_R_3 */
|
||||
|
||||
/* gethostbyname_r() takes 5 args */
|
||||
/* #undef HAVE_GETHOSTBYNAME_R_5 */
|
||||
|
||||
/* gethostbyname_r() takes 6 args */
|
||||
/* #undef HAVE_GETHOSTBYNAME_R_6 */
|
||||
|
||||
/* Define to 1 if you have the getnameinfo function. */
|
||||
#define HAVE_GETNAMEINFO 1
|
||||
|
||||
/* Define to 1 if you have the `getpass_r' function. */
|
||||
/* #undef HAVE_GETPASS_R */
|
||||
|
||||
/* Define to 1 if you have the `getppid' function. */
|
||||
#define HAVE_GETPPID 1
|
||||
|
||||
/* Define to 1 if you have the `getprotobyname' function. */
|
||||
#define HAVE_GETPROTOBYNAME 1
|
||||
|
||||
/* Define to 1 if you have the `getpwuid' function. */
|
||||
#define HAVE_GETPWUID 1
|
||||
|
||||
/* Define to 1 if you have the `getrlimit' function. */
|
||||
/*#define HAVE_GETRLIMIT 1*/
|
||||
|
||||
/* Define to 1 if you have the `gettimeofday' function. */
|
||||
#define HAVE_GETTIMEOFDAY 1
|
||||
|
||||
/* we have a glibc-style strerror_r() */
|
||||
/* #undef HAVE_GLIBC_STRERROR_R */
|
||||
|
||||
/* Define to 1 if you have the `gmtime_r' function. */
|
||||
#define HAVE_GMTIME_R 1
|
||||
|
||||
/* if you have the gssapi libraries */
|
||||
/* #undef HAVE_GSSAPI */
|
||||
|
||||
/* Define to 1 if you have the <gssapi/gssapi_generic.h> header file. */
|
||||
/* #undef HAVE_GSSAPI_GSSAPI_GENERIC_H */
|
||||
|
||||
/* Define to 1 if you have the <gssapi/gssapi.h> header file. */
|
||||
/* #undef HAVE_GSSAPI_GSSAPI_H */
|
||||
|
||||
/* Define to 1 if you have the <gssapi/gssapi_krb5.h> header file. */
|
||||
/* #undef HAVE_GSSAPI_GSSAPI_KRB5_H */
|
||||
|
||||
/* if you have the GNU gssapi libraries */
|
||||
/* #undef HAVE_GSSGNU */
|
||||
|
||||
/* if you have the Heimdal gssapi libraries */
|
||||
/* #undef HAVE_GSSHEIMDAL */
|
||||
|
||||
/* if you have the MIT gssapi libraries */
|
||||
/* #undef HAVE_GSSMIT */
|
||||
|
||||
/* Define to 1 if you have the `idna_strerror' function. */
|
||||
/*#define HAVE_IDNA_STRERROR 1*/
|
||||
|
||||
/* Define to 1 if you have the `idn_free' function. */
|
||||
/*#define HAVE_IDN_FREE 1*/
|
||||
|
||||
/* Define to 1 if you have the <idn-free.h> header file. */
|
||||
/*#define HAVE_IDN_FREE_H 1*/
|
||||
|
||||
/* Define to 1 if you have the `inet_addr' function. */
|
||||
/*#define HAVE_INET_ADDR 1*/
|
||||
|
||||
/* Define to 1 if you have a IPv6 capable working inet_ntop function. */
|
||||
/*#define HAVE_INET_NTOP 1*/
|
||||
|
||||
/* Define to 1 if you have a IPv6 capable working inet_pton function. */
|
||||
/*#define HAVE_INET_PTON 1*/
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the ioctl function. */
|
||||
#define HAVE_IOCTL 1
|
||||
|
||||
/* Define to 1 if you have a working ioctl FIONBIO function. */
|
||||
#define HAVE_IOCTL_FIONBIO 1
|
||||
|
||||
/* Define to 1 if you have the ioctlsocket function. */
|
||||
/* #undef HAVE_IOCTLSOCKET */
|
||||
|
||||
/* Define to 1 if you have a working ioctlsocket FIONBIO function. */
|
||||
/* #undef HAVE_IOCTLSOCKET_FIONBIO */
|
||||
|
||||
/* Define to 1 if you have the IoctlSocket camel case function. */
|
||||
/* #undef HAVE_IOCTLSOCKET_CAMEL */
|
||||
|
||||
/* Define to 1 if you have a working IoctlSocket camel case FIONBIO
|
||||
function. */
|
||||
/* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */
|
||||
|
||||
/* Define to 1 if you have the <io.h> header file. */
|
||||
/* #undef HAVE_IO_H */
|
||||
|
||||
/* if you have the Kerberos4 libraries (including -ldes) */
|
||||
/* #undef HAVE_KRB4 */
|
||||
|
||||
/* Define to 1 if you have the `krb_get_our_ip_for_realm' function. */
|
||||
/* #undef HAVE_KRB_GET_OUR_IP_FOR_REALM */
|
||||
|
||||
/* Define to 1 if you have the <krb.h> header file. */
|
||||
/* #undef HAVE_KRB_H */
|
||||
|
||||
/* Define to 1 if you have the lber.h header file. */
|
||||
/*#define HAVE_LBER_H 1*/
|
||||
|
||||
/* Define to 1 if you have the ldapssl.h header file. */
|
||||
/* #undef HAVE_LDAPSSL_H */
|
||||
|
||||
/* Define to 1 if you have the ldap.h header file. */
|
||||
/*#define HAVE_LDAP_H 1*/
|
||||
|
||||
/* Use LDAPS implementation */
|
||||
/*#define HAVE_LDAP_SSL 1*/
|
||||
|
||||
/* Define to 1 if you have the ldap_ssl.h header file. */
|
||||
/* #undef HAVE_LDAP_SSL_H */
|
||||
|
||||
/* Define to 1 if you have the `ldap_url_parse' function. */
|
||||
/*#define HAVE_LDAP_URL_PARSE 1*/
|
||||
|
||||
/* Define to 1 if you have the <libgen.h> header file. */
|
||||
/*#define HAVE_LIBGEN_H 1*/
|
||||
|
||||
/* Define to 1 if you have the `idn' library (-lidn). */
|
||||
/*#define HAVE_LIBIDN 1*/
|
||||
|
||||
/* Define to 1 if you have the `resolv' library (-lresolv). */
|
||||
/* #undef HAVE_LIBRESOLV */
|
||||
|
||||
/* Define to 1 if you have the `resolve' library (-lresolve). */
|
||||
/* #undef HAVE_LIBRESOLVE */
|
||||
|
||||
/* Define to 1 if you have the `socket' library (-lsocket). */
|
||||
/* #undef HAVE_LIBSOCKET */
|
||||
|
||||
/* Define to 1 if you have the `ssh2' library (-lssh2). */
|
||||
/*#define HAVE_LIBSSH2 1*/
|
||||
|
||||
/* Define to 1 if you have the <libssh2.h> header file. */
|
||||
/*#define HAVE_LIBSSH2_H 1*/
|
||||
|
||||
/* Define to 1 if you have the `ssl' library (-lssl). */
|
||||
/*#define HAVE_LIBSSL 1*/
|
||||
|
||||
/* Define to 1 if you have the <limits.h> header file. */
|
||||
#define HAVE_LIMITS_H 1
|
||||
|
||||
/* if your compiler supports LL */
|
||||
#define HAVE_LL 1
|
||||
|
||||
/* Define to 1 if you have the <locale.h> header file. */
|
||||
#define HAVE_LOCALE_H 1
|
||||
|
||||
/* Define to 1 if you have the `localtime_r' function. */
|
||||
#define HAVE_LOCALTIME_R 1
|
||||
|
||||
/* Define to 1 if the compiler supports the 'long long' data type. */
|
||||
#define HAVE_LONGLONG 1
|
||||
|
||||
/* Define to 1 if you have the malloc.h header file. */
|
||||
/*#define HAVE_MALLOC_H 1*/
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* Define to 1 if you have the MSG_NOSIGNAL flag. */
|
||||
/*#define HAVE_MSG_NOSIGNAL 1*/
|
||||
|
||||
/* Define to 1 if you have the <netdb.h> header file. */
|
||||
#define HAVE_NETDB_H 1
|
||||
|
||||
/* Define to 1 if you have the <netinet/in.h> header file. */
|
||||
#define HAVE_NETINET_IN_H 1
|
||||
|
||||
/* Define to 1 if you have the <netinet/tcp.h> header file. */
|
||||
/*#define HAVE_NETINET_TCP_H 1*/
|
||||
|
||||
/* Define to 1 if you have the <net/if.h> header file. */
|
||||
#define HAVE_NET_IF_H 1
|
||||
|
||||
/* Define to 1 if NI_WITHSCOPEID exists and works. */
|
||||
/*#define HAVE_NI_WITHSCOPEID 1*/
|
||||
|
||||
/* we have no strerror_r() proto */
|
||||
/* #undef HAVE_NO_STRERROR_R_DECL */
|
||||
|
||||
/* if you have an old MIT gssapi library, lacking GSS_C_NT_HOSTBASED_SERVICE
|
||||
*/
|
||||
/* #undef HAVE_OLD_GSSMIT */
|
||||
|
||||
/* Define to 1 if you have the <openssl/crypto.h> header file. */
|
||||
/*#define HAVE_OPENSSL_CRYPTO_H 1*/
|
||||
|
||||
/* Define to 1 if you have the <openssl/engine.h> header file. */
|
||||
/*#define HAVE_OPENSSL_ENGINE_H 1*/
|
||||
|
||||
/* Define to 1 if you have the <openssl/err.h> header file. */
|
||||
/*#define HAVE_OPENSSL_ERR_H 1*/
|
||||
|
||||
/* Define to 1 if you have the <openssl/pem.h> header file. */
|
||||
/*#define HAVE_OPENSSL_PEM_H 1*/
|
||||
|
||||
/* Define to 1 if you have the <openssl/pkcs12.h> header file. */
|
||||
/*#define HAVE_OPENSSL_PKCS12_H 1*/
|
||||
|
||||
/* Define to 1 if you have the <openssl/rsa.h> header file. */
|
||||
/*#define HAVE_OPENSSL_RSA_H 1*/
|
||||
|
||||
/* Define to 1 if you have the <openssl/ssl.h> header file. */
|
||||
/*#define HAVE_OPENSSL_SSL_H 1*/
|
||||
|
||||
/* Define to 1 if you have the <openssl/x509.h> header file. */
|
||||
/*#define HAVE_OPENSSL_X509_H 1*/
|
||||
|
||||
/* Define to 1 if you have the <pem.h> header file. */
|
||||
/* #undef HAVE_PEM_H */
|
||||
|
||||
/* Define to 1 if you have the `perror' function. */
|
||||
#define HAVE_PERROR 1
|
||||
|
||||
/* Define to 1 if you have the `pipe' function. */
|
||||
#define HAVE_PIPE 1
|
||||
|
||||
/* Define to 1 if you have the `poll' function. */
|
||||
/*#define HAVE_POLL 1*/
|
||||
|
||||
/* If you have a fine poll */
|
||||
/*#define HAVE_POLL_FINE 1*/
|
||||
|
||||
/* Define to 1 if you have the <poll.h> header file. */
|
||||
/*#define HAVE_POLL_H 1*/
|
||||
|
||||
/* we have a POSIX-style strerror_r() */
|
||||
#define HAVE_POSIX_STRERROR_R 1
|
||||
|
||||
/* Define to 1 if you have the <pwd.h> header file. */
|
||||
#define HAVE_PWD_H 1
|
||||
|
||||
/* Define to 1 if you have the `RAND_egd' function. */
|
||||
#define HAVE_RAND_EGD 1
|
||||
|
||||
/* Define to 1 if you have the `RAND_screen' function. */
|
||||
/* #undef HAVE_RAND_SCREEN */
|
||||
|
||||
/* Define to 1 if you have the `RAND_status' function. */
|
||||
/*#define HAVE_RAND_STATUS 1*/
|
||||
|
||||
/* Define to 1 if you have the recv function. */
|
||||
#define HAVE_RECV 1
|
||||
|
||||
/* Define to 1 if you have the recvfrom function. */
|
||||
#define HAVE_RECVFROM 1
|
||||
|
||||
/* Define to 1 if you have the <rsa.h> header file. */
|
||||
/* #undef HAVE_RSA_H */
|
||||
|
||||
/* Define to 1 if you have the select function. */
|
||||
#define HAVE_SELECT 1
|
||||
|
||||
/* Define to 1 if you have the send function. */
|
||||
#define HAVE_SEND 1
|
||||
|
||||
/* Define to 1 if you have the <setjmp.h> header file. */
|
||||
#define HAVE_SETJMP_H 1
|
||||
|
||||
/* Define to 1 if you have the `setlocale' function. */
|
||||
#define HAVE_SETLOCALE 1
|
||||
|
||||
/* Define to 1 if you have the `setmode' function. */
|
||||
/* #undef HAVE_SETMODE */
|
||||
|
||||
/* Define to 1 if you have the `setrlimit' function. */
|
||||
/*#define HAVE_SETRLIMIT 1*/
|
||||
|
||||
/* Define to 1 if you have the setsockopt function. */
|
||||
/* #undef HAVE_SETSOCKOPT */
|
||||
|
||||
/* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */
|
||||
/* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */
|
||||
|
||||
/* Define to 1 if you have the <sgtty.h> header file. */
|
||||
/*#define HAVE_SGTTY_H 1*/
|
||||
|
||||
/* Define to 1 if you have the `sigaction' function. */
|
||||
/*#define HAVE_SIGACTION 1*/
|
||||
|
||||
/* Define to 1 if you have the `siginterrupt' function. */
|
||||
/*#define HAVE_SIGINTERRUPT 1*/
|
||||
|
||||
/* Define to 1 if you have the `signal' function. */
|
||||
/*#define HAVE_SIGNAL 1*/
|
||||
|
||||
/* Define to 1 if you have the <signal.h> header file. */
|
||||
#define HAVE_SIGNAL_H 1
|
||||
|
||||
/* If you have sigsetjmp */
|
||||
/*#define HAVE_SIGSETJMP 1*/
|
||||
|
||||
/* Define to 1 if sig_atomic_t is an available typedef. */
|
||||
/*#define HAVE_SIG_ATOMIC_T 1*/
|
||||
|
||||
/* Define to 1 if sig_atomic_t is already defined as volatile. */
|
||||
/* #undef HAVE_SIG_ATOMIC_T_VOLATILE */
|
||||
|
||||
/* Define to 1 if you have the `socket' function. */
|
||||
#define HAVE_SOCKET 1
|
||||
|
||||
/* Define to 1 if you have the `SSL_get_shutdown' function. */
|
||||
/*#define HAVE_SSL_GET_SHUTDOWN 1*/
|
||||
|
||||
/* Define to 1 if you have the <ssl.h> header file. */
|
||||
/* #undef HAVE_SSL_H */
|
||||
|
||||
/* Define to 1 if you have the <stdbool.h> header file. */
|
||||
#define HAVE_STDBOOL_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdio.h> header file. */
|
||||
#define HAVE_STDIO_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* Define to 1 if you have the `strcasecmp' function. */
|
||||
#define HAVE_STRCASECMP 1
|
||||
|
||||
/* Define to 1 if you have the `strcmpi' function. */
|
||||
/* #undef HAVE_STRCMPI */
|
||||
|
||||
/* Define to 1 if you have the `strdup' function. */
|
||||
#define HAVE_STRDUP 1
|
||||
|
||||
/* Define to 1 if you have the `strerror_r' function. */
|
||||
#define HAVE_STRERROR_R 1
|
||||
|
||||
/* Define to 1 if you have the `stricmp' function. */
|
||||
/* #undef HAVE_STRICMP */
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#define HAVE_STRINGS_H 1
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if you have the `strlcpy' function. */
|
||||
#define HAVE_STRLCPY 1
|
||||
|
||||
/* Define to 1 if you have the `strstr' function. */
|
||||
#define HAVE_STRSTR 1
|
||||
|
||||
/* Define to 1 if you have the `strtok_r' function. */
|
||||
#define HAVE_STRTOK_R 1
|
||||
|
||||
/* Define to 1 if you have the `strtoll' function. */
|
||||
#define HAVE_STRTOLL 1
|
||||
|
||||
/* if struct sockaddr_storage is defined */
|
||||
#define HAVE_STRUCT_SOCKADDR_STORAGE 1
|
||||
|
||||
/* Define to 1 if you have the timeval struct. */
|
||||
#define HAVE_STRUCT_TIMEVAL 1
|
||||
|
||||
/* Define to 1 if you have the <sys/filio.h> header file. */
|
||||
#define HAVE_SYS_FILIO_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/ioctl.h> header file. */
|
||||
#define HAVE_SYS_IOCTL_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/param.h> header file. */
|
||||
#define HAVE_SYS_PARAM_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/poll.h> header file. */
|
||||
/*#define HAVE_SYS_POLL_H 1*/
|
||||
|
||||
/* Define to 1 if you have the <sys/resource.h> header file. */
|
||||
#define HAVE_SYS_RESOURCE_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/select.h> header file. */
|
||||
#define HAVE_SYS_SELECT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/socket.h> header file. */
|
||||
#define HAVE_SYS_SOCKET_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/sockio.h> header file. */
|
||||
#define HAVE_SYS_SOCKIO_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/utime.h> header file. */
|
||||
/* #undef HAVE_SYS_UTIME_H */
|
||||
|
||||
/* Define to 1 if you have the <termios.h> header file. */
|
||||
/*#define HAVE_TERMIOS_H 1*/
|
||||
|
||||
/* Define to 1 if you have the <termio.h> header file. */
|
||||
/*#define HAVE_TERMIO_H 1*/
|
||||
|
||||
/* Define to 1 if you have the <time.h> header file. */
|
||||
#define HAVE_TIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <tld.h> header file. */
|
||||
/*#define HAVE_TLD_H 1*/
|
||||
|
||||
/* Define to 1 if you have the `tld_strerror' function. */
|
||||
/*#define HAVE_TLD_STRERROR 1*/
|
||||
|
||||
/* Define to 1 if you have the `uname' function. */
|
||||
#define HAVE_UNAME 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define to 1 if you have the `utime' function. */
|
||||
#define HAVE_UTIME 1
|
||||
|
||||
/* Define to 1 if you have the <utime.h> header file. */
|
||||
#define HAVE_UTIME_H 1
|
||||
|
||||
/* Define to 1 if compiler supports C99 variadic macro style. */
|
||||
#define HAVE_VARIADIC_MACROS_C99 1
|
||||
|
||||
/* Define to 1 if compiler supports old gcc variadic macro style. */
|
||||
/*#define HAVE_VARIADIC_MACROS_GCC 1*/
|
||||
|
||||
/* Define to 1 if you have the winber.h header file. */
|
||||
/* #undef HAVE_WINBER_H */
|
||||
|
||||
/* Define to 1 if you have the windows.h header file. */
|
||||
/* #undef HAVE_WINDOWS_H */
|
||||
|
||||
/* Define to 1 if you have the winldap.h header file. */
|
||||
/* #undef HAVE_WINLDAP_H */
|
||||
|
||||
/* Define to 1 if you have the winsock2.h header file. */
|
||||
/* #undef HAVE_WINSOCK2_H */
|
||||
|
||||
/* Define to 1 if you have the winsock.h header file. */
|
||||
/* #undef HAVE_WINSOCK_H */
|
||||
|
||||
/* Define this symbol if your OS supports changing the contents of argv */
|
||||
/*#define HAVE_WRITABLE_ARGV 1*/
|
||||
|
||||
/* Define to 1 if you have the ws2tcpip.h header file. */
|
||||
/* #undef HAVE_WS2TCPIP_H */
|
||||
|
||||
/* Define to 1 if you have the <x509.h> header file. */
|
||||
/* #undef HAVE_X509_H */
|
||||
|
||||
/* Define to 1 if you need the lber.h header file even with ldap.h */
|
||||
/* #undef NEED_LBER_H */
|
||||
|
||||
/* Define to 1 if you need the malloc.h header file even with stdlib.h */
|
||||
/* #undef NEED_MALLOC_H */
|
||||
|
||||
/* Define to 1 if _REENTRANT preprocessor symbol must be defined. */
|
||||
/* #undef NEED_REENTRANT */
|
||||
|
||||
/* Define to 1 if _THREAD_SAFE preprocessor symbol must be defined. */
|
||||
/* #undef NEED_THREAD_SAFE */
|
||||
|
||||
/* cpu-machine-OS */
|
||||
#ifdef __WINS__
|
||||
#define OS "i386-pc-epoc32"
|
||||
#elif __MARM__
|
||||
#define OS "arm-unknown-epoc32"
|
||||
#else
|
||||
/* This won't happen on any current Symbian version */
|
||||
#define OS "unknown-unknown-epoc32"
|
||||
#endif
|
||||
|
||||
/* Name of package */
|
||||
/*#define PACKAGE "curl"*/
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
/*#define PACKAGE_BUGREPORT \
|
||||
"a suitable curl mailing list => https://curl.haxx.se/mail/"*/
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
/*#define PACKAGE_NAME "curl"*/
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
/*#define PACKAGE_STRING "curl -"*/
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
/*#define PACKAGE_TARNAME "curl"*/
|
||||
|
||||
/* Define to the version of this package. */
|
||||
/*#define PACKAGE_VERSION "-"*/
|
||||
|
||||
/* a suitable file to read random data from */
|
||||
/*#define RANDOM_FILE "/dev/urandom"*/
|
||||
|
||||
#define RECV_TYPE_ARG1 int
|
||||
#define RECV_TYPE_ARG2 void*
|
||||
#define RECV_TYPE_ARG3 size_t
|
||||
#define RECV_TYPE_ARG4 int
|
||||
#define RECV_TYPE_RETV ssize_t
|
||||
|
||||
#define RECVFROM_TYPE_ARG1 int
|
||||
#define RECVFROM_TYPE_ARG2 void
|
||||
#define RECVFROM_TYPE_ARG3 size_t
|
||||
#define RECVFROM_TYPE_ARG4 int
|
||||
#define RECVFROM_TYPE_ARG5 struct sockaddr
|
||||
#define RECVFROM_TYPE_ARG6 size_t
|
||||
#define RECVFROM_TYPE_RETV ssize_t
|
||||
#define RECVFROM_TYPE_ARG2_IS_VOID 1
|
||||
|
||||
#define SEND_TYPE_ARG1 int
|
||||
#define SEND_QUAL_ARG2 const
|
||||
#define SEND_TYPE_ARG2 void*
|
||||
#define SEND_TYPE_ARG3 size_t
|
||||
#define SEND_TYPE_ARG4 int
|
||||
#define SEND_TYPE_RETV ssize_t
|
||||
|
||||
|
||||
/* Define as the return type of signal handlers (`int' or `void'). */
|
||||
/*#define RETSIGTYPE void*/
|
||||
|
||||
/* Define to the type of arg 1 for `select'. */
|
||||
#define SELECT_TYPE_ARG1 int
|
||||
|
||||
/* Define to the type of args 2, 3 and 4 for `select'. */
|
||||
#define SELECT_TYPE_ARG234 (fd_set *)
|
||||
|
||||
/* Define to the type of arg 5 for `select'. */
|
||||
#define SELECT_TYPE_ARG5 (struct timeval *)
|
||||
|
||||
/* The size of `int', as computed by sizeof. */
|
||||
#define SIZEOF_INT 4
|
||||
|
||||
/* The size of `off_t', as computed by sizeof. */
|
||||
#define SIZEOF_OFF_T 8
|
||||
|
||||
/* The size of `short', as computed by sizeof. */
|
||||
#define SIZEOF_SHORT 2
|
||||
|
||||
/* The size of `size_t', as computed by sizeof. */
|
||||
#define SIZEOF_SIZE_T 4
|
||||
|
||||
/* The size of `time_t', as computed by sizeof. */
|
||||
#define SIZEOF_TIME_T 4
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#define TIME_WITH_SYS_TIME 1
|
||||
|
||||
/* Define if you want to enable c-ares support */
|
||||
/* #undef USE_ARES */
|
||||
|
||||
/* Define to disable non-blocking sockets */
|
||||
/* #undef USE_BLOCKING_SOCKETS */
|
||||
|
||||
/* if GnuTLS is enabled */
|
||||
/* #undef USE_GNUTLS */
|
||||
|
||||
/* if libSSH2 is in use */
|
||||
/*#define USE_LIBSSH2 1*/
|
||||
|
||||
/* If you want to build curl with the built-in manual */
|
||||
/*#define USE_MANUAL 1*/
|
||||
|
||||
/* if NSS is enabled */
|
||||
/* #undef USE_NSS */
|
||||
|
||||
/* to enable SSPI support */
|
||||
/* #undef USE_WINDOWS_SSPI */
|
||||
|
||||
/* Define to 1 if using yaSSL in OpenSSL compatibility mode. */
|
||||
/* #undef USE_YASSLEMUL */
|
||||
|
||||
/* Version number of package */
|
||||
/*#define VERSION "7.18.2-CVS"*/
|
||||
|
||||
/* Define to avoid automatic inclusion of winsock.h */
|
||||
/* #undef WIN32_LEAN_AND_MEAN */
|
||||
|
||||
/* Define to 1 if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
We just want to avoid a redefinition error message. */
|
||||
#ifndef _ALL_SOURCE
|
||||
/* # undef _ALL_SOURCE */
|
||||
#endif
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
/* #undef _LARGE_FILES */
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
/* #undef const */
|
||||
|
||||
/* type to use in place of in_addr_t if not defined */
|
||||
/* #undef in_addr_t */
|
||||
|
||||
/* Define to `__inline__' or `__inline' if that's what the C compiler
|
||||
calls it, or to nothing if 'inline' is not supported under any name. */
|
||||
#ifndef __cplusplus
|
||||
/* #undef inline */
|
||||
#endif
|
||||
|
||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||
/* #undef size_t */
|
||||
|
||||
/* the signed version of size_t */
|
||||
/* #undef ssize_t */
|
||||
|
||||
/* Enabling curl debug mode when building in Symbian debug mode would work */
|
||||
/* except that debug mode introduces new exports that must be frozen. */
|
||||
#ifdef _DEBUG
|
||||
/* #define CURLDEBUG */
|
||||
#endif
|
||||
|
||||
/* sys/cdefs.h fails to define this for WINSCW prior to Symbian OS ver. 9.4 */
|
||||
#ifndef __LONG_LONG_SUPPORTED
|
||||
#define __LONG_LONG_SUPPORTED
|
||||
#endif
|
||||
|
||||
/* Enable appropriate header only when zlib support is enabled */
|
||||
#ifdef HAVE_LIBZ
|
||||
#define HAVE_ZLIB_H 1
|
||||
#endif
|
||||
|
||||
#endif /* HEADER_CURL_CONFIG_SYMBIAN_H */
|
|
@ -1,772 +0,0 @@
|
|||
#ifndef HEADER_CURL_CONFIG_TPF_H
|
||||
#define HEADER_CURL_CONFIG_TPF_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* ================================================================ */
|
||||
/* Hand crafted config file for TPF */
|
||||
/* ================================================================ */
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* FEATURES, FUNCTIONS, and DEFINITIONS */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* NOTE: Refer also to the .mak file for some of the flags below */
|
||||
|
||||
/* to disable cookies support */
|
||||
/* #undef CURL_DISABLE_COOKIES */
|
||||
|
||||
/* to disable cryptographic authentication */
|
||||
/* #undef CURL_DISABLE_CRYPTO_AUTH */
|
||||
|
||||
/* to disable DICT */
|
||||
/* #undef CURL_DISABLE_DICT */
|
||||
|
||||
/* to disable FILE */
|
||||
/* #undef CURL_DISABLE_FILE */
|
||||
|
||||
/* to disable FTP */
|
||||
/* #undef CURL_DISABLE_FTP */
|
||||
|
||||
/* to disable HTTP */
|
||||
/* #undef CURL_DISABLE_HTTP */
|
||||
|
||||
/* to disable LDAP */
|
||||
/* #undef CURL_DISABLE_LDAP */
|
||||
|
||||
/* to disable TELNET */
|
||||
/* #undef CURL_DISABLE_TELNET */
|
||||
|
||||
/* to disable TFTP */
|
||||
/* #undef CURL_DISABLE_TFTP */
|
||||
|
||||
/* to disable verbose strings */
|
||||
/* #undef CURL_DISABLE_VERBOSE_STRINGS */
|
||||
|
||||
/* lber dynamic library file */
|
||||
/* #undef DL_LBER_FILE */
|
||||
|
||||
/* ldap dynamic library file */
|
||||
/* #undef DL_LDAP_FILE */
|
||||
|
||||
/* your Entropy Gathering Daemon socket pathname */
|
||||
/* #undef EGD_SOCKET */
|
||||
|
||||
/* Define if you want to enable IPv6 support */
|
||||
/* #undef ENABLE_IPV6 */
|
||||
|
||||
/* Define if struct sockaddr_in6 has the sin6_scope_id member */
|
||||
/* #undef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID */
|
||||
|
||||
/* Define to the type of arg 1 for getnameinfo. */
|
||||
/* #undef GETNAMEINFO_TYPE_ARG1 */
|
||||
|
||||
/* Define to the type of arg 2 for getnameinfo. */
|
||||
/* #undef GETNAMEINFO_TYPE_ARG2 */
|
||||
|
||||
/* Define to the type of args 4 and 6 for getnameinfo. */
|
||||
/* #undef GETNAMEINFO_TYPE_ARG46 */
|
||||
|
||||
/* Define to the type of arg 7 for getnameinfo. */
|
||||
/* #undef GETNAMEINFO_TYPE_ARG7 */
|
||||
|
||||
/* Define to 1 if you have the alarm function. */
|
||||
#define HAVE_ALARM 1
|
||||
|
||||
/* Define to 1 if you have the <arpa/inet.h> header file. */
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
|
||||
/* Define to 1 if you have the <arpa/tftp.h> header file. */
|
||||
/* #undef HAVE_ARPA_TFTP_H */
|
||||
|
||||
/* Define to 1 if you have the <assert.h> header file. */
|
||||
#define HAVE_ASSERT_H 1
|
||||
|
||||
/* Define to 1 if you have the `basename' function. */
|
||||
#define HAVE_BASENAME 1
|
||||
|
||||
/* Define to 1 if you have the `closesocket' function. */
|
||||
/* #undef HAVE_CLOSESOCKET */
|
||||
|
||||
/* Define to 1 if you have the `CRYPTO_cleanup_all_ex_data' function. */
|
||||
/* #undef HAVE_CRYPTO_CLEANUP_ALL_EX_DATA */
|
||||
#define HAVE_CRYPTO_CLEANUP_ALL_EX_DATA 1
|
||||
|
||||
/* Define to 1 if you have the <crypto.h> header file. */
|
||||
/* #undef HAVE_CRYPTO_H */
|
||||
#define HAVE_CRYPTO_H 1
|
||||
|
||||
/* Define to 1 if you have the <des.h> header file. */
|
||||
/* #undef HAVE_DES_H */
|
||||
#define HAVE_DES_H 1
|
||||
|
||||
/* Define to 1 if you have the `ENGINE_load_builtin_engines' function. */
|
||||
/* #undef HAVE_ENGINE_LOAD_BUILTIN_ENGINES */
|
||||
#define HAVE_ENGINE_LOAD_BUILTIN_ENGINES 1
|
||||
|
||||
/* Define to 1 if you have the <errno.h> header file. */
|
||||
#define HAVE_ERRNO_H 1
|
||||
|
||||
/* Define to 1 if you have the <err.h> header file. */
|
||||
/* #undef HAVE_ERR_H */
|
||||
#define HAVE_ERR_H 1
|
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#define HAVE_FCNTL_H 1
|
||||
|
||||
/* Define to 1 if you have the fcntl function. */
|
||||
#define HAVE_FCNTL 1
|
||||
|
||||
/* Define to 1 if you have a working fcntl O_NONBLOCK function. */
|
||||
#define HAVE_FCNTL_O_NONBLOCK 1
|
||||
|
||||
/* Define to 1 if you have the `fork' function. */
|
||||
/* #undef HAVE_FORK */
|
||||
#define HAVE_FORK 1
|
||||
|
||||
/* Define to 1 if you have the `ftruncate' function. */
|
||||
#define HAVE_FTRUNCATE 1
|
||||
|
||||
/* Define if getaddrinfo exists and works */
|
||||
/* #undef HAVE_GETADDRINFO */
|
||||
|
||||
/* Define to 1 if you have the `geteuid' function. */
|
||||
#define HAVE_GETEUID 1
|
||||
|
||||
/* Define to 1 if you have the `gethostbyaddr' function. */
|
||||
#define HAVE_GETHOSTBYADDR 1
|
||||
|
||||
/* If you have gethostbyname */
|
||||
#define HAVE_GETHOSTBYNAME 1
|
||||
|
||||
/* Define to 1 if you have the `gethostbyname_r' function. */
|
||||
/* #undef HAVE_GETHOSTBYNAME_R */
|
||||
|
||||
/* gethostbyname_r() takes 3 args */
|
||||
/* #undef HAVE_GETHOSTBYNAME_R_3 */
|
||||
|
||||
/* gethostbyname_r() takes 5 args */
|
||||
/* #undef HAVE_GETHOSTBYNAME_R_5 */
|
||||
|
||||
/* gethostbyname_r() takes 6 args */
|
||||
/* #undef HAVE_GETHOSTBYNAME_R_6 1 */
|
||||
|
||||
/* Define to 1 if you have the getnameinfo function. */
|
||||
/* #undef HAVE_GETNAMEINFO */
|
||||
|
||||
/* Define to 1 if you have the `getpass_r' function. */
|
||||
/* #undef HAVE_GETPASS_R */
|
||||
|
||||
/* Define to 1 if you have the `getprotobyname' function. */
|
||||
/* #undef HAVE_GETPROTOBYNAME */
|
||||
|
||||
/* Define to 1 if you have the `getpwuid' function. */
|
||||
#define HAVE_GETPWUID 1
|
||||
|
||||
/* Define to 1 if you have the `getrlimit' function. */
|
||||
/* #undef HAVE_GETRLIMIT */
|
||||
|
||||
/* Define to 1 if you have the `gettimeofday' function. */
|
||||
#define HAVE_GETTIMEOFDAY 1
|
||||
|
||||
/* we have a glibc-style strerror_r() */
|
||||
/* #undef HAVE_GLIBC_STRERROR_R */
|
||||
#define HAVE_GLIBC_STRERROR_R 1
|
||||
|
||||
/* Define to 1 if you have the `gmtime_r' function. */
|
||||
#define HAVE_GMTIME_R 1
|
||||
|
||||
/* if you have the gssapi libraries */
|
||||
/* #undef HAVE_GSSAPI */
|
||||
|
||||
/* if you have the GNU gssapi libraries */
|
||||
/* #undef HAVE_GSSGNU */
|
||||
|
||||
/* if you have the Heimdal gssapi libraries */
|
||||
/* #undef HAVE_GSSHEIMDAL */
|
||||
|
||||
/* if you have the MIT gssapi libraries */
|
||||
/* #undef HAVE_GSSMIT */
|
||||
|
||||
/* Define to 1 if you have the `iconv' functions. */
|
||||
#define HAVE_ICONV 1
|
||||
|
||||
/* Define to 1 if you have the `idna_strerror' function. */
|
||||
/* #undef HAVE_IDNA_STRERROR */
|
||||
|
||||
/* Define to 1 if you have the `idn_free' function. */
|
||||
/* #undef HAVE_IDN_FREE */
|
||||
|
||||
/* Define to 1 if you have the <idn-free.h> header file. */
|
||||
/* #undef HAVE_IDN_FREE_H */
|
||||
|
||||
/* Define to 1 if you have the `inet_addr' function. */
|
||||
#define HAVE_INET_ADDR 1
|
||||
|
||||
/* Define to 1 if you have a IPv6 capable working inet_ntop function. */
|
||||
/* #undef HAVE_INET_NTOP */
|
||||
|
||||
/* Define to 1 if you have a IPv6 capable working inet_pton function. */
|
||||
/* #undef HAVE_INET_PTON */
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the ioctl function. */
|
||||
#define HAVE_IOCTL 1
|
||||
|
||||
/* Define to 1 if you have a working ioctl FIONBIO function. */
|
||||
#define HAVE_IOCTL_FIONBIO 1
|
||||
|
||||
/* Define to 1 if you have the ioctlsocket function. */
|
||||
/* #undef HAVE_IOCTLSOCKET */
|
||||
|
||||
/* Define to 1 if you have a working ioctlsocket FIONBIO function. */
|
||||
/* #undef HAVE_IOCTLSOCKET_FIONBIO */
|
||||
|
||||
/* Define to 1 if you have the IoctlSocket camel case function. */
|
||||
/* #undef HAVE_IOCTLSOCKET_CAMEL */
|
||||
|
||||
/* Define to 1 if you have a working IoctlSocket camel case FIONBIO
|
||||
function. */
|
||||
/* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */
|
||||
|
||||
/* Define to 1 if you have the <io.h> header file. */
|
||||
/* #undef HAVE_IO_H */
|
||||
|
||||
/* if you have the Kerberos4 libraries (including -ldes) */
|
||||
/* #undef HAVE_KRB4 */
|
||||
|
||||
/* Define to 1 if you have the `krb_get_our_ip_for_realm' function. */
|
||||
/* #undef HAVE_KRB_GET_OUR_IP_FOR_REALM */
|
||||
|
||||
/* Define to 1 if you have the <krb.h> header file. */
|
||||
/* #undef HAVE_KRB_H */
|
||||
|
||||
/* Define to 1 if you have the <libgen.h> header file. */
|
||||
/* #undef HAVE_LIBGEN_H 1 */
|
||||
|
||||
/* Define to 1 if you have the `idn' library (-lidn). */
|
||||
/* #undef HAVE_LIBIDN */
|
||||
|
||||
/* Define to 1 if you have the `resolv' library (-lresolv). */
|
||||
/* #undef HAVE_LIBRESOLV */
|
||||
|
||||
/* Define to 1 if you have the `resolve' library (-lresolve). */
|
||||
/* #undef HAVE_LIBRESOLVE */
|
||||
|
||||
/* Define to 1 if you have the `socket' library (-lsocket). */
|
||||
/* #undef HAVE_LIBSOCKET */
|
||||
|
||||
/* Define to 1 if you have the `ssl' library (-lssl). */
|
||||
/* #undef HAVE_LIBSSL */
|
||||
#define HAVE_LIBSSL 1
|
||||
|
||||
/* if zlib is available */
|
||||
/* #undef HAVE_LIBZ */
|
||||
|
||||
/* Define to 1 if you have the <limits.h> header file. */
|
||||
#define HAVE_LIMITS_H 1
|
||||
|
||||
/* if your compiler supports LL */
|
||||
#define HAVE_LL 1
|
||||
|
||||
/* Define to 1 if you have the <locale.h> header file. */
|
||||
#define HAVE_LOCALE_H 1
|
||||
|
||||
/* Define to 1 if you have the `localtime_r' function. */
|
||||
#define HAVE_LOCALTIME_R 1
|
||||
|
||||
/* Define to 1 if the compiler supports the 'long long' data type. */
|
||||
#define HAVE_LONGLONG 1
|
||||
|
||||
/* Define to 1 if you need the malloc.h header file even with stdlib.h */
|
||||
/* #undef NEED_MALLOC_H */
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* Define to 1 if you have the <netdb.h> header file. */
|
||||
#define HAVE_NETDB_H 1
|
||||
|
||||
/* Define to 1 if you have the <netinet/in.h> header file. */
|
||||
#define HAVE_NETINET_IN_H 1
|
||||
|
||||
/* Define to 1 if you have the <netinet/tcp.h> header file. */
|
||||
/* undef HAVE_NETINET_TCP_H */
|
||||
|
||||
/* Define to 1 if you have the <net/if.h> header file. */
|
||||
#define HAVE_NET_IF_H 1
|
||||
|
||||
/* Define if NI_WITHSCOPEID exists and works */
|
||||
/* #undef HAVE_NI_WITHSCOPEID */
|
||||
|
||||
/* we have no strerror_r() proto */
|
||||
/* #undef HAVE_NO_STRERROR_R_DECL */
|
||||
|
||||
/* Define to 1 if you have the <openssl/crypto.h> header file. */
|
||||
/* #undef HAVE_OPENSSL_CRYPTO_H */
|
||||
#define HAVE_OPENSSL_CRYPTO_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/engine.h> header file. */
|
||||
/* #undef HAVE_OPENSSL_ENGINE_H */
|
||||
#define HAVE_OPENSSL_ENGINE_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/err.h> header file. */
|
||||
/* #undef HAVE_OPENSSL_ERR_H */
|
||||
#define HAVE_OPENSSL_ERR_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/pem.h> header file. */
|
||||
/* #undef HAVE_OPENSSL_PEM_H */
|
||||
#define HAVE_OPENSSL_PEM_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/pkcs12.h> header file. */
|
||||
/* #undef HAVE_OPENSSL_PKCS12_H */
|
||||
#define HAVE_OPENSSL_PKCS12_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/rsa.h> header file. */
|
||||
/* #undef HAVE_OPENSSL_RSA_H */
|
||||
#define HAVE_OPENSSL_RSA_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/ssl.h> header file. */
|
||||
/* #undef HAVE_OPENSSL_SSL_H */
|
||||
#define HAVE_OPENSSL_SSL_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/x509.h> header file. */
|
||||
/* #undef HAVE_OPENSSL_X509_H */
|
||||
#define HAVE_OPENSSL_X509_H 1
|
||||
|
||||
/* Define to 1 if you have the <pem.h> header file. */
|
||||
/* #undef HAVE_PEM_H */
|
||||
#define HAVE_PEM_H 1
|
||||
|
||||
/* Define to 1 if you have the `perror' function. */
|
||||
#define HAVE_PERROR 1
|
||||
|
||||
/* Define to 1 if you have the `pipe' function. */
|
||||
#define HAVE_PIPE 1
|
||||
|
||||
/* Define to 1 if you have the `poll' function. */
|
||||
/* #undef HAVE_POLL */
|
||||
|
||||
/* If you have a fine poll */
|
||||
/* #undef HAVE_POLL_FINE */
|
||||
|
||||
/* we have a POSIX-style strerror_r() */
|
||||
/* #undef HAVE_POSIX_STRERROR_R */
|
||||
|
||||
/* Define to 1 if you have the <pwd.h> header file. */
|
||||
#define HAVE_PWD_H 1
|
||||
|
||||
/* Define to 1 if you have the `RAND_egd' function. */
|
||||
/* #undef HAVE_RAND_EGD */
|
||||
#define HAVE_RAND_EGD 1
|
||||
|
||||
/* Define to 1 if you have the `RAND_screen' function. */
|
||||
/* #undef HAVE_RAND_SCREEN */
|
||||
|
||||
/* Define to 1 if you have the `RAND_status' function. */
|
||||
/* #undef HAVE_RAND_STATUS */
|
||||
#define HAVE_RAND_STATUS 1
|
||||
|
||||
/* Define to 1 if you have the <rsa.h> header file. */
|
||||
/* #undef HAVE_RSA_H */
|
||||
#define HAVE_RSA_H 1
|
||||
|
||||
/* Define to 1 if you have the `select' function. */
|
||||
#define HAVE_SELECT 1
|
||||
|
||||
/* Define to 1 if you have the <setjmp.h> header file. */
|
||||
#define HAVE_SETJMP_H 1
|
||||
|
||||
/* Define to 1 if you have the `setlocale' function. */
|
||||
#define HAVE_SETLOCALE 1
|
||||
|
||||
/* Define to 1 if you have the `setrlimit' function. */
|
||||
#define HAVE_SETRLIMIT 1
|
||||
|
||||
/* Define to 1 if you have the setsockopt function. */
|
||||
/* #undef HAVE_SETSOCKOPT */
|
||||
|
||||
/* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */
|
||||
/* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */
|
||||
|
||||
/* Define to 1 if you have the <sgtty.h> header file. */
|
||||
/* #undef HAVE_SGTTY_H 1 */
|
||||
|
||||
/* Define to 1 if you have the `sigaction' function. */
|
||||
#define HAVE_SIGACTION 1
|
||||
|
||||
/* Define to 1 if you have the `siginterrupt' function. */
|
||||
/* #undef HAVE_SIGINTERRUPT */
|
||||
|
||||
/* Define to 1 if you have the `signal' function. */
|
||||
#define HAVE_SIGNAL 1
|
||||
|
||||
/* Define to 1 if you have the <signal.h> header file. */
|
||||
#define HAVE_SIGNAL_H 1
|
||||
|
||||
/* Define to 1 if sig_atomic_t is an available typedef. */
|
||||
#define HAVE_SIG_ATOMIC_T 1
|
||||
|
||||
/* Define to 1 if sig_atomic_t is already defined as volatile. */
|
||||
/* #undef HAVE_SIG_ATOMIC_T_VOLATILE */
|
||||
|
||||
/* If you have sigsetjmp */
|
||||
/* #undef HAVE_SIGSETJMP */
|
||||
|
||||
/* Define to 1 if you have the `socket' function. */
|
||||
#define HAVE_SOCKET 1
|
||||
|
||||
/* Define to 1 if you have the <ssl.h> header file. */
|
||||
/* #undef HAVE_SSL_H */
|
||||
#define HAVE_SSL_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* Define to 1 if you have the `strcasecmp' function. */
|
||||
#define HAVE_STRCASECMP 1
|
||||
|
||||
/* Define to 1 if you have the `strcmpi' function. */
|
||||
/* #undef HAVE_STRCMPI */
|
||||
|
||||
/* Define to 1 if you have the `strdup' function. */
|
||||
#define HAVE_STRDUP 1
|
||||
|
||||
/* Define to 1 if you have the `strerror_r' function. */
|
||||
#define HAVE_STRERROR_R 1
|
||||
|
||||
/* Define to 1 if you have the `stricmp' function. */
|
||||
/* #undef HAVE_STRICMP */
|
||||
#define HAVE_STRICMP 1
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#define HAVE_STRINGS_H 1
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if you have the `strlcpy' function. */
|
||||
/* #undef HAVE_STRLCPY */
|
||||
|
||||
/* Define to 1 if you have the `strstr' function. */
|
||||
#define HAVE_STRSTR 1
|
||||
|
||||
/* Define to 1 if you have the `strtok_r' function. */
|
||||
#define HAVE_STRTOK_R 1
|
||||
|
||||
/* Define to 1 if you have the `strtoll' function. */
|
||||
#define HAVE_STRTOLL 1
|
||||
|
||||
/* if struct sockaddr_storage is defined */
|
||||
/* #undef HAVE_STRUCT_SOCKADDR_STORAGE */
|
||||
|
||||
/* Define this if you have struct timeval */
|
||||
#define HAVE_STRUCT_TIMEVAL 1
|
||||
|
||||
/* Define to 1 if you have the <sys/filio.h> header file. */
|
||||
#define HAVE_SYS_FILIO_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/ioctl.h> header file. */
|
||||
#define HAVE_SYS_IOCTL_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/param.h> header file. */
|
||||
#define HAVE_SYS_PARAM_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/poll.h> header file. */
|
||||
/* #undef HAVE_SYS_POLL_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/resource.h> header file. */
|
||||
#define HAVE_SYS_RESOURCE_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/select.h> header file. */
|
||||
#define HAVE_SYS_SELECT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/socket.h> header file. */
|
||||
#define HAVE_SYS_SOCKET_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/sockio.h> header file. */
|
||||
/* #undef HAVE_SYS_SOCKIO_H */
|
||||
#define HAVE_SYS_SOCKIO_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/utime.h> header file. */
|
||||
/* #undef HAVE_SYS_UTIME_H */
|
||||
|
||||
/* Define to 1 if you have the <termios.h> header file. */
|
||||
/* #undef HAVE_TERMIOS_H */
|
||||
|
||||
/* Define to 1 if you have the <termio.h> header file. */
|
||||
/* #undef HAVE_TERMIO_H */
|
||||
|
||||
/* Define to 1 if you have the <time.h> header file. */
|
||||
#define HAVE_TIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <tld.h> header file. */
|
||||
/* #undef HAVE_TLD_H */
|
||||
|
||||
/* Define to 1 if you have the `tld_strerror' function. */
|
||||
/* #undef HAVE_TLD_STRERROR */
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define to 1 if you have the `utime' function. */
|
||||
#define HAVE_UTIME 1
|
||||
|
||||
/* Define to 1 if you have the <utime.h> header file. */
|
||||
#define HAVE_UTIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <winsock2.h> header file. */
|
||||
/* #undef HAVE_WINSOCK2_H */
|
||||
|
||||
/* Define to 1 if you have the <winsock.h> header file. */
|
||||
/* #undef HAVE_WINSOCK_H */
|
||||
|
||||
/* Define this symbol if your OS supports changing the contents of argv */
|
||||
/* #undef HAVE_WRITABLE_ARGV */
|
||||
|
||||
/* Define to 1 if you have the ws2tcpip.h header file. */
|
||||
/* #undef HAVE_WS2TCPIP_H */
|
||||
|
||||
/* Define to 1 if you have the <x509.h> header file. */
|
||||
/* #undef HAVE_X509_H */
|
||||
|
||||
/* if you have the zlib.h header file */
|
||||
/* #undef HAVE_ZLIB_H */
|
||||
|
||||
/* Define to 1 if _REENTRANT preprocessor symbol must be defined. */
|
||||
/* #undef NEED_REENTRANT */
|
||||
|
||||
/* Define to 1 if _THREAD_SAFE preprocessor symbol must be defined. */
|
||||
/* #undef NEED_THREAD_SAFE */
|
||||
|
||||
/* cpu-machine-OS */
|
||||
#define OS "s390x-ibm-tpf"
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "curl"
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT \
|
||||
"a suitable curl mailing list => https://curl.haxx.se/mail/"
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "curl"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "curl -"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "curl"
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "-"
|
||||
|
||||
/* a suitable file to read random data from */
|
||||
/* #undef RANDOM_FILE */
|
||||
|
||||
/* Define as the return type of signal handlers (`int' or `void'). */
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* Define to the type of arg 1 for `select'. */
|
||||
#define SELECT_TYPE_ARG1 int
|
||||
|
||||
/* Define to the type of args 2, 3 and 4 for `select'. */
|
||||
#define SELECT_TYPE_ARG234 (fd_set *)
|
||||
|
||||
/* Define to the type of arg 5 for `select'. */
|
||||
#define SELECT_TYPE_ARG5 (struct timeval *)
|
||||
|
||||
/* The size of `int', as computed by sizeof. */
|
||||
#define SIZEOF_INT 4
|
||||
|
||||
/* The size of `off_t', as computed by sizeof. */
|
||||
#define SIZEOF_OFF_T 8
|
||||
|
||||
/* The size of `short', as computed by sizeof. */
|
||||
#define SIZEOF_SHORT 2
|
||||
|
||||
/* The size of `size_t', as computed by sizeof. */
|
||||
#define SIZEOF_SIZE_T 8
|
||||
|
||||
/* The size of `time_t', as computed by sizeof. */
|
||||
#define SIZEOF_TIME_T 8
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#define TIME_WITH_SYS_TIME 1
|
||||
|
||||
/* Define if you want to enable ares support */
|
||||
/* #undef USE_ARES */
|
||||
|
||||
/* Define to disable non-blocking sockets */
|
||||
/* #undef USE_BLOCKING_SOCKETS */
|
||||
|
||||
/* if GnuTLS is enabled */
|
||||
/* #undef USE_GNUTLS */
|
||||
|
||||
/* If you want to build curl with the built-in manual */
|
||||
/* #undef USE_MANUAL */
|
||||
|
||||
/* if OpenSSL is in use */
|
||||
/* #undef USE_OPENSSL */
|
||||
|
||||
/* if SSL is enabled */
|
||||
/* #undef USE_OPENSSL */
|
||||
|
||||
/* to enable SSPI support */
|
||||
/* #undef USE_WINDOWS_SSPI */
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "not-used"
|
||||
|
||||
/* Define to avoid automatic inclusion of winsock.h */
|
||||
/* #undef WIN32_LEAN_AND_MEAN */
|
||||
|
||||
/* Define to 1 if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
We just want to avoid a redefinition error message. */
|
||||
#ifndef _ALL_SOURCE
|
||||
/* # undef _ALL_SOURCE */
|
||||
#endif
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
/* #undef _FILE_OFFSET_BITS */
|
||||
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
/* #undef _LARGE_FILES */
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
/* #undef const */
|
||||
|
||||
/* type to use in place of in_addr_t if not defined */
|
||||
/* #undef in_addr_t */
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> does not define. */
|
||||
/* #undef size_t */
|
||||
|
||||
/* the signed version of size_t */
|
||||
/* #undef ssize_t */
|
||||
|
||||
/* Define to 1 if you have the getnameinfo function. */
|
||||
/* #undef HAVE_GETNAMEINFO 1 */
|
||||
|
||||
/* Define to the type qualifier of arg 1 for getnameinfo. */
|
||||
/* #undef GETNAMEINFO_QUAL_ARG1 const */
|
||||
|
||||
/* Define to the type of arg 1 for getnameinfo. */
|
||||
/* #undef GETNAMEINFO_TYPE_ARG1 struct sockaddr * */
|
||||
|
||||
/* Define to the type of arg 2 for getnameinfo. */
|
||||
/* #undef GETNAMEINFO_TYPE_ARG2 socklen_t */
|
||||
|
||||
/* Define to the type of args 4 and 6 for getnameinfo. */
|
||||
/* #undef GETNAMEINFO_TYPE_ARG46 size_t */
|
||||
|
||||
/* Define to the type of arg 7 for getnameinfo. */
|
||||
/* #undef GETNAMEINFO_TYPE_ARG7 int */
|
||||
|
||||
/* Define to 1 if you have the recv function. */
|
||||
#define HAVE_RECV 1
|
||||
|
||||
/* Define to the type of arg 1 for recv. */
|
||||
#define RECV_TYPE_ARG1 int
|
||||
|
||||
/* Define to the type of arg 2 for recv. */
|
||||
#define RECV_TYPE_ARG2 char *
|
||||
|
||||
/* Define to the type of arg 3 for recv. */
|
||||
#define RECV_TYPE_ARG3 int
|
||||
|
||||
/* Define to the type of arg 4 for recv. */
|
||||
#define RECV_TYPE_ARG4 int
|
||||
|
||||
/* Define to the function return type for recv. */
|
||||
#define RECV_TYPE_RETV int
|
||||
|
||||
/* Define to 1 if you have the recvfrom function. */
|
||||
#define HAVE_RECVFROM 1
|
||||
|
||||
/* Define to the type of arg 1 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG1 int
|
||||
|
||||
/* Define to the type pointed by arg 2 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG2 char
|
||||
|
||||
/* Define to the type of arg 3 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG3 int
|
||||
|
||||
/* Define to the type of arg 4 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG4 int
|
||||
|
||||
/* Define to the type pointed by arg 5 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG5 struct sockaddr
|
||||
|
||||
/* Define to the type pointed by arg 6 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG6 int
|
||||
|
||||
/* Define to the function return type for recvfrom. */
|
||||
#define RECVFROM_TYPE_RETV int
|
||||
|
||||
/* Define to 1 if you have the send function. */
|
||||
#define HAVE_SEND 1
|
||||
|
||||
/* Define to the type of arg 1 for send. */
|
||||
#define SEND_TYPE_ARG1 int
|
||||
|
||||
/* Define to the type qualifier of arg 2 for send. */
|
||||
#define SEND_QUAL_ARG2 const
|
||||
|
||||
/* Define to the type of arg 2 for send. */
|
||||
#define SEND_TYPE_ARG2 char *
|
||||
|
||||
/* Define to the type of arg 3 for send. */
|
||||
#define SEND_TYPE_ARG3 int
|
||||
|
||||
/* Define to the type of arg 4 for send. */
|
||||
#define SEND_TYPE_ARG4 int
|
||||
|
||||
/* Define to the function return type for send. */
|
||||
#define SEND_TYPE_RETV int
|
||||
|
||||
#define CURL_DOES_CONVERSIONS
|
||||
#ifndef CURL_ICONV_CODESET_OF_HOST
|
||||
#define CURL_ICONV_CODESET_OF_HOST "IBM-1047"
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* HEADER_CURL_CONFIG_TPF_H */
|
|
@ -1,928 +0,0 @@
|
|||
#ifndef HEADER_CURL_CONFIG_VXWORKS_H
|
||||
#define HEADER_CURL_CONFIG_VXWORKS_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* =============================================================== */
|
||||
/* Hand crafted config file for VxWorks */
|
||||
/* =============================================================== */
|
||||
|
||||
/* Location of default ca bundle */
|
||||
/* #undef CURL_CA_BUNDLE */
|
||||
|
||||
/* Location of default ca path */
|
||||
/* #undef CURL_CA_PATH */
|
||||
|
||||
/* to disable cookies support */
|
||||
/* #undef CURL_DISABLE_COOKIES */
|
||||
|
||||
/* to disable cryptographic authentication */
|
||||
/* #undef CURL_DISABLE_CRYPTO_AUTH */
|
||||
|
||||
/* to disable DICT */
|
||||
/* #undef CURL_DISABLE_DICT */
|
||||
|
||||
/* to disable FILE */
|
||||
/* #undef CURL_DISABLE_FILE */
|
||||
|
||||
/* to disable FTP */
|
||||
#define CURL_DISABLE_FTP 1
|
||||
|
||||
/* to disable HTTP */
|
||||
/* #undef CURL_DISABLE_HTTP */
|
||||
|
||||
/* to disable LDAP */
|
||||
#define CURL_DISABLE_LDAP 1
|
||||
|
||||
/* to disable LDAPS */
|
||||
#define CURL_DISABLE_LDAPS 1
|
||||
|
||||
/* to disable NTLM authentication */
|
||||
#define CURL_DISABLE_NTLM 1
|
||||
|
||||
/* to disable proxies */
|
||||
/* #undef CURL_DISABLE_PROXY */
|
||||
|
||||
/* to disable TELNET */
|
||||
#define CURL_DISABLE_TELNET 1
|
||||
|
||||
/* to disable TFTP */
|
||||
#define CURL_DISABLE_TFTP 1
|
||||
|
||||
/* to disable verbose strings */
|
||||
/* #undef CURL_DISABLE_VERBOSE_STRINGS */
|
||||
|
||||
/* Definition to make a library symbol externally visible. */
|
||||
/* #undef CURL_EXTERN_SYMBOL */
|
||||
|
||||
/* Use Windows LDAP implementation */
|
||||
/* #undef USE_WIN32_LDAP */
|
||||
|
||||
/* your Entropy Gathering Daemon socket pathname */
|
||||
/* #undef EGD_SOCKET */
|
||||
|
||||
/* Define if you want to enable IPv6 support */
|
||||
#define ENABLE_IPV6 1
|
||||
|
||||
/* Define to the type qualifier of arg 1 for getnameinfo. */
|
||||
#define GETNAMEINFO_QUAL_ARG1 const
|
||||
|
||||
/* Define to the type of arg 1 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG1 struct sockaddr *
|
||||
|
||||
/* Define to the type of arg 2 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG2 socklen_t
|
||||
|
||||
/* Define to the type of args 4 and 6 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG46 size_t
|
||||
|
||||
/* Define to the type of arg 7 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG7 unsigned int
|
||||
|
||||
/* Specifies the number of arguments to getservbyport_r */
|
||||
#define GETSERVBYPORT_R_ARGS 6
|
||||
|
||||
/* Specifies the size of the buffer to pass to getservbyport_r */
|
||||
#define GETSERVBYPORT_R_BUFSIZE 4096
|
||||
|
||||
/* Define to 1 if you have the alarm function. */
|
||||
#define HAVE_ALARM 1
|
||||
|
||||
/* Define to 1 if you have the <alloca.h> header file. */
|
||||
#define HAVE_ALLOCA_H 1
|
||||
|
||||
/* Define to 1 if you have the <arpa/inet.h> header file. */
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
|
||||
/* Define to 1 if you have the <arpa/tftp.h> header file. */
|
||||
/* #undef HAVE_ARPA_TFTP_H */
|
||||
|
||||
/* Define to 1 if you have the <assert.h> header file. */
|
||||
#define HAVE_ASSERT_H 1
|
||||
|
||||
/* Define to 1 if you have the `basename' function. */
|
||||
/* #undef HAVE_BASENAME */
|
||||
|
||||
/* Define to 1 if bool is an available type. */
|
||||
#define HAVE_BOOL_T 1
|
||||
|
||||
/* Define to 1 if you have the clock_gettime function and monotonic timer. */
|
||||
/* #undef HAVE_CLOCK_GETTIME_MONOTONIC */
|
||||
|
||||
/* Define to 1 if you have the `closesocket' function. */
|
||||
/* #undef HAVE_CLOSESOCKET */
|
||||
|
||||
/* Define to 1 if you have the `CRYPTO_cleanup_all_ex_data' function. */
|
||||
#define HAVE_CRYPTO_CLEANUP_ALL_EX_DATA 1
|
||||
|
||||
/* Define to 1 if you have the <crypto.h> header file. */
|
||||
/* #undef HAVE_CRYPTO_H */
|
||||
|
||||
/* Define to 1 if you have the <des.h> header file. */
|
||||
/* #undef HAVE_DES_H */
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#define HAVE_DLFCN_H 1
|
||||
|
||||
/* Define to 1 if you have the `ENGINE_load_builtin_engines' function. */
|
||||
#define HAVE_ENGINE_LOAD_BUILTIN_ENGINES 1
|
||||
|
||||
/* Define to 1 if you have the <errno.h> header file. */
|
||||
#define HAVE_ERRNO_H 1
|
||||
|
||||
/* Define to 1 if you have the <err.h> header file. */
|
||||
/* #undef HAVE_ERR_H */
|
||||
|
||||
/* Define to 1 if you have the fcntl function. */
|
||||
#define HAVE_FCNTL 1
|
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#define HAVE_FCNTL_H 1
|
||||
|
||||
/* Define to 1 if you have a working fcntl O_NONBLOCK function. */
|
||||
#define HAVE_FCNTL_O_NONBLOCK 1
|
||||
|
||||
/* Define to 1 if you have the fdopen function. */
|
||||
#define HAVE_FDOPEN 1
|
||||
|
||||
/* Define to 1 if you have the `fork' function. */
|
||||
#define HAVE_FORK 1
|
||||
|
||||
/* Define to 1 if you have the freeaddrinfo function. */
|
||||
#define HAVE_FREEADDRINFO 1
|
||||
|
||||
/* Define to 1 if you have the freeifaddrs function. */
|
||||
#define HAVE_FREEIFADDRS 1
|
||||
|
||||
/* Define to 1 if you have the ftruncate function. */
|
||||
#define HAVE_FTRUNCATE 1
|
||||
|
||||
/* Define to 1 if you have a working getaddrinfo function. */
|
||||
#define HAVE_GETADDRINFO 1
|
||||
|
||||
/* Define to 1 if you have the `geteuid' function. */
|
||||
/* #undef HAVE_GETEUID */
|
||||
|
||||
/* Define to 1 if you have the gethostbyaddr function. */
|
||||
#define HAVE_GETHOSTBYADDR 1
|
||||
|
||||
/* Define to 1 if you have the gethostbyaddr_r function. */
|
||||
#define HAVE_GETHOSTBYADDR_R 1
|
||||
|
||||
/* gethostbyaddr_r() takes 5 args */
|
||||
/* #undef HAVE_GETHOSTBYADDR_R_5 */
|
||||
|
||||
/* gethostbyaddr_r() takes 7 args */
|
||||
/* #undef HAVE_GETHOSTBYADDR_R_7 */
|
||||
|
||||
/* gethostbyaddr_r() takes 8 args */
|
||||
#define HAVE_GETHOSTBYADDR_R_8 1
|
||||
|
||||
/* Define to 1 if you have the gethostbyname function. */
|
||||
#define HAVE_GETHOSTBYNAME 1
|
||||
|
||||
/* Define to 1 if you have the gethostbyname_r function. */
|
||||
/* #undef HAVE_GETHOSTBYNAME_R */
|
||||
|
||||
/* gethostbyname_r() takes 3 args */
|
||||
/* #undef HAVE_GETHOSTBYNAME_R_3 */
|
||||
|
||||
/* gethostbyname_r() takes 5 args */
|
||||
/* #undef HAVE_GETHOSTBYNAME_R_5 */
|
||||
|
||||
/* gethostbyname_r() takes 6 args */
|
||||
/* #undef HAVE_GETHOSTBYNAME_R_6 */
|
||||
|
||||
/* Define to 1 if you have the gethostname function. */
|
||||
#define HAVE_GETHOSTNAME 1
|
||||
|
||||
/* Define to 1 if you have a working getifaddrs function. */
|
||||
/* #undef HAVE_GETIFADDRS */
|
||||
|
||||
/* Define to 1 if you have the getnameinfo function. */
|
||||
#define HAVE_GETNAMEINFO 1
|
||||
|
||||
/* Define to 1 if you have the `getpass_r' function. */
|
||||
/* #undef HAVE_GETPASS_R */
|
||||
|
||||
/* Define to 1 if you have the `getppid' function. */
|
||||
#define HAVE_GETPPID 1
|
||||
|
||||
/* Define to 1 if you have the `getprotobyname' function. */
|
||||
#define HAVE_GETPROTOBYNAME 1
|
||||
|
||||
/* Define to 1 if you have the `getpwuid' function. */
|
||||
/* #undef HAVE_GETPWUID */
|
||||
|
||||
/* Define to 1 if you have the `getrlimit' function. */
|
||||
#define HAVE_GETRLIMIT 1
|
||||
|
||||
/* Define to 1 if you have the getservbyport_r function. */
|
||||
/* #undef HAVE_GETSERVBYPORT_R */
|
||||
|
||||
/* Define to 1 if you have the `gettimeofday' function. */
|
||||
/* #undef HAVE_GETTIMEOFDAY */
|
||||
|
||||
/* Define to 1 if you have a working glibc-style strerror_r function. */
|
||||
/* #undef HAVE_GLIBC_STRERROR_R */
|
||||
|
||||
/* Define to 1 if you have a working gmtime_r function. */
|
||||
#define HAVE_GMTIME_R 1
|
||||
|
||||
/* if you have the gssapi libraries */
|
||||
/* #undef HAVE_GSSAPI */
|
||||
|
||||
/* Define to 1 if you have the <gssapi/gssapi_generic.h> header file. */
|
||||
/* #undef HAVE_GSSAPI_GSSAPI_GENERIC_H */
|
||||
|
||||
/* Define to 1 if you have the <gssapi/gssapi.h> header file. */
|
||||
/* #undef HAVE_GSSAPI_GSSAPI_H */
|
||||
|
||||
/* Define to 1 if you have the <gssapi/gssapi_krb5.h> header file. */
|
||||
/* #undef HAVE_GSSAPI_GSSAPI_KRB5_H */
|
||||
|
||||
/* if you have the GNU gssapi libraries */
|
||||
/* #undef HAVE_GSSGNU */
|
||||
|
||||
/* if you have the Heimdal gssapi libraries */
|
||||
/* #undef HAVE_GSSHEIMDAL */
|
||||
|
||||
/* if you have the MIT gssapi libraries */
|
||||
/* #undef HAVE_GSSMIT */
|
||||
|
||||
/* Define to 1 if you have the `idna_strerror' function. */
|
||||
/* #undef HAVE_IDNA_STRERROR */
|
||||
|
||||
/* Define to 1 if you have the `idn_free' function. */
|
||||
/* #undef HAVE_IDN_FREE */
|
||||
|
||||
/* Define to 1 if you have the <idn-free.h> header file. */
|
||||
/* #undef HAVE_IDN_FREE_H */
|
||||
|
||||
/* Define to 1 if you have the <ifaddrs.h> header file. */
|
||||
/* #undef HAVE_IFADDRS_H */
|
||||
|
||||
/* Define to 1 if you have the `inet_addr' function. */
|
||||
#define HAVE_INET_ADDR 1
|
||||
|
||||
/* Define to 1 if you have the inet_ntoa_r function. */
|
||||
/* #undef HAVE_INET_NTOA_R */
|
||||
|
||||
/* inet_ntoa_r() takes 2 args */
|
||||
/* #undef HAVE_INET_NTOA_R_2 */
|
||||
|
||||
/* inet_ntoa_r() takes 3 args */
|
||||
/* #undef HAVE_INET_NTOA_R_3 */
|
||||
|
||||
/* Define to 1 if you have a IPv6 capable working inet_ntop function. */
|
||||
/* #undef HAVE_INET_NTOP */
|
||||
|
||||
/* Define to 1 if you have a IPv6 capable working inet_pton function. */
|
||||
/* #undef HAVE_INET_PTON */
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the ioctl function. */
|
||||
#define HAVE_IOCTL 1
|
||||
|
||||
/* Define to 1 if you have the ioctlsocket function. */
|
||||
/* #undef HAVE_IOCTLSOCKET */
|
||||
|
||||
/* Define to 1 if you have the IoctlSocket camel case function. */
|
||||
/* #undef HAVE_IOCTLSOCKET_CAMEL */
|
||||
|
||||
/* Define to 1 if you have a working IoctlSocket camel case FIONBIO function.
|
||||
*/
|
||||
/* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */
|
||||
|
||||
/* Define to 1 if you have a working ioctlsocket FIONBIO function. */
|
||||
/* #undef HAVE_IOCTLSOCKET_FIONBIO */
|
||||
|
||||
/* Define to 1 if you have a working ioctl FIONBIO function. */
|
||||
#define HAVE_IOCTL_FIONBIO 1
|
||||
|
||||
/* Define to 1 if you have a working ioctl SIOCGIFADDR function. */
|
||||
#define HAVE_IOCTL_SIOCGIFADDR 1
|
||||
|
||||
/* Define to 1 if you have the <io.h> header file. */
|
||||
#define HAVE_IO_H 1
|
||||
|
||||
/* if you have the Kerberos4 libraries (including -ldes) */
|
||||
/* #undef HAVE_KRB4 */
|
||||
|
||||
/* Define to 1 if you have the `krb_get_our_ip_for_realm' function. */
|
||||
/* #undef HAVE_KRB_GET_OUR_IP_FOR_REALM */
|
||||
|
||||
/* Define to 1 if you have the <krb.h> header file. */
|
||||
/* #undef HAVE_KRB_H */
|
||||
|
||||
/* Define to 1 if you have the lber.h header file. */
|
||||
/* #undef HAVE_LBER_H */
|
||||
|
||||
/* Define to 1 if you have the ldapssl.h header file. */
|
||||
/* #undef HAVE_LDAPSSL_H */
|
||||
|
||||
/* Define to 1 if you have the ldap.h header file. */
|
||||
/* #undef HAVE_LDAP_H */
|
||||
|
||||
/* Use LDAPS implementation */
|
||||
/* #undef HAVE_LDAP_SSL */
|
||||
|
||||
/* Define to 1 if you have the ldap_ssl.h header file. */
|
||||
/* #undef HAVE_LDAP_SSL_H */
|
||||
|
||||
/* Define to 1 if you have the `ldap_url_parse' function. */
|
||||
/* #undef HAVE_LDAP_URL_PARSE */
|
||||
|
||||
/* Define to 1 if you have the <libgen.h> header file. */
|
||||
/* #undef HAVE_LIBGEN_H */
|
||||
|
||||
/* Define to 1 if you have the `idn' library (-lidn). */
|
||||
/* #undef HAVE_LIBIDN */
|
||||
|
||||
/* Define to 1 if you have the `resolv' library (-lresolv). */
|
||||
/* #undef HAVE_LIBRESOLV */
|
||||
|
||||
/* Define to 1 if you have the `resolve' library (-lresolve). */
|
||||
/* #undef HAVE_LIBRESOLVE */
|
||||
|
||||
/* Define to 1 if you have the `socket' library (-lsocket). */
|
||||
/* #undef HAVE_LIBSOCKET */
|
||||
|
||||
/* Define to 1 if you have the `ssh2' library (-lssh2). */
|
||||
/* #undef HAVE_LIBSSH2 */
|
||||
|
||||
/* Define to 1 if you have the <libssh2.h> header file. */
|
||||
/* #undef HAVE_LIBSSH2_H */
|
||||
|
||||
/* Define to 1 if you have the `libssh2_version' function. */
|
||||
/* #undef HAVE_LIBSSH2_VERSION */
|
||||
|
||||
/* Define to 1 if you have the `ssl' library (-lssl). */
|
||||
#define HAVE_LIBSSL 1
|
||||
|
||||
/* if zlib is available */
|
||||
#define HAVE_LIBZ 1
|
||||
|
||||
/* Define to 1 if you have the <limits.h> header file. */
|
||||
#define HAVE_LIMITS_H 1
|
||||
|
||||
/* if your compiler supports LL */
|
||||
#define HAVE_LL 1
|
||||
|
||||
/* Define to 1 if you have the <locale.h> header file. */
|
||||
#define HAVE_LOCALE_H 1
|
||||
|
||||
/* Define to 1 if you have a working localtime_r function. */
|
||||
#define HAVE_LOCALTIME_R 1
|
||||
|
||||
/* Define to 1 if the compiler supports the 'long long' data type. */
|
||||
#define HAVE_LONGLONG 1
|
||||
|
||||
/* Define to 1 if you have the malloc.h header file. */
|
||||
#define HAVE_MALLOC_H 1
|
||||
|
||||
/* Define to 1 if you have the memory.h header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* Define to 1 if you have the MSG_NOSIGNAL flag. */
|
||||
/* #undef HAVE_MSG_NOSIGNAL */
|
||||
|
||||
/* Define to 1 if you have the <netdb.h> header file. */
|
||||
#define HAVE_NETDB_H 1
|
||||
|
||||
/* Define to 1 if you have the <netinet/in.h> header file. */
|
||||
#define HAVE_NETINET_IN_H 1
|
||||
|
||||
/* Define to 1 if you have the <netinet/tcp.h> header file. */
|
||||
#define HAVE_NETINET_TCP_H 1
|
||||
|
||||
/* Define to 1 if you have the <net/if.h> header file. */
|
||||
#define HAVE_NET_IF_H 1
|
||||
|
||||
/* Define to 1 if NI_WITHSCOPEID exists and works. */
|
||||
/* #undef HAVE_NI_WITHSCOPEID */
|
||||
|
||||
/* if you have an old MIT gssapi library, lacking GSS_C_NT_HOSTBASED_SERVICE
|
||||
*/
|
||||
/* #undef HAVE_OLD_GSSMIT */
|
||||
|
||||
/* Define to 1 if you have the <openssl/crypto.h> header file. */
|
||||
#define HAVE_OPENSSL_CRYPTO_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/engine.h> header file. */
|
||||
#define HAVE_OPENSSL_ENGINE_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/err.h> header file. */
|
||||
#define HAVE_OPENSSL_ERR_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/pem.h> header file. */
|
||||
#define HAVE_OPENSSL_PEM_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/pkcs12.h> header file. */
|
||||
#define HAVE_OPENSSL_PKCS12_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/rsa.h> header file. */
|
||||
#define HAVE_OPENSSL_RSA_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/ssl.h> header file. */
|
||||
#define HAVE_OPENSSL_SSL_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/x509.h> header file. */
|
||||
#define HAVE_OPENSSL_X509_H 1
|
||||
|
||||
/* Define to 1 if you have the <pem.h> header file. */
|
||||
/* #undef HAVE_PEM_H */
|
||||
|
||||
/* Define to 1 if you have the `perror' function. */
|
||||
#define HAVE_PERROR 1
|
||||
|
||||
/* Define to 1 if you have the `pipe' function. */
|
||||
#define HAVE_PIPE 1
|
||||
|
||||
/* Define to 1 if you have a working poll function. */
|
||||
/* #undef HAVE_POLL */
|
||||
|
||||
/* If you have a fine poll */
|
||||
/* #undef HAVE_POLL_FINE */
|
||||
|
||||
/* Define to 1 if you have the <poll.h> header file. */
|
||||
/* #undef HAVE_POLL_H */
|
||||
|
||||
/* Define to 1 if you have a working POSIX-style strerror_r function. */
|
||||
/* #undef HAVE_POSIX_STRERROR_R */
|
||||
|
||||
/* Define to 1 if you have the <pwd.h> header file. */
|
||||
/* #undef HAVE_PWD_H */
|
||||
|
||||
/* Define to 1 if you have the `RAND_egd' function. */
|
||||
#define HAVE_RAND_EGD 1
|
||||
|
||||
/* Define to 1 if you have the `RAND_screen' function. */
|
||||
/* #undef HAVE_RAND_SCREEN */
|
||||
|
||||
/* Define to 1 if you have the `RAND_status' function. */
|
||||
#define HAVE_RAND_STATUS 1
|
||||
|
||||
/* Define to 1 if you have the recv function. */
|
||||
#define HAVE_RECV 1
|
||||
|
||||
/* Define to 1 if you have the recvfrom function. */
|
||||
#define HAVE_RECVFROM 1
|
||||
|
||||
/* Define to 1 if you have the <rsa.h> header file. */
|
||||
/* #undef HAVE_RSA_H */
|
||||
|
||||
/* Define to 1 if you have the select function. */
|
||||
#define HAVE_SELECT 1
|
||||
|
||||
/* Define to 1 if you have the send function. */
|
||||
#define HAVE_SEND 1
|
||||
|
||||
/* Define to 1 if you have the <setjmp.h> header file. */
|
||||
#define HAVE_SETJMP_H 1
|
||||
|
||||
/* Define to 1 if you have the `setlocale' function. */
|
||||
#define HAVE_SETLOCALE 1
|
||||
|
||||
/* Define to 1 if you have the `setmode' function. */
|
||||
#define HAVE_SETMODE 1
|
||||
|
||||
/* Define to 1 if you have the `setrlimit' function. */
|
||||
#define HAVE_SETRLIMIT 1
|
||||
|
||||
/* Define to 1 if you have the setsockopt function. */
|
||||
#define HAVE_SETSOCKOPT 1
|
||||
|
||||
/* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */
|
||||
/* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */
|
||||
|
||||
/* Define to 1 if you have the <sgtty.h> header file. */
|
||||
/* #undef HAVE_SGTTY_H */
|
||||
|
||||
/* Define to 1 if you have the sigaction function. */
|
||||
#define HAVE_SIGACTION 1
|
||||
|
||||
/* Define to 1 if you have the siginterrupt function. */
|
||||
#define HAVE_SIGINTERRUPT 1
|
||||
|
||||
/* Define to 1 if you have the signal function. */
|
||||
#define HAVE_SIGNAL 1
|
||||
|
||||
/* Define to 1 if you have the <signal.h> header file. */
|
||||
#define HAVE_SIGNAL_H 1
|
||||
|
||||
/* Define to 1 if you have the sigsetjmp function or macro. */
|
||||
/* #undef HAVE_SIGSETJMP */
|
||||
|
||||
/* Define to 1 if sig_atomic_t is an available typedef. */
|
||||
#define HAVE_SIG_ATOMIC_T 1
|
||||
|
||||
/* Define to 1 if sig_atomic_t is already defined as volatile. */
|
||||
/* #undef HAVE_SIG_ATOMIC_T_VOLATILE */
|
||||
|
||||
/* Define to 1 if struct sockaddr_in6 has the sin6_scope_id member */
|
||||
#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
|
||||
|
||||
/* Define to 1 if you have the `socket' function. */
|
||||
#define HAVE_SOCKET 1
|
||||
|
||||
/* Define to 1 if you have the `SSL_get_shutdown' function. */
|
||||
#define HAVE_SSL_GET_SHUTDOWN 1
|
||||
|
||||
/* Define to 1 if you have the <ssl.h> header file. */
|
||||
/* #undef HAVE_SSL_H */
|
||||
|
||||
/* Define to 1 if you have the <stdbool.h> header file. */
|
||||
#define HAVE_STDBOOL_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
/* #undef HAVE_STDINT_H */
|
||||
|
||||
/* Define to 1 if you have the <stdio.h> header file. */
|
||||
#define HAVE_STDIO_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* Define to 1 if you have the strcasecmp function. */
|
||||
#define HAVE_STRCASECMP 1
|
||||
|
||||
/* Define to 1 if you have the strcmpi function. */
|
||||
/* #undef HAVE_STRCMPI */
|
||||
|
||||
/* Define to 1 if you have the strdup function. */
|
||||
#define HAVE_STRDUP 1
|
||||
|
||||
/* Define to 1 if you have the strerror_r function. */
|
||||
#define HAVE_STRERROR_R 1
|
||||
|
||||
/* Define to 1 if you have the stricmp function. */
|
||||
/* #undef HAVE_STRICMP */
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#define HAVE_STRINGS_H 1
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if you have the `strlcpy' function. */
|
||||
/* #undef HAVE_STRLCPY */
|
||||
|
||||
/* Define to 1 if you have the strncasecmp function. */
|
||||
#define HAVE_STRNCASECMP 1
|
||||
|
||||
/* Define to 1 if you have the strncmpi function. */
|
||||
/* #undef HAVE_STRNCMPI */
|
||||
|
||||
/* Define to 1 if you have the strnicmp function. */
|
||||
/* #undef HAVE_STRNICMP */
|
||||
|
||||
/* Define to 1 if you have the <stropts.h> header file. */
|
||||
/* #undef HAVE_STROPTS_H */
|
||||
|
||||
/* Define to 1 if you have the strstr function. */
|
||||
#define HAVE_STRSTR 1
|
||||
|
||||
/* Define to 1 if you have the strtok_r function. */
|
||||
#define HAVE_STRTOK_R 1
|
||||
|
||||
/* Define to 1 if you have the strtoll function. */
|
||||
/* #undef HAVE_STRTOLL */
|
||||
|
||||
/* if struct sockaddr_storage is defined */
|
||||
#define HAVE_STRUCT_SOCKADDR_STORAGE 1
|
||||
|
||||
/* Define to 1 if you have the timeval struct. */
|
||||
#define HAVE_STRUCT_TIMEVAL 1
|
||||
|
||||
/* Define to 1 if you have the <sys/filio.h> header file. */
|
||||
/* #undef HAVE_SYS_FILIO_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/ioctl.h> header file. */
|
||||
#define HAVE_SYS_IOCTL_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/param.h> header file. */
|
||||
/* #undef HAVE_SYS_PARAM_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/poll.h> header file. */
|
||||
/* #undef HAVE_SYS_POLL_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/resource.h> header file. */
|
||||
#define HAVE_SYS_RESOURCE_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/select.h> header file. */
|
||||
/* #undef HAVE_SYS_SELECT_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/socket.h> header file. */
|
||||
#define HAVE_SYS_SOCKET_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/sockio.h> header file. */
|
||||
/* #undef HAVE_SYS_SOCKIO_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
/* #undef HAVE_SYS_TIME_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/uio.h> header file. */
|
||||
#define HAVE_SYS_UIO_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/un.h> header file. */
|
||||
#define HAVE_SYS_UN_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/utime.h> header file. */
|
||||
#define HAVE_SYS_UTIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <termios.h> header file. */
|
||||
#define HAVE_TERMIOS_H 1
|
||||
|
||||
/* Define to 1 if you have the <termio.h> header file. */
|
||||
#define HAVE_TERMIO_H 1
|
||||
|
||||
/* Define to 1 if you have the <time.h> header file. */
|
||||
#define HAVE_TIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <tld.h> header file. */
|
||||
/* #undef HAVE_TLD_H */
|
||||
|
||||
/* Define to 1 if you have the `tld_strerror' function. */
|
||||
/* #undef HAVE_TLD_STRERROR */
|
||||
|
||||
/* Define to 1 if you have the `uname' function. */
|
||||
#define HAVE_UNAME 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define to 1 if you have the `utime' function. */
|
||||
#define HAVE_UTIME 1
|
||||
|
||||
/* Define to 1 if you have the <utime.h> header file. */
|
||||
#define HAVE_UTIME_H 1
|
||||
|
||||
/* Define to 1 if compiler supports C99 variadic macro style. */
|
||||
#define HAVE_VARIADIC_MACROS_C99 1
|
||||
|
||||
/* Define to 1 if compiler supports old gcc variadic macro style. */
|
||||
#define HAVE_VARIADIC_MACROS_GCC 1
|
||||
|
||||
/* Define to 1 if you have a working vxworks-style strerror_r function. */
|
||||
#define HAVE_VXWORKS_STRERROR_R 1
|
||||
|
||||
/* Define to 1 if you have the winber.h header file. */
|
||||
/* #undef HAVE_WINBER_H */
|
||||
|
||||
/* Define to 1 if you have the windows.h header file. */
|
||||
/* #undef HAVE_WINDOWS_H */
|
||||
|
||||
/* Define to 1 if you have the winldap.h header file. */
|
||||
/* #undef HAVE_WINLDAP_H */
|
||||
|
||||
/* Define to 1 if you have the winsock2.h header file. */
|
||||
/* #undef HAVE_WINSOCK2_H */
|
||||
|
||||
/* Define to 1 if you have the winsock.h header file. */
|
||||
/* #undef HAVE_WINSOCK_H */
|
||||
|
||||
/* Define this symbol if your OS supports changing the contents of argv */
|
||||
#define HAVE_WRITABLE_ARGV 1
|
||||
|
||||
/* Define to 1 if you have the writev function. */
|
||||
#define HAVE_WRITEV 1
|
||||
|
||||
/* Define to 1 if you have the ws2tcpip.h header file. */
|
||||
/* #undef HAVE_WS2TCPIP_H */
|
||||
|
||||
/* Define to 1 if you have the <x509.h> header file. */
|
||||
/* #undef HAVE_X509_H */
|
||||
|
||||
/* if you have the zlib.h header file */
|
||||
#define HAVE_ZLIB_H 1
|
||||
|
||||
/* Define to 1 if you need the lber.h header file even with ldap.h */
|
||||
/* #undef NEED_LBER_H */
|
||||
|
||||
/* Define to 1 if you need the malloc.h header file even with stdlib.h */
|
||||
/* #undef NEED_MALLOC_H */
|
||||
|
||||
/* Define to 1 if you need the memory.h header file even with stdlib.h */
|
||||
/* #undef NEED_MEMORY_H */
|
||||
|
||||
/* Define to 1 if _REENTRANT preprocessor symbol must be defined. */
|
||||
/* #undef NEED_REENTRANT */
|
||||
|
||||
/* Define to 1 if _THREAD_SAFE preprocessor symbol must be defined. */
|
||||
/* #undef NEED_THREAD_SAFE */
|
||||
|
||||
/* Define to 1 if the open function requires three arguments. */
|
||||
#define OPEN_NEEDS_ARG3 1
|
||||
|
||||
/* cpu-machine-OS */
|
||||
#define OS "unknown-unknown-vxworks"
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "curl"
|
||||
|
||||
/* a suitable file to read random data from */
|
||||
#define RANDOM_FILE "/dev/urandom"
|
||||
|
||||
/* Define to the type of arg 1 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG1 int
|
||||
|
||||
/* Define to the type pointed by arg 2 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG2 void
|
||||
|
||||
/* Define to 1 if the type pointed by arg 2 for recvfrom is void. */
|
||||
#define RECVFROM_TYPE_ARG2_IS_VOID 1
|
||||
|
||||
/* Define to the type of arg 3 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG3 size_t
|
||||
|
||||
/* Define to the type of arg 4 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG4 int
|
||||
|
||||
/* Define to the type pointed by arg 5 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG5 struct sockaddr
|
||||
|
||||
/* Define to 1 if the type pointed by arg 5 for recvfrom is void. */
|
||||
/* #undef RECVFROM_TYPE_ARG5_IS_VOID */
|
||||
|
||||
/* Define to the type pointed by arg 6 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG6 socklen_t
|
||||
|
||||
/* Define to 1 if the type pointed by arg 6 for recvfrom is void. */
|
||||
/* #undef RECVFROM_TYPE_ARG6_IS_VOID */
|
||||
|
||||
/* Define to the function return type for recvfrom. */
|
||||
#define RECVFROM_TYPE_RETV int
|
||||
|
||||
/* Define to the type of arg 1 for recv. */
|
||||
#define RECV_TYPE_ARG1 int
|
||||
|
||||
/* Define to the type of arg 2 for recv. */
|
||||
#define RECV_TYPE_ARG2 void *
|
||||
|
||||
/* Define to the type of arg 3 for recv. */
|
||||
#define RECV_TYPE_ARG3 size_t
|
||||
|
||||
/* Define to the type of arg 4 for recv. */
|
||||
#define RECV_TYPE_ARG4 int
|
||||
|
||||
/* Define to the function return type for recv. */
|
||||
#define RECV_TYPE_RETV int
|
||||
|
||||
/* Define as the return type of signal handlers (`int' or `void'). */
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* Define to the type qualifier of arg 5 for select. */
|
||||
#define SELECT_QUAL_ARG5
|
||||
|
||||
/* Define to the type of arg 1 for select. */
|
||||
#define SELECT_TYPE_ARG1 int
|
||||
|
||||
/* Define to the type of args 2, 3 and 4 for select. */
|
||||
#define SELECT_TYPE_ARG234 fd_set *
|
||||
|
||||
/* Define to the type of arg 5 for select. */
|
||||
#define SELECT_TYPE_ARG5 struct timeval *
|
||||
|
||||
/* Define to the function return type for select. */
|
||||
#define SELECT_TYPE_RETV int
|
||||
|
||||
/* Define to the type qualifier of arg 2 for send. */
|
||||
#define SEND_QUAL_ARG2 const
|
||||
|
||||
/* Define to the type of arg 1 for send. */
|
||||
#define SEND_TYPE_ARG1 int
|
||||
|
||||
/* Define to the type of arg 2 for send. */
|
||||
#define SEND_TYPE_ARG2 void *
|
||||
|
||||
/* Define to the type of arg 3 for send. */
|
||||
#define SEND_TYPE_ARG3 size_t
|
||||
|
||||
/* Define to the type of arg 4 for send. */
|
||||
#define SEND_TYPE_ARG4 int
|
||||
|
||||
/* Define to the function return type for send. */
|
||||
#define SEND_TYPE_RETV int
|
||||
|
||||
/* The size of `int', as computed by sizeof. */
|
||||
#define SIZEOF_INT 4
|
||||
|
||||
/* The size of `long', as computed by sizeof. */
|
||||
#define SIZEOF_LONG 4
|
||||
|
||||
/* The size of `off_t', as computed by sizeof. */
|
||||
#define SIZEOF_OFF_T 8
|
||||
|
||||
/* The size of `short', as computed by sizeof. */
|
||||
#define SIZEOF_SHORT 2
|
||||
|
||||
/* The size of `size_t', as computed by sizeof. */
|
||||
#define SIZEOF_SIZE_T 4
|
||||
|
||||
/* The size of `time_t', as computed by sizeof. */
|
||||
#define SIZEOF_TIME_T 4
|
||||
|
||||
/* The size of `void*', as computed by sizeof. */
|
||||
#define SIZEOF_VOIDP 4
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define to the type of arg 3 for strerror_r. */
|
||||
/* #undef STRERROR_R_TYPE_ARG3 */
|
||||
|
||||
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
||||
/* #undef TIME_WITH_SYS_TIME */
|
||||
|
||||
/* Define if you want to enable c-ares support */
|
||||
/* #undef USE_ARES */
|
||||
|
||||
/* Define to disable non-blocking sockets. */
|
||||
/* #undef USE_BLOCKING_SOCKETS */
|
||||
|
||||
/* if GnuTLS is enabled */
|
||||
/* #undef USE_GNUTLS */
|
||||
|
||||
/* if libSSH2 is in use */
|
||||
/* #undef USE_LIBSSH2 */
|
||||
|
||||
/* If you want to build curl with the built-in manual */
|
||||
#define USE_MANUAL 1
|
||||
|
||||
/* if NSS is enabled */
|
||||
/* #undef USE_NSS */
|
||||
|
||||
/* if OpenSSL is in use */
|
||||
#define USE_OPENSSL 1
|
||||
|
||||
/* Define to 1 if you are building a Windows target without large file
|
||||
support. */
|
||||
/* #undef USE_WIN32_LARGE_FILES */
|
||||
|
||||
/* to enable SSPI support */
|
||||
/* #undef USE_WINDOWS_SSPI */
|
||||
|
||||
/* Define to 1 if using yaSSL in OpenSSL compatibility mode. */
|
||||
/* #undef USE_YASSLEMUL */
|
||||
|
||||
/* Define to avoid automatic inclusion of winsock.h */
|
||||
/* #undef WIN32_LEAN_AND_MEAN */
|
||||
|
||||
/* Define to 1 if OS is AIX. */
|
||||
#ifndef _ALL_SOURCE
|
||||
/* # undef _ALL_SOURCE */
|
||||
#endif
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
/* #undef _FILE_OFFSET_BITS */
|
||||
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
/* #undef _LARGE_FILES */
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
/* #undef const */
|
||||
|
||||
/* Type to use in place of in_addr_t when system does not provide it. */
|
||||
/* #undef in_addr_t */
|
||||
|
||||
/* Define to `__inline__' or `__inline' if that's what the C compiler
|
||||
calls it, or to nothing if 'inline' is not supported under any name. */
|
||||
#ifndef __cplusplus
|
||||
/* #undef inline */
|
||||
#endif
|
||||
|
||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||
/* #undef size_t */
|
||||
|
||||
/* the signed version of size_t */
|
||||
/* #undef ssize_t */
|
||||
|
||||
#endif /* HEADER_CURL_CONFIG_VXWORKS_H */
|
|
@ -1,725 +0,0 @@
|
|||
#ifndef HEADER_CURL_CONFIG_WIN32_H
|
||||
#define HEADER_CURL_CONFIG_WIN32_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* ================================================================ */
|
||||
/* Hand crafted config file for Windows */
|
||||
/* ================================================================ */
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* HEADER FILES */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* Define if you have the <arpa/inet.h> header file. */
|
||||
/* #define HAVE_ARPA_INET_H 1 */
|
||||
|
||||
/* Define if you have the <assert.h> header file. */
|
||||
#define HAVE_ASSERT_H 1
|
||||
|
||||
/* Define if you have the <crypto.h> header file. */
|
||||
/* #define HAVE_CRYPTO_H 1 */
|
||||
|
||||
/* Define if you have the <errno.h> header file. */
|
||||
#define HAVE_ERRNO_H 1
|
||||
|
||||
/* Define if you have the <err.h> header file. */
|
||||
/* #define HAVE_ERR_H 1 */
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#define HAVE_FCNTL_H 1
|
||||
|
||||
/* Define if you have the <getopt.h> header file. */
|
||||
#if defined(__MINGW32__) || defined(__POCC__)
|
||||
#define HAVE_GETOPT_H 1
|
||||
#endif
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1800)
|
||||
#define HAVE_INTTYPES_H 1
|
||||
#endif
|
||||
|
||||
/* Define if you have the <io.h> header file. */
|
||||
#define HAVE_IO_H 1
|
||||
|
||||
/* Define if you have the <limits.h> header file. */
|
||||
#define HAVE_LIMITS_H 1
|
||||
|
||||
/* Define if you have the <locale.h> header file. */
|
||||
#define HAVE_LOCALE_H 1
|
||||
|
||||
/* Define if you need <malloc.h> header even with <stdlib.h> header file. */
|
||||
#if !defined(__SALFORDC__) && !defined(__POCC__)
|
||||
#define NEED_MALLOC_H 1
|
||||
#endif
|
||||
|
||||
/* Define if you have the <netdb.h> header file. */
|
||||
/* #define HAVE_NETDB_H 1 */
|
||||
|
||||
/* Define if you have the <netinet/in.h> header file. */
|
||||
/* #define HAVE_NETINET_IN_H 1 */
|
||||
|
||||
/* Define if you have the <process.h> header file. */
|
||||
#ifndef __SALFORDC__
|
||||
#define HAVE_PROCESS_H 1
|
||||
#endif
|
||||
|
||||
/* Define if you have the <signal.h> header file. */
|
||||
#define HAVE_SIGNAL_H 1
|
||||
|
||||
/* Define if you have the <sgtty.h> header file. */
|
||||
/* #define HAVE_SGTTY_H 1 */
|
||||
|
||||
/* Define if you have the <ssl.h> header file. */
|
||||
/* #define HAVE_SSL_H 1 */
|
||||
|
||||
/* Define to 1 if you have the <stdbool.h> header file. */
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1800)
|
||||
#define HAVE_STDBOOL_H 1
|
||||
#endif
|
||||
|
||||
/* Define if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
/* #define HAVE_SYS_PARAM_H 1 */
|
||||
|
||||
/* Define if you have the <sys/select.h> header file. */
|
||||
/* #define HAVE_SYS_SELECT_H 1 */
|
||||
|
||||
/* Define if you have the <sys/socket.h> header file. */
|
||||
/* #define HAVE_SYS_SOCKET_H 1 */
|
||||
|
||||
/* Define if you have the <sys/sockio.h> header file. */
|
||||
/* #define HAVE_SYS_SOCKIO_H 1 */
|
||||
|
||||
/* Define if you have the <sys/stat.h> header file. */
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
|
||||
/* Define if you have the <sys/time.h> header file. */
|
||||
/* #define HAVE_SYS_TIME_H 1 */
|
||||
|
||||
/* Define if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define if you have the <sys/utime.h> header file. */
|
||||
#ifndef __BORLANDC__
|
||||
#define HAVE_SYS_UTIME_H 1
|
||||
#endif
|
||||
|
||||
/* Define if you have the <termio.h> header file. */
|
||||
/* #define HAVE_TERMIO_H 1 */
|
||||
|
||||
/* Define if you have the <termios.h> header file. */
|
||||
/* #define HAVE_TERMIOS_H 1 */
|
||||
|
||||
/* Define if you have the <time.h> header file. */
|
||||
#define HAVE_TIME_H 1
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__LCC__) || \
|
||||
defined(__POCC__)
|
||||
#define HAVE_UNISTD_H 1
|
||||
#endif
|
||||
|
||||
/* Define if you have the <windows.h> header file. */
|
||||
#define HAVE_WINDOWS_H 1
|
||||
|
||||
/* Define if you have the <winsock.h> header file. */
|
||||
#define HAVE_WINSOCK_H 1
|
||||
|
||||
/* Define if you have the <winsock2.h> header file. */
|
||||
#ifndef __SALFORDC__
|
||||
#define HAVE_WINSOCK2_H 1
|
||||
#endif
|
||||
|
||||
/* Define if you have the <ws2tcpip.h> header file. */
|
||||
#ifndef __SALFORDC__
|
||||
#define HAVE_WS2TCPIP_H 1
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* OTHER HEADER INFO */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* Define if sig_atomic_t is an available typedef. */
|
||||
#define HAVE_SIG_ATOMIC_T 1
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define if you can safely include both <sys/time.h> and <time.h>. */
|
||||
/* #define TIME_WITH_SYS_TIME 1 */
|
||||
|
||||
/* Define to 1 if bool is an available type. */
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1800)
|
||||
#define HAVE_BOOL_T 1
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* FUNCTIONS */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* Define if you have the closesocket function. */
|
||||
#define HAVE_CLOSESOCKET 1
|
||||
|
||||
/* Define if you don't have vprintf but do have _doprnt. */
|
||||
/* #define HAVE_DOPRNT 1 */
|
||||
|
||||
/* Define if you have the ftruncate function. */
|
||||
#define HAVE_FTRUNCATE 1
|
||||
|
||||
/* Define if you have the gethostbyaddr function. */
|
||||
#define HAVE_GETHOSTBYADDR 1
|
||||
|
||||
/* Define if you have the gethostname function. */
|
||||
#define HAVE_GETHOSTNAME 1
|
||||
|
||||
/* Define if you have the getpass function. */
|
||||
/* #define HAVE_GETPASS 1 */
|
||||
|
||||
/* Define if you have the getservbyname function. */
|
||||
#define HAVE_GETSERVBYNAME 1
|
||||
|
||||
/* Define if you have the getprotobyname function. */
|
||||
#define HAVE_GETPROTOBYNAME
|
||||
|
||||
/* Define if you have the gettimeofday function. */
|
||||
/* #define HAVE_GETTIMEOFDAY 1 */
|
||||
|
||||
/* Define if you have the inet_addr function. */
|
||||
#define HAVE_INET_ADDR 1
|
||||
|
||||
/* Define if you have the ioctlsocket function. */
|
||||
#define HAVE_IOCTLSOCKET 1
|
||||
|
||||
/* Define if you have a working ioctlsocket FIONBIO function. */
|
||||
#define HAVE_IOCTLSOCKET_FIONBIO 1
|
||||
|
||||
/* Define if you have the perror function. */
|
||||
#define HAVE_PERROR 1
|
||||
|
||||
/* Define if you have the RAND_screen function when using SSL. */
|
||||
#define HAVE_RAND_SCREEN 1
|
||||
|
||||
/* Define if you have the `RAND_status' function when using SSL. */
|
||||
#define HAVE_RAND_STATUS 1
|
||||
|
||||
/* Define if you have the `CRYPTO_cleanup_all_ex_data' function.
|
||||
This is present in OpenSSL versions after 0.9.6b */
|
||||
#define HAVE_CRYPTO_CLEANUP_ALL_EX_DATA 1
|
||||
|
||||
/* Define if you have the select function. */
|
||||
#define HAVE_SELECT 1
|
||||
|
||||
/* Define if you have the setlocale function. */
|
||||
#define HAVE_SETLOCALE 1
|
||||
|
||||
/* Define if you have the setmode function. */
|
||||
#define HAVE_SETMODE 1
|
||||
|
||||
/* Define if you have the setvbuf function. */
|
||||
#define HAVE_SETVBUF 1
|
||||
|
||||
/* Define if you have the socket function. */
|
||||
#define HAVE_SOCKET 1
|
||||
|
||||
/* Define if you have the strcasecmp function. */
|
||||
/* #define HAVE_STRCASECMP 1 */
|
||||
|
||||
/* Define if you have the strdup function. */
|
||||
#define HAVE_STRDUP 1
|
||||
|
||||
/* Define if you have the strftime function. */
|
||||
#define HAVE_STRFTIME 1
|
||||
|
||||
/* Define if you have the stricmp function. */
|
||||
#define HAVE_STRICMP 1
|
||||
|
||||
/* Define if you have the strncasecmp function. */
|
||||
/* #define HAVE_STRNCASECMP 1 */
|
||||
|
||||
/* Define if you have the strnicmp function. */
|
||||
#define HAVE_STRNICMP 1
|
||||
|
||||
/* Define if you have the strstr function. */
|
||||
#define HAVE_STRSTR 1
|
||||
|
||||
/* Define if you have the strtoll function. */
|
||||
#if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__POCC__) || \
|
||||
(defined(_MSC_VER) && (_MSC_VER >= 1800))
|
||||
#define HAVE_STRTOLL 1
|
||||
#endif
|
||||
|
||||
/* Define if you have the tcgetattr function. */
|
||||
/* #define HAVE_TCGETATTR 1 */
|
||||
|
||||
/* Define if you have the tcsetattr function. */
|
||||
/* #define HAVE_TCSETATTR 1 */
|
||||
|
||||
/* Define if you have the utime function. */
|
||||
#ifndef __BORLANDC__
|
||||
#define HAVE_UTIME 1
|
||||
#endif
|
||||
|
||||
/* Define to the type qualifier of arg 1 for getnameinfo. */
|
||||
#define GETNAMEINFO_QUAL_ARG1 const
|
||||
|
||||
/* Define to the type of arg 1 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG1 struct sockaddr *
|
||||
|
||||
/* Define to the type of arg 2 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG2 socklen_t
|
||||
|
||||
/* Define to the type of args 4 and 6 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG46 DWORD
|
||||
|
||||
/* Define to the type of arg 7 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG7 int
|
||||
|
||||
/* Define if you have the recv function. */
|
||||
#define HAVE_RECV 1
|
||||
|
||||
/* Define to the type of arg 1 for recv. */
|
||||
#define RECV_TYPE_ARG1 SOCKET
|
||||
|
||||
/* Define to the type of arg 2 for recv. */
|
||||
#define RECV_TYPE_ARG2 char *
|
||||
|
||||
/* Define to the type of arg 3 for recv. */
|
||||
#define RECV_TYPE_ARG3 int
|
||||
|
||||
/* Define to the type of arg 4 for recv. */
|
||||
#define RECV_TYPE_ARG4 int
|
||||
|
||||
/* Define to the function return type for recv. */
|
||||
#define RECV_TYPE_RETV int
|
||||
|
||||
/* Define if you have the recvfrom function. */
|
||||
#define HAVE_RECVFROM 1
|
||||
|
||||
/* Define to the type of arg 1 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG1 SOCKET
|
||||
|
||||
/* Define to the type pointed by arg 2 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG2 char
|
||||
|
||||
/* Define to the type of arg 3 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG3 int
|
||||
|
||||
/* Define to the type of arg 4 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG4 int
|
||||
|
||||
/* Define to the type pointed by arg 5 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG5 struct sockaddr
|
||||
|
||||
/* Define to the type pointed by arg 6 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG6 int
|
||||
|
||||
/* Define to the function return type for recvfrom. */
|
||||
#define RECVFROM_TYPE_RETV int
|
||||
|
||||
/* Define if you have the send function. */
|
||||
#define HAVE_SEND 1
|
||||
|
||||
/* Define to the type of arg 1 for send. */
|
||||
#define SEND_TYPE_ARG1 SOCKET
|
||||
|
||||
/* Define to the type qualifier of arg 2 for send. */
|
||||
#define SEND_QUAL_ARG2 const
|
||||
|
||||
/* Define to the type of arg 2 for send. */
|
||||
#define SEND_TYPE_ARG2 char *
|
||||
|
||||
/* Define to the type of arg 3 for send. */
|
||||
#define SEND_TYPE_ARG3 int
|
||||
|
||||
/* Define to the type of arg 4 for send. */
|
||||
#define SEND_TYPE_ARG4 int
|
||||
|
||||
/* Define to the function return type for send. */
|
||||
#define SEND_TYPE_RETV int
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* TYPEDEF REPLACEMENTS */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* Define if in_addr_t is not an available 'typedefed' type. */
|
||||
#define in_addr_t unsigned long
|
||||
|
||||
/* Define to the return type of signal handlers (int or void). */
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* Define if ssize_t is not an available 'typedefed' type. */
|
||||
#ifndef _SSIZE_T_DEFINED
|
||||
# if (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || \
|
||||
defined(__POCC__) || \
|
||||
defined(__MINGW32__)
|
||||
# elif defined(_WIN64)
|
||||
# define _SSIZE_T_DEFINED
|
||||
# define ssize_t __int64
|
||||
# else
|
||||
# define _SSIZE_T_DEFINED
|
||||
# define ssize_t int
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* TYPE SIZES */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* Define to the size of `int', as computed by sizeof. */
|
||||
#define SIZEOF_INT 4
|
||||
|
||||
/* Define to the size of `long double', as computed by sizeof. */
|
||||
#define SIZEOF_LONG_DOUBLE 16
|
||||
|
||||
/* Define to the size of `long long', as computed by sizeof. */
|
||||
/* #define SIZEOF_LONG_LONG 8 */
|
||||
|
||||
/* Define to the size of `short', as computed by sizeof. */
|
||||
#define SIZEOF_SHORT 2
|
||||
|
||||
/* Define to the size of `size_t', as computed by sizeof. */
|
||||
#if defined(_WIN64)
|
||||
# define SIZEOF_SIZE_T 8
|
||||
#else
|
||||
# define SIZEOF_SIZE_T 4
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* BSD-style lwIP TCP/IP stack SPECIFIC */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* Define to use BSD-style lwIP TCP/IP stack. */
|
||||
/* #define USE_LWIPSOCK 1 */
|
||||
|
||||
#ifdef USE_LWIPSOCK
|
||||
# undef USE_WINSOCK
|
||||
# undef HAVE_WINSOCK_H
|
||||
# undef HAVE_WINSOCK2_H
|
||||
# undef HAVE_WS2TCPIP_H
|
||||
# undef HAVE_ERRNO_H
|
||||
# undef HAVE_GETHOSTNAME
|
||||
# undef HAVE_GETNAMEINFO
|
||||
# undef LWIP_POSIX_SOCKETS_IO_NAMES
|
||||
# undef RECV_TYPE_ARG1
|
||||
# undef RECV_TYPE_ARG3
|
||||
# undef SEND_TYPE_ARG1
|
||||
# undef SEND_TYPE_ARG3
|
||||
# define HAVE_FREEADDRINFO
|
||||
# define HAVE_GETADDRINFO
|
||||
# define HAVE_GETHOSTBYNAME
|
||||
# define HAVE_GETHOSTBYNAME_R
|
||||
# define HAVE_GETHOSTBYNAME_R_6
|
||||
# define LWIP_POSIX_SOCKETS_IO_NAMES 0
|
||||
# define RECV_TYPE_ARG1 int
|
||||
# define RECV_TYPE_ARG3 size_t
|
||||
# define SEND_TYPE_ARG1 int
|
||||
# define SEND_TYPE_ARG3 size_t
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* Watt-32 tcp/ip SPECIFIC */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
#ifdef USE_WATT32
|
||||
#include <tcp.h>
|
||||
#undef byte
|
||||
#undef word
|
||||
#undef USE_WINSOCK
|
||||
#undef HAVE_WINSOCK_H
|
||||
#undef HAVE_WINSOCK2_H
|
||||
#undef HAVE_WS2TCPIP_H
|
||||
#define HAVE_GETADDRINFO
|
||||
#define HAVE_GETNAMEINFO
|
||||
#define HAVE_SYS_IOCTL_H
|
||||
#define HAVE_SYS_SOCKET_H
|
||||
#define HAVE_NETINET_IN_H
|
||||
#define HAVE_NETDB_H
|
||||
#define HAVE_ARPA_INET_H
|
||||
#define HAVE_FREEADDRINFO
|
||||
#define SOCKET int
|
||||
#endif
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* COMPILER SPECIFIC */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* Define to nothing if compiler does not support 'const' qualifier. */
|
||||
/* #define const */
|
||||
|
||||
/* Define to nothing if compiler does not support 'volatile' qualifier. */
|
||||
/* #define volatile */
|
||||
|
||||
/* Windows should not have HAVE_GMTIME_R defined */
|
||||
/* #undef HAVE_GMTIME_R */
|
||||
|
||||
/* Define if the compiler supports C99 variadic macro style. */
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1400)
|
||||
#define HAVE_VARIADIC_MACROS_C99 1
|
||||
#endif
|
||||
|
||||
/* Define if the compiler supports the 'long long' data type. */
|
||||
#if defined(__MINGW32__) || defined(__WATCOMC__) || \
|
||||
(defined(_MSC_VER) && (_MSC_VER >= 1310)) || \
|
||||
(defined(__BORLANDC__) && (__BORLANDC__ >= 0x561))
|
||||
#define HAVE_LONGLONG 1
|
||||
#endif
|
||||
|
||||
/* Define to avoid VS2005 complaining about portable C functions. */
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1400)
|
||||
#define _CRT_SECURE_NO_DEPRECATE 1
|
||||
#define _CRT_NONSTDC_NO_DEPRECATE 1
|
||||
#endif
|
||||
|
||||
/* VS2005 and later dafault size for time_t is 64-bit, unless
|
||||
_USE_32BIT_TIME_T has been defined to get a 32-bit time_t. */
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1400)
|
||||
# ifndef _USE_32BIT_TIME_T
|
||||
# define SIZEOF_TIME_T 8
|
||||
# else
|
||||
# define SIZEOF_TIME_T 4
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Define some minimum and default build targets for Visual Studio */
|
||||
#if defined(_MSC_VER)
|
||||
/* Officially, Microsoft's Windows SDK versions 6.X does not support Windows
|
||||
2000 as a supported build target. VS2008 default installations provides
|
||||
an embedded Windows SDK v6.0A along with the claim that Windows 2000 is a
|
||||
valid build target for VS2008. Popular belief is that binaries built with
|
||||
VS2008 using Windows SDK versions v6.X and Windows 2000 as a build target
|
||||
are functional. */
|
||||
# define VS2008_MIN_TARGET 0x0500
|
||||
|
||||
/* The minimum build target for VS2012 is Vista unless Update 1 is installed
|
||||
and the v110_xp toolset is choosen. */
|
||||
# if defined(_USING_V110_SDK71_)
|
||||
# define VS2012_MIN_TARGET 0x0501
|
||||
# else
|
||||
# define VS2012_MIN_TARGET 0x0600
|
||||
# endif
|
||||
|
||||
/* VS2008 default build target is Windows Vista. We override default target
|
||||
to be Windows XP. */
|
||||
# define VS2008_DEF_TARGET 0x0501
|
||||
|
||||
/* VS2012 default build target is Windows Vista unless Update 1 is installed
|
||||
and the v110_xp toolset is choosen. */
|
||||
# if defined(_USING_V110_SDK71_)
|
||||
# define VS2012_DEF_TARGET 0x0501
|
||||
# else
|
||||
# define VS2012_DEF_TARGET 0x0600
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* VS2008 default target settings and minimum build target check. */
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1500) && (_MSC_VER <= 1600)
|
||||
# ifndef _WIN32_WINNT
|
||||
# define _WIN32_WINNT VS2008_DEF_TARGET
|
||||
# endif
|
||||
# ifndef WINVER
|
||||
# define WINVER VS2008_DEF_TARGET
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* VS2012 default target settings and minimum build target check. */
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1700)
|
||||
# ifndef _WIN32_WINNT
|
||||
# define _WIN32_WINNT VS2012_DEF_TARGET
|
||||
# endif
|
||||
# ifndef WINVER
|
||||
# define WINVER VS2012_DEF_TARGET
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* When no build target is specified Pelles C 5.00 and later default build
|
||||
target is Windows Vista. We override default target to be Windows 2000. */
|
||||
#if defined(__POCC__) && (__POCC__ >= 500)
|
||||
# ifndef _WIN32_WINNT
|
||||
# define _WIN32_WINNT 0x0500
|
||||
# endif
|
||||
# ifndef WINVER
|
||||
# define WINVER 0x0500
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Availability of freeaddrinfo, getaddrinfo and getnameinfo functions is
|
||||
quite convoluted, compiler dependent and even build target dependent. */
|
||||
#if defined(HAVE_WS2TCPIP_H)
|
||||
# if defined(__POCC__)
|
||||
# define HAVE_FREEADDRINFO 1
|
||||
# define HAVE_GETADDRINFO 1
|
||||
# define HAVE_GETADDRINFO_THREADSAFE 1
|
||||
# define HAVE_GETNAMEINFO 1
|
||||
# elif defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501)
|
||||
# define HAVE_FREEADDRINFO 1
|
||||
# define HAVE_GETADDRINFO 1
|
||||
# define HAVE_GETADDRINFO_THREADSAFE 1
|
||||
# define HAVE_GETNAMEINFO 1
|
||||
# elif defined(_MSC_VER) && (_MSC_VER >= 1200)
|
||||
# define HAVE_FREEADDRINFO 1
|
||||
# define HAVE_GETADDRINFO 1
|
||||
# define HAVE_GETADDRINFO_THREADSAFE 1
|
||||
# define HAVE_GETNAMEINFO 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__POCC__)
|
||||
# ifndef _MSC_VER
|
||||
# error Microsoft extensions /Ze compiler option is required
|
||||
# endif
|
||||
# ifndef __POCC__OLDNAMES
|
||||
# error Compatibility names /Go compiler option is required
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* STRUCT RELATED */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* Define if you have struct sockaddr_storage. */
|
||||
#if !defined(__SALFORDC__) && !defined(__BORLANDC__)
|
||||
#define HAVE_STRUCT_SOCKADDR_STORAGE 1
|
||||
#endif
|
||||
|
||||
/* Define if you have struct timeval. */
|
||||
#define HAVE_STRUCT_TIMEVAL 1
|
||||
|
||||
/* Define if struct sockaddr_in6 has the sin6_scope_id member. */
|
||||
#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
|
||||
|
||||
#if defined(HAVE_WINSOCK2_H) && defined(_WIN32_WINNT) && \
|
||||
(_WIN32_WINNT >= 0x0600)
|
||||
#define HAVE_STRUCT_POLLFD 1
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* LARGE FILE SUPPORT */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
#if defined(_MSC_VER) && !defined(_WIN32_WCE)
|
||||
# if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64)
|
||||
# define USE_WIN32_LARGE_FILES
|
||||
# else
|
||||
# define USE_WIN32_SMALL_FILES
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__MINGW32__) && !defined(USE_WIN32_LARGE_FILES)
|
||||
# define USE_WIN32_LARGE_FILES
|
||||
#endif
|
||||
|
||||
#if defined(__WATCOMC__) && !defined(USE_WIN32_LARGE_FILES)
|
||||
# define USE_WIN32_LARGE_FILES
|
||||
#endif
|
||||
|
||||
#if defined(__POCC__)
|
||||
# undef USE_WIN32_LARGE_FILES
|
||||
#endif
|
||||
|
||||
#if !defined(USE_WIN32_LARGE_FILES) && !defined(USE_WIN32_SMALL_FILES)
|
||||
# define USE_WIN32_SMALL_FILES
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* DNS RESOLVER SPECIALTY */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* Undefine both USE_ARES and USE_THREADS_WIN32 for synchronous DNS.
|
||||
*/
|
||||
|
||||
/* Define to enable c-ares asynchronous DNS lookups. */
|
||||
/* #define USE_ARES 1 */
|
||||
|
||||
/* Default define to enable threaded asynchronous DNS lookups. */
|
||||
#if !defined(USE_SYNC_DNS) && !defined(USE_ARES) && \
|
||||
!defined(USE_THREADS_WIN32)
|
||||
# define USE_THREADS_WIN32 1
|
||||
#endif
|
||||
|
||||
#if defined(USE_ARES) && defined(USE_THREADS_WIN32)
|
||||
# error "Only one DNS lookup specialty may be defined at most"
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* LDAP SUPPORT */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
#if defined(CURL_HAS_NOVELL_LDAPSDK) || defined(CURL_HAS_MOZILLA_LDAPSDK)
|
||||
#undef USE_WIN32_LDAP
|
||||
#define HAVE_LDAP_SSL_H 1
|
||||
#define HAVE_LDAP_URL_PARSE 1
|
||||
#elif defined(CURL_HAS_OPENLDAP_LDAPSDK)
|
||||
#undef USE_WIN32_LDAP
|
||||
#define HAVE_LDAP_URL_PARSE 1
|
||||
#else
|
||||
#undef HAVE_LDAP_URL_PARSE
|
||||
#define USE_WIN32_LDAP 1
|
||||
#endif
|
||||
|
||||
#if defined(__WATCOMC__) && defined(USE_WIN32_LDAP)
|
||||
#if __WATCOMC__ < 1280
|
||||
#define WINBERAPI __declspec(cdecl)
|
||||
#define WINLDAPAPI __declspec(cdecl)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__POCC__) && defined(USE_WIN32_LDAP)
|
||||
# define CURL_DISABLE_LDAP 1
|
||||
#endif
|
||||
|
||||
/* Define to use the Windows crypto library. */
|
||||
#if !defined(USE_OPENSSL) && !defined(USE_NSS)
|
||||
#define USE_WIN32_CRYPTO
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* ADDITIONAL DEFINITIONS */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* Define cpu-machine-OS */
|
||||
#undef OS
|
||||
#if defined(_M_IX86) || defined(__i386__) /* x86 (MSVC or gcc) */
|
||||
#define OS "i386-pc-win32"
|
||||
#elif defined(_M_X64) || defined(__x86_64__) /* x86_64 (MSVC >=2005 or gcc) */
|
||||
#define OS "x86_64-pc-win32"
|
||||
#elif defined(_M_IA64) /* Itanium */
|
||||
#define OS "ia64-pc-win32"
|
||||
#else
|
||||
#define OS "unknown-pc-win32"
|
||||
#endif
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "curl"
|
||||
|
||||
/* If you want to build curl with the built-in manual */
|
||||
#define USE_MANUAL 1
|
||||
|
||||
#if defined(__POCC__) || defined(USE_IPV6)
|
||||
# define ENABLE_IPV6 1
|
||||
#endif
|
||||
|
||||
#endif /* HEADER_CURL_CONFIG_WIN32_H */
|
|
@ -1,448 +0,0 @@
|
|||
#ifndef HEADER_CURL_CONFIG_WIN32CE_H
|
||||
#define HEADER_CURL_CONFIG_WIN32CE_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* ================================================================ */
|
||||
/* lib/config-win32ce.h - Hand crafted config file for windows ce */
|
||||
/* ================================================================ */
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* HEADER FILES */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* Define if you have the <arpa/inet.h> header file. */
|
||||
/* #define HAVE_ARPA_INET_H 1 */
|
||||
|
||||
/* Define if you have the <assert.h> header file. */
|
||||
/* #define HAVE_ASSERT_H 1 */
|
||||
|
||||
/* Define if you have the <crypto.h> header file. */
|
||||
/* #define HAVE_CRYPTO_H 1 */
|
||||
|
||||
/* Define if you have the <errno.h> header file. */
|
||||
/* #define HAVE_ERRNO_H 1 */
|
||||
|
||||
/* Define if you have the <err.h> header file. */
|
||||
/* #define HAVE_ERR_H 1 */
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#define HAVE_FCNTL_H 1
|
||||
|
||||
/* Define if you have the <getopt.h> header file. */
|
||||
/* #define HAVE_GETOPT_H 1 */
|
||||
|
||||
/* Define if you have the <io.h> header file. */
|
||||
#define HAVE_IO_H 1
|
||||
|
||||
/* Define if you have the <limits.h> header file. */
|
||||
#define HAVE_LIMITS_H 1
|
||||
|
||||
/* Define if you need the malloc.h header header file even with stdlib.h */
|
||||
#define NEED_MALLOC_H 1
|
||||
|
||||
/* Define if you have the <netdb.h> header file. */
|
||||
/* #define HAVE_NETDB_H 1 */
|
||||
|
||||
/* Define if you have the <netinet/in.h> header file. */
|
||||
/* #define HAVE_NETINET_IN_H 1 */
|
||||
|
||||
/* Define if you have the <signal.h> header file. */
|
||||
#define HAVE_SIGNAL_H 1
|
||||
|
||||
/* Define if you have the <sgtty.h> header file. */
|
||||
/* #define HAVE_SGTTY_H 1 */
|
||||
|
||||
/* Define if you have the <ssl.h> header file. */
|
||||
/* #define HAVE_SSL_H 1 */
|
||||
|
||||
/* Define if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* Define if you have the <process.h> header file. */
|
||||
/* #define HAVE_PROCESS_H 1 */
|
||||
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
/* #define HAVE_SYS_PARAM_H 1 */
|
||||
|
||||
/* Define if you have the <sys/select.h> header file. */
|
||||
/* #define HAVE_SYS_SELECT_H 1 */
|
||||
|
||||
/* Define if you have the <sys/socket.h> header file. */
|
||||
/* #define HAVE_SYS_SOCKET_H 1 */
|
||||
|
||||
/* Define if you have the <sys/sockio.h> header file. */
|
||||
/* #define HAVE_SYS_SOCKIO_H 1 */
|
||||
|
||||
/* Define if you have the <sys/stat.h> header file. */
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
|
||||
/* Define if you have the <sys/time.h> header file */
|
||||
/* #define HAVE_SYS_TIME_H 1 */
|
||||
|
||||
/* Define if you have the <sys/types.h> header file. */
|
||||
/* #define HAVE_SYS_TYPES_H 1 */
|
||||
|
||||
/* Define if you have the <sys/utime.h> header file */
|
||||
#define HAVE_SYS_UTIME_H 1
|
||||
|
||||
/* Define if you have the <termio.h> header file. */
|
||||
/* #define HAVE_TERMIO_H 1 */
|
||||
|
||||
/* Define if you have the <termios.h> header file. */
|
||||
/* #define HAVE_TERMIOS_H 1 */
|
||||
|
||||
/* Define if you have the <time.h> header file. */
|
||||
#define HAVE_TIME_H 1
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__LCC__)
|
||||
#define HAVE_UNISTD_H 1
|
||||
#endif
|
||||
|
||||
/* Define if you have the <windows.h> header file. */
|
||||
#define HAVE_WINDOWS_H 1
|
||||
|
||||
/* Define if you have the <winsock.h> header file. */
|
||||
#define HAVE_WINSOCK_H 1
|
||||
|
||||
/* Define if you have the <winsock2.h> header file. */
|
||||
/* #define HAVE_WINSOCK2_H 1 */
|
||||
|
||||
/* Define if you have the <ws2tcpip.h> header file. */
|
||||
/* #define HAVE_WS2TCPIP_H 1 */
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* OTHER HEADER INFO */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* Define if sig_atomic_t is an available typedef. */
|
||||
#define HAVE_SIG_ATOMIC_T 1
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define if you can safely include both <sys/time.h> and <time.h>. */
|
||||
/* #define TIME_WITH_SYS_TIME 1 */
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* FUNCTIONS */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* Define if you have the closesocket function. */
|
||||
#define HAVE_CLOSESOCKET 1
|
||||
|
||||
/* Define if you don't have vprintf but do have _doprnt. */
|
||||
/* #define HAVE_DOPRNT 1 */
|
||||
|
||||
/* Define if you have the gethostbyaddr function. */
|
||||
#define HAVE_GETHOSTBYADDR 1
|
||||
|
||||
/* Define if you have the gethostname function. */
|
||||
#define HAVE_GETHOSTNAME 1
|
||||
|
||||
/* Define if you have the getpass function. */
|
||||
/* #define HAVE_GETPASS 1 */
|
||||
|
||||
/* Define if you have the getservbyname function. */
|
||||
#define HAVE_GETSERVBYNAME 1
|
||||
|
||||
/* Define if you have the gettimeofday function. */
|
||||
/* #define HAVE_GETTIMEOFDAY 1 */
|
||||
|
||||
/* Define if you have the inet_addr function. */
|
||||
#define HAVE_INET_ADDR 1
|
||||
|
||||
/* Define if you have the ioctlsocket function. */
|
||||
#define HAVE_IOCTLSOCKET 1
|
||||
|
||||
/* Define if you have a working ioctlsocket FIONBIO function. */
|
||||
#define HAVE_IOCTLSOCKET_FIONBIO 1
|
||||
|
||||
/* Define if you have the perror function. */
|
||||
#define HAVE_PERROR 1
|
||||
|
||||
/* Define if you have the RAND_screen function when using SSL */
|
||||
#define HAVE_RAND_SCREEN 1
|
||||
|
||||
/* Define if you have the `RAND_status' function when using SSL. */
|
||||
#define HAVE_RAND_STATUS 1
|
||||
|
||||
/* Define if you have the select function. */
|
||||
#define HAVE_SELECT 1
|
||||
|
||||
/* Define if you have the setvbuf function. */
|
||||
#define HAVE_SETVBUF 1
|
||||
|
||||
/* Define if you have the socket function. */
|
||||
#define HAVE_SOCKET 1
|
||||
|
||||
/* Define if you have the strcasecmp function. */
|
||||
/* #define HAVE_STRCASECMP 1 */
|
||||
|
||||
/* Define if you have the strdup function. */
|
||||
/* #define HAVE_STRDUP 1 */
|
||||
|
||||
/* Define if you have the strftime function. */
|
||||
/* #define HAVE_STRFTIME 1 */
|
||||
|
||||
/* Define if you have the stricmp function. */
|
||||
/* #define HAVE_STRICMP 1 */
|
||||
|
||||
/* Define if you have the strncasecmp function. */
|
||||
/* #define HAVE_STRNCASECMP 1 */
|
||||
|
||||
/* Define if you have the strnicmp function. */
|
||||
/* #define HAVE_STRNICMP 1 */
|
||||
|
||||
/* Define if you have the strstr function. */
|
||||
#define HAVE_STRSTR 1
|
||||
|
||||
/* Define if you have the strtoll function. */
|
||||
#if defined(__MINGW32__) || defined(__WATCOMC__)
|
||||
#define HAVE_STRTOLL 1
|
||||
#endif
|
||||
|
||||
/* Define if you have the tcgetattr function. */
|
||||
/* #define HAVE_TCGETATTR 1 */
|
||||
|
||||
/* Define if you have the tcsetattr function. */
|
||||
/* #define HAVE_TCSETATTR 1 */
|
||||
|
||||
/* Define if you have the utime function */
|
||||
#define HAVE_UTIME 1
|
||||
|
||||
/* Define if you have the getnameinfo function. */
|
||||
#define HAVE_GETNAMEINFO 1
|
||||
|
||||
/* Define to the type qualifier of arg 1 for getnameinfo. */
|
||||
#define GETNAMEINFO_QUAL_ARG1 const
|
||||
|
||||
/* Define to the type of arg 1 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG1 struct sockaddr *
|
||||
|
||||
/* Define to the type of arg 2 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG2 socklen_t
|
||||
|
||||
/* Define to the type of args 4 and 6 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG46 DWORD
|
||||
|
||||
/* Define to the type of arg 7 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG7 int
|
||||
|
||||
/* Define if you have the recv function. */
|
||||
#define HAVE_RECV 1
|
||||
|
||||
/* Define to the type of arg 1 for recv. */
|
||||
#define RECV_TYPE_ARG1 SOCKET
|
||||
|
||||
/* Define to the type of arg 2 for recv. */
|
||||
#define RECV_TYPE_ARG2 char *
|
||||
|
||||
/* Define to the type of arg 3 for recv. */
|
||||
#define RECV_TYPE_ARG3 int
|
||||
|
||||
/* Define to the type of arg 4 for recv. */
|
||||
#define RECV_TYPE_ARG4 int
|
||||
|
||||
/* Define to the function return type for recv. */
|
||||
#define RECV_TYPE_RETV int
|
||||
|
||||
/* Define if you have the recvfrom function. */
|
||||
#define HAVE_RECVFROM 1
|
||||
|
||||
/* Define to the type of arg 1 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG1 SOCKET
|
||||
|
||||
/* Define to the type pointed by arg 2 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG2 char
|
||||
|
||||
/* Define to the type of arg 3 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG3 int
|
||||
|
||||
/* Define to the type of arg 4 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG4 int
|
||||
|
||||
/* Define to the type pointed by arg 5 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG5 struct sockaddr
|
||||
|
||||
/* Define to the type pointed by arg 6 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG6 int
|
||||
|
||||
/* Define to the function return type for recvfrom. */
|
||||
#define RECVFROM_TYPE_RETV int
|
||||
|
||||
/* Define if you have the send function. */
|
||||
#define HAVE_SEND 1
|
||||
|
||||
/* Define to the type of arg 1 for send. */
|
||||
#define SEND_TYPE_ARG1 SOCKET
|
||||
|
||||
/* Define to the type qualifier of arg 2 for send. */
|
||||
#define SEND_QUAL_ARG2 const
|
||||
|
||||
/* Define to the type of arg 2 for send. */
|
||||
#define SEND_TYPE_ARG2 char *
|
||||
|
||||
/* Define to the type of arg 3 for send. */
|
||||
#define SEND_TYPE_ARG3 int
|
||||
|
||||
/* Define to the type of arg 4 for send. */
|
||||
#define SEND_TYPE_ARG4 int
|
||||
|
||||
/* Define to the function return type for send. */
|
||||
#define SEND_TYPE_RETV int
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* TYPEDEF REPLACEMENTS */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* Define this if in_addr_t is not an available 'typedefed' type */
|
||||
#define in_addr_t unsigned long
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* Define ssize_t if it is not an available 'typedefed' type */
|
||||
#if (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || defined(__POCC__)
|
||||
#elif defined(_WIN64)
|
||||
#define ssize_t __int64
|
||||
#else
|
||||
#define ssize_t int
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* TYPE SIZES */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* The size of `int', as computed by sizeof. */
|
||||
#define SIZEOF_INT 4
|
||||
|
||||
/* The size of `long double', as computed by sizeof. */
|
||||
#define SIZEOF_LONG_DOUBLE 16
|
||||
|
||||
/* The size of `long long', as computed by sizeof. */
|
||||
/* #define SIZEOF_LONG_LONG 8 */
|
||||
|
||||
/* The size of `short', as computed by sizeof. */
|
||||
#define SIZEOF_SHORT 2
|
||||
|
||||
/* The size of `size_t', as computed by sizeof. */
|
||||
#if defined(_WIN64)
|
||||
# define SIZEOF_SIZE_T 8
|
||||
#else
|
||||
# define SIZEOF_SIZE_T 4
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* STRUCT RELATED */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* Define this if you have struct sockaddr_storage */
|
||||
/* #define HAVE_STRUCT_SOCKADDR_STORAGE 1 */
|
||||
|
||||
/* Define this if you have struct timeval */
|
||||
#define HAVE_STRUCT_TIMEVAL 1
|
||||
|
||||
/* Define this if struct sockaddr_in6 has the sin6_scope_id member */
|
||||
#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* COMPILER SPECIFIC */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* Undef keyword 'const' if it does not work. */
|
||||
/* #undef const */
|
||||
|
||||
/* Define to avoid VS2005 complaining about portable C functions */
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1400)
|
||||
#define _CRT_SECURE_NO_DEPRECATE 1
|
||||
#define _CRT_NONSTDC_NO_DEPRECATE 1
|
||||
#endif
|
||||
|
||||
/* VS2005 and later dafault size for time_t is 64-bit, unless */
|
||||
/* _USE_32BIT_TIME_T has been defined to get a 32-bit time_t. */
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1400)
|
||||
# ifndef _USE_32BIT_TIME_T
|
||||
# define SIZEOF_TIME_T 8
|
||||
# else
|
||||
# define SIZEOF_TIME_T 4
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* LARGE FILE SUPPORT */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
#if defined(_MSC_VER) && !defined(_WIN32_WCE)
|
||||
# if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64)
|
||||
# define USE_WIN32_LARGE_FILES
|
||||
# else
|
||||
# define USE_WIN32_SMALL_FILES
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(USE_WIN32_LARGE_FILES) && !defined(USE_WIN32_SMALL_FILES)
|
||||
# define USE_WIN32_SMALL_FILES
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* LDAP SUPPORT */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
#define USE_WIN32_LDAP 1
|
||||
#undef HAVE_LDAP_URL_PARSE
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* ADDITIONAL DEFINITIONS */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* Define cpu-machine-OS */
|
||||
#undef OS
|
||||
#define OS "i386-pc-win32ce"
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "curl"
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* WinCE */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
#ifndef UNICODE
|
||||
# define UNICODE
|
||||
#endif
|
||||
|
||||
#ifndef _UNICODE
|
||||
# define _UNICODE
|
||||
#endif
|
||||
|
||||
#define CURL_DISABLE_FILE 1
|
||||
#define CURL_DISABLE_TELNET 1
|
||||
#define CURL_DISABLE_LDAP 1
|
||||
|
||||
#define ENOSPC 1
|
||||
#define ENOMEM 2
|
||||
#define EAGAIN 3
|
||||
|
||||
extern int stat(const char *path, struct stat *buffer);
|
||||
|
||||
#endif /* HEADER_CURL_CONFIG_WIN32CE_H */
|
|
@ -1,370 +0,0 @@
|
|||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 2012, 2016, Linus Nielsen Feltzing, <linus@haxx.se>
|
||||
* Copyright (C) 2012 - 2015, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
#include "urldata.h"
|
||||
#include "url.h"
|
||||
#include "progress.h"
|
||||
#include "multiif.h"
|
||||
#include "sendf.h"
|
||||
#include "rawstr.h"
|
||||
#include "conncache.h"
|
||||
/* The last 3 #include files should be in this order */
|
||||
#include "curl_printf.h"
|
||||
#include "curl_memory.h"
|
||||
#include "memdebug.h"
|
||||
|
||||
static void conn_llist_dtor(void *user, void *element)
|
||||
{
|
||||
struct connectdata *data = element;
|
||||
(void)user;
|
||||
|
||||
data->bundle = NULL;
|
||||
}
|
||||
|
||||
static CURLcode bundle_create(struct SessionHandle *data,
|
||||
struct connectbundle **cb_ptr)
|
||||
{
|
||||
(void)data;
|
||||
DEBUGASSERT(*cb_ptr == NULL);
|
||||
*cb_ptr = malloc(sizeof(struct connectbundle));
|
||||
if(!*cb_ptr)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
(*cb_ptr)->num_connections = 0;
|
||||
(*cb_ptr)->multiuse = BUNDLE_UNKNOWN;
|
||||
|
||||
(*cb_ptr)->conn_list = Curl_llist_alloc((curl_llist_dtor) conn_llist_dtor);
|
||||
if(!(*cb_ptr)->conn_list) {
|
||||
Curl_safefree(*cb_ptr);
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static void bundle_destroy(struct connectbundle *cb_ptr)
|
||||
{
|
||||
if(!cb_ptr)
|
||||
return;
|
||||
|
||||
if(cb_ptr->conn_list) {
|
||||
Curl_llist_destroy(cb_ptr->conn_list, NULL);
|
||||
cb_ptr->conn_list = NULL;
|
||||
}
|
||||
free(cb_ptr);
|
||||
}
|
||||
|
||||
/* Add a connection to a bundle */
|
||||
static CURLcode bundle_add_conn(struct connectbundle *cb_ptr,
|
||||
struct connectdata *conn)
|
||||
{
|
||||
if(!Curl_llist_insert_next(cb_ptr->conn_list, cb_ptr->conn_list->tail, conn))
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
conn->bundle = cb_ptr;
|
||||
|
||||
cb_ptr->num_connections++;
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
/* Remove a connection from a bundle */
|
||||
static int bundle_remove_conn(struct connectbundle *cb_ptr,
|
||||
struct connectdata *conn)
|
||||
{
|
||||
struct curl_llist_element *curr;
|
||||
|
||||
curr = cb_ptr->conn_list->head;
|
||||
while(curr) {
|
||||
if(curr->ptr == conn) {
|
||||
Curl_llist_remove(cb_ptr->conn_list, curr, NULL);
|
||||
cb_ptr->num_connections--;
|
||||
conn->bundle = NULL;
|
||||
return 1; /* we removed a handle */
|
||||
}
|
||||
curr = curr->next;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void free_bundle_hash_entry(void *freethis)
|
||||
{
|
||||
struct connectbundle *b = (struct connectbundle *) freethis;
|
||||
|
||||
bundle_destroy(b);
|
||||
}
|
||||
|
||||
int Curl_conncache_init(struct conncache *connc, int size)
|
||||
{
|
||||
return Curl_hash_init(&connc->hash, size, Curl_hash_str,
|
||||
Curl_str_key_compare, free_bundle_hash_entry);
|
||||
}
|
||||
|
||||
void Curl_conncache_destroy(struct conncache *connc)
|
||||
{
|
||||
if(connc)
|
||||
Curl_hash_destroy(&connc->hash);
|
||||
}
|
||||
|
||||
/* returns an allocated key to find a bundle for this connection */
|
||||
static char *hashkey(struct connectdata *conn)
|
||||
{
|
||||
const char *hostname;
|
||||
|
||||
if(conn->bits.proxy)
|
||||
hostname = conn->proxy.name;
|
||||
else if(conn->bits.conn_to_host)
|
||||
hostname = conn->conn_to_host.name;
|
||||
else
|
||||
hostname = conn->host.name;
|
||||
|
||||
return aprintf("%s:%d", hostname, conn->port);
|
||||
}
|
||||
|
||||
/* Look up the bundle with all the connections to the same host this
|
||||
connectdata struct is setup to use. */
|
||||
struct connectbundle *Curl_conncache_find_bundle(struct connectdata *conn,
|
||||
struct conncache *connc)
|
||||
{
|
||||
struct connectbundle *bundle = NULL;
|
||||
if(connc) {
|
||||
char *key = hashkey(conn);
|
||||
if(key) {
|
||||
bundle = Curl_hash_pick(&connc->hash, key, strlen(key));
|
||||
free(key);
|
||||
}
|
||||
}
|
||||
|
||||
return bundle;
|
||||
}
|
||||
|
||||
static bool conncache_add_bundle(struct conncache *connc,
|
||||
char *key,
|
||||
struct connectbundle *bundle)
|
||||
{
|
||||
void *p = Curl_hash_add(&connc->hash, key, strlen(key), bundle);
|
||||
|
||||
return p?TRUE:FALSE;
|
||||
}
|
||||
|
||||
static void conncache_remove_bundle(struct conncache *connc,
|
||||
struct connectbundle *bundle)
|
||||
{
|
||||
struct curl_hash_iterator iter;
|
||||
struct curl_hash_element *he;
|
||||
|
||||
if(!connc)
|
||||
return;
|
||||
|
||||
Curl_hash_start_iterate(&connc->hash, &iter);
|
||||
|
||||
he = Curl_hash_next_element(&iter);
|
||||
while(he) {
|
||||
if(he->ptr == bundle) {
|
||||
/* The bundle is destroyed by the hash destructor function,
|
||||
free_bundle_hash_entry() */
|
||||
Curl_hash_delete(&connc->hash, he->key, he->key_len);
|
||||
return;
|
||||
}
|
||||
|
||||
he = Curl_hash_next_element(&iter);
|
||||
}
|
||||
}
|
||||
|
||||
CURLcode Curl_conncache_add_conn(struct conncache *connc,
|
||||
struct connectdata *conn)
|
||||
{
|
||||
CURLcode result;
|
||||
struct connectbundle *bundle;
|
||||
struct connectbundle *new_bundle = NULL;
|
||||
struct SessionHandle *data = conn->data;
|
||||
|
||||
bundle = Curl_conncache_find_bundle(conn, data->state.conn_cache);
|
||||
if(!bundle) {
|
||||
char *key;
|
||||
int rc;
|
||||
|
||||
result = bundle_create(data, &new_bundle);
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
key = hashkey(conn);
|
||||
if(!key) {
|
||||
bundle_destroy(new_bundle);
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
rc = conncache_add_bundle(data->state.conn_cache, key, new_bundle);
|
||||
free(key);
|
||||
if(!rc) {
|
||||
bundle_destroy(new_bundle);
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
bundle = new_bundle;
|
||||
}
|
||||
|
||||
result = bundle_add_conn(bundle, conn);
|
||||
if(result) {
|
||||
if(new_bundle)
|
||||
conncache_remove_bundle(data->state.conn_cache, new_bundle);
|
||||
return result;
|
||||
}
|
||||
|
||||
conn->connection_id = connc->next_connection_id++;
|
||||
connc->num_connections++;
|
||||
|
||||
DEBUGF(infof(conn->data, "Added connection %ld. "
|
||||
"The cache now contains %" CURL_FORMAT_CURL_OFF_TU " members\n",
|
||||
conn->connection_id, (curl_off_t) connc->num_connections));
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
void Curl_conncache_remove_conn(struct conncache *connc,
|
||||
struct connectdata *conn)
|
||||
{
|
||||
struct connectbundle *bundle = conn->bundle;
|
||||
|
||||
/* The bundle pointer can be NULL, since this function can be called
|
||||
due to a failed connection attempt, before being added to a bundle */
|
||||
if(bundle) {
|
||||
bundle_remove_conn(bundle, conn);
|
||||
if(bundle->num_connections == 0) {
|
||||
conncache_remove_bundle(connc, bundle);
|
||||
}
|
||||
|
||||
if(connc) {
|
||||
connc->num_connections--;
|
||||
|
||||
DEBUGF(infof(conn->data, "The cache now contains %"
|
||||
CURL_FORMAT_CURL_OFF_TU " members\n",
|
||||
(curl_off_t) connc->num_connections));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* This function iterates the entire connection cache and calls the
|
||||
function func() with the connection pointer as the first argument
|
||||
and the supplied 'param' argument as the other,
|
||||
|
||||
Return 0 from func() to continue the loop, return 1 to abort it.
|
||||
*/
|
||||
void Curl_conncache_foreach(struct conncache *connc,
|
||||
void *param,
|
||||
int (*func)(struct connectdata *conn, void *param))
|
||||
{
|
||||
struct curl_hash_iterator iter;
|
||||
struct curl_llist_element *curr;
|
||||
struct curl_hash_element *he;
|
||||
|
||||
if(!connc)
|
||||
return;
|
||||
|
||||
Curl_hash_start_iterate(&connc->hash, &iter);
|
||||
|
||||
he = Curl_hash_next_element(&iter);
|
||||
while(he) {
|
||||
struct connectbundle *bundle;
|
||||
|
||||
bundle = he->ptr;
|
||||
he = Curl_hash_next_element(&iter);
|
||||
|
||||
curr = bundle->conn_list->head;
|
||||
while(curr) {
|
||||
/* Yes, we need to update curr before calling func(), because func()
|
||||
might decide to remove the connection */
|
||||
struct connectdata *conn = curr->ptr;
|
||||
curr = curr->next;
|
||||
|
||||
if(1 == func(conn, param))
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Return the first connection found in the cache. Used when closing all
|
||||
connections */
|
||||
struct connectdata *
|
||||
Curl_conncache_find_first_connection(struct conncache *connc)
|
||||
{
|
||||
struct curl_hash_iterator iter;
|
||||
struct curl_hash_element *he;
|
||||
struct connectbundle *bundle;
|
||||
|
||||
Curl_hash_start_iterate(&connc->hash, &iter);
|
||||
|
||||
he = Curl_hash_next_element(&iter);
|
||||
while(he) {
|
||||
struct curl_llist_element *curr;
|
||||
bundle = he->ptr;
|
||||
|
||||
curr = bundle->conn_list->head;
|
||||
if(curr) {
|
||||
return curr->ptr;
|
||||
}
|
||||
|
||||
he = Curl_hash_next_element(&iter);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
/* Useful for debugging the connection cache */
|
||||
void Curl_conncache_print(struct conncache *connc)
|
||||
{
|
||||
struct curl_hash_iterator iter;
|
||||
struct curl_llist_element *curr;
|
||||
struct curl_hash_element *he;
|
||||
|
||||
if(!connc)
|
||||
return;
|
||||
|
||||
fprintf(stderr, "=Bundle cache=\n");
|
||||
|
||||
Curl_hash_start_iterate(connc->hash, &iter);
|
||||
|
||||
he = Curl_hash_next_element(&iter);
|
||||
while(he) {
|
||||
struct connectbundle *bundle;
|
||||
struct connectdata *conn;
|
||||
|
||||
bundle = he->ptr;
|
||||
|
||||
fprintf(stderr, "%s -", he->key);
|
||||
curr = bundle->conn_list->head;
|
||||
while(curr) {
|
||||
conn = curr->ptr;
|
||||
|
||||
fprintf(stderr, " [%p %d]", (void *)conn, conn->inuse);
|
||||
curr = curr->next;
|
||||
}
|
||||
fprintf(stderr, "\n");
|
||||
|
||||
he = Curl_hash_next_element(&iter);
|
||||
}
|
||||
}
|
||||
#endif
|
|
@ -1,68 +0,0 @@
|
|||
#ifndef HEADER_CURL_CONNCACHE_H
|
||||
#define HEADER_CURL_CONNCACHE_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 2012 - 2014, Linus Nielsen Feltzing, <linus@haxx.se>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
struct conncache {
|
||||
struct curl_hash hash;
|
||||
size_t num_connections;
|
||||
long next_connection_id;
|
||||
struct timeval last_cleanup;
|
||||
};
|
||||
|
||||
#define BUNDLE_NO_MULTIUSE -1
|
||||
#define BUNDLE_UNKNOWN 0 /* initial value */
|
||||
#define BUNDLE_PIPELINING 1
|
||||
#define BUNDLE_MULTIPLEX 2
|
||||
|
||||
struct connectbundle {
|
||||
int multiuse; /* supports multi-use */
|
||||
size_t num_connections; /* Number of connections in the bundle */
|
||||
struct curl_llist *conn_list; /* The connectdata members of the bundle */
|
||||
};
|
||||
|
||||
int Curl_conncache_init(struct conncache *, int size);
|
||||
|
||||
void Curl_conncache_destroy(struct conncache *connc);
|
||||
|
||||
/* return the correct bundle, to a host or a proxy */
|
||||
struct connectbundle *Curl_conncache_find_bundle(struct connectdata *conn,
|
||||
struct conncache *connc);
|
||||
|
||||
CURLcode Curl_conncache_add_conn(struct conncache *connc,
|
||||
struct connectdata *conn);
|
||||
|
||||
void Curl_conncache_remove_conn(struct conncache *connc,
|
||||
struct connectdata *conn);
|
||||
|
||||
void Curl_conncache_foreach(struct conncache *connc,
|
||||
void *param,
|
||||
int (*func)(struct connectdata *conn,
|
||||
void *param));
|
||||
|
||||
struct connectdata *
|
||||
Curl_conncache_find_first_connection(struct conncache *connc);
|
||||
|
||||
void Curl_conncache_print(struct conncache *connc);
|
||||
|
||||
#endif /* HEADER_CURL_CONNCACHE_H */
|
File diff suppressed because it is too large
Load Diff
|
@ -1,124 +0,0 @@
|
|||
#ifndef HEADER_CURL_CONNECT_H
|
||||
#define HEADER_CURL_CONNECT_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
#include "curl_setup.h"
|
||||
|
||||
#include "nonblock.h" /* for curlx_nonblock(), formerly Curl_nonblock() */
|
||||
#include "sockaddr.h"
|
||||
|
||||
CURLcode Curl_is_connected(struct connectdata *conn,
|
||||
int sockindex,
|
||||
bool *connected);
|
||||
|
||||
CURLcode Curl_connecthost(struct connectdata *conn,
|
||||
const struct Curl_dns_entry *host);
|
||||
|
||||
/* generic function that returns how much time there's left to run, according
|
||||
to the timeouts set */
|
||||
long Curl_timeleft(struct SessionHandle *data,
|
||||
struct timeval *nowp,
|
||||
bool duringconnect);
|
||||
|
||||
#define DEFAULT_CONNECT_TIMEOUT 300000 /* milliseconds == five minutes */
|
||||
#define HAPPY_EYEBALLS_TIMEOUT 200 /* milliseconds to wait between
|
||||
IPv4/IPv6 connection attempts */
|
||||
|
||||
/*
|
||||
* Used to extract socket and connectdata struct for the most recent
|
||||
* transfer on the given SessionHandle.
|
||||
*
|
||||
* The returned socket will be CURL_SOCKET_BAD in case of failure!
|
||||
*/
|
||||
curl_socket_t Curl_getconnectinfo(struct SessionHandle *data,
|
||||
struct connectdata **connp);
|
||||
|
||||
#ifdef USE_WINSOCK
|
||||
/* When you run a program that uses the Windows Sockets API, you may
|
||||
experience slow performance when you copy data to a TCP server.
|
||||
|
||||
https://support.microsoft.com/kb/823764
|
||||
|
||||
Work-around: Make the Socket Send Buffer Size Larger Than the Program Send
|
||||
Buffer Size
|
||||
|
||||
*/
|
||||
void Curl_sndbufset(curl_socket_t sockfd);
|
||||
#else
|
||||
#define Curl_sndbufset(y) Curl_nop_stmt
|
||||
#endif
|
||||
|
||||
void Curl_updateconninfo(struct connectdata *conn, curl_socket_t sockfd);
|
||||
void Curl_persistconninfo(struct connectdata *conn);
|
||||
int Curl_closesocket(struct connectdata *conn, curl_socket_t sock);
|
||||
|
||||
/*
|
||||
* The Curl_sockaddr_ex structure is basically libcurl's external API
|
||||
* curl_sockaddr structure with enough space available to directly hold any
|
||||
* protocol-specific address structures. The variable declared here will be
|
||||
* used to pass / receive data to/from the fopensocket callback if this has
|
||||
* been set, before that, it is initialized from parameters.
|
||||
*/
|
||||
struct Curl_sockaddr_ex {
|
||||
int family;
|
||||
int socktype;
|
||||
int protocol;
|
||||
unsigned int addrlen;
|
||||
union {
|
||||
struct sockaddr addr;
|
||||
struct Curl_sockaddr_storage buff;
|
||||
} _sa_ex_u;
|
||||
};
|
||||
#define sa_addr _sa_ex_u.addr
|
||||
|
||||
/*
|
||||
* Create a socket based on info from 'conn' and 'ai'.
|
||||
*
|
||||
* Fill in 'addr' and 'sockfd' accordingly if OK is returned. If the open
|
||||
* socket callback is set, used that!
|
||||
*
|
||||
*/
|
||||
CURLcode Curl_socket(struct connectdata *conn,
|
||||
const Curl_addrinfo *ai,
|
||||
struct Curl_sockaddr_ex *addr,
|
||||
curl_socket_t *sockfd);
|
||||
|
||||
void Curl_tcpnodelay(struct connectdata *conn, curl_socket_t sockfd);
|
||||
|
||||
#ifdef CURLDEBUG
|
||||
/*
|
||||
* Curl_connclose() sets the bit.close bit to TRUE with an explanation.
|
||||
* Nothing else.
|
||||
*/
|
||||
void Curl_conncontrol(struct connectdata *conn,
|
||||
bool closeit,
|
||||
const char *reason);
|
||||
#define connclose(x,y) Curl_conncontrol(x,TRUE, y)
|
||||
#define connkeep(x,y) Curl_conncontrol(x, FALSE, y)
|
||||
#else /* if !CURLDEBUG */
|
||||
|
||||
#define connclose(x,y) (x)->bits.close = TRUE
|
||||
#define connkeep(x,y) (x)->bits.close = FALSE
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* HEADER_CURL_CONNECT_H */
|
|
@ -1,435 +0,0 @@
|
|||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#ifdef HAVE_LIBZ
|
||||
|
||||
#include "urldata.h"
|
||||
#include <curl/curl.h>
|
||||
#include "sendf.h"
|
||||
#include "content_encoding.h"
|
||||
#include "curl_memory.h"
|
||||
|
||||
#include "memdebug.h"
|
||||
|
||||
/* Comment this out if zlib is always going to be at least ver. 1.2.0.4
|
||||
(doing so will reduce code size slightly). */
|
||||
#define OLD_ZLIB_SUPPORT 1
|
||||
|
||||
#define DSIZ CURL_MAX_WRITE_SIZE /* buffer size for decompressed data */
|
||||
|
||||
#define GZIP_MAGIC_0 0x1f
|
||||
#define GZIP_MAGIC_1 0x8b
|
||||
|
||||
/* gzip flag byte */
|
||||
#define ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */
|
||||
#define HEAD_CRC 0x02 /* bit 1 set: header CRC present */
|
||||
#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */
|
||||
#define ORIG_NAME 0x08 /* bit 3 set: original file name present */
|
||||
#define COMMENT 0x10 /* bit 4 set: file comment present */
|
||||
#define RESERVED 0xE0 /* bits 5..7: reserved */
|
||||
|
||||
static voidpf
|
||||
zalloc_cb(voidpf opaque, unsigned int items, unsigned int size)
|
||||
{
|
||||
(void) opaque;
|
||||
/* not a typo, keep it calloc() */
|
||||
return (voidpf) calloc(items, size);
|
||||
}
|
||||
|
||||
static void
|
||||
zfree_cb(voidpf opaque, voidpf ptr)
|
||||
{
|
||||
(void) opaque;
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
static CURLcode
|
||||
process_zlib_error(struct connectdata *conn, z_stream *z)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
if(z->msg)
|
||||
failf (data, "Error while processing content unencoding: %s",
|
||||
z->msg);
|
||||
else
|
||||
failf (data, "Error while processing content unencoding: "
|
||||
"Unknown failure within decompression software.");
|
||||
|
||||
return CURLE_BAD_CONTENT_ENCODING;
|
||||
}
|
||||
|
||||
static CURLcode
|
||||
exit_zlib(z_stream *z, zlibInitState *zlib_init, CURLcode result)
|
||||
{
|
||||
inflateEnd(z);
|
||||
*zlib_init = ZLIB_UNINIT;
|
||||
return result;
|
||||
}
|
||||
|
||||
static CURLcode
|
||||
inflate_stream(struct connectdata *conn,
|
||||
struct SingleRequest *k)
|
||||
{
|
||||
int allow_restart = 1;
|
||||
z_stream *z = &k->z; /* zlib state structure */
|
||||
uInt nread = z->avail_in;
|
||||
Bytef *orig_in = z->next_in;
|
||||
int status; /* zlib status */
|
||||
CURLcode result = CURLE_OK; /* Curl_client_write status */
|
||||
char *decomp; /* Put the decompressed data here. */
|
||||
|
||||
/* Dynamically allocate a buffer for decompression because it's uncommonly
|
||||
large to hold on the stack */
|
||||
decomp = malloc(DSIZ);
|
||||
if(decomp == NULL) {
|
||||
return exit_zlib(z, &k->zlib_init, CURLE_OUT_OF_MEMORY);
|
||||
}
|
||||
|
||||
/* because the buffer size is fixed, iteratively decompress and transfer to
|
||||
the client via client_write. */
|
||||
for(;;) {
|
||||
/* (re)set buffer for decompressed output for every iteration */
|
||||
z->next_out = (Bytef *)decomp;
|
||||
z->avail_out = DSIZ;
|
||||
|
||||
status = inflate(z, Z_SYNC_FLUSH);
|
||||
if(status == Z_OK || status == Z_STREAM_END) {
|
||||
allow_restart = 0;
|
||||
if((DSIZ - z->avail_out) && (!k->ignorebody)) {
|
||||
result = Curl_client_write(conn, CLIENTWRITE_BODY, decomp,
|
||||
DSIZ - z->avail_out);
|
||||
/* if !CURLE_OK, clean up, return */
|
||||
if(result) {
|
||||
free(decomp);
|
||||
return exit_zlib(z, &k->zlib_init, result);
|
||||
}
|
||||
}
|
||||
|
||||
/* Done? clean up, return */
|
||||
if(status == Z_STREAM_END) {
|
||||
free(decomp);
|
||||
if(inflateEnd(z) == Z_OK)
|
||||
return exit_zlib(z, &k->zlib_init, result);
|
||||
else
|
||||
return exit_zlib(z, &k->zlib_init, process_zlib_error(conn, z));
|
||||
}
|
||||
|
||||
/* Done with these bytes, exit */
|
||||
|
||||
/* status is always Z_OK at this point! */
|
||||
if(z->avail_in == 0) {
|
||||
free(decomp);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
else if(allow_restart && status == Z_DATA_ERROR) {
|
||||
/* some servers seem to not generate zlib headers, so this is an attempt
|
||||
to fix and continue anyway */
|
||||
|
||||
(void) inflateEnd(z); /* don't care about the return code */
|
||||
if(inflateInit2(z, -MAX_WBITS) != Z_OK) {
|
||||
free(decomp);
|
||||
return exit_zlib(z, &k->zlib_init, process_zlib_error(conn, z));
|
||||
}
|
||||
z->next_in = orig_in;
|
||||
z->avail_in = nread;
|
||||
allow_restart = 0;
|
||||
continue;
|
||||
}
|
||||
else { /* Error; exit loop, handle below */
|
||||
free(decomp);
|
||||
return exit_zlib(z, &k->zlib_init, process_zlib_error(conn, z));
|
||||
}
|
||||
}
|
||||
/* Will never get here */
|
||||
}
|
||||
|
||||
CURLcode
|
||||
Curl_unencode_deflate_write(struct connectdata *conn,
|
||||
struct SingleRequest *k,
|
||||
ssize_t nread)
|
||||
{
|
||||
z_stream *z = &k->z; /* zlib state structure */
|
||||
|
||||
/* Initialize zlib? */
|
||||
if(k->zlib_init == ZLIB_UNINIT) {
|
||||
memset(z, 0, sizeof(z_stream));
|
||||
z->zalloc = (alloc_func)zalloc_cb;
|
||||
z->zfree = (free_func)zfree_cb;
|
||||
|
||||
if(inflateInit(z) != Z_OK)
|
||||
return process_zlib_error(conn, z);
|
||||
k->zlib_init = ZLIB_INIT;
|
||||
}
|
||||
|
||||
/* Set the compressed input when this function is called */
|
||||
z->next_in = (Bytef *)k->str;
|
||||
z->avail_in = (uInt)nread;
|
||||
|
||||
/* Now uncompress the data */
|
||||
return inflate_stream(conn, k);
|
||||
}
|
||||
|
||||
#ifdef OLD_ZLIB_SUPPORT
|
||||
/* Skip over the gzip header */
|
||||
static enum {
|
||||
GZIP_OK,
|
||||
GZIP_BAD,
|
||||
GZIP_UNDERFLOW
|
||||
} check_gzip_header(unsigned char const *data, ssize_t len, ssize_t *headerlen)
|
||||
{
|
||||
int method, flags;
|
||||
const ssize_t totallen = len;
|
||||
|
||||
/* The shortest header is 10 bytes */
|
||||
if(len < 10)
|
||||
return GZIP_UNDERFLOW;
|
||||
|
||||
if((data[0] != GZIP_MAGIC_0) || (data[1] != GZIP_MAGIC_1))
|
||||
return GZIP_BAD;
|
||||
|
||||
method = data[2];
|
||||
flags = data[3];
|
||||
|
||||
if(method != Z_DEFLATED || (flags & RESERVED) != 0) {
|
||||
/* Can't handle this compression method or unknown flag */
|
||||
return GZIP_BAD;
|
||||
}
|
||||
|
||||
/* Skip over time, xflags, OS code and all previous bytes */
|
||||
len -= 10;
|
||||
data += 10;
|
||||
|
||||
if(flags & EXTRA_FIELD) {
|
||||
ssize_t extra_len;
|
||||
|
||||
if(len < 2)
|
||||
return GZIP_UNDERFLOW;
|
||||
|
||||
extra_len = (data[1] << 8) | data[0];
|
||||
|
||||
if(len < (extra_len+2))
|
||||
return GZIP_UNDERFLOW;
|
||||
|
||||
len -= (extra_len + 2);
|
||||
data += (extra_len + 2);
|
||||
}
|
||||
|
||||
if(flags & ORIG_NAME) {
|
||||
/* Skip over NUL-terminated file name */
|
||||
while(len && *data) {
|
||||
--len;
|
||||
++data;
|
||||
}
|
||||
if(!len || *data)
|
||||
return GZIP_UNDERFLOW;
|
||||
|
||||
/* Skip over the NUL */
|
||||
--len;
|
||||
++data;
|
||||
}
|
||||
|
||||
if(flags & COMMENT) {
|
||||
/* Skip over NUL-terminated comment */
|
||||
while(len && *data) {
|
||||
--len;
|
||||
++data;
|
||||
}
|
||||
if(!len || *data)
|
||||
return GZIP_UNDERFLOW;
|
||||
|
||||
/* Skip over the NUL */
|
||||
--len;
|
||||
}
|
||||
|
||||
if(flags & HEAD_CRC) {
|
||||
if(len < 2)
|
||||
return GZIP_UNDERFLOW;
|
||||
|
||||
len -= 2;
|
||||
}
|
||||
|
||||
*headerlen = totallen - len;
|
||||
return GZIP_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
CURLcode
|
||||
Curl_unencode_gzip_write(struct connectdata *conn,
|
||||
struct SingleRequest *k,
|
||||
ssize_t nread)
|
||||
{
|
||||
z_stream *z = &k->z; /* zlib state structure */
|
||||
|
||||
/* Initialize zlib? */
|
||||
if(k->zlib_init == ZLIB_UNINIT) {
|
||||
memset(z, 0, sizeof(z_stream));
|
||||
z->zalloc = (alloc_func)zalloc_cb;
|
||||
z->zfree = (free_func)zfree_cb;
|
||||
|
||||
if(strcmp(zlibVersion(), "1.2.0.4") >= 0) {
|
||||
/* zlib ver. >= 1.2.0.4 supports transparent gzip decompressing */
|
||||
if(inflateInit2(z, MAX_WBITS+32) != Z_OK) {
|
||||
return process_zlib_error(conn, z);
|
||||
}
|
||||
k->zlib_init = ZLIB_INIT_GZIP; /* Transparent gzip decompress state */
|
||||
}
|
||||
else {
|
||||
/* we must parse the gzip header ourselves */
|
||||
if(inflateInit2(z, -MAX_WBITS) != Z_OK) {
|
||||
return process_zlib_error(conn, z);
|
||||
}
|
||||
k->zlib_init = ZLIB_INIT; /* Initial call state */
|
||||
}
|
||||
}
|
||||
|
||||
if(k->zlib_init == ZLIB_INIT_GZIP) {
|
||||
/* Let zlib handle the gzip decompression entirely */
|
||||
z->next_in = (Bytef *)k->str;
|
||||
z->avail_in = (uInt)nread;
|
||||
/* Now uncompress the data */
|
||||
return inflate_stream(conn, k);
|
||||
}
|
||||
|
||||
#ifndef OLD_ZLIB_SUPPORT
|
||||
/* Support for old zlib versions is compiled away and we are running with
|
||||
an old version, so return an error. */
|
||||
return exit_zlib(z, &k->zlib_init, CURLE_FUNCTION_NOT_FOUND);
|
||||
|
||||
#else
|
||||
/* This next mess is to get around the potential case where there isn't
|
||||
* enough data passed in to skip over the gzip header. If that happens, we
|
||||
* malloc a block and copy what we have then wait for the next call. If
|
||||
* there still isn't enough (this is definitely a worst-case scenario), we
|
||||
* make the block bigger, copy the next part in and keep waiting.
|
||||
*
|
||||
* This is only required with zlib versions < 1.2.0.4 as newer versions
|
||||
* can handle the gzip header themselves.
|
||||
*/
|
||||
|
||||
switch (k->zlib_init) {
|
||||
/* Skip over gzip header? */
|
||||
case ZLIB_INIT:
|
||||
{
|
||||
/* Initial call state */
|
||||
ssize_t hlen;
|
||||
|
||||
switch (check_gzip_header((unsigned char *)k->str, nread, &hlen)) {
|
||||
case GZIP_OK:
|
||||
z->next_in = (Bytef *)k->str + hlen;
|
||||
z->avail_in = (uInt)(nread - hlen);
|
||||
k->zlib_init = ZLIB_GZIP_INFLATING; /* Inflating stream state */
|
||||
break;
|
||||
|
||||
case GZIP_UNDERFLOW:
|
||||
/* We need more data so we can find the end of the gzip header. It's
|
||||
* possible that the memory block we malloc here will never be freed if
|
||||
* the transfer abruptly aborts after this point. Since it's unlikely
|
||||
* that circumstances will be right for this code path to be followed in
|
||||
* the first place, and it's even more unlikely for a transfer to fail
|
||||
* immediately afterwards, it should seldom be a problem.
|
||||
*/
|
||||
z->avail_in = (uInt)nread;
|
||||
z->next_in = malloc(z->avail_in);
|
||||
if(z->next_in == NULL) {
|
||||
return exit_zlib(z, &k->zlib_init, CURLE_OUT_OF_MEMORY);
|
||||
}
|
||||
memcpy(z->next_in, k->str, z->avail_in);
|
||||
k->zlib_init = ZLIB_GZIP_HEADER; /* Need more gzip header data state */
|
||||
/* We don't have any data to inflate yet */
|
||||
return CURLE_OK;
|
||||
|
||||
case GZIP_BAD:
|
||||
default:
|
||||
return exit_zlib(z, &k->zlib_init, process_zlib_error(conn, z));
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case ZLIB_GZIP_HEADER:
|
||||
{
|
||||
/* Need more gzip header data state */
|
||||
ssize_t hlen;
|
||||
unsigned char *oldblock = z->next_in;
|
||||
|
||||
z->avail_in += (uInt)nread;
|
||||
z->next_in = realloc(z->next_in, z->avail_in);
|
||||
if(z->next_in == NULL) {
|
||||
free(oldblock);
|
||||
return exit_zlib(z, &k->zlib_init, CURLE_OUT_OF_MEMORY);
|
||||
}
|
||||
/* Append the new block of data to the previous one */
|
||||
memcpy(z->next_in + z->avail_in - nread, k->str, nread);
|
||||
|
||||
switch (check_gzip_header(z->next_in, z->avail_in, &hlen)) {
|
||||
case GZIP_OK:
|
||||
/* This is the zlib stream data */
|
||||
free(z->next_in);
|
||||
/* Don't point into the malloced block since we just freed it */
|
||||
z->next_in = (Bytef *)k->str + hlen + nread - z->avail_in;
|
||||
z->avail_in = (uInt)(z->avail_in - hlen);
|
||||
k->zlib_init = ZLIB_GZIP_INFLATING; /* Inflating stream state */
|
||||
break;
|
||||
|
||||
case GZIP_UNDERFLOW:
|
||||
/* We still don't have any data to inflate! */
|
||||
return CURLE_OK;
|
||||
|
||||
case GZIP_BAD:
|
||||
default:
|
||||
free(z->next_in);
|
||||
return exit_zlib(z, &k->zlib_init, process_zlib_error(conn, z));
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case ZLIB_GZIP_INFLATING:
|
||||
default:
|
||||
/* Inflating stream state */
|
||||
z->next_in = (Bytef *)k->str;
|
||||
z->avail_in = (uInt)nread;
|
||||
break;
|
||||
}
|
||||
|
||||
if(z->avail_in == 0) {
|
||||
/* We don't have any data to inflate; wait until next time */
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
/* We've parsed the header, now uncompress the data */
|
||||
return inflate_stream(conn, k);
|
||||
#endif
|
||||
}
|
||||
|
||||
void Curl_unencode_cleanup(struct connectdata *conn)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct SingleRequest *k = &data->req;
|
||||
z_stream *z = &k->z;
|
||||
if(k->zlib_init != ZLIB_UNINIT)
|
||||
(void) exit_zlib(z, &k->zlib_init, CURLE_OK);
|
||||
}
|
||||
|
||||
#endif /* HAVE_LIBZ */
|
|
@ -1,48 +0,0 @@
|
|||
#ifndef HEADER_CURL_CONTENT_ENCODING_H
|
||||
#define HEADER_CURL_CONTENT_ENCODING_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
#include "curl_setup.h"
|
||||
|
||||
/*
|
||||
* Comma-separated list all supported Content-Encodings ('identity' is implied)
|
||||
*/
|
||||
#ifdef HAVE_LIBZ
|
||||
#define ALL_CONTENT_ENCODINGS "deflate, gzip"
|
||||
/* force a cleanup */
|
||||
void Curl_unencode_cleanup(struct connectdata *conn);
|
||||
#else
|
||||
#define ALL_CONTENT_ENCODINGS "identity"
|
||||
#define Curl_unencode_cleanup(x) Curl_nop_stmt
|
||||
#endif
|
||||
|
||||
CURLcode Curl_unencode_deflate_write(struct connectdata *conn,
|
||||
struct SingleRequest *req,
|
||||
ssize_t nread);
|
||||
|
||||
CURLcode
|
||||
Curl_unencode_gzip_write(struct connectdata *conn,
|
||||
struct SingleRequest *k,
|
||||
ssize_t nread);
|
||||
|
||||
|
||||
#endif /* HEADER_CURL_CONTENT_ENCODING_H */
|
File diff suppressed because it is too large
Load Diff
|
@ -1,104 +0,0 @@
|
|||
#ifndef HEADER_CURL_COOKIE_H
|
||||
#define HEADER_CURL_COOKIE_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
#include "curl_setup.h"
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
struct Cookie {
|
||||
struct Cookie *next; /* next in the chain */
|
||||
char *name; /* <this> = value */
|
||||
char *value; /* name = <this> */
|
||||
char *path; /* path = <this> which is in Set-Cookie: */
|
||||
char *spath; /* sanitized cookie path */
|
||||
char *domain; /* domain = <this> */
|
||||
curl_off_t expires; /* expires = <this> */
|
||||
char *expirestr; /* the plain text version */
|
||||
bool tailmatch; /* weather we do tail-matchning of the domain name */
|
||||
|
||||
/* RFC 2109 keywords. Version=1 means 2109-compliant cookie sending */
|
||||
char *version; /* Version = <value> */
|
||||
char *maxage; /* Max-Age = <value> */
|
||||
|
||||
bool secure; /* whether the 'secure' keyword was used */
|
||||
bool livecookie; /* updated from a server, not a stored file */
|
||||
bool httponly; /* true if the httponly directive is present */
|
||||
};
|
||||
|
||||
struct CookieInfo {
|
||||
/* linked list of cookies we know of */
|
||||
struct Cookie *cookies;
|
||||
|
||||
char *filename; /* file we read from/write to */
|
||||
bool running; /* state info, for cookie adding information */
|
||||
long numcookies; /* number of cookies in the "jar" */
|
||||
bool newsession; /* new session, discard session cookies on load */
|
||||
};
|
||||
|
||||
/* This is the maximum line length we accept for a cookie line. RFC 2109
|
||||
section 6.3 says:
|
||||
|
||||
"at least 4096 bytes per cookie (as measured by the size of the characters
|
||||
that comprise the cookie non-terminal in the syntax description of the
|
||||
Set-Cookie header)"
|
||||
|
||||
*/
|
||||
#define MAX_COOKIE_LINE 5000
|
||||
#define MAX_COOKIE_LINE_TXT "4999"
|
||||
|
||||
/* This is the maximum length of a cookie name we deal with: */
|
||||
#define MAX_NAME 1024
|
||||
#define MAX_NAME_TXT "1023"
|
||||
|
||||
struct SessionHandle;
|
||||
/*
|
||||
* Add a cookie to the internal list of cookies. The domain and path arguments
|
||||
* are only used if the header boolean is TRUE.
|
||||
*/
|
||||
|
||||
struct Cookie *Curl_cookie_add(struct SessionHandle *data,
|
||||
struct CookieInfo *, bool header, char *lineptr,
|
||||
const char *domain, const char *path);
|
||||
|
||||
struct Cookie *Curl_cookie_getlist(struct CookieInfo *, const char *,
|
||||
const char *, bool);
|
||||
void Curl_cookie_freelist(struct Cookie *cookies, bool cookiestoo);
|
||||
void Curl_cookie_clearall(struct CookieInfo *cookies);
|
||||
void Curl_cookie_clearsess(struct CookieInfo *cookies);
|
||||
|
||||
#if defined(CURL_DISABLE_HTTP) || defined(CURL_DISABLE_COOKIES)
|
||||
#define Curl_cookie_list(x) NULL
|
||||
#define Curl_cookie_loadfiles(x) Curl_nop_stmt
|
||||
#define Curl_cookie_init(x,y,z,w) NULL
|
||||
#define Curl_cookie_cleanup(x) Curl_nop_stmt
|
||||
#define Curl_flush_cookies(x,y) Curl_nop_stmt
|
||||
#else
|
||||
void Curl_flush_cookies(struct SessionHandle *data, int cleanup);
|
||||
void Curl_cookie_cleanup(struct CookieInfo *);
|
||||
struct CookieInfo *Curl_cookie_init(struct SessionHandle *data,
|
||||
const char *, struct CookieInfo *, bool);
|
||||
struct curl_slist *Curl_cookie_list(struct SessionHandle *data);
|
||||
void Curl_cookie_loadfiles(struct SessionHandle *data);
|
||||
#endif
|
||||
|
||||
#endif /* HEADER_CURL_COOKIE_H */
|
|
@ -1,565 +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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_UN_H
|
||||
# include <sys/un.h>
|
||||
#endif
|
||||
|
||||
#ifdef __VMS
|
||||
# include <in.h>
|
||||
# include <inet.h>
|
||||
#endif
|
||||
|
||||
#if defined(NETWARE) && defined(__NOVELL_LIBC__)
|
||||
# undef in_addr_t
|
||||
# define in_addr_t unsigned long
|
||||
#endif
|
||||
|
||||
#include "curl_addrinfo.h"
|
||||
#include "inet_pton.h"
|
||||
#include "warnless.h"
|
||||
/* The last 3 #include files should be in this order */
|
||||
#include "curl_printf.h"
|
||||
#include "curl_memory.h"
|
||||
#include "memdebug.h"
|
||||
|
||||
/*
|
||||
* Curl_freeaddrinfo()
|
||||
*
|
||||
* This is used to free a linked list of Curl_addrinfo structs along
|
||||
* with all its associated allocated storage. This function should be
|
||||
* called once for each successful call to Curl_getaddrinfo_ex() or to
|
||||
* any function call which actually allocates a Curl_addrinfo struct.
|
||||
*/
|
||||
|
||||
#if defined(__INTEL_COMPILER) && (__INTEL_COMPILER == 910) && \
|
||||
defined(__OPTIMIZE__) && defined(__unix__) && defined(__i386__)
|
||||
/* workaround icc 9.1 optimizer issue */
|
||||
# define vqualifier volatile
|
||||
#else
|
||||
# define vqualifier
|
||||
#endif
|
||||
|
||||
void
|
||||
Curl_freeaddrinfo(Curl_addrinfo *cahead)
|
||||
{
|
||||
Curl_addrinfo *vqualifier canext;
|
||||
Curl_addrinfo *ca;
|
||||
|
||||
for(ca = cahead; ca != NULL; ca = canext) {
|
||||
free(ca->ai_addr);
|
||||
free(ca->ai_canonname);
|
||||
canext = ca->ai_next;
|
||||
|
||||
free(ca);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_GETADDRINFO
|
||||
/*
|
||||
* Curl_getaddrinfo_ex()
|
||||
*
|
||||
* This is a wrapper function around system's getaddrinfo(), with
|
||||
* the only difference that instead of returning a linked list of
|
||||
* addrinfo structs this one returns a linked list of Curl_addrinfo
|
||||
* ones. The memory allocated by this function *MUST* be free'd with
|
||||
* Curl_freeaddrinfo(). For each successful call to this function
|
||||
* there must be an associated call later to Curl_freeaddrinfo().
|
||||
*
|
||||
* There should be no single call to system's getaddrinfo() in the
|
||||
* whole library, any such call should be 'routed' through this one.
|
||||
*/
|
||||
|
||||
int
|
||||
Curl_getaddrinfo_ex(const char *nodename,
|
||||
const char *servname,
|
||||
const struct addrinfo *hints,
|
||||
Curl_addrinfo **result)
|
||||
{
|
||||
const struct addrinfo *ai;
|
||||
struct addrinfo *aihead;
|
||||
Curl_addrinfo *cafirst = NULL;
|
||||
Curl_addrinfo *calast = NULL;
|
||||
Curl_addrinfo *ca;
|
||||
size_t ss_size;
|
||||
int error;
|
||||
|
||||
*result = NULL; /* assume failure */
|
||||
|
||||
error = getaddrinfo(nodename, servname, hints, &aihead);
|
||||
if(error)
|
||||
return error;
|
||||
|
||||
/* traverse the addrinfo list */
|
||||
|
||||
for(ai = aihead; ai != NULL; ai = ai->ai_next) {
|
||||
|
||||
/* ignore elements with unsupported address family, */
|
||||
/* settle family-specific sockaddr structure size. */
|
||||
if(ai->ai_family == AF_INET)
|
||||
ss_size = sizeof(struct sockaddr_in);
|
||||
#ifdef ENABLE_IPV6
|
||||
else if(ai->ai_family == AF_INET6)
|
||||
ss_size = sizeof(struct sockaddr_in6);
|
||||
#endif
|
||||
else
|
||||
continue;
|
||||
|
||||
/* ignore elements without required address info */
|
||||
if((ai->ai_addr == NULL) || !(ai->ai_addrlen > 0))
|
||||
continue;
|
||||
|
||||
/* ignore elements with bogus address size */
|
||||
if((size_t)ai->ai_addrlen < ss_size)
|
||||
continue;
|
||||
|
||||
if((ca = malloc(sizeof(Curl_addrinfo))) == NULL) {
|
||||
error = EAI_MEMORY;
|
||||
break;
|
||||
}
|
||||
|
||||
/* copy each structure member individually, member ordering, */
|
||||
/* size, or padding might be different for each platform. */
|
||||
|
||||
ca->ai_flags = ai->ai_flags;
|
||||
ca->ai_family = ai->ai_family;
|
||||
ca->ai_socktype = ai->ai_socktype;
|
||||
ca->ai_protocol = ai->ai_protocol;
|
||||
ca->ai_addrlen = (curl_socklen_t)ss_size;
|
||||
ca->ai_addr = NULL;
|
||||
ca->ai_canonname = NULL;
|
||||
ca->ai_next = NULL;
|
||||
|
||||
if((ca->ai_addr = malloc(ss_size)) == NULL) {
|
||||
error = EAI_MEMORY;
|
||||
free(ca);
|
||||
break;
|
||||
}
|
||||
memcpy(ca->ai_addr, ai->ai_addr, ss_size);
|
||||
|
||||
if(ai->ai_canonname != NULL) {
|
||||
if((ca->ai_canonname = strdup(ai->ai_canonname)) == NULL) {
|
||||
error = EAI_MEMORY;
|
||||
free(ca->ai_addr);
|
||||
free(ca);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* if the return list is empty, this becomes the first element */
|
||||
if(!cafirst)
|
||||
cafirst = ca;
|
||||
|
||||
/* add this element last in the return list */
|
||||
if(calast)
|
||||
calast->ai_next = ca;
|
||||
calast = ca;
|
||||
|
||||
}
|
||||
|
||||
/* destroy the addrinfo list */
|
||||
if(aihead)
|
||||
freeaddrinfo(aihead);
|
||||
|
||||
/* if we failed, also destroy the Curl_addrinfo list */
|
||||
if(error) {
|
||||
Curl_freeaddrinfo(cafirst);
|
||||
cafirst = NULL;
|
||||
}
|
||||
else if(!cafirst) {
|
||||
#ifdef EAI_NONAME
|
||||
/* rfc3493 conformant */
|
||||
error = EAI_NONAME;
|
||||
#else
|
||||
/* rfc3493 obsoleted */
|
||||
error = EAI_NODATA;
|
||||
#endif
|
||||
#ifdef USE_WINSOCK
|
||||
SET_SOCKERRNO(error);
|
||||
#endif
|
||||
}
|
||||
|
||||
*result = cafirst;
|
||||
|
||||
/* This is not a CURLcode */
|
||||
return error;
|
||||
}
|
||||
#endif /* HAVE_GETADDRINFO */
|
||||
|
||||
|
||||
/*
|
||||
* Curl_he2ai()
|
||||
*
|
||||
* This function returns a pointer to the first element of a newly allocated
|
||||
* Curl_addrinfo struct linked list filled with the data of a given hostent.
|
||||
* Curl_addrinfo is meant to work like the addrinfo struct does for a IPv6
|
||||
* stack, but usable also for IPv4, all hosts and environments.
|
||||
*
|
||||
* The memory allocated by this function *MUST* be free'd later on calling
|
||||
* Curl_freeaddrinfo(). For each successful call to this function there
|
||||
* must be an associated call later to Curl_freeaddrinfo().
|
||||
*
|
||||
* Curl_addrinfo defined in "lib/curl_addrinfo.h"
|
||||
*
|
||||
* struct Curl_addrinfo {
|
||||
* int ai_flags;
|
||||
* int ai_family;
|
||||
* int ai_socktype;
|
||||
* int ai_protocol;
|
||||
* curl_socklen_t ai_addrlen; * Follow rfc3493 struct addrinfo *
|
||||
* char *ai_canonname;
|
||||
* struct sockaddr *ai_addr;
|
||||
* struct Curl_addrinfo *ai_next;
|
||||
* };
|
||||
* typedef struct Curl_addrinfo Curl_addrinfo;
|
||||
*
|
||||
* hostent defined in <netdb.h>
|
||||
*
|
||||
* struct hostent {
|
||||
* char *h_name;
|
||||
* char **h_aliases;
|
||||
* int h_addrtype;
|
||||
* int h_length;
|
||||
* char **h_addr_list;
|
||||
* };
|
||||
*
|
||||
* for backward compatibility:
|
||||
*
|
||||
* #define h_addr h_addr_list[0]
|
||||
*/
|
||||
|
||||
Curl_addrinfo *
|
||||
Curl_he2ai(const struct hostent *he, int port)
|
||||
{
|
||||
Curl_addrinfo *ai;
|
||||
Curl_addrinfo *prevai = NULL;
|
||||
Curl_addrinfo *firstai = NULL;
|
||||
struct sockaddr_in *addr;
|
||||
#ifdef ENABLE_IPV6
|
||||
struct sockaddr_in6 *addr6;
|
||||
#endif
|
||||
CURLcode result = CURLE_OK;
|
||||
int i;
|
||||
char *curr;
|
||||
|
||||
if(!he)
|
||||
/* no input == no output! */
|
||||
return NULL;
|
||||
|
||||
DEBUGASSERT((he->h_name != NULL) && (he->h_addr_list != NULL));
|
||||
|
||||
for(i=0; (curr = he->h_addr_list[i]) != NULL; i++) {
|
||||
|
||||
size_t ss_size;
|
||||
#ifdef ENABLE_IPV6
|
||||
if(he->h_addrtype == AF_INET6)
|
||||
ss_size = sizeof (struct sockaddr_in6);
|
||||
else
|
||||
#endif
|
||||
ss_size = sizeof (struct sockaddr_in);
|
||||
|
||||
if((ai = calloc(1, sizeof(Curl_addrinfo))) == NULL) {
|
||||
result = CURLE_OUT_OF_MEMORY;
|
||||
break;
|
||||
}
|
||||
if((ai->ai_canonname = strdup(he->h_name)) == NULL) {
|
||||
result = CURLE_OUT_OF_MEMORY;
|
||||
free(ai);
|
||||
break;
|
||||
}
|
||||
if((ai->ai_addr = calloc(1, ss_size)) == NULL) {
|
||||
result = CURLE_OUT_OF_MEMORY;
|
||||
free(ai->ai_canonname);
|
||||
free(ai);
|
||||
break;
|
||||
}
|
||||
|
||||
if(!firstai)
|
||||
/* store the pointer we want to return from this function */
|
||||
firstai = ai;
|
||||
|
||||
if(prevai)
|
||||
/* make the previous entry point to this */
|
||||
prevai->ai_next = ai;
|
||||
|
||||
ai->ai_family = he->h_addrtype;
|
||||
|
||||
/* we return all names as STREAM, so when using this address for TFTP
|
||||
the type must be ignored and conn->socktype be used instead! */
|
||||
ai->ai_socktype = SOCK_STREAM;
|
||||
|
||||
ai->ai_addrlen = (curl_socklen_t)ss_size;
|
||||
|
||||
/* leave the rest of the struct filled with zero */
|
||||
|
||||
switch (ai->ai_family) {
|
||||
case AF_INET:
|
||||
addr = (void *)ai->ai_addr; /* storage area for this info */
|
||||
|
||||
memcpy(&addr->sin_addr, curr, sizeof(struct in_addr));
|
||||
addr->sin_family = (unsigned short)(he->h_addrtype);
|
||||
addr->sin_port = htons((unsigned short)port);
|
||||
break;
|
||||
|
||||
#ifdef ENABLE_IPV6
|
||||
case AF_INET6:
|
||||
addr6 = (void *)ai->ai_addr; /* storage area for this info */
|
||||
|
||||
memcpy(&addr6->sin6_addr, curr, sizeof(struct in6_addr));
|
||||
addr6->sin6_family = (unsigned short)(he->h_addrtype);
|
||||
addr6->sin6_port = htons((unsigned short)port);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
prevai = ai;
|
||||
}
|
||||
|
||||
if(result) {
|
||||
Curl_freeaddrinfo(firstai);
|
||||
firstai = NULL;
|
||||
}
|
||||
|
||||
return firstai;
|
||||
}
|
||||
|
||||
|
||||
struct namebuff {
|
||||
struct hostent hostentry;
|
||||
union {
|
||||
struct in_addr ina4;
|
||||
#ifdef ENABLE_IPV6
|
||||
struct in6_addr ina6;
|
||||
#endif
|
||||
} addrentry;
|
||||
char *h_addr_list[2];
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Curl_ip2addr()
|
||||
*
|
||||
* This function takes an internet address, in binary form, as input parameter
|
||||
* along with its address family and the string version of the address, and it
|
||||
* returns a Curl_addrinfo chain filled in correctly with information for the
|
||||
* given address/host
|
||||
*/
|
||||
|
||||
Curl_addrinfo *
|
||||
Curl_ip2addr(int af, const void *inaddr, const char *hostname, int port)
|
||||
{
|
||||
Curl_addrinfo *ai;
|
||||
|
||||
#if defined(__VMS) && \
|
||||
defined(__INITIAL_POINTER_SIZE) && (__INITIAL_POINTER_SIZE == 64)
|
||||
#pragma pointer_size save
|
||||
#pragma pointer_size short
|
||||
#pragma message disable PTRMISMATCH
|
||||
#endif
|
||||
|
||||
struct hostent *h;
|
||||
struct namebuff *buf;
|
||||
char *addrentry;
|
||||
char *hoststr;
|
||||
size_t addrsize;
|
||||
|
||||
DEBUGASSERT(inaddr && hostname);
|
||||
|
||||
buf = malloc(sizeof(struct namebuff));
|
||||
if(!buf)
|
||||
return NULL;
|
||||
|
||||
hoststr = strdup(hostname);
|
||||
if(!hoststr) {
|
||||
free(buf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
switch(af) {
|
||||
case AF_INET:
|
||||
addrsize = sizeof(struct in_addr);
|
||||
addrentry = (void *)&buf->addrentry.ina4;
|
||||
memcpy(addrentry, inaddr, sizeof(struct in_addr));
|
||||
break;
|
||||
#ifdef ENABLE_IPV6
|
||||
case AF_INET6:
|
||||
addrsize = sizeof(struct in6_addr);
|
||||
addrentry = (void *)&buf->addrentry.ina6;
|
||||
memcpy(addrentry, inaddr, sizeof(struct in6_addr));
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
free(hoststr);
|
||||
free(buf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
h = &buf->hostentry;
|
||||
h->h_name = hoststr;
|
||||
h->h_aliases = NULL;
|
||||
h->h_addrtype = (short)af;
|
||||
h->h_length = (short)addrsize;
|
||||
h->h_addr_list = &buf->h_addr_list[0];
|
||||
h->h_addr_list[0] = addrentry;
|
||||
h->h_addr_list[1] = NULL; /* terminate list of entries */
|
||||
|
||||
#if defined(__VMS) && \
|
||||
defined(__INITIAL_POINTER_SIZE) && (__INITIAL_POINTER_SIZE == 64)
|
||||
#pragma pointer_size restore
|
||||
#pragma message enable PTRMISMATCH
|
||||
#endif
|
||||
|
||||
ai = Curl_he2ai(h, port);
|
||||
|
||||
free(hoststr);
|
||||
free(buf);
|
||||
|
||||
return ai;
|
||||
}
|
||||
|
||||
/*
|
||||
* Given an IPv4 or IPv6 dotted string address, this converts it to a proper
|
||||
* allocated Curl_addrinfo struct and returns it.
|
||||
*/
|
||||
Curl_addrinfo *Curl_str2addr(char *address, int port)
|
||||
{
|
||||
struct in_addr in;
|
||||
if(Curl_inet_pton(AF_INET, address, &in) > 0)
|
||||
/* This is a dotted IP address 123.123.123.123-style */
|
||||
return Curl_ip2addr(AF_INET, &in, address, port);
|
||||
#ifdef ENABLE_IPV6
|
||||
else {
|
||||
struct in6_addr in6;
|
||||
if(Curl_inet_pton(AF_INET6, address, &in6) > 0)
|
||||
/* This is a dotted IPv6 address ::1-style */
|
||||
return Curl_ip2addr(AF_INET6, &in6, address, port);
|
||||
}
|
||||
#endif
|
||||
return NULL; /* bad input format */
|
||||
}
|
||||
|
||||
#ifdef USE_UNIX_SOCKETS
|
||||
/**
|
||||
* Given a path to a Unix domain socket, return a newly allocated Curl_addrinfo
|
||||
* struct initialized with this path.
|
||||
*/
|
||||
Curl_addrinfo *Curl_unix2addr(const char *path)
|
||||
{
|
||||
Curl_addrinfo *ai;
|
||||
struct sockaddr_un *sa_un;
|
||||
size_t path_len;
|
||||
|
||||
ai = calloc(1, sizeof(Curl_addrinfo));
|
||||
if(!ai)
|
||||
return NULL;
|
||||
if((ai->ai_addr = calloc(1, sizeof(struct sockaddr_un))) == NULL) {
|
||||
free(ai);
|
||||
return NULL;
|
||||
}
|
||||
/* sun_path must be able to store the NUL-terminated path */
|
||||
path_len = strlen(path);
|
||||
if(path_len >= sizeof(sa_un->sun_path)) {
|
||||
free(ai->ai_addr);
|
||||
free(ai);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ai->ai_family = AF_UNIX;
|
||||
ai->ai_socktype = SOCK_STREAM; /* assume reliable transport for HTTP */
|
||||
ai->ai_addrlen = (curl_socklen_t) sizeof(struct sockaddr_un);
|
||||
sa_un = (void *) ai->ai_addr;
|
||||
sa_un->sun_family = AF_UNIX;
|
||||
memcpy(sa_un->sun_path, path, path_len + 1); /* copy NUL byte */
|
||||
return ai;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CURLDEBUG) && defined(HAVE_FREEADDRINFO)
|
||||
/*
|
||||
* curl_dofreeaddrinfo()
|
||||
*
|
||||
* This is strictly for memory tracing and are using the same style as the
|
||||
* family otherwise present in memdebug.c. I put these ones here since they
|
||||
* require a bunch of structs I didn't want to include in memdebug.c
|
||||
*/
|
||||
|
||||
void
|
||||
curl_dofreeaddrinfo(struct addrinfo *freethis,
|
||||
int line, const char *source)
|
||||
{
|
||||
#ifdef USE_LWIPSOCK
|
||||
lwip_freeaddrinfo(freethis);
|
||||
#else
|
||||
(freeaddrinfo)(freethis);
|
||||
#endif
|
||||
curl_memlog("ADDR %s:%d freeaddrinfo(%p)\n",
|
||||
source, line, (void *)freethis);
|
||||
}
|
||||
#endif /* defined(CURLDEBUG) && defined(HAVE_FREEADDRINFO) */
|
||||
|
||||
|
||||
#if defined(CURLDEBUG) && defined(HAVE_GETADDRINFO)
|
||||
/*
|
||||
* curl_dogetaddrinfo()
|
||||
*
|
||||
* This is strictly for memory tracing and are using the same style as the
|
||||
* family otherwise present in memdebug.c. I put these ones here since they
|
||||
* require a bunch of structs I didn't want to include in memdebug.c
|
||||
*/
|
||||
|
||||
int
|
||||
curl_dogetaddrinfo(const char *hostname,
|
||||
const char *service,
|
||||
const struct addrinfo *hints,
|
||||
struct addrinfo **result,
|
||||
int line, const char *source)
|
||||
{
|
||||
#ifdef USE_LWIPSOCK
|
||||
int res=lwip_getaddrinfo(hostname, service, hints, result);
|
||||
#else
|
||||
int res=(getaddrinfo)(hostname, service, hints, result);
|
||||
#endif
|
||||
if(0 == res)
|
||||
/* success */
|
||||
curl_memlog("ADDR %s:%d getaddrinfo() = %p\n",
|
||||
source, line, (void *)*result);
|
||||
else
|
||||
curl_memlog("ADDR %s:%d getaddrinfo() failed\n",
|
||||
source, line);
|
||||
return res;
|
||||
}
|
||||
#endif /* defined(CURLDEBUG) && defined(HAVE_GETADDRINFO) */
|
||||
|
|
@ -1,102 +0,0 @@
|
|||
#ifndef HEADER_CURL_ADDRINFO_H
|
||||
#define HEADER_CURL_ADDRINFO_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
#ifdef __VMS
|
||||
# include <in.h>
|
||||
# include <inet.h>
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Curl_addrinfo is our internal struct definition that we use to allow
|
||||
* consistent internal handling of this data. We use this even when the
|
||||
* system provides an addrinfo structure definition. And we use this for
|
||||
* all sorts of IPv4 and IPV6 builds.
|
||||
*/
|
||||
|
||||
struct Curl_addrinfo {
|
||||
int ai_flags;
|
||||
int ai_family;
|
||||
int ai_socktype;
|
||||
int ai_protocol;
|
||||
curl_socklen_t ai_addrlen; /* Follow rfc3493 struct addrinfo */
|
||||
char *ai_canonname;
|
||||
struct sockaddr *ai_addr;
|
||||
struct Curl_addrinfo *ai_next;
|
||||
};
|
||||
typedef struct Curl_addrinfo Curl_addrinfo;
|
||||
|
||||
void
|
||||
Curl_freeaddrinfo(Curl_addrinfo *cahead);
|
||||
|
||||
#ifdef HAVE_GETADDRINFO
|
||||
int
|
||||
Curl_getaddrinfo_ex(const char *nodename,
|
||||
const char *servname,
|
||||
const struct addrinfo *hints,
|
||||
Curl_addrinfo **result);
|
||||
#endif
|
||||
|
||||
Curl_addrinfo *
|
||||
Curl_he2ai(const struct hostent *he, int port);
|
||||
|
||||
Curl_addrinfo *
|
||||
Curl_ip2addr(int af, const void *inaddr, const char *hostname, int port);
|
||||
|
||||
Curl_addrinfo *Curl_str2addr(char *dotted, int port);
|
||||
|
||||
#ifdef USE_UNIX_SOCKETS
|
||||
Curl_addrinfo *Curl_unix2addr(const char *path);
|
||||
#endif
|
||||
|
||||
#if defined(CURLDEBUG) && defined(HAVE_GETADDRINFO) && \
|
||||
defined(HAVE_FREEADDRINFO)
|
||||
void
|
||||
curl_dofreeaddrinfo(struct addrinfo *freethis,
|
||||
int line, const char *source);
|
||||
#endif
|
||||
|
||||
#if defined(CURLDEBUG) && defined(HAVE_GETADDRINFO)
|
||||
int
|
||||
curl_dogetaddrinfo(const char *hostname,
|
||||
const char *service,
|
||||
const struct addrinfo *hints,
|
||||
struct addrinfo **result,
|
||||
int line, const char *source);
|
||||
#endif
|
||||
|
||||
#endif /* HEADER_CURL_ADDRINFO_H */
|
|
@ -1,35 +0,0 @@
|
|||
#ifndef HEADER_CURL_BASE64_H
|
||||
#define HEADER_CURL_BASE64_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
CURLcode Curl_base64_encode(struct SessionHandle *data,
|
||||
const char *inputbuff, size_t insize,
|
||||
char **outptr, size_t *outlen);
|
||||
CURLcode Curl_base64url_encode(struct SessionHandle *data,
|
||||
const char *inputbuff, size_t insize,
|
||||
char **outptr, size_t *outlen);
|
||||
|
||||
CURLcode Curl_base64_decode(const char *src,
|
||||
unsigned char **outptr, size_t *outlen);
|
||||
|
||||
#endif /* HEADER_CURL_BASE64_H */
|
|
@ -1,985 +0,0 @@
|
|||
/* lib/curl_config.h.in. Generated somehow by cmake. */
|
||||
|
||||
/* when building libcurl itself */
|
||||
#cmakedefine BUILDING_LIBCURL 1
|
||||
|
||||
/* Location of default ca bundle */
|
||||
#cmakedefine CURL_CA_BUNDLE ${CURL_CA_BUNDLE}
|
||||
|
||||
/* Location of default ca path */
|
||||
#cmakedefine CURL_CA_PATH ${CURL_CA_PATH}
|
||||
|
||||
/* to disable cookies support */
|
||||
#cmakedefine CURL_DISABLE_COOKIES 1
|
||||
|
||||
/* to disable cryptographic authentication */
|
||||
#cmakedefine CURL_DISABLE_CRYPTO_AUTH 1
|
||||
|
||||
/* to disable DICT */
|
||||
#cmakedefine CURL_DISABLE_DICT 1
|
||||
|
||||
/* to disable FILE */
|
||||
#cmakedefine CURL_DISABLE_FILE 1
|
||||
|
||||
/* to disable FTP */
|
||||
#cmakedefine CURL_DISABLE_FTP 1
|
||||
|
||||
/* to disable GOPHER */
|
||||
#cmakedefine CURL_DISABLE_GOPHER 1
|
||||
|
||||
/* to disable IMAP */
|
||||
#cmakedefine CURL_DISABLE_IMAP 1
|
||||
|
||||
/* to disable HTTP */
|
||||
#cmakedefine CURL_DISABLE_HTTP 1
|
||||
|
||||
/* to disable LDAP */
|
||||
#cmakedefine CURL_DISABLE_LDAP 1
|
||||
|
||||
/* to disable LDAPS */
|
||||
#cmakedefine CURL_DISABLE_LDAPS 1
|
||||
|
||||
/* to disable POP3 */
|
||||
#cmakedefine CURL_DISABLE_POP3 1
|
||||
|
||||
/* to disable proxies */
|
||||
#cmakedefine CURL_DISABLE_PROXY 1
|
||||
|
||||
/* to disable RTSP */
|
||||
#cmakedefine CURL_DISABLE_RTSP 1
|
||||
|
||||
/* to disable RTMP */
|
||||
#cmakedefine CURL_DISABLE_RTMP 1
|
||||
|
||||
/* to disable SMB */
|
||||
#cmakedefine CURL_DISABLE_SMB 1
|
||||
|
||||
/* to disable SMTP */
|
||||
#cmakedefine CURL_DISABLE_SMTP 1
|
||||
|
||||
/* to disable TELNET */
|
||||
#cmakedefine CURL_DISABLE_TELNET 1
|
||||
|
||||
/* to disable TFTP */
|
||||
#cmakedefine CURL_DISABLE_TFTP 1
|
||||
|
||||
/* to disable verbose strings */
|
||||
#cmakedefine CURL_DISABLE_VERBOSE_STRINGS 1
|
||||
|
||||
/* to make a symbol visible */
|
||||
#cmakedefine CURL_EXTERN_SYMBOL 1
|
||||
/* Ensure using CURL_EXTERN_SYMBOL is possible */
|
||||
#ifndef CURL_EXTERN_SYMBOL
|
||||
#define CURL_EXTERN_SYMBOL
|
||||
#endif
|
||||
|
||||
/* Use Windows LDAP implementation */
|
||||
#cmakedefine USE_WIN32_LDAP 1
|
||||
|
||||
/* when not building a shared library */
|
||||
#cmakedefine CURL_STATICLIB 1
|
||||
|
||||
/* Set to explicitly specify we don't want to use thread-safe functions */
|
||||
#cmakedefine DISABLED_THREADSAFE 1
|
||||
|
||||
/* your Entropy Gathering Daemon socket pathname */
|
||||
#cmakedefine EGD_SOCKET ${EGD_SOCKET}
|
||||
|
||||
/* Define if you want to enable IPv6 support */
|
||||
#cmakedefine ENABLE_IPV6 1
|
||||
|
||||
/* Define to the type qualifier of arg 1 for getnameinfo. */
|
||||
#cmakedefine GETNAMEINFO_QUAL_ARG1 ${GETNAMEINFO_QUAL_ARG1}
|
||||
|
||||
/* Define to the type of arg 1 for getnameinfo. */
|
||||
#cmakedefine GETNAMEINFO_TYPE_ARG1 ${GETNAMEINFO_TYPE_ARG1}
|
||||
|
||||
/* Define to the type of arg 2 for getnameinfo. */
|
||||
#cmakedefine GETNAMEINFO_TYPE_ARG2 ${GETNAMEINFO_TYPE_ARG2}
|
||||
|
||||
/* Define to the type of args 4 and 6 for getnameinfo. */
|
||||
#cmakedefine GETNAMEINFO_TYPE_ARG46 ${GETNAMEINFO_TYPE_ARG46}
|
||||
|
||||
/* Define to the type of arg 7 for getnameinfo. */
|
||||
#cmakedefine GETNAMEINFO_TYPE_ARG7 ${GETNAMEINFO_TYPE_ARG7}
|
||||
|
||||
/* Specifies the number of arguments to getservbyport_r */
|
||||
#cmakedefine GETSERVBYPORT_R_ARGS ${GETSERVBYPORT_R_ARGS}
|
||||
|
||||
/* Specifies the size of the buffer to pass to getservbyport_r */
|
||||
#cmakedefine GETSERVBYPORT_R_BUFSIZE ${GETSERVBYPORT_R_BUFSIZE}
|
||||
|
||||
/* Define to 1 if you have the alarm function. */
|
||||
#cmakedefine HAVE_ALARM 1
|
||||
|
||||
/* Define to 1 if you have the <alloca.h> header file. */
|
||||
#cmakedefine HAVE_ALLOCA_H 1
|
||||
|
||||
/* Define to 1 if you have the <arpa/inet.h> header file. */
|
||||
#cmakedefine HAVE_ARPA_INET_H 1
|
||||
|
||||
/* Define to 1 if you have the <arpa/tftp.h> header file. */
|
||||
#cmakedefine HAVE_ARPA_TFTP_H 1
|
||||
|
||||
/* Define to 1 if you have the <assert.h> header file. */
|
||||
#cmakedefine HAVE_ASSERT_H 1
|
||||
|
||||
/* Define to 1 if you have the `basename' function. */
|
||||
#cmakedefine HAVE_BASENAME 1
|
||||
|
||||
/* Define to 1 if bool is an available type. */
|
||||
#cmakedefine HAVE_BOOL_T 1
|
||||
|
||||
/* Define to 1 if you have the clock_gettime function and monotonic timer. */
|
||||
#cmakedefine HAVE_CLOCK_GETTIME_MONOTONIC 1
|
||||
|
||||
/* Define to 1 if you have the `closesocket' function. */
|
||||
#cmakedefine HAVE_CLOSESOCKET 1
|
||||
|
||||
/* Define to 1 if you have the `CRYPTO_cleanup_all_ex_data' function. */
|
||||
#cmakedefine HAVE_CRYPTO_CLEANUP_ALL_EX_DATA 1
|
||||
|
||||
/* Define to 1 if you have the <crypto.h> header file. */
|
||||
#cmakedefine HAVE_CRYPTO_H 1
|
||||
|
||||
/* Define to 1 if you have the <des.h> header file. */
|
||||
#cmakedefine HAVE_DES_H 1
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#cmakedefine HAVE_DLFCN_H 1
|
||||
|
||||
/* Define to 1 if you have the `ENGINE_load_builtin_engines' function. */
|
||||
#cmakedefine HAVE_ENGINE_LOAD_BUILTIN_ENGINES 1
|
||||
|
||||
/* Define to 1 if you have the <errno.h> header file. */
|
||||
#cmakedefine HAVE_ERRNO_H 1
|
||||
|
||||
/* Define to 1 if you have the <err.h> header file. */
|
||||
#cmakedefine HAVE_ERR_H 1
|
||||
|
||||
/* Define to 1 if you have the fcntl function. */
|
||||
#cmakedefine HAVE_FCNTL 1
|
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#cmakedefine HAVE_FCNTL_H 1
|
||||
|
||||
/* Define to 1 if you have a working fcntl O_NONBLOCK function. */
|
||||
#cmakedefine HAVE_FCNTL_O_NONBLOCK 1
|
||||
|
||||
/* Define to 1 if you have the fdopen function. */
|
||||
#cmakedefine HAVE_FDOPEN 1
|
||||
|
||||
/* Define to 1 if you have the `fork' function. */
|
||||
#cmakedefine HAVE_FORK 1
|
||||
|
||||
/* Define to 1 if you have the freeaddrinfo function. */
|
||||
#cmakedefine HAVE_FREEADDRINFO 1
|
||||
|
||||
/* Define to 1 if you have the freeifaddrs function. */
|
||||
#cmakedefine HAVE_FREEIFADDRS 1
|
||||
|
||||
/* Define to 1 if you have the ftruncate function. */
|
||||
#cmakedefine HAVE_FTRUNCATE 1
|
||||
|
||||
/* Define to 1 if you have a working getaddrinfo function. */
|
||||
#cmakedefine HAVE_GETADDRINFO 1
|
||||
|
||||
/* Define to 1 if you have the `geteuid' function. */
|
||||
#cmakedefine HAVE_GETEUID 1
|
||||
|
||||
/* Define to 1 if you have the gethostbyaddr function. */
|
||||
#cmakedefine HAVE_GETHOSTBYADDR 1
|
||||
|
||||
/* Define to 1 if you have the gethostbyaddr_r function. */
|
||||
#cmakedefine HAVE_GETHOSTBYADDR_R 1
|
||||
|
||||
/* gethostbyaddr_r() takes 5 args */
|
||||
#cmakedefine HAVE_GETHOSTBYADDR_R_5 1
|
||||
|
||||
/* gethostbyaddr_r() takes 7 args */
|
||||
#cmakedefine HAVE_GETHOSTBYADDR_R_7 1
|
||||
|
||||
/* gethostbyaddr_r() takes 8 args */
|
||||
#cmakedefine HAVE_GETHOSTBYADDR_R_8 1
|
||||
|
||||
/* Define to 1 if you have the gethostbyname function. */
|
||||
#cmakedefine HAVE_GETHOSTBYNAME 1
|
||||
|
||||
/* Define to 1 if you have the gethostbyname_r function. */
|
||||
#cmakedefine HAVE_GETHOSTBYNAME_R 1
|
||||
|
||||
/* gethostbyname_r() takes 3 args */
|
||||
#cmakedefine HAVE_GETHOSTBYNAME_R_3 1
|
||||
|
||||
/* gethostbyname_r() takes 5 args */
|
||||
#cmakedefine HAVE_GETHOSTBYNAME_R_5 1
|
||||
|
||||
/* gethostbyname_r() takes 6 args */
|
||||
#cmakedefine HAVE_GETHOSTBYNAME_R_6 1
|
||||
|
||||
/* Define to 1 if you have the gethostname function. */
|
||||
#cmakedefine HAVE_GETHOSTNAME 1
|
||||
|
||||
/* Define to 1 if you have a working getifaddrs function. */
|
||||
#cmakedefine HAVE_GETIFADDRS 1
|
||||
|
||||
/* Define to 1 if you have the getnameinfo function. */
|
||||
#cmakedefine HAVE_GETNAMEINFO 1
|
||||
|
||||
/* Define to 1 if you have the `getpass_r' function. */
|
||||
#cmakedefine HAVE_GETPASS_R 1
|
||||
|
||||
/* Define to 1 if you have the `getppid' function. */
|
||||
#cmakedefine HAVE_GETPPID 1
|
||||
|
||||
/* Define to 1 if you have the `getprotobyname' function. */
|
||||
#cmakedefine HAVE_GETPROTOBYNAME 1
|
||||
|
||||
/* Define to 1 if you have the `getpwuid' function. */
|
||||
#cmakedefine HAVE_GETPWUID 1
|
||||
|
||||
/* Define to 1 if you have the `getrlimit' function. */
|
||||
#cmakedefine HAVE_GETRLIMIT 1
|
||||
|
||||
/* Define to 1 if you have the getservbyport_r function. */
|
||||
#cmakedefine HAVE_GETSERVBYPORT_R 1
|
||||
|
||||
/* Define to 1 if you have the `gettimeofday' function. */
|
||||
#cmakedefine HAVE_GETTIMEOFDAY 1
|
||||
|
||||
/* Define to 1 if you have a working glibc-style strerror_r function. */
|
||||
#cmakedefine HAVE_GLIBC_STRERROR_R 1
|
||||
|
||||
/* Define to 1 if you have a working gmtime_r function. */
|
||||
#cmakedefine HAVE_GMTIME_R 1
|
||||
|
||||
/* if you have the gssapi libraries */
|
||||
#cmakedefine HAVE_GSSAPI 1
|
||||
|
||||
/* Define to 1 if you have the <gssapi/gssapi_generic.h> header file. */
|
||||
#cmakedefine HAVE_GSSAPI_GSSAPI_GENERIC_H 1
|
||||
|
||||
/* Define to 1 if you have the <gssapi/gssapi.h> header file. */
|
||||
#cmakedefine HAVE_GSSAPI_GSSAPI_H 1
|
||||
|
||||
/* Define to 1 if you have the <gssapi/gssapi_krb5.h> header file. */
|
||||
#cmakedefine HAVE_GSSAPI_GSSAPI_KRB5_H 1
|
||||
|
||||
/* if you have the GNU gssapi libraries */
|
||||
#cmakedefine HAVE_GSSGNU 1
|
||||
|
||||
/* if you have the Heimdal gssapi libraries */
|
||||
#cmakedefine HAVE_GSSHEIMDAL 1
|
||||
|
||||
/* if you have the MIT gssapi libraries */
|
||||
#cmakedefine HAVE_GSSMIT 1
|
||||
|
||||
/* Define to 1 if you have the `idna_strerror' function. */
|
||||
#cmakedefine HAVE_IDNA_STRERROR 1
|
||||
|
||||
/* Define to 1 if you have the `idn_free' function. */
|
||||
#cmakedefine HAVE_IDN_FREE 1
|
||||
|
||||
/* Define to 1 if you have the <idn-free.h> header file. */
|
||||
#cmakedefine HAVE_IDN_FREE_H 1
|
||||
|
||||
/* Define to 1 if you have the <ifaddrs.h> header file. */
|
||||
#cmakedefine HAVE_IFADDRS_H 1
|
||||
|
||||
/* Define to 1 if you have the `inet_addr' function. */
|
||||
#cmakedefine HAVE_INET_ADDR 1
|
||||
|
||||
/* Define to 1 if you have the inet_ntoa_r function. */
|
||||
#cmakedefine HAVE_INET_NTOA_R 1
|
||||
|
||||
/* inet_ntoa_r() takes 2 args */
|
||||
#cmakedefine HAVE_INET_NTOA_R_2 1
|
||||
|
||||
/* inet_ntoa_r() takes 3 args */
|
||||
#cmakedefine HAVE_INET_NTOA_R_3 1
|
||||
|
||||
/* Define to 1 if you have a IPv6 capable working inet_ntop function. */
|
||||
#cmakedefine HAVE_INET_NTOP 1
|
||||
|
||||
/* Define to 1 if you have a IPv6 capable working inet_pton function. */
|
||||
#cmakedefine HAVE_INET_PTON 1
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#cmakedefine HAVE_INTTYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the ioctl function. */
|
||||
#cmakedefine HAVE_IOCTL 1
|
||||
|
||||
/* Define to 1 if you have the ioctlsocket function. */
|
||||
#cmakedefine HAVE_IOCTLSOCKET 1
|
||||
|
||||
/* Define to 1 if you have the IoctlSocket camel case function. */
|
||||
#cmakedefine HAVE_IOCTLSOCKET_CAMEL 1
|
||||
|
||||
/* Define to 1 if you have a working IoctlSocket camel case FIONBIO function.
|
||||
*/
|
||||
#cmakedefine HAVE_IOCTLSOCKET_CAMEL_FIONBIO 1
|
||||
|
||||
/* Define to 1 if you have a working ioctlsocket FIONBIO function. */
|
||||
#cmakedefine HAVE_IOCTLSOCKET_FIONBIO 1
|
||||
|
||||
/* Define to 1 if you have a working ioctl FIONBIO function. */
|
||||
#cmakedefine HAVE_IOCTL_FIONBIO 1
|
||||
|
||||
/* Define to 1 if you have a working ioctl SIOCGIFADDR function. */
|
||||
#cmakedefine HAVE_IOCTL_SIOCGIFADDR 1
|
||||
|
||||
/* Define to 1 if you have the <io.h> header file. */
|
||||
#cmakedefine HAVE_IO_H 1
|
||||
|
||||
/* if you have the Kerberos4 libraries (including -ldes) */
|
||||
#cmakedefine HAVE_KRB4 1
|
||||
|
||||
/* Define to 1 if you have the `krb_get_our_ip_for_realm' function. */
|
||||
#cmakedefine HAVE_KRB_GET_OUR_IP_FOR_REALM 1
|
||||
|
||||
/* Define to 1 if you have the <krb.h> header file. */
|
||||
#cmakedefine HAVE_KRB_H 1
|
||||
|
||||
/* Define to 1 if you have the lber.h header file. */
|
||||
#cmakedefine HAVE_LBER_H 1
|
||||
|
||||
/* Define to 1 if you have the ldapssl.h header file. */
|
||||
#cmakedefine HAVE_LDAPSSL_H 1
|
||||
|
||||
/* Define to 1 if you have the ldap.h header file. */
|
||||
#cmakedefine HAVE_LDAP_H 1
|
||||
|
||||
/* Use LDAPS implementation */
|
||||
#cmakedefine HAVE_LDAP_SSL 1
|
||||
|
||||
/* Define to 1 if you have the ldap_ssl.h header file. */
|
||||
#cmakedefine HAVE_LDAP_SSL_H 1
|
||||
|
||||
/* Define to 1 if you have the `ldap_url_parse' function. */
|
||||
#cmakedefine HAVE_LDAP_URL_PARSE 1
|
||||
|
||||
/* Define to 1 if you have the <libgen.h> header file. */
|
||||
#cmakedefine HAVE_LIBGEN_H 1
|
||||
|
||||
/* Define to 1 if you have the `idn' library (-lidn). */
|
||||
#cmakedefine HAVE_LIBIDN 1
|
||||
|
||||
/* Define to 1 if you have the `resolv' library (-lresolv). */
|
||||
#cmakedefine HAVE_LIBRESOLV 1
|
||||
|
||||
/* Define to 1 if you have the `resolve' library (-lresolve). */
|
||||
#cmakedefine HAVE_LIBRESOLVE 1
|
||||
|
||||
/* Define to 1 if you have the `socket' library (-lsocket). */
|
||||
#cmakedefine HAVE_LIBSOCKET 1
|
||||
|
||||
/* Define to 1 if you have the `ssh2' library (-lssh2). */
|
||||
#cmakedefine HAVE_LIBSSH2 1
|
||||
|
||||
/* Define to 1 if libssh2 provides `libssh2_version'. */
|
||||
#cmakedefine HAVE_LIBSSH2_VERSION 1
|
||||
|
||||
/* Define to 1 if libssh2 provides `libssh2_init'. */
|
||||
#cmakedefine HAVE_LIBSSH2_INIT 1
|
||||
|
||||
/* Define to 1 if libssh2 provides `libssh2_exit'. */
|
||||
#cmakedefine HAVE_LIBSSH2_EXIT 1
|
||||
|
||||
/* Define to 1 if libssh2 provides `libssh2_scp_send64'. */
|
||||
#cmakedefine HAVE_LIBSSH2_SCP_SEND64 1
|
||||
|
||||
/* Define to 1 if libssh2 provides `libssh2_session_handshake'. */
|
||||
#cmakedefine HAVE_LIBSSH2_SESSION_HANDSHAKE 1
|
||||
|
||||
/* Define to 1 if you have the <libssh2.h> header file. */
|
||||
#cmakedefine HAVE_LIBSSH2_H 1
|
||||
|
||||
/* Define to 1 if you have the `ssl' library (-lssl). */
|
||||
#cmakedefine HAVE_LIBSSL 1
|
||||
|
||||
/* if zlib is available */
|
||||
#cmakedefine HAVE_LIBZ 1
|
||||
|
||||
/* Define to 1 if you have the <limits.h> header file. */
|
||||
#cmakedefine HAVE_LIMITS_H 1
|
||||
|
||||
/* if your compiler supports LL */
|
||||
#cmakedefine HAVE_LL 1
|
||||
|
||||
/* Define to 1 if you have the <locale.h> header file. */
|
||||
#cmakedefine HAVE_LOCALE_H 1
|
||||
|
||||
/* Define to 1 if you have a working localtime_r function. */
|
||||
#cmakedefine HAVE_LOCALTIME_R 1
|
||||
|
||||
/* Define to 1 if the compiler supports the 'long long' data type. */
|
||||
#cmakedefine HAVE_LONGLONG 1
|
||||
|
||||
/* Define to 1 if you have the malloc.h header file. */
|
||||
#cmakedefine HAVE_MALLOC_H 1
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#cmakedefine HAVE_MEMORY_H 1
|
||||
|
||||
/* Define to 1 if you have the MSG_NOSIGNAL flag. */
|
||||
#cmakedefine HAVE_MSG_NOSIGNAL 1
|
||||
|
||||
/* Define to 1 if you have the <netdb.h> header file. */
|
||||
#cmakedefine HAVE_NETDB_H 1
|
||||
|
||||
/* Define to 1 if you have the <netinet/in.h> header file. */
|
||||
#cmakedefine HAVE_NETINET_IN_H 1
|
||||
|
||||
/* Define to 1 if you have the <netinet/tcp.h> header file. */
|
||||
#cmakedefine HAVE_NETINET_TCP_H 1
|
||||
|
||||
/* Define to 1 if you have the <net/if.h> header file. */
|
||||
#cmakedefine HAVE_NET_IF_H 1
|
||||
|
||||
/* Define to 1 if NI_WITHSCOPEID exists and works. */
|
||||
#cmakedefine HAVE_NI_WITHSCOPEID 1
|
||||
|
||||
/* if you have an old MIT gssapi library, lacking GSS_C_NT_HOSTBASED_SERVICE */
|
||||
#cmakedefine HAVE_OLD_GSSMIT 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/crypto.h> header file. */
|
||||
#cmakedefine HAVE_OPENSSL_CRYPTO_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/engine.h> header file. */
|
||||
#cmakedefine HAVE_OPENSSL_ENGINE_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/err.h> header file. */
|
||||
#cmakedefine HAVE_OPENSSL_ERR_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/pem.h> header file. */
|
||||
#cmakedefine HAVE_OPENSSL_PEM_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/pkcs12.h> header file. */
|
||||
#cmakedefine HAVE_OPENSSL_PKCS12_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/rsa.h> header file. */
|
||||
#cmakedefine HAVE_OPENSSL_RSA_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/ssl.h> header file. */
|
||||
#cmakedefine HAVE_OPENSSL_SSL_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/x509.h> header file. */
|
||||
#cmakedefine HAVE_OPENSSL_X509_H 1
|
||||
|
||||
/* Define to 1 if you have the <pem.h> header file. */
|
||||
#cmakedefine HAVE_PEM_H 1
|
||||
|
||||
/* Define to 1 if you have the `perror' function. */
|
||||
#cmakedefine HAVE_PERROR 1
|
||||
|
||||
/* Define to 1 if you have the `pipe' function. */
|
||||
#cmakedefine HAVE_PIPE 1
|
||||
|
||||
/* Define to 1 if you have a working poll function. */
|
||||
#cmakedefine HAVE_POLL 1
|
||||
|
||||
/* If you have a fine poll */
|
||||
#cmakedefine HAVE_POLL_FINE 1
|
||||
|
||||
/* Define to 1 if you have the <poll.h> header file. */
|
||||
#cmakedefine HAVE_POLL_H 1
|
||||
|
||||
/* Define to 1 if you have a working POSIX-style strerror_r function. */
|
||||
#cmakedefine HAVE_POSIX_STRERROR_R 1
|
||||
|
||||
/* Define to 1 if you have the <pthread.h> header file */
|
||||
#cmakedefine HAVE_PTHREAD_H 1
|
||||
|
||||
/* Define to 1 if you have the <pwd.h> header file. */
|
||||
#cmakedefine HAVE_PWD_H 1
|
||||
|
||||
/* Define to 1 if you have the `RAND_egd' function. */
|
||||
#cmakedefine HAVE_RAND_EGD 1
|
||||
|
||||
/* Define to 1 if you have the `RAND_screen' function. */
|
||||
#cmakedefine HAVE_RAND_SCREEN 1
|
||||
|
||||
/* Define to 1 if you have the `RAND_status' function. */
|
||||
#cmakedefine HAVE_RAND_STATUS 1
|
||||
|
||||
/* Define to 1 if you have the recv function. */
|
||||
#cmakedefine HAVE_RECV 1
|
||||
|
||||
/* Define to 1 if you have the recvfrom function. */
|
||||
#cmakedefine HAVE_RECVFROM 1
|
||||
|
||||
/* Define to 1 if you have the <rsa.h> header file. */
|
||||
#cmakedefine HAVE_RSA_H 1
|
||||
|
||||
/* Define to 1 if you have the select function. */
|
||||
#cmakedefine HAVE_SELECT 1
|
||||
|
||||
/* Define to 1 if you have the send function. */
|
||||
#cmakedefine HAVE_SEND 1
|
||||
|
||||
/* Define to 1 if you have the <setjmp.h> header file. */
|
||||
#cmakedefine HAVE_SETJMP_H 1
|
||||
|
||||
/* Define to 1 if you have the `setlocale' function. */
|
||||
#cmakedefine HAVE_SETLOCALE 1
|
||||
|
||||
/* Define to 1 if you have the `setmode' function. */
|
||||
#cmakedefine HAVE_SETMODE 1
|
||||
|
||||
/* Define to 1 if you have the `setrlimit' function. */
|
||||
#cmakedefine HAVE_SETRLIMIT 1
|
||||
|
||||
/* Define to 1 if you have the setsockopt function. */
|
||||
#cmakedefine HAVE_SETSOCKOPT 1
|
||||
|
||||
/* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */
|
||||
#cmakedefine HAVE_SETSOCKOPT_SO_NONBLOCK 1
|
||||
|
||||
/* Define to 1 if you have the <sgtty.h> header file. */
|
||||
#cmakedefine HAVE_SGTTY_H 1
|
||||
|
||||
/* Define to 1 if you have the sigaction function. */
|
||||
#cmakedefine HAVE_SIGACTION 1
|
||||
|
||||
/* Define to 1 if you have the siginterrupt function. */
|
||||
#cmakedefine HAVE_SIGINTERRUPT 1
|
||||
|
||||
/* Define to 1 if you have the signal function. */
|
||||
#cmakedefine HAVE_SIGNAL 1
|
||||
|
||||
/* Define to 1 if you have the <signal.h> header file. */
|
||||
#cmakedefine HAVE_SIGNAL_H 1
|
||||
|
||||
/* Define to 1 if you have the sigsetjmp function or macro. */
|
||||
#cmakedefine HAVE_SIGSETJMP 1
|
||||
|
||||
/* Define to 1 if sig_atomic_t is an available typedef. */
|
||||
#cmakedefine HAVE_SIG_ATOMIC_T 1
|
||||
|
||||
/* Define to 1 if sig_atomic_t is already defined as volatile. */
|
||||
#cmakedefine HAVE_SIG_ATOMIC_T_VOLATILE 1
|
||||
|
||||
/* Define to 1 if struct sockaddr_in6 has the sin6_scope_id member */
|
||||
#cmakedefine HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
|
||||
|
||||
/* Define to 1 if you have the `socket' function. */
|
||||
#cmakedefine HAVE_SOCKET 1
|
||||
|
||||
/* Define to 1 if you have the `SSL_get_shutdown' function. */
|
||||
#cmakedefine HAVE_SSL_GET_SHUTDOWN 1
|
||||
|
||||
/* Define to 1 if you have the <ssl.h> header file. */
|
||||
#cmakedefine HAVE_SSL_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdbool.h> header file. */
|
||||
#cmakedefine HAVE_STDBOOL_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#cmakedefine HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdio.h> header file. */
|
||||
#cmakedefine HAVE_STDIO_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#cmakedefine HAVE_STDLIB_H 1
|
||||
|
||||
/* Define to 1 if you have the strcasecmp function. */
|
||||
#cmakedefine HAVE_STRCASECMP 1
|
||||
|
||||
/* Define to 1 if you have the strcasestr function. */
|
||||
#cmakedefine HAVE_STRCASESTR 1
|
||||
|
||||
/* Define to 1 if you have the strcmpi function. */
|
||||
#cmakedefine HAVE_STRCMPI 1
|
||||
|
||||
/* Define to 1 if you have the strdup function. */
|
||||
#cmakedefine HAVE_STRDUP 1
|
||||
|
||||
/* Define to 1 if you have the strerror_r function. */
|
||||
#cmakedefine HAVE_STRERROR_R 1
|
||||
|
||||
/* Define to 1 if you have the stricmp function. */
|
||||
#cmakedefine HAVE_STRICMP 1
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#cmakedefine HAVE_STRINGS_H 1
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#cmakedefine HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if you have the strlcat function. */
|
||||
#cmakedefine HAVE_STRLCAT 1
|
||||
|
||||
/* Define to 1 if you have the `strlcpy' function. */
|
||||
#cmakedefine HAVE_STRLCPY 1
|
||||
|
||||
/* Define to 1 if you have the strncasecmp function. */
|
||||
#cmakedefine HAVE_STRNCASECMP 1
|
||||
|
||||
/* Define to 1 if you have the strncmpi function. */
|
||||
#cmakedefine HAVE_STRNCMPI 1
|
||||
|
||||
/* Define to 1 if you have the strnicmp function. */
|
||||
#cmakedefine HAVE_STRNICMP 1
|
||||
|
||||
/* Define to 1 if you have the <stropts.h> header file. */
|
||||
#cmakedefine HAVE_STROPTS_H 1
|
||||
|
||||
/* Define to 1 if you have the strstr function. */
|
||||
#cmakedefine HAVE_STRSTR 1
|
||||
|
||||
/* Define to 1 if you have the strtok_r function. */
|
||||
#cmakedefine HAVE_STRTOK_R 1
|
||||
|
||||
/* Define to 1 if you have the strtoll function. */
|
||||
#cmakedefine HAVE_STRTOLL 1
|
||||
|
||||
/* if struct sockaddr_storage is defined */
|
||||
#cmakedefine HAVE_STRUCT_SOCKADDR_STORAGE 1
|
||||
|
||||
/* Define to 1 if you have the timeval struct. */
|
||||
#cmakedefine HAVE_STRUCT_TIMEVAL 1
|
||||
|
||||
/* Define to 1 if you have the <sys/filio.h> header file. */
|
||||
#cmakedefine HAVE_SYS_FILIO_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/ioctl.h> header file. */
|
||||
#cmakedefine HAVE_SYS_IOCTL_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/param.h> header file. */
|
||||
#cmakedefine HAVE_SYS_PARAM_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/poll.h> header file. */
|
||||
#cmakedefine HAVE_SYS_POLL_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/resource.h> header file. */
|
||||
#cmakedefine HAVE_SYS_RESOURCE_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/select.h> header file. */
|
||||
#cmakedefine HAVE_SYS_SELECT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/socket.h> header file. */
|
||||
#cmakedefine HAVE_SYS_SOCKET_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/sockio.h> header file. */
|
||||
#cmakedefine HAVE_SYS_SOCKIO_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#cmakedefine HAVE_SYS_STAT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#cmakedefine HAVE_SYS_TIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#cmakedefine HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/uio.h> header file. */
|
||||
#cmakedefine HAVE_SYS_UIO_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/un.h> header file. */
|
||||
#cmakedefine HAVE_SYS_UN_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/utime.h> header file. */
|
||||
#cmakedefine HAVE_SYS_UTIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <termios.h> header file. */
|
||||
#cmakedefine HAVE_TERMIOS_H 1
|
||||
|
||||
/* Define to 1 if you have the <termio.h> header file. */
|
||||
#cmakedefine HAVE_TERMIO_H 1
|
||||
|
||||
/* Define to 1 if you have the <time.h> header file. */
|
||||
#cmakedefine HAVE_TIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <tld.h> header file. */
|
||||
#cmakedefine HAVE_TLD_H 1
|
||||
|
||||
/* Define to 1 if you have the `tld_strerror' function. */
|
||||
#cmakedefine HAVE_TLD_STRERROR 1
|
||||
|
||||
/* Define to 1 if you have the `uname' function. */
|
||||
#cmakedefine HAVE_UNAME 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#cmakedefine HAVE_UNISTD_H 1
|
||||
|
||||
/* Define to 1 if you have the `utime' function. */
|
||||
#cmakedefine HAVE_UTIME 1
|
||||
|
||||
/* Define to 1 if you have the <utime.h> header file. */
|
||||
#cmakedefine HAVE_UTIME_H 1
|
||||
|
||||
/* Define to 1 if compiler supports C99 variadic macro style. */
|
||||
#cmakedefine HAVE_VARIADIC_MACROS_C99 1
|
||||
|
||||
/* Define to 1 if compiler supports old gcc variadic macro style. */
|
||||
#cmakedefine HAVE_VARIADIC_MACROS_GCC 1
|
||||
|
||||
/* Define to 1 if you have the winber.h header file. */
|
||||
#cmakedefine HAVE_WINBER_H 1
|
||||
|
||||
/* Define to 1 if you have the windows.h header file. */
|
||||
#cmakedefine HAVE_WINDOWS_H 1
|
||||
|
||||
/* Define to 1 if you have the winldap.h header file. */
|
||||
#cmakedefine HAVE_WINLDAP_H 1
|
||||
|
||||
/* Define to 1 if you have the winsock2.h header file. */
|
||||
#cmakedefine HAVE_WINSOCK2_H 1
|
||||
|
||||
/* Define to 1 if you have the winsock.h header file. */
|
||||
#cmakedefine HAVE_WINSOCK_H 1
|
||||
|
||||
/* Define this symbol if your OS supports changing the contents of argv */
|
||||
#cmakedefine HAVE_WRITABLE_ARGV 1
|
||||
|
||||
/* Define to 1 if you have the writev function. */
|
||||
#cmakedefine HAVE_WRITEV 1
|
||||
|
||||
/* Define to 1 if you have the ws2tcpip.h header file. */
|
||||
#cmakedefine HAVE_WS2TCPIP_H 1
|
||||
|
||||
/* Define to 1 if you have the <x509.h> header file. */
|
||||
#cmakedefine HAVE_X509_H 1
|
||||
|
||||
/* Define if you have the <process.h> header file. */
|
||||
#cmakedefine HAVE_PROCESS_H 1
|
||||
|
||||
/* if you have the zlib.h header file */
|
||||
#cmakedefine HAVE_ZLIB_H 1
|
||||
|
||||
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
||||
*/
|
||||
#cmakedefine LT_OBJDIR ${LT_OBJDIR}
|
||||
|
||||
/* If you lack a fine basename() prototype */
|
||||
#cmakedefine NEED_BASENAME_PROTO 1
|
||||
|
||||
/* Define to 1 if you need the lber.h header file even with ldap.h */
|
||||
#cmakedefine NEED_LBER_H 1
|
||||
|
||||
/* Define to 1 if you need the malloc.h header file even with stdlib.h */
|
||||
#cmakedefine NEED_MALLOC_H 1
|
||||
|
||||
/* Define to 1 if _REENTRANT preprocessor symbol must be defined. */
|
||||
#cmakedefine NEED_REENTRANT 1
|
||||
|
||||
/* cpu-machine-OS */
|
||||
#cmakedefine OS ${OS}
|
||||
|
||||
/* Name of package */
|
||||
#cmakedefine PACKAGE ${PACKAGE}
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#cmakedefine PACKAGE_BUGREPORT ${PACKAGE_BUGREPORT}
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#cmakedefine PACKAGE_NAME ${PACKAGE_NAME}
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#cmakedefine PACKAGE_STRING ${PACKAGE_STRING}
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#cmakedefine PACKAGE_TARNAME ${PACKAGE_TARNAME}
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#cmakedefine PACKAGE_VERSION ${PACKAGE_VERSION}
|
||||
|
||||
/* a suitable file to read random data from */
|
||||
#cmakedefine RANDOM_FILE "${RANDOM_FILE}"
|
||||
|
||||
/* Define to the type of arg 1 for recvfrom. */
|
||||
#cmakedefine RECVFROM_TYPE_ARG1 ${RECVFROM_TYPE_ARG1}
|
||||
|
||||
/* Define to the type pointed by arg 2 for recvfrom. */
|
||||
#cmakedefine RECVFROM_TYPE_ARG2 ${RECVFROM_TYPE_ARG2}
|
||||
|
||||
/* Define to 1 if the type pointed by arg 2 for recvfrom is void. */
|
||||
#cmakedefine RECVFROM_TYPE_ARG2_IS_VOID 1
|
||||
|
||||
/* Define to the type of arg 3 for recvfrom. */
|
||||
#cmakedefine RECVFROM_TYPE_ARG3 ${RECVFROM_TYPE_ARG3}
|
||||
|
||||
/* Define to the type of arg 4 for recvfrom. */
|
||||
#cmakedefine RECVFROM_TYPE_ARG4 ${RECVFROM_TYPE_ARG4}
|
||||
|
||||
/* Define to the type pointed by arg 5 for recvfrom. */
|
||||
#cmakedefine RECVFROM_TYPE_ARG5 ${RECVFROM_TYPE_ARG5}
|
||||
|
||||
/* Define to 1 if the type pointed by arg 5 for recvfrom is void. */
|
||||
#cmakedefine RECVFROM_TYPE_ARG5_IS_VOID 1
|
||||
|
||||
/* Define to the type pointed by arg 6 for recvfrom. */
|
||||
#cmakedefine RECVFROM_TYPE_ARG6 ${RECVFROM_TYPE_ARG6}
|
||||
|
||||
/* Define to 1 if the type pointed by arg 6 for recvfrom is void. */
|
||||
#cmakedefine RECVFROM_TYPE_ARG6_IS_VOID 1
|
||||
|
||||
/* Define to the function return type for recvfrom. */
|
||||
#cmakedefine RECVFROM_TYPE_RETV ${RECVFROM_TYPE_RETV}
|
||||
|
||||
/* Define to the type of arg 1 for recv. */
|
||||
#cmakedefine RECV_TYPE_ARG1 ${RECV_TYPE_ARG1}
|
||||
|
||||
/* Define to the type of arg 2 for recv. */
|
||||
#cmakedefine RECV_TYPE_ARG2 ${RECV_TYPE_ARG2}
|
||||
|
||||
/* Define to the type of arg 3 for recv. */
|
||||
#cmakedefine RECV_TYPE_ARG3 ${RECV_TYPE_ARG3}
|
||||
|
||||
/* Define to the type of arg 4 for recv. */
|
||||
#cmakedefine RECV_TYPE_ARG4 ${RECV_TYPE_ARG4}
|
||||
|
||||
/* Define to the function return type for recv. */
|
||||
#cmakedefine RECV_TYPE_RETV ${RECV_TYPE_RETV}
|
||||
|
||||
/* Define as the return type of signal handlers (`int' or `void'). */
|
||||
#cmakedefine RETSIGTYPE ${RETSIGTYPE}
|
||||
|
||||
/* Define to the type qualifier of arg 5 for select. */
|
||||
#cmakedefine SELECT_QUAL_ARG5 ${SELECT_QUAL_ARG5}
|
||||
|
||||
/* Define to the type of arg 1 for select. */
|
||||
#cmakedefine SELECT_TYPE_ARG1 ${SELECT_TYPE_ARG1}
|
||||
|
||||
/* Define to the type of args 2, 3 and 4 for select. */
|
||||
#cmakedefine SELECT_TYPE_ARG234 ${SELECT_TYPE_ARG234}
|
||||
|
||||
/* Define to the type of arg 5 for select. */
|
||||
#cmakedefine SELECT_TYPE_ARG5 ${SELECT_TYPE_ARG5}
|
||||
|
||||
/* Define to the function return type for select. */
|
||||
#cmakedefine SELECT_TYPE_RETV ${SELECT_TYPE_RETV}
|
||||
|
||||
/* Define to the type qualifier of arg 2 for send. */
|
||||
#cmakedefine SEND_QUAL_ARG2 ${SEND_QUAL_ARG2}
|
||||
|
||||
/* Define to the type of arg 1 for send. */
|
||||
#cmakedefine SEND_TYPE_ARG1 ${SEND_TYPE_ARG1}
|
||||
|
||||
/* Define to the type of arg 2 for send. */
|
||||
#cmakedefine SEND_TYPE_ARG2 ${SEND_TYPE_ARG2}
|
||||
|
||||
/* Define to the type of arg 3 for send. */
|
||||
#cmakedefine SEND_TYPE_ARG3 ${SEND_TYPE_ARG3}
|
||||
|
||||
/* Define to the type of arg 4 for send. */
|
||||
#cmakedefine SEND_TYPE_ARG4 ${SEND_TYPE_ARG4}
|
||||
|
||||
/* Define to the function return type for send. */
|
||||
#cmakedefine SEND_TYPE_RETV ${SEND_TYPE_RETV}
|
||||
|
||||
/* The size of `int', as computed by sizeof. */
|
||||
#cmakedefine SIZEOF_INT ${SIZEOF_INT}
|
||||
|
||||
/* The size of `short', as computed by sizeof. */
|
||||
#cmakedefine SIZEOF_SHORT ${SIZEOF_SHORT}
|
||||
|
||||
/* The size of `long', as computed by sizeof. */
|
||||
#cmakedefine SIZEOF_LONG ${SIZEOF_LONG}
|
||||
|
||||
/* The size of `off_t', as computed by sizeof. */
|
||||
#cmakedefine SIZEOF_OFF_T ${SIZEOF_OFF_T}
|
||||
|
||||
/* The size of `size_t', as computed by sizeof. */
|
||||
#cmakedefine SIZEOF_SIZE_T ${SIZEOF_SIZE_T}
|
||||
|
||||
/* The size of `time_t', as computed by sizeof. */
|
||||
#cmakedefine SIZEOF_TIME_T ${SIZEOF_TIME_T}
|
||||
|
||||
/* The size of `void*', as computed by sizeof. */
|
||||
#cmakedefine SIZEOF_VOIDP ${SIZEOF_VOIDP}
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#cmakedefine STDC_HEADERS 1
|
||||
|
||||
/* Define to the type of arg 3 for strerror_r. */
|
||||
#cmakedefine STRERROR_R_TYPE_ARG3 ${STRERROR_R_TYPE_ARG3}
|
||||
|
||||
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#cmakedefine TIME_WITH_SYS_TIME 1
|
||||
|
||||
/* Define if you want to enable c-ares support */
|
||||
#cmakedefine USE_ARES 1
|
||||
|
||||
/* Define if you want to enable POSIX threaded DNS lookup */
|
||||
#cmakedefine USE_THREADS_POSIX 1
|
||||
|
||||
/* Define to disable non-blocking sockets. */
|
||||
#cmakedefine USE_BLOCKING_SOCKETS 1
|
||||
|
||||
/* if GnuTLS is enabled */
|
||||
#cmakedefine USE_GNUTLS 1
|
||||
|
||||
/* if PolarSSL is enabled */
|
||||
#cmakedefine USE_POLARSSL 1
|
||||
|
||||
/* if libSSH2 is in use */
|
||||
#cmakedefine USE_LIBSSH2 1
|
||||
|
||||
/* If you want to build curl with the built-in manual */
|
||||
#cmakedefine USE_MANUAL 1
|
||||
|
||||
/* if NSS is enabled */
|
||||
#cmakedefine USE_NSS 1
|
||||
|
||||
/* if you want to use OpenLDAP code instead of legacy ldap implementation */
|
||||
#cmakedefine USE_OPENLDAP 1
|
||||
|
||||
/* if OpenSSL is in use */
|
||||
#cmakedefine USE_OPENSSL 1
|
||||
|
||||
/* if Unix domain sockets are enabled */
|
||||
#cmakedefine USE_UNIX_SOCKETS
|
||||
|
||||
/* Define to 1 if you are building a Windows target without large file
|
||||
support. */
|
||||
#cmakedefine USE_WIN32_LARGE_FILES 1
|
||||
|
||||
/* to enable SSPI support */
|
||||
#cmakedefine USE_WINDOWS_SSPI 1
|
||||
|
||||
/* to enable Windows SSL */
|
||||
#cmakedefine USE_SCHANNEL 1
|
||||
|
||||
/* Define to 1 if using yaSSL in OpenSSL compatibility mode. */
|
||||
#cmakedefine USE_YASSLEMUL 1
|
||||
|
||||
/* Version number of package */
|
||||
#cmakedefine VERSION ${VERSION}
|
||||
|
||||
/* Define to avoid automatic inclusion of winsock.h */
|
||||
#cmakedefine WIN32_LEAN_AND_MEAN 1
|
||||
|
||||
/* Define to 1 if OS is AIX. */
|
||||
#ifndef _ALL_SOURCE
|
||||
# undef _ALL_SOURCE
|
||||
#endif
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
#cmakedefine _FILE_OFFSET_BITS ${_FILE_OFFSET_BITS}
|
||||
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
#cmakedefine _LARGE_FILES ${_LARGE_FILES}
|
||||
|
||||
/* define this if you need it to compile thread-safe code */
|
||||
#cmakedefine _THREAD_SAFE ${_THREAD_SAFE}
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
#cmakedefine const ${const}
|
||||
|
||||
/* Type to use in place of in_addr_t when system does not provide it. */
|
||||
#cmakedefine in_addr_t ${in_addr_t}
|
||||
|
||||
/* Define to `__inline__' or `__inline' if that's what the C compiler
|
||||
calls it, or to nothing if 'inline' is not supported under any name. */
|
||||
#ifndef __cplusplus
|
||||
#undef inline
|
||||
#endif
|
||||
|
||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||
#cmakedefine size_t ${size_t}
|
||||
|
||||
/* the signed version of size_t */
|
||||
#cmakedefine ssize_t ${ssize_t}
|
File diff suppressed because it is too large
Load Diff
|
@ -1,63 +0,0 @@
|
|||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 2015, Steve Holme, <steve_holme@hotmail.com>.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#if defined(USE_NTLM) && !defined(USE_OPENSSL)
|
||||
|
||||
#include "curl_des.h"
|
||||
|
||||
/*
|
||||
* Curl_des_set_odd_parity()
|
||||
*
|
||||
* This is used to apply odd parity to the given byte array. It is typically
|
||||
* used by when a cryptography engines doesn't have it's own version.
|
||||
*
|
||||
* The function is a port of the Java based oddParity() function over at:
|
||||
*
|
||||
* http://davenport.sourceforge.net/ntlm.html
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* bytes [in/out] - The data whose parity bits are to be adjusted for
|
||||
* odd parity.
|
||||
* len [out] - The length of the data.
|
||||
*/
|
||||
void Curl_des_set_odd_parity(unsigned char *bytes, size_t len)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for(i = 0; i < len; i++) {
|
||||
unsigned char b = bytes[i];
|
||||
|
||||
bool needs_parity = (((b >> 7) ^ (b >> 6) ^ (b >> 5) ^
|
||||
(b >> 4) ^ (b >> 3) ^ (b >> 2) ^
|
||||
(b >> 1)) & 0x01) == 0;
|
||||
|
||||
if(needs_parity)
|
||||
bytes[i] |= 0x01;
|
||||
else
|
||||
bytes[i] &= 0xfe;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* USE_NTLM && !USE_OPENSSL */
|
|
@ -1,34 +0,0 @@
|
|||
#ifndef HEADER_CURL_DES_H
|
||||
#define HEADER_CURL_DES_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 2015, Steve Holme, <steve_holme@hotmail.com>.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#if defined(USE_NTLM) && !defined(USE_OPENSSL)
|
||||
|
||||
/* Applies odd parity to the given byte array */
|
||||
void Curl_des_set_odd_parity(unsigned char *bytes, size_t length);
|
||||
|
||||
#endif /* USE_NTLM && !USE_OPENSSL */
|
||||
|
||||
#endif /* HEADER_CURL_DES_H */
|
|
@ -1,236 +0,0 @@
|
|||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#include "curl_endian.h"
|
||||
|
||||
/*
|
||||
* Curl_read16_le()
|
||||
*
|
||||
* This function converts a 16-bit integer from the little endian format, as
|
||||
* used in the incoming package to whatever endian format we're using
|
||||
* natively.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* buf [in] - A pointer to a 2 byte buffer.
|
||||
*
|
||||
* Returns the integer.
|
||||
*/
|
||||
unsigned short Curl_read16_le(unsigned char *buf)
|
||||
{
|
||||
return (unsigned short)(((unsigned short)buf[0]) |
|
||||
((unsigned short)buf[1] << 8));
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_read32_le()
|
||||
*
|
||||
* This function converts a 32-bit integer from the little endian format, as
|
||||
* used in the incoming package to whatever endian format we're using
|
||||
* natively.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* buf [in] - A pointer to a 4 byte buffer.
|
||||
*
|
||||
* Returns the integer.
|
||||
*/
|
||||
unsigned int Curl_read32_le(unsigned char *buf)
|
||||
{
|
||||
return ((unsigned int)buf[0]) | ((unsigned int)buf[1] << 8) |
|
||||
((unsigned int)buf[2] << 16) | ((unsigned int)buf[3] << 24);
|
||||
}
|
||||
|
||||
#if (CURL_SIZEOF_CURL_OFF_T > 4)
|
||||
/*
|
||||
* Curl_read64_le()
|
||||
*
|
||||
* This function converts a 64-bit integer from the little endian format, as
|
||||
* used in the incoming package to whatever endian format we're using
|
||||
* natively.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* buf [in] - A pointer to a 8 byte buffer.
|
||||
*
|
||||
* Returns the integer.
|
||||
*/
|
||||
#if defined(HAVE_LONGLONG)
|
||||
unsigned long long Curl_read64_le(unsigned char *buf)
|
||||
{
|
||||
return ((unsigned long long)buf[0]) |
|
||||
((unsigned long long)buf[1] << 8) |
|
||||
((unsigned long long)buf[2] << 16) |
|
||||
((unsigned long long)buf[3] << 24) |
|
||||
((unsigned long long)buf[4] << 32) |
|
||||
((unsigned long long)buf[5] << 40) |
|
||||
((unsigned long long)buf[6] << 48) |
|
||||
((unsigned long long)buf[7] << 56);
|
||||
}
|
||||
#else
|
||||
unsigned __int64 Curl_read64_le(unsigned char *buf)
|
||||
{
|
||||
return ((unsigned __int64)buf[0]) | ((unsigned __int64)buf[1] << 8) |
|
||||
((unsigned __int64)buf[2] << 16) | ((unsigned __int64)buf[3] << 24) |
|
||||
((unsigned __int64)buf[4] << 32) | ((unsigned __int64)buf[5] << 40) |
|
||||
((unsigned __int64)buf[6] << 48) | ((unsigned __int64)buf[7] << 56);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CURL_SIZEOF_CURL_OFF_T > 4 */
|
||||
|
||||
/*
|
||||
* Curl_read16_be()
|
||||
*
|
||||
* This function converts a 16-bit integer from the big endian format, as
|
||||
* used in the incoming package to whatever endian format we're using
|
||||
* natively.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* buf [in] - A pointer to a 2 byte buffer.
|
||||
*
|
||||
* Returns the integer.
|
||||
*/
|
||||
unsigned short Curl_read16_be(unsigned char *buf)
|
||||
{
|
||||
return (unsigned short)(((unsigned short)buf[0] << 8) |
|
||||
((unsigned short)buf[1]));
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_read32_be()
|
||||
*
|
||||
* This function converts a 32-bit integer from the big endian format, as
|
||||
* used in the incoming package to whatever endian format we're using
|
||||
* natively.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* buf [in] - A pointer to a 4 byte buffer.
|
||||
*
|
||||
* Returns the integer.
|
||||
*/
|
||||
unsigned int Curl_read32_be(unsigned char *buf)
|
||||
{
|
||||
return ((unsigned int)buf[0] << 24) | ((unsigned int)buf[1] << 16) |
|
||||
((unsigned int)buf[2] << 8) | ((unsigned int)buf[3]);
|
||||
}
|
||||
|
||||
#if (CURL_SIZEOF_CURL_OFF_T > 4)
|
||||
/*
|
||||
* Curl_read64_be()
|
||||
*
|
||||
* This function converts a 64-bit integer from the big endian format, as
|
||||
* used in the incoming package to whatever endian format we're using
|
||||
* natively.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* buf [in] - A pointer to a 8 byte buffer.
|
||||
*
|
||||
* Returns the integer.
|
||||
*/
|
||||
#if defined(HAVE_LONGLONG)
|
||||
unsigned long long Curl_read64_be(unsigned char *buf)
|
||||
{
|
||||
return ((unsigned long long)buf[0] << 56) |
|
||||
((unsigned long long)buf[1] << 48) |
|
||||
((unsigned long long)buf[2] << 40) |
|
||||
((unsigned long long)buf[3] << 32) |
|
||||
((unsigned long long)buf[4] << 24) |
|
||||
((unsigned long long)buf[5] << 16) |
|
||||
((unsigned long long)buf[6] << 8) |
|
||||
((unsigned long long)buf[7]);
|
||||
}
|
||||
#else
|
||||
unsigned __int64 Curl_read64_be(unsigned char *buf)
|
||||
{
|
||||
return ((unsigned __int64)buf[0] << 56) | ((unsigned __int64)buf[1] << 48) |
|
||||
((unsigned __int64)buf[2] << 40) | ((unsigned __int64)buf[3] << 32) |
|
||||
((unsigned __int64)buf[4] << 24) | ((unsigned __int64)buf[5] << 16) |
|
||||
((unsigned __int64)buf[6] << 8) | ((unsigned __int64)buf[7]);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CURL_SIZEOF_CURL_OFF_T > 4 */
|
||||
|
||||
/*
|
||||
* Curl_write16_le()
|
||||
*
|
||||
* This function converts a 16-bit integer from the native endian format,
|
||||
* to little endian format ready for sending down the wire.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* value [in] - The 16-bit integer value.
|
||||
* buffer [in] - A pointer to the output buffer.
|
||||
*/
|
||||
void Curl_write16_le(const short value, unsigned char *buffer)
|
||||
{
|
||||
buffer[0] = (char)(value & 0x00FF);
|
||||
buffer[1] = (char)((value & 0xFF00) >> 8);
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_write32_le()
|
||||
*
|
||||
* This function converts a 32-bit integer from the native endian format,
|
||||
* to little endian format ready for sending down the wire.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* value [in] - The 32-bit integer value.
|
||||
* buffer [in] - A pointer to the output buffer.
|
||||
*/
|
||||
void Curl_write32_le(const int value, unsigned char *buffer)
|
||||
{
|
||||
buffer[0] = (char)(value & 0x000000FF);
|
||||
buffer[1] = (char)((value & 0x0000FF00) >> 8);
|
||||
buffer[2] = (char)((value & 0x00FF0000) >> 16);
|
||||
buffer[3] = (char)((value & 0xFF000000) >> 24);
|
||||
}
|
||||
|
||||
#if (CURL_SIZEOF_CURL_OFF_T > 4)
|
||||
/*
|
||||
* Curl_write64_le()
|
||||
*
|
||||
* This function converts a 64-bit integer from the native endian format,
|
||||
* to little endian format ready for sending down the wire.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* value [in] - The 64-bit integer value.
|
||||
* buffer [in] - A pointer to the output buffer.
|
||||
*/
|
||||
#if defined(HAVE_LONGLONG)
|
||||
void Curl_write64_le(const long long value, unsigned char *buffer)
|
||||
#else
|
||||
void Curl_write64_le(const __int64 value, unsigned char *buffer)
|
||||
#endif
|
||||
{
|
||||
Curl_write32_le((int)value, buffer);
|
||||
Curl_write32_le((int)(value >> 32), buffer + 4);
|
||||
}
|
||||
#endif /* CURL_SIZEOF_CURL_OFF_T > 4 */
|
|
@ -1,70 +0,0 @@
|
|||
#ifndef HEADER_CURL_ENDIAN_H
|
||||
#define HEADER_CURL_ENDIAN_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* Converts a 16-bit integer from little endian */
|
||||
unsigned short Curl_read16_le(unsigned char *buf);
|
||||
|
||||
/* Converts a 32-bit integer from little endian */
|
||||
unsigned int Curl_read32_le(unsigned char *buf);
|
||||
|
||||
#if (CURL_SIZEOF_CURL_OFF_T > 4)
|
||||
/* Converts a 64-bit integer from little endian */
|
||||
#if defined(HAVE_LONGLONG)
|
||||
unsigned long long Curl_read64_le(unsigned char *buf);
|
||||
#else
|
||||
unsigned __int64 Curl_read64_le(unsigned char *buf);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Converts a 16-bit integer from big endian */
|
||||
unsigned short Curl_read16_be(unsigned char *buf);
|
||||
|
||||
/* Converts a 32-bit integer from big endian */
|
||||
unsigned int Curl_read32_be(unsigned char *buf);
|
||||
|
||||
#if (CURL_SIZEOF_CURL_OFF_T > 4)
|
||||
/* Converts a 64-bit integer from big endian */
|
||||
#if defined(HAVE_LONGLONG)
|
||||
unsigned long long Curl_read64_be(unsigned char *buf);
|
||||
#else
|
||||
unsigned __int64 Curl_read64_be(unsigned char *buf);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Converts a 16-bit integer to little endian */
|
||||
void Curl_write16_le(const short value, unsigned char *buffer);
|
||||
|
||||
/* Converts a 32-bit integer to little endian */
|
||||
void Curl_write32_le(const int value, unsigned char *buffer);
|
||||
|
||||
#if (CURL_SIZEOF_CURL_OFF_T > 4)
|
||||
/* Converts a 64-bit integer to little endian */
|
||||
#if defined(HAVE_LONGLONG)
|
||||
void Curl_write64_le(const long long value, unsigned char *buffer);
|
||||
#else
|
||||
void Curl_write64_le(const __int64 value, unsigned char *buffer);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* HEADER_CURL_ENDIAN_H */
|
|
@ -1,426 +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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
#include "curl_fnmatch.h"
|
||||
#include "curl_memory.h"
|
||||
|
||||
/* The last #include file should be: */
|
||||
#include "memdebug.h"
|
||||
|
||||
#define CURLFNM_CHARSET_LEN (sizeof(char) * 256)
|
||||
#define CURLFNM_CHSET_SIZE (CURLFNM_CHARSET_LEN + 15)
|
||||
|
||||
#define CURLFNM_NEGATE CURLFNM_CHARSET_LEN
|
||||
|
||||
#define CURLFNM_ALNUM (CURLFNM_CHARSET_LEN + 1)
|
||||
#define CURLFNM_DIGIT (CURLFNM_CHARSET_LEN + 2)
|
||||
#define CURLFNM_XDIGIT (CURLFNM_CHARSET_LEN + 3)
|
||||
#define CURLFNM_ALPHA (CURLFNM_CHARSET_LEN + 4)
|
||||
#define CURLFNM_PRINT (CURLFNM_CHARSET_LEN + 5)
|
||||
#define CURLFNM_BLANK (CURLFNM_CHARSET_LEN + 6)
|
||||
#define CURLFNM_LOWER (CURLFNM_CHARSET_LEN + 7)
|
||||
#define CURLFNM_GRAPH (CURLFNM_CHARSET_LEN + 8)
|
||||
#define CURLFNM_SPACE (CURLFNM_CHARSET_LEN + 9)
|
||||
#define CURLFNM_UPPER (CURLFNM_CHARSET_LEN + 10)
|
||||
|
||||
typedef enum {
|
||||
CURLFNM_LOOP_DEFAULT = 0,
|
||||
CURLFNM_LOOP_BACKSLASH
|
||||
} loop_state;
|
||||
|
||||
typedef enum {
|
||||
CURLFNM_SCHS_DEFAULT = 0,
|
||||
CURLFNM_SCHS_MAYRANGE,
|
||||
CURLFNM_SCHS_MAYRANGE2,
|
||||
CURLFNM_SCHS_RIGHTBR,
|
||||
CURLFNM_SCHS_RIGHTBRLEFTBR
|
||||
} setcharset_state;
|
||||
|
||||
typedef enum {
|
||||
CURLFNM_PKW_INIT = 0,
|
||||
CURLFNM_PKW_DDOT
|
||||
} parsekey_state;
|
||||
|
||||
#define SETCHARSET_OK 1
|
||||
#define SETCHARSET_FAIL 0
|
||||
|
||||
static int parsekeyword(unsigned char **pattern, unsigned char *charset)
|
||||
{
|
||||
parsekey_state state = CURLFNM_PKW_INIT;
|
||||
#define KEYLEN 10
|
||||
char keyword[KEYLEN] = { 0 };
|
||||
int found = FALSE;
|
||||
int i;
|
||||
unsigned char *p = *pattern;
|
||||
for(i = 0; !found; i++) {
|
||||
char c = *p++;
|
||||
if(i >= KEYLEN)
|
||||
return SETCHARSET_FAIL;
|
||||
switch(state) {
|
||||
case CURLFNM_PKW_INIT:
|
||||
if(ISALPHA(c) && ISLOWER(c))
|
||||
keyword[i] = c;
|
||||
else if(c == ':')
|
||||
state = CURLFNM_PKW_DDOT;
|
||||
else
|
||||
return 0;
|
||||
break;
|
||||
case CURLFNM_PKW_DDOT:
|
||||
if(c == ']')
|
||||
found = TRUE;
|
||||
else
|
||||
return SETCHARSET_FAIL;
|
||||
}
|
||||
}
|
||||
#undef KEYLEN
|
||||
|
||||
*pattern = p; /* move caller's pattern pointer */
|
||||
if(strcmp(keyword, "digit") == 0)
|
||||
charset[CURLFNM_DIGIT] = 1;
|
||||
else if(strcmp(keyword, "alnum") == 0)
|
||||
charset[CURLFNM_ALNUM] = 1;
|
||||
else if(strcmp(keyword, "alpha") == 0)
|
||||
charset[CURLFNM_ALPHA] = 1;
|
||||
else if(strcmp(keyword, "xdigit") == 0)
|
||||
charset[CURLFNM_XDIGIT] = 1;
|
||||
else if(strcmp(keyword, "print") == 0)
|
||||
charset[CURLFNM_PRINT] = 1;
|
||||
else if(strcmp(keyword, "graph") == 0)
|
||||
charset[CURLFNM_GRAPH] = 1;
|
||||
else if(strcmp(keyword, "space") == 0)
|
||||
charset[CURLFNM_SPACE] = 1;
|
||||
else if(strcmp(keyword, "blank") == 0)
|
||||
charset[CURLFNM_BLANK] = 1;
|
||||
else if(strcmp(keyword, "upper") == 0)
|
||||
charset[CURLFNM_UPPER] = 1;
|
||||
else if(strcmp(keyword, "lower") == 0)
|
||||
charset[CURLFNM_LOWER] = 1;
|
||||
else
|
||||
return SETCHARSET_FAIL;
|
||||
return SETCHARSET_OK;
|
||||
}
|
||||
|
||||
/* returns 1 (true) if pattern is OK, 0 if is bad ("p" is pattern pointer) */
|
||||
static int setcharset(unsigned char **p, unsigned char *charset)
|
||||
{
|
||||
setcharset_state state = CURLFNM_SCHS_DEFAULT;
|
||||
unsigned char rangestart = 0;
|
||||
unsigned char lastchar = 0;
|
||||
bool something_found = FALSE;
|
||||
unsigned char c;
|
||||
for(;;) {
|
||||
c = **p;
|
||||
switch(state) {
|
||||
case CURLFNM_SCHS_DEFAULT:
|
||||
if(ISALNUM(c)) { /* ASCII value */
|
||||
rangestart = c;
|
||||
charset[c] = 1;
|
||||
(*p)++;
|
||||
state = CURLFNM_SCHS_MAYRANGE;
|
||||
something_found = TRUE;
|
||||
}
|
||||
else if(c == ']') {
|
||||
if(something_found)
|
||||
return SETCHARSET_OK;
|
||||
else
|
||||
something_found = TRUE;
|
||||
state = CURLFNM_SCHS_RIGHTBR;
|
||||
charset[c] = 1;
|
||||
(*p)++;
|
||||
}
|
||||
else if(c == '[') {
|
||||
char c2 = *((*p)+1);
|
||||
if(c2 == ':') { /* there has to be a keyword */
|
||||
(*p) += 2;
|
||||
if(parsekeyword(p, charset)) {
|
||||
state = CURLFNM_SCHS_DEFAULT;
|
||||
}
|
||||
else
|
||||
return SETCHARSET_FAIL;
|
||||
}
|
||||
else {
|
||||
charset[c] = 1;
|
||||
(*p)++;
|
||||
}
|
||||
something_found = TRUE;
|
||||
}
|
||||
else if(c == '?' || c == '*') {
|
||||
something_found = TRUE;
|
||||
charset[c] = 1;
|
||||
(*p)++;
|
||||
}
|
||||
else if(c == '^' || c == '!') {
|
||||
if(!something_found) {
|
||||
if(charset[CURLFNM_NEGATE]) {
|
||||
charset[c] = 1;
|
||||
something_found = TRUE;
|
||||
}
|
||||
else
|
||||
charset[CURLFNM_NEGATE] = 1; /* negate charset */
|
||||
}
|
||||
else
|
||||
charset[c] = 1;
|
||||
(*p)++;
|
||||
}
|
||||
else if(c == '\\') {
|
||||
c = *(++(*p));
|
||||
if(ISPRINT((c))) {
|
||||
something_found = TRUE;
|
||||
state = CURLFNM_SCHS_MAYRANGE;
|
||||
charset[c] = 1;
|
||||
rangestart = c;
|
||||
(*p)++;
|
||||
}
|
||||
else
|
||||
return SETCHARSET_FAIL;
|
||||
}
|
||||
else if(c == '\0') {
|
||||
return SETCHARSET_FAIL;
|
||||
}
|
||||
else {
|
||||
charset[c] = 1;
|
||||
(*p)++;
|
||||
something_found = TRUE;
|
||||
}
|
||||
break;
|
||||
case CURLFNM_SCHS_MAYRANGE:
|
||||
if(c == '-') {
|
||||
charset[c] = 1;
|
||||
(*p)++;
|
||||
lastchar = '-';
|
||||
state = CURLFNM_SCHS_MAYRANGE2;
|
||||
}
|
||||
else if(c == '[') {
|
||||
state = CURLFNM_SCHS_DEFAULT;
|
||||
}
|
||||
else if(ISALNUM(c)) {
|
||||
charset[c] = 1;
|
||||
(*p)++;
|
||||
}
|
||||
else if(c == '\\') {
|
||||
c = *(++(*p));
|
||||
if(ISPRINT(c)) {
|
||||
charset[c] = 1;
|
||||
(*p)++;
|
||||
}
|
||||
else
|
||||
return SETCHARSET_FAIL;
|
||||
}
|
||||
else if(c == ']') {
|
||||
return SETCHARSET_OK;
|
||||
}
|
||||
else
|
||||
return SETCHARSET_FAIL;
|
||||
break;
|
||||
case CURLFNM_SCHS_MAYRANGE2:
|
||||
if(c == '\\') {
|
||||
c = *(++(*p));
|
||||
if(!ISPRINT(c))
|
||||
return SETCHARSET_FAIL;
|
||||
}
|
||||
if(c == ']') {
|
||||
return SETCHARSET_OK;
|
||||
}
|
||||
else if(c == '\\') {
|
||||
c = *(++(*p));
|
||||
if(ISPRINT(c)) {
|
||||
charset[c] = 1;
|
||||
state = CURLFNM_SCHS_DEFAULT;
|
||||
(*p)++;
|
||||
}
|
||||
else
|
||||
return SETCHARSET_FAIL;
|
||||
}
|
||||
if(c >= rangestart) {
|
||||
if((ISLOWER(c) && ISLOWER(rangestart)) ||
|
||||
(ISDIGIT(c) && ISDIGIT(rangestart)) ||
|
||||
(ISUPPER(c) && ISUPPER(rangestart))) {
|
||||
charset[lastchar] = 0;
|
||||
rangestart++;
|
||||
while(rangestart++ <= c)
|
||||
charset[rangestart-1] = 1;
|
||||
(*p)++;
|
||||
state = CURLFNM_SCHS_DEFAULT;
|
||||
}
|
||||
else
|
||||
return SETCHARSET_FAIL;
|
||||
}
|
||||
break;
|
||||
case CURLFNM_SCHS_RIGHTBR:
|
||||
if(c == '[') {
|
||||
state = CURLFNM_SCHS_RIGHTBRLEFTBR;
|
||||
charset[c] = 1;
|
||||
(*p)++;
|
||||
}
|
||||
else if(c == ']') {
|
||||
return SETCHARSET_OK;
|
||||
}
|
||||
else if(c == '\0') {
|
||||
return SETCHARSET_FAIL;
|
||||
}
|
||||
else if(ISPRINT(c)) {
|
||||
charset[c] = 1;
|
||||
(*p)++;
|
||||
state = CURLFNM_SCHS_DEFAULT;
|
||||
}
|
||||
else
|
||||
/* used 'goto fail' instead of 'return SETCHARSET_FAIL' to avoid a
|
||||
* nonsense warning 'statement not reached' at end of the fnc when
|
||||
* compiling on Solaris */
|
||||
goto fail;
|
||||
break;
|
||||
case CURLFNM_SCHS_RIGHTBRLEFTBR:
|
||||
if(c == ']') {
|
||||
return SETCHARSET_OK;
|
||||
}
|
||||
else {
|
||||
state = CURLFNM_SCHS_DEFAULT;
|
||||
charset[c] = 1;
|
||||
(*p)++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
fail:
|
||||
return SETCHARSET_FAIL;
|
||||
}
|
||||
|
||||
static int loop(const unsigned char *pattern, const unsigned char *string)
|
||||
{
|
||||
loop_state state = CURLFNM_LOOP_DEFAULT;
|
||||
unsigned char *p = (unsigned char *)pattern;
|
||||
unsigned char *s = (unsigned char *)string;
|
||||
unsigned char charset[CURLFNM_CHSET_SIZE] = { 0 };
|
||||
int rc = 0;
|
||||
|
||||
for(;;) {
|
||||
switch(state) {
|
||||
case CURLFNM_LOOP_DEFAULT:
|
||||
if(*p == '*') {
|
||||
while(*(p+1) == '*') /* eliminate multiple stars */
|
||||
p++;
|
||||
if(*s == '\0' && *(p+1) == '\0')
|
||||
return CURL_FNMATCH_MATCH;
|
||||
rc = loop(p + 1, s); /* *.txt matches .txt <=> .txt matches .txt */
|
||||
if(rc == CURL_FNMATCH_MATCH)
|
||||
return CURL_FNMATCH_MATCH;
|
||||
if(*s) /* let the star eat up one character */
|
||||
s++;
|
||||
else
|
||||
return CURL_FNMATCH_NOMATCH;
|
||||
}
|
||||
else if(*p == '?') {
|
||||
if(ISPRINT(*s)) {
|
||||
s++;
|
||||
p++;
|
||||
}
|
||||
else if(*s == '\0')
|
||||
return CURL_FNMATCH_NOMATCH;
|
||||
else
|
||||
return CURL_FNMATCH_FAIL; /* cannot deal with other character */
|
||||
}
|
||||
else if(*p == '\0') {
|
||||
if(*s == '\0')
|
||||
return CURL_FNMATCH_MATCH;
|
||||
else
|
||||
return CURL_FNMATCH_NOMATCH;
|
||||
}
|
||||
else if(*p == '\\') {
|
||||
state = CURLFNM_LOOP_BACKSLASH;
|
||||
p++;
|
||||
}
|
||||
else if(*p == '[') {
|
||||
unsigned char *pp = p+1; /* cannot handle with pointer to register */
|
||||
if(setcharset(&pp, charset)) {
|
||||
int found = FALSE;
|
||||
if(charset[(unsigned int)*s])
|
||||
found = TRUE;
|
||||
else if(charset[CURLFNM_ALNUM])
|
||||
found = ISALNUM(*s);
|
||||
else if(charset[CURLFNM_ALPHA])
|
||||
found = ISALPHA(*s);
|
||||
else if(charset[CURLFNM_DIGIT])
|
||||
found = ISDIGIT(*s);
|
||||
else if(charset[CURLFNM_XDIGIT])
|
||||
found = ISXDIGIT(*s);
|
||||
else if(charset[CURLFNM_PRINT])
|
||||
found = ISPRINT(*s);
|
||||
else if(charset[CURLFNM_SPACE])
|
||||
found = ISSPACE(*s);
|
||||
else if(charset[CURLFNM_UPPER])
|
||||
found = ISUPPER(*s);
|
||||
else if(charset[CURLFNM_LOWER])
|
||||
found = ISLOWER(*s);
|
||||
else if(charset[CURLFNM_BLANK])
|
||||
found = ISBLANK(*s);
|
||||
else if(charset[CURLFNM_GRAPH])
|
||||
found = ISGRAPH(*s);
|
||||
|
||||
if(charset[CURLFNM_NEGATE])
|
||||
found = !found;
|
||||
|
||||
if(found) {
|
||||
p = pp+1;
|
||||
s++;
|
||||
memset(charset, 0, CURLFNM_CHSET_SIZE);
|
||||
}
|
||||
else
|
||||
return CURL_FNMATCH_NOMATCH;
|
||||
}
|
||||
else
|
||||
return CURL_FNMATCH_FAIL;
|
||||
}
|
||||
else {
|
||||
if(*p++ != *s++)
|
||||
return CURL_FNMATCH_NOMATCH;
|
||||
}
|
||||
break;
|
||||
case CURLFNM_LOOP_BACKSLASH:
|
||||
if(ISPRINT(*p)) {
|
||||
if(*p++ == *s++)
|
||||
state = CURLFNM_LOOP_DEFAULT;
|
||||
else
|
||||
return CURL_FNMATCH_NOMATCH;
|
||||
}
|
||||
else
|
||||
return CURL_FNMATCH_FAIL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* @unittest: 1307
|
||||
*/
|
||||
int Curl_fnmatch(void *ptr, const char *pattern, const char *string)
|
||||
{
|
||||
(void)ptr; /* the argument is specified by the curl_fnmatch_callback
|
||||
prototype, but not used by Curl_fnmatch() */
|
||||
if(!pattern || !string) {
|
||||
return CURL_FNMATCH_FAIL;
|
||||
}
|
||||
return loop((unsigned char *)pattern, (unsigned char *)string);
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
#ifndef HEADER_CURL_FNMATCH_H
|
||||
#define HEADER_CURL_FNMATCH_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2009, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#define CURL_FNMATCH_MATCH 0
|
||||
#define CURL_FNMATCH_NOMATCH 1
|
||||
#define CURL_FNMATCH_FAIL 2
|
||||
|
||||
/* default pattern matching function
|
||||
* =================================
|
||||
* Implemented with recursive backtracking, if you want to use Curl_fnmatch,
|
||||
* please note that there is not implemented UTF/UNICODE support.
|
||||
*
|
||||
* Implemented features:
|
||||
* '?' notation, does not match UTF characters
|
||||
* '*' can also work with UTF string
|
||||
* [a-zA-Z0-9] enumeration support
|
||||
*
|
||||
* keywords: alnum, digit, xdigit, alpha, print, blank, lower, graph, space
|
||||
* and upper (use as "[[:alnum:]]")
|
||||
*/
|
||||
int Curl_fnmatch(void *ptr, const char *pattern, const char *string);
|
||||
|
||||
#endif /* HEADER_CURL_FNMATCH_H */
|
|
@ -1,100 +0,0 @@
|
|||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#include "curl_gethostname.h"
|
||||
|
||||
/*
|
||||
* Curl_gethostname() is a wrapper around gethostname() which allows
|
||||
* overriding the host name that the function would normally return.
|
||||
* This capability is used by the test suite to verify exact matching
|
||||
* of NTLM authentication, which exercises libcurl's MD4 and DES code
|
||||
* as well as by the SMTP module when a hostname is not provided.
|
||||
*
|
||||
* For libcurl debug enabled builds host name overriding takes place
|
||||
* when environment variable CURL_GETHOSTNAME is set, using the value
|
||||
* held by the variable to override returned host name.
|
||||
*
|
||||
* Note: The function always returns the un-qualified hostname rather
|
||||
* than being provider dependent.
|
||||
*
|
||||
* For libcurl shared library release builds the test suite preloads
|
||||
* another shared library named libhostname using the LD_PRELOAD
|
||||
* mechanism which intercepts, and might override, the gethostname()
|
||||
* function call. In this case a given platform must support the
|
||||
* LD_PRELOAD mechanism and additionally have environment variable
|
||||
* CURL_GETHOSTNAME set in order to override the returned host name.
|
||||
*
|
||||
* For libcurl static library release builds no overriding takes place.
|
||||
*/
|
||||
|
||||
int Curl_gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen) {
|
||||
|
||||
#ifndef HAVE_GETHOSTNAME
|
||||
|
||||
/* Allow compilation and return failure when unavailable */
|
||||
(void) name;
|
||||
(void) namelen;
|
||||
return -1;
|
||||
|
||||
#else
|
||||
int err;
|
||||
char* dot;
|
||||
|
||||
#ifdef DEBUGBUILD
|
||||
|
||||
/* Override host name when environment variable CURL_GETHOSTNAME is set */
|
||||
const char *force_hostname = getenv("CURL_GETHOSTNAME");
|
||||
if(force_hostname) {
|
||||
strncpy(name, force_hostname, namelen);
|
||||
err = 0;
|
||||
}
|
||||
else {
|
||||
name[0] = '\0';
|
||||
err = gethostname(name, namelen);
|
||||
}
|
||||
|
||||
#else /* DEBUGBUILD */
|
||||
|
||||
/* The call to system's gethostname() might get intercepted by the
|
||||
libhostname library when libcurl is built as a non-debug shared
|
||||
library when running the test suite. */
|
||||
name[0] = '\0';
|
||||
err = gethostname(name, namelen);
|
||||
|
||||
#endif
|
||||
|
||||
name[namelen - 1] = '\0';
|
||||
|
||||
if(err)
|
||||
return err;
|
||||
|
||||
/* Truncate domain, leave only machine name */
|
||||
dot = strchr(name, '.');
|
||||
if(dot)
|
||||
*dot = '\0';
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
#ifndef HEADER_CURL_GETHOSTNAME_H
|
||||
#define HEADER_CURL_GETHOSTNAME_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2010, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* Hostname buffer size */
|
||||
#define HOSTNAME_MAX 1024
|
||||
|
||||
/* This returns the local machine's un-qualified hostname */
|
||||
int Curl_gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen);
|
||||
|
||||
#endif /* HEADER_CURL_GETHOSTNAME_H */
|
|
@ -1,131 +0,0 @@
|
|||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 2011 - 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#ifdef HAVE_GSSAPI
|
||||
|
||||
#include "curl_gssapi.h"
|
||||
#include "sendf.h"
|
||||
|
||||
static char spnego_oid_bytes[] = "\x2b\x06\x01\x05\x05\x02";
|
||||
gss_OID_desc Curl_spnego_mech_oid = { 6, &spnego_oid_bytes };
|
||||
static char krb5_oid_bytes[] = "\x2a\x86\x48\x86\xf7\x12\x01\x02\x02";
|
||||
gss_OID_desc Curl_krb5_mech_oid = { 9, &krb5_oid_bytes };
|
||||
|
||||
OM_uint32 Curl_gss_init_sec_context(
|
||||
struct SessionHandle *data,
|
||||
OM_uint32 *minor_status,
|
||||
gss_ctx_id_t *context,
|
||||
gss_name_t target_name,
|
||||
gss_OID mech_type,
|
||||
gss_channel_bindings_t input_chan_bindings,
|
||||
gss_buffer_t input_token,
|
||||
gss_buffer_t output_token,
|
||||
const bool mutual_auth,
|
||||
OM_uint32 *ret_flags)
|
||||
{
|
||||
OM_uint32 req_flags = GSS_C_REPLAY_FLAG;
|
||||
|
||||
if(mutual_auth)
|
||||
req_flags |= GSS_C_MUTUAL_FLAG;
|
||||
|
||||
if(data->set.gssapi_delegation & CURLGSSAPI_DELEGATION_POLICY_FLAG) {
|
||||
#ifdef GSS_C_DELEG_POLICY_FLAG
|
||||
req_flags |= GSS_C_DELEG_POLICY_FLAG;
|
||||
#else
|
||||
infof(data, "warning: support for CURLGSSAPI_DELEGATION_POLICY_FLAG not "
|
||||
"compiled in\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
if(data->set.gssapi_delegation & CURLGSSAPI_DELEGATION_FLAG)
|
||||
req_flags |= GSS_C_DELEG_FLAG;
|
||||
|
||||
return gss_init_sec_context(minor_status,
|
||||
GSS_C_NO_CREDENTIAL, /* cred_handle */
|
||||
context,
|
||||
target_name,
|
||||
mech_type,
|
||||
req_flags,
|
||||
0, /* time_req */
|
||||
input_chan_bindings,
|
||||
input_token,
|
||||
NULL, /* actual_mech_type */
|
||||
output_token,
|
||||
ret_flags,
|
||||
NULL /* time_rec */);
|
||||
}
|
||||
|
||||
#define GSS_LOG_BUFFER_LEN 1024
|
||||
static size_t display_gss_error(OM_uint32 status, int type,
|
||||
char *buf, size_t len) {
|
||||
OM_uint32 maj_stat;
|
||||
OM_uint32 min_stat;
|
||||
OM_uint32 msg_ctx = 0;
|
||||
gss_buffer_desc status_string;
|
||||
|
||||
do {
|
||||
maj_stat = gss_display_status(&min_stat,
|
||||
status,
|
||||
type,
|
||||
GSS_C_NO_OID,
|
||||
&msg_ctx,
|
||||
&status_string);
|
||||
if(GSS_LOG_BUFFER_LEN > len + status_string.length + 3) {
|
||||
len += snprintf(buf + len, GSS_LOG_BUFFER_LEN - len,
|
||||
"%.*s. ", (int)status_string.length,
|
||||
(char*)status_string.value);
|
||||
}
|
||||
gss_release_buffer(&min_stat, &status_string);
|
||||
} while(!GSS_ERROR(maj_stat) && msg_ctx != 0);
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_gss_log_error()
|
||||
*
|
||||
* This is used to log a GSS-API error status.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* data [in] - The session handle.
|
||||
* prefix [in] - The prefix of the log message.
|
||||
* major [in] - The major status code.
|
||||
* minor [in] - The minor status code.
|
||||
*/
|
||||
void Curl_gss_log_error(struct SessionHandle *data, const char *prefix,
|
||||
OM_uint32 major, OM_uint32 minor)
|
||||
{
|
||||
char buf[GSS_LOG_BUFFER_LEN];
|
||||
size_t len = 0;
|
||||
|
||||
if(major != GSS_S_FAILURE)
|
||||
len = display_gss_error(major, GSS_C_GSS_CODE, buf, len);
|
||||
|
||||
display_gss_error(minor, GSS_C_MECH_CODE, buf, len);
|
||||
|
||||
infof(data, "%s%s\n", prefix, buf);
|
||||
}
|
||||
|
||||
#endif /* HAVE_GSSAPI */
|
|
@ -1,75 +0,0 @@
|
|||
#ifndef HEADER_CURL_GSSAPI_H
|
||||
#define HEADER_CURL_GSSAPI_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 2011 - 2015, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
#include "urldata.h"
|
||||
|
||||
#ifdef HAVE_GSSAPI
|
||||
|
||||
#ifdef HAVE_GSSGNU
|
||||
# include <gss.h>
|
||||
#elif defined HAVE_GSSMIT
|
||||
/* MIT style */
|
||||
# include <gssapi/gssapi.h>
|
||||
# include <gssapi/gssapi_generic.h>
|
||||
# include <gssapi/gssapi_krb5.h>
|
||||
#else
|
||||
/* Heimdal-style */
|
||||
# include <gssapi.h>
|
||||
#endif
|
||||
|
||||
extern gss_OID_desc Curl_spnego_mech_oid;
|
||||
extern gss_OID_desc Curl_krb5_mech_oid;
|
||||
|
||||
/* Common method for using GSS-API */
|
||||
OM_uint32 Curl_gss_init_sec_context(
|
||||
struct SessionHandle *data,
|
||||
OM_uint32 *minor_status,
|
||||
gss_ctx_id_t *context,
|
||||
gss_name_t target_name,
|
||||
gss_OID mech_type,
|
||||
gss_channel_bindings_t input_chan_bindings,
|
||||
gss_buffer_t input_token,
|
||||
gss_buffer_t output_token,
|
||||
const bool mutual_auth,
|
||||
OM_uint32 *ret_flags);
|
||||
|
||||
/* Helper to log a GSS-API error status */
|
||||
void Curl_gss_log_error(struct SessionHandle *data, const char *prefix,
|
||||
OM_uint32 major, OM_uint32 minor);
|
||||
|
||||
/* Provide some definitions missing in old headers */
|
||||
#ifdef HAVE_OLD_GSSMIT
|
||||
#define GSS_C_NT_HOSTBASED_SERVICE gss_nt_service_name
|
||||
#define NCOMPAT 1
|
||||
#endif
|
||||
|
||||
/* Define our privacy and integrity protection values */
|
||||
#define GSSAUTH_P_NONE 1
|
||||
#define GSSAUTH_P_INTEGRITY 2
|
||||
#define GSSAUTH_P_PRIVACY 4
|
||||
|
||||
#endif /* HAVE_GSSAPI */
|
||||
|
||||
#endif /* HEADER_CURL_GSSAPI_H */
|
|
@ -1,67 +0,0 @@
|
|||
#ifndef HEADER_CURL_HMAC_H
|
||||
#define HEADER_CURL_HMAC_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2010, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef CURL_DISABLE_CRYPTO_AUTH
|
||||
|
||||
typedef void (* HMAC_hinit_func)(void * context);
|
||||
typedef void (* HMAC_hupdate_func)(void * context,
|
||||
const unsigned char * data,
|
||||
unsigned int len);
|
||||
typedef void (* HMAC_hfinal_func)(unsigned char * result, void * context);
|
||||
|
||||
|
||||
/* Per-hash function HMAC parameters. */
|
||||
|
||||
typedef struct {
|
||||
HMAC_hinit_func hmac_hinit; /* Initialize context procedure. */
|
||||
HMAC_hupdate_func hmac_hupdate; /* Update context with data. */
|
||||
HMAC_hfinal_func hmac_hfinal; /* Get final result procedure. */
|
||||
unsigned int hmac_ctxtsize; /* Context structure size. */
|
||||
unsigned int hmac_maxkeylen; /* Maximum key length (bytes). */
|
||||
unsigned int hmac_resultlen; /* Result length (bytes). */
|
||||
} HMAC_params;
|
||||
|
||||
|
||||
/* HMAC computation context. */
|
||||
|
||||
typedef struct {
|
||||
const HMAC_params * hmac_hash; /* Hash function definition. */
|
||||
void * hmac_hashctxt1; /* Hash function context 1. */
|
||||
void * hmac_hashctxt2; /* Hash function context 2. */
|
||||
} HMAC_context;
|
||||
|
||||
|
||||
/* Prototypes. */
|
||||
|
||||
HMAC_context * Curl_HMAC_init(const HMAC_params * hashparams,
|
||||
const unsigned char * key,
|
||||
unsigned int keylen);
|
||||
int Curl_HMAC_update(HMAC_context * context,
|
||||
const unsigned char * data,
|
||||
unsigned int len);
|
||||
int Curl_HMAC_final(HMAC_context * context, unsigned char * result);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* HEADER_CURL_HMAC_H */
|
|
@ -1,35 +0,0 @@
|
|||
#ifndef HEADER_CURL_LDAP_H
|
||||
#define HEADER_CURL_LDAP_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2010, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
#ifndef CURL_DISABLE_LDAP
|
||||
extern const struct Curl_handler Curl_handler_ldap;
|
||||
|
||||
#if !defined(CURL_DISABLE_LDAPS) && \
|
||||
((defined(USE_OPENLDAP) && defined(USE_SSL)) || \
|
||||
(!defined(USE_OPENLDAP) && defined(HAVE_LDAP_SSL)))
|
||||
extern const struct Curl_handler Curl_handler_ldaps;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* HEADER_CURL_LDAP_H */
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
#ifndef HEADER_CURL_MD4_H
|
||||
#define HEADER_CURL_MD4_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
/* NSS and OS/400 crypto library do not provide the MD4 hash algorithm, so
|
||||
* that we have a local implementation of it */
|
||||
#if defined(USE_NSS) || defined(USE_OS400CRYPTO)
|
||||
|
||||
void Curl_md4it(unsigned char *output, const unsigned char *input, size_t len);
|
||||
|
||||
#endif /* defined(USE_NSS) || defined(USE_OS400CRYPTO) */
|
||||
|
||||
#endif /* HEADER_CURL_MD4_H */
|
|
@ -1,63 +0,0 @@
|
|||
#ifndef HEADER_CURL_MD5_H
|
||||
#define HEADER_CURL_MD5_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2010, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef CURL_DISABLE_CRYPTO_AUTH
|
||||
#include "curl_hmac.h"
|
||||
|
||||
#define MD5_DIGEST_LEN 16
|
||||
|
||||
typedef void (* Curl_MD5_init_func)(void *context);
|
||||
typedef void (* Curl_MD5_update_func)(void *context,
|
||||
const unsigned char *data,
|
||||
unsigned int len);
|
||||
typedef void (* Curl_MD5_final_func)(unsigned char *result, void *context);
|
||||
|
||||
typedef struct {
|
||||
Curl_MD5_init_func md5_init_func; /* Initialize context procedure */
|
||||
Curl_MD5_update_func md5_update_func; /* Update context with data */
|
||||
Curl_MD5_final_func md5_final_func; /* Get final result procedure */
|
||||
unsigned int md5_ctxtsize; /* Context structure size */
|
||||
unsigned int md5_resultlen; /* Result length (bytes) */
|
||||
} MD5_params;
|
||||
|
||||
typedef struct {
|
||||
const MD5_params *md5_hash; /* Hash function definition */
|
||||
void *md5_hashctx; /* Hash function context */
|
||||
} MD5_context;
|
||||
|
||||
extern const MD5_params Curl_DIGEST_MD5[1];
|
||||
extern const HMAC_params Curl_HMAC_MD5[1];
|
||||
|
||||
void Curl_md5it(unsigned char *output,
|
||||
const unsigned char *input);
|
||||
|
||||
MD5_context * Curl_MD5_init(const MD5_params *md5params);
|
||||
int Curl_MD5_update(MD5_context *context,
|
||||
const unsigned char *data,
|
||||
unsigned int len);
|
||||
int Curl_MD5_final(MD5_context *context, unsigned char *result);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* HEADER_CURL_MD5_H */
|
|
@ -1,156 +0,0 @@
|
|||
#ifndef HEADER_CURL_MEMORY_H
|
||||
#define HEADER_CURL_MEMORY_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/*
|
||||
* Nasty internal details ahead...
|
||||
*
|
||||
* File curl_memory.h must be included by _all_ *.c source files
|
||||
* that use memory related functions strdup, malloc, calloc, realloc
|
||||
* or free, and given source file is used to build libcurl library.
|
||||
* It should be included immediately before memdebug.h as the last files
|
||||
* included to avoid undesired interaction with other memory function
|
||||
* headers in dependent libraries.
|
||||
*
|
||||
* There is nearly no exception to above rule. All libcurl source
|
||||
* files in 'lib' subdirectory as well as those living deep inside
|
||||
* 'packages' subdirectories and linked together in order to build
|
||||
* libcurl library shall follow it.
|
||||
*
|
||||
* File lib/strdup.c is an exception, given that it provides a strdup
|
||||
* clone implementation while using malloc. Extra care needed inside
|
||||
* this one. TODO: revisit this paragraph and related code.
|
||||
*
|
||||
* The need for curl_memory.h inclusion is due to libcurl's feature
|
||||
* of allowing library user to provide memory replacement functions,
|
||||
* memory callbacks, at runtime with curl_global_init_mem()
|
||||
*
|
||||
* Any *.c source file used to build libcurl library that does not
|
||||
* include curl_memory.h and uses any memory function of the five
|
||||
* mentioned above will compile without any indication, but it will
|
||||
* trigger weird memory related issues at runtime.
|
||||
*
|
||||
* OTOH some source files from 'lib' subdirectory may additionally be
|
||||
* used directly as source code when using some curlx_ functions by
|
||||
* third party programs that don't even use libcurl at all. When using
|
||||
* these source files in this way it is necessary these are compiled
|
||||
* with CURLX_NO_MEMORY_CALLBACKS defined, in order to ensure that no
|
||||
* attempt of calling libcurl's memory callbacks is done from code
|
||||
* which can not use this machinery.
|
||||
*
|
||||
* Notice that libcurl's 'memory tracking' system works chaining into
|
||||
* the memory callback machinery. This implies that when compiling
|
||||
* 'lib' source files with CURLX_NO_MEMORY_CALLBACKS defined this file
|
||||
* disengages usage of libcurl's 'memory tracking' system, defining
|
||||
* MEMDEBUG_NODEFINES and overriding CURLDEBUG purpose.
|
||||
*
|
||||
* CURLX_NO_MEMORY_CALLBACKS takes precedence over CURLDEBUG. This is
|
||||
* done in order to allow building a 'memory tracking' enabled libcurl
|
||||
* and at the same time allow building programs which do not use it.
|
||||
*
|
||||
* Programs and libraries in 'tests' subdirectories have specific
|
||||
* purposes and needs, and as such each one will use whatever fits
|
||||
* best, depending additionally wether it links with libcurl or not.
|
||||
*
|
||||
* Caveat emptor. Proper curlx_* separation is a work in progress
|
||||
* the same as CURLX_NO_MEMORY_CALLBACKS usage, some adjustments may
|
||||
* still be required. IOW don't use them yet, there are sharp edges.
|
||||
*/
|
||||
|
||||
#ifdef HEADER_CURL_MEMDEBUG_H
|
||||
#error "Header memdebug.h shall not be included before curl_memory.h"
|
||||
#endif
|
||||
|
||||
#ifndef CURLX_NO_MEMORY_CALLBACKS
|
||||
|
||||
#ifndef CURL_DID_MEMORY_FUNC_TYPEDEFS /* only if not already done */
|
||||
/*
|
||||
* The following memory function replacement typedef's are COPIED from
|
||||
* curl/curl.h and MUST match the originals. We copy them to avoid having to
|
||||
* include curl/curl.h here. We avoid that include since it includes stdio.h
|
||||
* and other headers that may get messed up with defines done here.
|
||||
*/
|
||||
typedef void *(*curl_malloc_callback)(size_t size);
|
||||
typedef void (*curl_free_callback)(void *ptr);
|
||||
typedef void *(*curl_realloc_callback)(void *ptr, size_t size);
|
||||
typedef char *(*curl_strdup_callback)(const char *str);
|
||||
typedef void *(*curl_calloc_callback)(size_t nmemb, size_t size);
|
||||
#define CURL_DID_MEMORY_FUNC_TYPEDEFS
|
||||
#endif
|
||||
|
||||
extern curl_malloc_callback Curl_cmalloc;
|
||||
extern curl_free_callback Curl_cfree;
|
||||
extern curl_realloc_callback Curl_crealloc;
|
||||
extern curl_strdup_callback Curl_cstrdup;
|
||||
extern curl_calloc_callback Curl_ccalloc;
|
||||
#if defined(WIN32) && defined(UNICODE)
|
||||
extern curl_wcsdup_callback Curl_cwcsdup;
|
||||
#endif
|
||||
|
||||
#ifndef CURLDEBUG
|
||||
|
||||
/*
|
||||
* libcurl's 'memory tracking' system defines strdup, malloc, calloc,
|
||||
* realloc and free, along with others, in memdebug.h in a different
|
||||
* way although still using memory callbacks forward declared above.
|
||||
* When using the 'memory tracking' system (CURLDEBUG defined) we do
|
||||
* not define here the five memory functions given that definitions
|
||||
* from memdebug.h are the ones that shall be used.
|
||||
*/
|
||||
|
||||
#undef strdup
|
||||
#define strdup(ptr) Curl_cstrdup(ptr)
|
||||
#undef malloc
|
||||
#define malloc(size) Curl_cmalloc(size)
|
||||
#undef calloc
|
||||
#define calloc(nbelem,size) Curl_ccalloc(nbelem, size)
|
||||
#undef realloc
|
||||
#define realloc(ptr,size) Curl_crealloc(ptr, size)
|
||||
#undef free
|
||||
#define free(ptr) Curl_cfree(ptr)
|
||||
|
||||
#ifdef WIN32
|
||||
# ifdef UNICODE
|
||||
# undef wcsdup
|
||||
# define wcsdup(ptr) Curl_cwcsdup(ptr)
|
||||
# undef _wcsdup
|
||||
# define _wcsdup(ptr) Curl_cwcsdup(ptr)
|
||||
# undef _tcsdup
|
||||
# define _tcsdup(ptr) Curl_cwcsdup(ptr)
|
||||
# else
|
||||
# undef _tcsdup
|
||||
# define _tcsdup(ptr) Curl_cstrdup(ptr)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif /* CURLDEBUG */
|
||||
|
||||
#else /* CURLX_NO_MEMORY_CALLBACKS */
|
||||
|
||||
#ifndef MEMDEBUG_NODEFINES
|
||||
#define MEMDEBUG_NODEFINES
|
||||
#endif
|
||||
|
||||
#endif /* CURLX_NO_MEMORY_CALLBACKS */
|
||||
|
||||
#endif /* HEADER_CURL_MEMORY_H */
|
|
@ -1,61 +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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
#include "curl_memrchr.h"
|
||||
#include "curl_memory.h"
|
||||
|
||||
/* The last #include file should be: */
|
||||
#include "memdebug.h"
|
||||
|
||||
#ifndef HAVE_MEMRCHR
|
||||
|
||||
/*
|
||||
* Curl_memrchr()
|
||||
*
|
||||
* Our memrchr() function clone for systems which lack this function. The
|
||||
* memrchr() function is like the memchr() function, except that it searches
|
||||
* backwards from the end of the n bytes pointed to by s instead of forward
|
||||
* from the beginning.
|
||||
*/
|
||||
|
||||
void *
|
||||
Curl_memrchr(const void *s, int c, size_t n)
|
||||
{
|
||||
const unsigned char *p = s;
|
||||
const unsigned char *q = s;
|
||||
|
||||
p += n - 1;
|
||||
|
||||
while(p >= q) {
|
||||
if(*p == (unsigned char)c)
|
||||
return (void *)p;
|
||||
p--;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif /* HAVE_MEMRCHR */
|
|
@ -1,44 +0,0 @@
|
|||
#ifndef HEADER_CURL_MEMRCHR_H
|
||||
#define HEADER_CURL_MEMRCHR_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2009, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#ifdef HAVE_MEMRCHR
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#else /* HAVE_MEMRCHR */
|
||||
|
||||
void *Curl_memrchr(const void *s, int c, size_t n);
|
||||
|
||||
#define memrchr(x,y,z) Curl_memrchr((x),(y),(z))
|
||||
|
||||
#endif /* HAVE_MEMRCHR */
|
||||
|
||||
#endif /* HEADER_CURL_MEMRCHR_H */
|
|
@ -1,84 +0,0 @@
|
|||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
#if defined(USE_WIN32_IDN) || ((defined(USE_WINDOWS_SSPI) || \
|
||||
defined(USE_WIN32_LDAP)) && defined(UNICODE))
|
||||
|
||||
/*
|
||||
* MultiByte conversions using Windows kernel32 library.
|
||||
*/
|
||||
|
||||
#include "curl_multibyte.h"
|
||||
#include "curl_memory.h"
|
||||
|
||||
/* The last #include file should be: */
|
||||
#include "memdebug.h"
|
||||
|
||||
wchar_t *Curl_convert_UTF8_to_wchar(const char *str_utf8)
|
||||
{
|
||||
wchar_t *str_w = NULL;
|
||||
|
||||
if(str_utf8) {
|
||||
int str_w_len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS,
|
||||
str_utf8, -1, NULL, 0);
|
||||
if(str_w_len > 0) {
|
||||
str_w = malloc(str_w_len * sizeof(wchar_t));
|
||||
if(str_w) {
|
||||
if(MultiByteToWideChar(CP_UTF8, 0, str_utf8, -1, str_w,
|
||||
str_w_len) == 0) {
|
||||
free(str_w);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return str_w;
|
||||
}
|
||||
|
||||
char *Curl_convert_wchar_to_UTF8(const wchar_t *str_w)
|
||||
{
|
||||
char *str_utf8 = NULL;
|
||||
|
||||
if(str_w) {
|
||||
int str_utf8_len = WideCharToMultiByte(CP_UTF8, 0, str_w, -1, NULL,
|
||||
0, NULL, NULL);
|
||||
if(str_utf8_len > 0) {
|
||||
str_utf8 = malloc(str_utf8_len * sizeof(wchar_t));
|
||||
if(str_utf8) {
|
||||
if(WideCharToMultiByte(CP_UTF8, 0, str_w, -1, str_utf8, str_utf8_len,
|
||||
NULL, FALSE) == 0) {
|
||||
free(str_utf8);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return str_utf8;
|
||||
}
|
||||
|
||||
#endif /* USE_WIN32_IDN || ((USE_WINDOWS_SSPI || USE_WIN32_LDAP) && UNICODE) */
|
|
@ -1,92 +0,0 @@
|
|||
#ifndef HEADER_CURL_MULTIBYTE_H
|
||||
#define HEADER_CURL_MULTIBYTE_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
#include "curl_setup.h"
|
||||
|
||||
#if defined(USE_WIN32_IDN) || ((defined(USE_WINDOWS_SSPI) || \
|
||||
defined(USE_WIN32_LDAP)) && defined(UNICODE))
|
||||
|
||||
/*
|
||||
* MultiByte conversions using Windows kernel32 library.
|
||||
*/
|
||||
|
||||
wchar_t *Curl_convert_UTF8_to_wchar(const char *str_utf8);
|
||||
char *Curl_convert_wchar_to_UTF8(const wchar_t *str_w);
|
||||
|
||||
#endif /* USE_WIN32_IDN || ((USE_WINDOWS_SSPI || USE_WIN32_LDAP) && UNICODE) */
|
||||
|
||||
|
||||
#if defined(USE_WIN32_IDN) || defined(USE_WINDOWS_SSPI) || \
|
||||
defined(USE_WIN32_LDAP)
|
||||
|
||||
/*
|
||||
* Macros Curl_convert_UTF8_to_tchar(), Curl_convert_tchar_to_UTF8()
|
||||
* and Curl_unicodefree() main purpose is to minimize the number of
|
||||
* preprocessor conditional directives needed by code using these
|
||||
* to differentiate UNICODE from non-UNICODE builds.
|
||||
*
|
||||
* When building with UNICODE defined, this two macros
|
||||
* Curl_convert_UTF8_to_tchar() and Curl_convert_tchar_to_UTF8()
|
||||
* return a pointer to a newly allocated memory area holding result.
|
||||
* When the result is no longer needed, allocated memory is intended
|
||||
* to be free'ed with Curl_unicodefree().
|
||||
*
|
||||
* When building without UNICODE defined, this macros
|
||||
* Curl_convert_UTF8_to_tchar() and Curl_convert_tchar_to_UTF8()
|
||||
* return the pointer received as argument. Curl_unicodefree() does
|
||||
* no actual free'ing of this pointer it is simply set to NULL.
|
||||
*/
|
||||
|
||||
#ifdef UNICODE
|
||||
|
||||
#define Curl_convert_UTF8_to_tchar(ptr) Curl_convert_UTF8_to_wchar((ptr))
|
||||
#define Curl_convert_tchar_to_UTF8(ptr) Curl_convert_wchar_to_UTF8((ptr))
|
||||
#define Curl_unicodefree(ptr) \
|
||||
do {if((ptr)) {free((ptr)); (ptr) = NULL;}} WHILE_FALSE
|
||||
|
||||
typedef union {
|
||||
unsigned short *tchar_ptr;
|
||||
const unsigned short *const_tchar_ptr;
|
||||
unsigned short *tbyte_ptr;
|
||||
const unsigned short *const_tbyte_ptr;
|
||||
} xcharp_u;
|
||||
|
||||
#else
|
||||
|
||||
#define Curl_convert_UTF8_to_tchar(ptr) (ptr)
|
||||
#define Curl_convert_tchar_to_UTF8(ptr) (ptr)
|
||||
#define Curl_unicodefree(ptr) \
|
||||
do {(ptr) = NULL;} WHILE_FALSE
|
||||
|
||||
typedef union {
|
||||
char *tchar_ptr;
|
||||
const char *const_tchar_ptr;
|
||||
unsigned char *tbyte_ptr;
|
||||
const unsigned char *const_tbyte_ptr;
|
||||
} xcharp_u;
|
||||
|
||||
#endif /* UNICODE */
|
||||
|
||||
#endif /* USE_WIN32_IDN || USE_WINDOWS_SSPI || USE_WIN32_LDAP */
|
||||
|
||||
#endif /* HEADER_CURL_MULTIBYTE_H */
|
|
@ -1,761 +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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#if defined(USE_NTLM)
|
||||
|
||||
/*
|
||||
* NTLM details:
|
||||
*
|
||||
* http://davenport.sourceforge.net/ntlm.html
|
||||
* https://www.innovation.ch/java/ntlm.html
|
||||
*/
|
||||
|
||||
#if !defined(USE_WINDOWS_SSPI) || defined(USE_WIN32_CRYPTO)
|
||||
|
||||
#ifdef USE_OPENSSL
|
||||
|
||||
# ifdef USE_OPENSSL
|
||||
# include <openssl/des.h>
|
||||
# ifndef OPENSSL_NO_MD4
|
||||
# include <openssl/md4.h>
|
||||
# endif
|
||||
# include <openssl/md5.h>
|
||||
# include <openssl/ssl.h>
|
||||
# include <openssl/rand.h>
|
||||
# else
|
||||
# include <des.h>
|
||||
# ifndef OPENSSL_NO_MD4
|
||||
# include <md4.h>
|
||||
# endif
|
||||
# include <md5.h>
|
||||
# include <ssl.h>
|
||||
# include <rand.h>
|
||||
# endif
|
||||
# if (OPENSSL_VERSION_NUMBER < 0x00907001L)
|
||||
# define DES_key_schedule des_key_schedule
|
||||
# define DES_cblock des_cblock
|
||||
# define DES_set_odd_parity des_set_odd_parity
|
||||
# define DES_set_key des_set_key
|
||||
# define DES_ecb_encrypt des_ecb_encrypt
|
||||
# define DESKEY(x) x
|
||||
# define DESKEYARG(x) x
|
||||
# else
|
||||
# define DESKEYARG(x) *x
|
||||
# define DESKEY(x) &x
|
||||
# endif
|
||||
|
||||
#elif defined(USE_GNUTLS_NETTLE)
|
||||
|
||||
# include <nettle/des.h>
|
||||
# include <nettle/md4.h>
|
||||
|
||||
#elif defined(USE_GNUTLS)
|
||||
|
||||
# include <gcrypt.h>
|
||||
# define MD5_DIGEST_LENGTH 16
|
||||
# define MD4_DIGEST_LENGTH 16
|
||||
|
||||
#elif defined(USE_NSS)
|
||||
|
||||
# include <nss.h>
|
||||
# include <pk11pub.h>
|
||||
# include <hasht.h>
|
||||
# include "curl_md4.h"
|
||||
# define MD5_DIGEST_LENGTH MD5_LENGTH
|
||||
|
||||
#elif defined(USE_DARWINSSL)
|
||||
|
||||
# include <CommonCrypto/CommonCryptor.h>
|
||||
# include <CommonCrypto/CommonDigest.h>
|
||||
|
||||
#elif defined(USE_OS400CRYPTO)
|
||||
# include "cipher.mih" /* mih/cipher */
|
||||
# include "curl_md4.h"
|
||||
#elif defined(USE_WIN32_CRYPTO)
|
||||
# include <wincrypt.h>
|
||||
#else
|
||||
# error "Can't compile NTLM support without a crypto library."
|
||||
#endif
|
||||
|
||||
#include "urldata.h"
|
||||
#include "non-ascii.h"
|
||||
#include "rawstr.h"
|
||||
#include "curl_ntlm_core.h"
|
||||
#include "curl_md5.h"
|
||||
#include "curl_hmac.h"
|
||||
#include "warnless.h"
|
||||
#include "curl_endian.h"
|
||||
#include "curl_des.h"
|
||||
/* The last 3 #include files should be in this order */
|
||||
#include "curl_printf.h"
|
||||
#include "curl_memory.h"
|
||||
#include "memdebug.h"
|
||||
|
||||
#define NTLM_HMAC_MD5_LEN (16)
|
||||
#define NTLMv2_BLOB_SIGNATURE "\x01\x01\x00\x00"
|
||||
#define NTLMv2_BLOB_LEN (44 -16 + ntlm->target_info_len + 4)
|
||||
|
||||
/*
|
||||
* Turns a 56-bit key into being 64-bit wide.
|
||||
*/
|
||||
static void extend_key_56_to_64(const unsigned char *key_56, char *key)
|
||||
{
|
||||
key[0] = key_56[0];
|
||||
key[1] = (unsigned char)(((key_56[0] << 7) & 0xFF) | (key_56[1] >> 1));
|
||||
key[2] = (unsigned char)(((key_56[1] << 6) & 0xFF) | (key_56[2] >> 2));
|
||||
key[3] = (unsigned char)(((key_56[2] << 5) & 0xFF) | (key_56[3] >> 3));
|
||||
key[4] = (unsigned char)(((key_56[3] << 4) & 0xFF) | (key_56[4] >> 4));
|
||||
key[5] = (unsigned char)(((key_56[4] << 3) & 0xFF) | (key_56[5] >> 5));
|
||||
key[6] = (unsigned char)(((key_56[5] << 2) & 0xFF) | (key_56[6] >> 6));
|
||||
key[7] = (unsigned char) ((key_56[6] << 1) & 0xFF);
|
||||
}
|
||||
|
||||
#ifdef USE_OPENSSL
|
||||
/*
|
||||
* Turns a 56 bit key into the 64 bit, odd parity key and sets the key. The
|
||||
* key schedule ks is also set.
|
||||
*/
|
||||
static void setup_des_key(const unsigned char *key_56,
|
||||
DES_key_schedule DESKEYARG(ks))
|
||||
{
|
||||
DES_cblock key;
|
||||
|
||||
/* Expand the 56-bit key to 64-bits */
|
||||
extend_key_56_to_64(key_56, (char *) &key);
|
||||
|
||||
/* Set the key parity to odd */
|
||||
DES_set_odd_parity(&key);
|
||||
|
||||
/* Set the key */
|
||||
DES_set_key(&key, ks);
|
||||
}
|
||||
|
||||
#elif defined(USE_GNUTLS_NETTLE)
|
||||
|
||||
static void setup_des_key(const unsigned char *key_56,
|
||||
struct des_ctx *des)
|
||||
{
|
||||
char key[8];
|
||||
|
||||
/* Expand the 56-bit key to 64-bits */
|
||||
extend_key_56_to_64(key_56, key);
|
||||
|
||||
/* Set the key parity to odd */
|
||||
Curl_des_set_odd_parity((unsigned char *) key, sizeof(key));
|
||||
|
||||
/* Set the key */
|
||||
des_set_key(des, (const uint8_t *) key);
|
||||
}
|
||||
|
||||
#elif defined(USE_GNUTLS)
|
||||
|
||||
/*
|
||||
* Turns a 56 bit key into the 64 bit, odd parity key and sets the key.
|
||||
*/
|
||||
static void setup_des_key(const unsigned char *key_56,
|
||||
gcry_cipher_hd_t *des)
|
||||
{
|
||||
char key[8];
|
||||
|
||||
/* Expand the 56-bit key to 64-bits */
|
||||
extend_key_56_to_64(key_56, key);
|
||||
|
||||
/* Set the key parity to odd */
|
||||
Curl_des_set_odd_parity((unsigned char *) key, sizeof(key));
|
||||
|
||||
/* Set the key */
|
||||
gcry_cipher_setkey(*des, key, sizeof(key));
|
||||
}
|
||||
|
||||
#elif defined(USE_NSS)
|
||||
|
||||
/*
|
||||
* Expands a 56 bit key KEY_56 to 64 bit and encrypts 64 bit of data, using
|
||||
* the expanded key. The caller is responsible for giving 64 bit of valid
|
||||
* data is IN and (at least) 64 bit large buffer as OUT.
|
||||
*/
|
||||
static bool encrypt_des(const unsigned char *in, unsigned char *out,
|
||||
const unsigned char *key_56)
|
||||
{
|
||||
const CK_MECHANISM_TYPE mech = CKM_DES_ECB; /* DES cipher in ECB mode */
|
||||
PK11SlotInfo *slot = NULL;
|
||||
char key[8]; /* expanded 64 bit key */
|
||||
SECItem key_item;
|
||||
PK11SymKey *symkey = NULL;
|
||||
SECItem *param = NULL;
|
||||
PK11Context *ctx = NULL;
|
||||
int out_len; /* not used, required by NSS */
|
||||
bool rv = FALSE;
|
||||
|
||||
/* use internal slot for DES encryption (requires NSS to be initialized) */
|
||||
slot = PK11_GetInternalKeySlot();
|
||||
if(!slot)
|
||||
return FALSE;
|
||||
|
||||
/* Expand the 56-bit key to 64-bits */
|
||||
extend_key_56_to_64(key_56, key);
|
||||
|
||||
/* Set the key parity to odd */
|
||||
Curl_des_set_odd_parity((unsigned char *) key, sizeof(key));
|
||||
|
||||
/* Import the key */
|
||||
key_item.data = (unsigned char *)key;
|
||||
key_item.len = sizeof(key);
|
||||
symkey = PK11_ImportSymKey(slot, mech, PK11_OriginUnwrap, CKA_ENCRYPT,
|
||||
&key_item, NULL);
|
||||
if(!symkey)
|
||||
goto fail;
|
||||
|
||||
/* Create the DES encryption context */
|
||||
param = PK11_ParamFromIV(mech, /* no IV in ECB mode */ NULL);
|
||||
if(!param)
|
||||
goto fail;
|
||||
ctx = PK11_CreateContextBySymKey(mech, CKA_ENCRYPT, symkey, param);
|
||||
if(!ctx)
|
||||
goto fail;
|
||||
|
||||
/* Perform the encryption */
|
||||
if(SECSuccess == PK11_CipherOp(ctx, out, &out_len, /* outbuflen */ 8,
|
||||
(unsigned char *)in, /* inbuflen */ 8)
|
||||
&& SECSuccess == PK11_Finalize(ctx))
|
||||
rv = /* all OK */ TRUE;
|
||||
|
||||
fail:
|
||||
/* cleanup */
|
||||
if(ctx)
|
||||
PK11_DestroyContext(ctx, PR_TRUE);
|
||||
if(symkey)
|
||||
PK11_FreeSymKey(symkey);
|
||||
if(param)
|
||||
SECITEM_FreeItem(param, PR_TRUE);
|
||||
PK11_FreeSlot(slot);
|
||||
return rv;
|
||||
}
|
||||
|
||||
#elif defined(USE_DARWINSSL)
|
||||
|
||||
static bool encrypt_des(const unsigned char *in, unsigned char *out,
|
||||
const unsigned char *key_56)
|
||||
{
|
||||
char key[8];
|
||||
size_t out_len;
|
||||
CCCryptorStatus err;
|
||||
|
||||
/* Expand the 56-bit key to 64-bits */
|
||||
extend_key_56_to_64(key_56, key);
|
||||
|
||||
/* Set the key parity to odd */
|
||||
Curl_des_set_odd_parity((unsigned char *) key, sizeof(key));
|
||||
|
||||
/* Perform the encryption */
|
||||
err = CCCrypt(kCCEncrypt, kCCAlgorithmDES, kCCOptionECBMode, key,
|
||||
kCCKeySizeDES, NULL, in, 8 /* inbuflen */, out,
|
||||
8 /* outbuflen */, &out_len);
|
||||
|
||||
return err == kCCSuccess;
|
||||
}
|
||||
|
||||
#elif defined(USE_OS400CRYPTO)
|
||||
|
||||
static bool encrypt_des(const unsigned char *in, unsigned char *out,
|
||||
const unsigned char *key_56)
|
||||
{
|
||||
char key[8];
|
||||
_CIPHER_Control_T ctl;
|
||||
|
||||
/* Setup the cipher control structure */
|
||||
ctl.Func_ID = ENCRYPT_ONLY;
|
||||
ctl.Data_Len = sizeof(key);
|
||||
|
||||
/* Expand the 56-bit key to 64-bits */
|
||||
extend_key_56_to_64(key_56, ctl.Crypto_Key);
|
||||
|
||||
/* Set the key parity to odd */
|
||||
Curl_des_set_odd_parity((unsigned char *) ctl.Crypto_Key, ctl.Data_Len);
|
||||
|
||||
/* Perform the encryption */
|
||||
_CIPHER((_SPCPTR *) &out, &ctl, (_SPCPTR *) &in);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#elif defined(USE_WIN32_CRYPTO)
|
||||
|
||||
static bool encrypt_des(const unsigned char *in, unsigned char *out,
|
||||
const unsigned char *key_56)
|
||||
{
|
||||
HCRYPTPROV hprov;
|
||||
HCRYPTKEY hkey;
|
||||
struct {
|
||||
BLOBHEADER hdr;
|
||||
unsigned int len;
|
||||
char key[8];
|
||||
} blob;
|
||||
DWORD len = 8;
|
||||
|
||||
/* Acquire the crypto provider */
|
||||
if(!CryptAcquireContext(&hprov, NULL, NULL, PROV_RSA_FULL,
|
||||
CRYPT_VERIFYCONTEXT))
|
||||
return FALSE;
|
||||
|
||||
/* Setup the key blob structure */
|
||||
memset(&blob, 0, sizeof(blob));
|
||||
blob.hdr.bType = PLAINTEXTKEYBLOB;
|
||||
blob.hdr.bVersion = 2;
|
||||
blob.hdr.aiKeyAlg = CALG_DES;
|
||||
blob.len = sizeof(blob.key);
|
||||
|
||||
/* Expand the 56-bit key to 64-bits */
|
||||
extend_key_56_to_64(key_56, blob.key);
|
||||
|
||||
/* Set the key parity to odd */
|
||||
Curl_des_set_odd_parity((unsigned char *) blob.key, sizeof(blob.key));
|
||||
|
||||
/* Import the key */
|
||||
if(!CryptImportKey(hprov, (BYTE *) &blob, sizeof(blob), 0, 0, &hkey)) {
|
||||
CryptReleaseContext(hprov, 0);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
memcpy(out, in, 8);
|
||||
|
||||
/* Perform the encryption */
|
||||
CryptEncrypt(hkey, 0, FALSE, 0, out, &len, len);
|
||||
|
||||
CryptDestroyKey(hkey);
|
||||
CryptReleaseContext(hprov, 0);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#endif /* defined(USE_WIN32_CRYPTO) */
|
||||
|
||||
/*
|
||||
* takes a 21 byte array and treats it as 3 56-bit DES keys. The
|
||||
* 8 byte plaintext is encrypted with each key and the resulting 24
|
||||
* bytes are stored in the results array.
|
||||
*/
|
||||
void Curl_ntlm_core_lm_resp(const unsigned char *keys,
|
||||
const unsigned char *plaintext,
|
||||
unsigned char *results)
|
||||
{
|
||||
#ifdef USE_OPENSSL
|
||||
DES_key_schedule ks;
|
||||
|
||||
setup_des_key(keys, DESKEY(ks));
|
||||
DES_ecb_encrypt((DES_cblock*) plaintext, (DES_cblock*) results,
|
||||
DESKEY(ks), DES_ENCRYPT);
|
||||
|
||||
setup_des_key(keys + 7, DESKEY(ks));
|
||||
DES_ecb_encrypt((DES_cblock*) plaintext, (DES_cblock*) (results + 8),
|
||||
DESKEY(ks), DES_ENCRYPT);
|
||||
|
||||
setup_des_key(keys + 14, DESKEY(ks));
|
||||
DES_ecb_encrypt((DES_cblock*) plaintext, (DES_cblock*) (results + 16),
|
||||
DESKEY(ks), DES_ENCRYPT);
|
||||
#elif defined(USE_GNUTLS_NETTLE)
|
||||
struct des_ctx des;
|
||||
setup_des_key(keys, &des);
|
||||
des_encrypt(&des, 8, results, plaintext);
|
||||
setup_des_key(keys + 7, &des);
|
||||
des_encrypt(&des, 8, results + 8, plaintext);
|
||||
setup_des_key(keys + 14, &des);
|
||||
des_encrypt(&des, 8, results + 16, plaintext);
|
||||
#elif defined(USE_GNUTLS)
|
||||
gcry_cipher_hd_t des;
|
||||
|
||||
gcry_cipher_open(&des, GCRY_CIPHER_DES, GCRY_CIPHER_MODE_ECB, 0);
|
||||
setup_des_key(keys, &des);
|
||||
gcry_cipher_encrypt(des, results, 8, plaintext, 8);
|
||||
gcry_cipher_close(des);
|
||||
|
||||
gcry_cipher_open(&des, GCRY_CIPHER_DES, GCRY_CIPHER_MODE_ECB, 0);
|
||||
setup_des_key(keys + 7, &des);
|
||||
gcry_cipher_encrypt(des, results + 8, 8, plaintext, 8);
|
||||
gcry_cipher_close(des);
|
||||
|
||||
gcry_cipher_open(&des, GCRY_CIPHER_DES, GCRY_CIPHER_MODE_ECB, 0);
|
||||
setup_des_key(keys + 14, &des);
|
||||
gcry_cipher_encrypt(des, results + 16, 8, plaintext, 8);
|
||||
gcry_cipher_close(des);
|
||||
#elif defined(USE_NSS) || defined(USE_DARWINSSL) || defined(USE_OS400CRYPTO) \
|
||||
|| defined(USE_WIN32_CRYPTO)
|
||||
encrypt_des(plaintext, results, keys);
|
||||
encrypt_des(plaintext, results + 8, keys + 7);
|
||||
encrypt_des(plaintext, results + 16, keys + 14);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Set up lanmanager hashed password
|
||||
*/
|
||||
CURLcode Curl_ntlm_core_mk_lm_hash(struct SessionHandle *data,
|
||||
const char *password,
|
||||
unsigned char *lmbuffer /* 21 bytes */)
|
||||
{
|
||||
CURLcode result;
|
||||
unsigned char pw[14];
|
||||
static const unsigned char magic[] = {
|
||||
0x4B, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25 /* i.e. KGS!@#$% */
|
||||
};
|
||||
size_t len = CURLMIN(strlen(password), 14);
|
||||
|
||||
Curl_strntoupper((char *)pw, password, len);
|
||||
memset(&pw[len], 0, 14 - len);
|
||||
|
||||
/*
|
||||
* The LanManager hashed password needs to be created using the
|
||||
* password in the network encoding not the host encoding.
|
||||
*/
|
||||
result = Curl_convert_to_network(data, (char *)pw, 14);
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
{
|
||||
/* Create LanManager hashed password. */
|
||||
|
||||
#ifdef USE_OPENSSL
|
||||
DES_key_schedule ks;
|
||||
|
||||
setup_des_key(pw, DESKEY(ks));
|
||||
DES_ecb_encrypt((DES_cblock *)magic, (DES_cblock *)lmbuffer,
|
||||
DESKEY(ks), DES_ENCRYPT);
|
||||
|
||||
setup_des_key(pw + 7, DESKEY(ks));
|
||||
DES_ecb_encrypt((DES_cblock *)magic, (DES_cblock *)(lmbuffer + 8),
|
||||
DESKEY(ks), DES_ENCRYPT);
|
||||
#elif defined(USE_GNUTLS_NETTLE)
|
||||
struct des_ctx des;
|
||||
setup_des_key(pw, &des);
|
||||
des_encrypt(&des, 8, lmbuffer, magic);
|
||||
setup_des_key(pw + 7, &des);
|
||||
des_encrypt(&des, 8, lmbuffer + 8, magic);
|
||||
#elif defined(USE_GNUTLS)
|
||||
gcry_cipher_hd_t des;
|
||||
|
||||
gcry_cipher_open(&des, GCRY_CIPHER_DES, GCRY_CIPHER_MODE_ECB, 0);
|
||||
setup_des_key(pw, &des);
|
||||
gcry_cipher_encrypt(des, lmbuffer, 8, magic, 8);
|
||||
gcry_cipher_close(des);
|
||||
|
||||
gcry_cipher_open(&des, GCRY_CIPHER_DES, GCRY_CIPHER_MODE_ECB, 0);
|
||||
setup_des_key(pw + 7, &des);
|
||||
gcry_cipher_encrypt(des, lmbuffer + 8, 8, magic, 8);
|
||||
gcry_cipher_close(des);
|
||||
#elif defined(USE_NSS) || defined(USE_DARWINSSL) || defined(USE_OS400CRYPTO) \
|
||||
|| defined(USE_WIN32_CRYPTO)
|
||||
encrypt_des(magic, lmbuffer, pw);
|
||||
encrypt_des(magic, lmbuffer + 8, pw + 7);
|
||||
#endif
|
||||
|
||||
memset(lmbuffer + 16, 0, 21 - 16);
|
||||
}
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
#if USE_NTRESPONSES
|
||||
static void ascii_to_unicode_le(unsigned char *dest, const char *src,
|
||||
size_t srclen)
|
||||
{
|
||||
size_t i;
|
||||
for(i = 0; i < srclen; i++) {
|
||||
dest[2 * i] = (unsigned char)src[i];
|
||||
dest[2 * i + 1] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
#if USE_NTLM_V2 && !defined(USE_WINDOWS_SSPI)
|
||||
|
||||
static void ascii_uppercase_to_unicode_le(unsigned char *dest,
|
||||
const char *src, size_t srclen)
|
||||
{
|
||||
size_t i;
|
||||
for(i = 0; i < srclen; i++) {
|
||||
dest[2 * i] = (unsigned char)(toupper(src[i]));
|
||||
dest[2 * i + 1] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* USE_NTLM_V2 && !USE_WINDOWS_SSPI */
|
||||
|
||||
/*
|
||||
* Set up nt hashed passwords
|
||||
* @unittest: 1600
|
||||
*/
|
||||
CURLcode Curl_ntlm_core_mk_nt_hash(struct SessionHandle *data,
|
||||
const char *password,
|
||||
unsigned char *ntbuffer /* 21 bytes */)
|
||||
{
|
||||
size_t len = strlen(password);
|
||||
unsigned char *pw = malloc(len * 2);
|
||||
CURLcode result;
|
||||
if(!pw)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
ascii_to_unicode_le(pw, password, len);
|
||||
|
||||
/*
|
||||
* The NT hashed password needs to be created using the password in the
|
||||
* network encoding not the host encoding.
|
||||
*/
|
||||
result = Curl_convert_to_network(data, (char *)pw, len * 2);
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
{
|
||||
/* Create NT hashed password. */
|
||||
#ifdef USE_OPENSSL
|
||||
MD4_CTX MD4pw;
|
||||
MD4_Init(&MD4pw);
|
||||
MD4_Update(&MD4pw, pw, 2 * len);
|
||||
MD4_Final(ntbuffer, &MD4pw);
|
||||
#elif defined(USE_GNUTLS_NETTLE)
|
||||
struct md4_ctx MD4pw;
|
||||
md4_init(&MD4pw);
|
||||
md4_update(&MD4pw, (unsigned int)(2 * len), pw);
|
||||
md4_digest(&MD4pw, MD4_DIGEST_SIZE, ntbuffer);
|
||||
#elif defined(USE_GNUTLS)
|
||||
gcry_md_hd_t MD4pw;
|
||||
gcry_md_open(&MD4pw, GCRY_MD_MD4, 0);
|
||||
gcry_md_write(MD4pw, pw, 2 * len);
|
||||
memcpy (ntbuffer, gcry_md_read (MD4pw, 0), MD4_DIGEST_LENGTH);
|
||||
gcry_md_close(MD4pw);
|
||||
#elif defined(USE_NSS) || defined(USE_OS400CRYPTO)
|
||||
Curl_md4it(ntbuffer, pw, 2 * len);
|
||||
#elif defined(USE_DARWINSSL)
|
||||
(void)CC_MD4(pw, (CC_LONG)(2 * len), ntbuffer);
|
||||
#elif defined(USE_WIN32_CRYPTO)
|
||||
HCRYPTPROV hprov;
|
||||
if(CryptAcquireContext(&hprov, NULL, NULL, PROV_RSA_FULL,
|
||||
CRYPT_VERIFYCONTEXT)) {
|
||||
HCRYPTHASH hhash;
|
||||
if(CryptCreateHash(hprov, CALG_MD4, 0, 0, &hhash)) {
|
||||
DWORD length = 16;
|
||||
CryptHashData(hhash, pw, (unsigned int)len * 2, 0);
|
||||
CryptGetHashParam(hhash, HP_HASHVAL, ntbuffer, &length, 0);
|
||||
CryptDestroyHash(hhash);
|
||||
}
|
||||
CryptReleaseContext(hprov, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
memset(ntbuffer + 16, 0, 21 - 16);
|
||||
}
|
||||
|
||||
free(pw);
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
#if USE_NTLM_V2 && !defined(USE_WINDOWS_SSPI)
|
||||
|
||||
/* This returns the HMAC MD5 digest */
|
||||
CURLcode Curl_hmac_md5(const unsigned char *key, unsigned int keylen,
|
||||
const unsigned char *data, unsigned int datalen,
|
||||
unsigned char *output)
|
||||
{
|
||||
HMAC_context *ctxt = Curl_HMAC_init(Curl_HMAC_MD5, key, keylen);
|
||||
|
||||
if(!ctxt)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
/* Update the digest with the given challenge */
|
||||
Curl_HMAC_update(ctxt, data, datalen);
|
||||
|
||||
/* Finalise the digest */
|
||||
Curl_HMAC_final(ctxt, output);
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
/* This creates the NTLMv2 hash by using NTLM hash as the key and Unicode
|
||||
* (uppercase UserName + Domain) as the data
|
||||
*/
|
||||
CURLcode Curl_ntlm_core_mk_ntlmv2_hash(const char *user, size_t userlen,
|
||||
const char *domain, size_t domlen,
|
||||
unsigned char *ntlmhash,
|
||||
unsigned char *ntlmv2hash)
|
||||
{
|
||||
/* Unicode representation */
|
||||
size_t identity_len = (userlen + domlen) * 2;
|
||||
unsigned char *identity = malloc(identity_len);
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
if(!identity)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
ascii_uppercase_to_unicode_le(identity, user, userlen);
|
||||
ascii_to_unicode_le(identity + (userlen << 1), domain, domlen);
|
||||
|
||||
result = Curl_hmac_md5(ntlmhash, 16, identity, curlx_uztoui(identity_len),
|
||||
ntlmv2hash);
|
||||
|
||||
free(identity);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_ntlm_core_mk_ntlmv2_resp()
|
||||
*
|
||||
* This creates the NTLMv2 response as set in the ntlm type-3 message.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* ntlmv2hash [in] - The ntlmv2 hash (16 bytes)
|
||||
* challenge_client [in] - The client nonce (8 bytes)
|
||||
* ntlm [in] - The ntlm data struct being used to read TargetInfo
|
||||
and Server challenge received in the type-2 message
|
||||
* ntresp [out] - The address where a pointer to newly allocated
|
||||
* memory holding the NTLMv2 response.
|
||||
* ntresp_len [out] - The length of the output message.
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
*/
|
||||
CURLcode Curl_ntlm_core_mk_ntlmv2_resp(unsigned char *ntlmv2hash,
|
||||
unsigned char *challenge_client,
|
||||
struct ntlmdata *ntlm,
|
||||
unsigned char **ntresp,
|
||||
unsigned int *ntresp_len)
|
||||
{
|
||||
/* NTLMv2 response structure :
|
||||
------------------------------------------------------------------------------
|
||||
0 HMAC MD5 16 bytes
|
||||
------BLOB--------------------------------------------------------------------
|
||||
16 Signature 0x01010000
|
||||
20 Reserved long (0x00000000)
|
||||
24 Timestamp LE, 64-bit signed value representing the number of
|
||||
tenths of a microsecond since January 1, 1601.
|
||||
32 Client Nonce 8 bytes
|
||||
40 Unknown 4 bytes
|
||||
44 Target Info N bytes (from the type-2 message)
|
||||
44+N Unknown 4 bytes
|
||||
------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
unsigned int len = 0;
|
||||
unsigned char *ptr = NULL;
|
||||
unsigned char hmac_output[NTLM_HMAC_MD5_LEN];
|
||||
curl_off_t tw;
|
||||
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
#if CURL_SIZEOF_CURL_OFF_T < 8
|
||||
#error "this section needs 64bit support to work"
|
||||
#endif
|
||||
|
||||
/* Calculate the timestamp */
|
||||
#ifdef DEBUGBUILD
|
||||
char *force_timestamp = getenv("CURL_FORCETIME");
|
||||
if(force_timestamp)
|
||||
tw = CURL_OFF_T_C(11644473600) * 10000000;
|
||||
else
|
||||
#endif
|
||||
tw = ((curl_off_t)time(NULL) + CURL_OFF_T_C(11644473600)) * 10000000;
|
||||
|
||||
/* Calculate the response len */
|
||||
len = NTLM_HMAC_MD5_LEN + NTLMv2_BLOB_LEN;
|
||||
|
||||
/* Allocate the response */
|
||||
ptr = malloc(len);
|
||||
if(!ptr)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
memset(ptr, 0, len);
|
||||
|
||||
/* Create the BLOB structure */
|
||||
snprintf((char *)ptr + NTLM_HMAC_MD5_LEN, NTLMv2_BLOB_LEN,
|
||||
NTLMv2_BLOB_SIGNATURE
|
||||
"%c%c%c%c", /* Reserved = 0 */
|
||||
0, 0, 0, 0);
|
||||
|
||||
Curl_write64_le(tw, ptr + 24);
|
||||
memcpy(ptr + 32, challenge_client, 8);
|
||||
memcpy(ptr + 44, ntlm->target_info, ntlm->target_info_len);
|
||||
|
||||
/* Concatenate the Type 2 challenge with the BLOB and do HMAC MD5 */
|
||||
memcpy(ptr + 8, &ntlm->nonce[0], 8);
|
||||
result = Curl_hmac_md5(ntlmv2hash, NTLM_HMAC_MD5_LEN, ptr + 8,
|
||||
NTLMv2_BLOB_LEN + 8, hmac_output);
|
||||
if(result) {
|
||||
free(ptr);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Concatenate the HMAC MD5 output with the BLOB */
|
||||
memcpy(ptr, hmac_output, NTLM_HMAC_MD5_LEN);
|
||||
|
||||
/* Return the response */
|
||||
*ntresp = ptr;
|
||||
*ntresp_len = len;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_ntlm_core_mk_lmv2_resp()
|
||||
*
|
||||
* This creates the LMv2 response as used in the ntlm type-3 message.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* ntlmv2hash [in] - The ntlmv2 hash (16 bytes)
|
||||
* challenge_client [in] - The client nonce (8 bytes)
|
||||
* challenge_client [in] - The server challenge (8 bytes)
|
||||
* lmresp [out] - The LMv2 response (24 bytes)
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
*/
|
||||
CURLcode Curl_ntlm_core_mk_lmv2_resp(unsigned char *ntlmv2hash,
|
||||
unsigned char *challenge_client,
|
||||
unsigned char *challenge_server,
|
||||
unsigned char *lmresp)
|
||||
{
|
||||
unsigned char data[16];
|
||||
unsigned char hmac_output[16];
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
memcpy(&data[0], challenge_server, 8);
|
||||
memcpy(&data[8], challenge_client, 8);
|
||||
|
||||
result = Curl_hmac_md5(ntlmv2hash, 16, &data[0], 16, hmac_output);
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
/* Concatenate the HMAC MD5 output with the client nonce */
|
||||
memcpy(lmresp, hmac_output, 16);
|
||||
memcpy(lmresp+16, challenge_client, 8);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif /* USE_NTLM_V2 && !USE_WINDOWS_SSPI */
|
||||
|
||||
#endif /* USE_NTRESPONSES */
|
||||
|
||||
#endif /* !USE_WINDOWS_SSPI || USE_WIN32_CRYPTO */
|
||||
|
||||
#endif /* USE_NTLM */
|
|
@ -1,106 +0,0 @@
|
|||
#ifndef HEADER_CURL_NTLM_CORE_H
|
||||
#define HEADER_CURL_NTLM_CORE_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#if defined(USE_NTLM)
|
||||
|
||||
#if !defined(USE_WINDOWS_SSPI) || defined(USE_WIN32_CRYPTO)
|
||||
|
||||
#ifdef USE_OPENSSL
|
||||
# if !defined(OPENSSL_VERSION_NUMBER) && \
|
||||
!defined(HEADER_SSL_H) && !defined(HEADER_MD5_H)
|
||||
# error "curl_ntlm_core.h shall not be included before OpenSSL headers."
|
||||
# endif
|
||||
# ifdef OPENSSL_NO_MD4
|
||||
# define USE_NTRESPONSES 0
|
||||
# define USE_NTLM2SESSION 0
|
||||
# define USE_NTLM_V2 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Define USE_NTRESPONSES to 1 in order to make the type-3 message include
|
||||
* the NT response message. */
|
||||
#ifndef USE_NTRESPONSES
|
||||
#define USE_NTRESPONSES 1
|
||||
#endif
|
||||
|
||||
/* Define USE_NTLM2SESSION to 1 in order to make the type-3 message include the
|
||||
NTLM2Session response message, requires USE_NTRESPONSES defined to 1 and a
|
||||
Crypto engine that we have curl_ssl_md5sum() for. */
|
||||
#if !defined(USE_NTLM2SESSION) && USE_NTRESPONSES && !defined(USE_WIN32_CRYPTO)
|
||||
#define USE_NTLM2SESSION 1
|
||||
#endif
|
||||
|
||||
/* Define USE_NTLM_V2 to 1 in order to allow the type-3 message to include the
|
||||
LMv2 and NTLMv2 response messages, requires USE_NTRESPONSES defined to 1
|
||||
and support for 64-bit integers. */
|
||||
#if !defined(USE_NTLM_V2) && USE_NTRESPONSES && (CURL_SIZEOF_CURL_OFF_T > 4)
|
||||
#define USE_NTLM_V2 1
|
||||
#endif
|
||||
|
||||
void Curl_ntlm_core_lm_resp(const unsigned char *keys,
|
||||
const unsigned char *plaintext,
|
||||
unsigned char *results);
|
||||
|
||||
CURLcode Curl_ntlm_core_mk_lm_hash(struct SessionHandle *data,
|
||||
const char *password,
|
||||
unsigned char *lmbuffer /* 21 bytes */);
|
||||
|
||||
#if USE_NTRESPONSES
|
||||
CURLcode Curl_ntlm_core_mk_nt_hash(struct SessionHandle *data,
|
||||
const char *password,
|
||||
unsigned char *ntbuffer /* 21 bytes */);
|
||||
|
||||
#if USE_NTLM_V2 && !defined(USE_WINDOWS_SSPI)
|
||||
|
||||
CURLcode Curl_hmac_md5(const unsigned char *key, unsigned int keylen,
|
||||
const unsigned char *data, unsigned int datalen,
|
||||
unsigned char *output);
|
||||
|
||||
CURLcode Curl_ntlm_core_mk_ntlmv2_hash(const char *user, size_t userlen,
|
||||
const char *domain, size_t domlen,
|
||||
unsigned char *ntlmhash,
|
||||
unsigned char *ntlmv2hash);
|
||||
|
||||
CURLcode Curl_ntlm_core_mk_ntlmv2_resp(unsigned char *ntlmv2hash,
|
||||
unsigned char *challenge_client,
|
||||
struct ntlmdata *ntlm,
|
||||
unsigned char **ntresp,
|
||||
unsigned int *ntresp_len);
|
||||
|
||||
CURLcode Curl_ntlm_core_mk_lmv2_resp(unsigned char *ntlmv2hash,
|
||||
unsigned char *challenge_client,
|
||||
unsigned char *challenge_server,
|
||||
unsigned char *lmresp);
|
||||
|
||||
#endif /* USE_NTLM_V2 && !USE_WINDOWS_SSPI */
|
||||
|
||||
#endif /* USE_NTRESPONSES */
|
||||
|
||||
#endif /* !USE_WINDOWS_SSPI || USE_WIN32_CRYPTO */
|
||||
|
||||
#endif /* USE_NTLM */
|
||||
|
||||
#endif /* HEADER_CURL_NTLM_CORE_H */
|
|
@ -1,430 +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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#if !defined(CURL_DISABLE_HTTP) && defined(USE_NTLM) && \
|
||||
defined(NTLM_WB_ENABLED)
|
||||
|
||||
/*
|
||||
* NTLM details:
|
||||
*
|
||||
* http://davenport.sourceforge.net/ntlm.html
|
||||
* https://www.innovation.ch/java/ntlm.html
|
||||
*/
|
||||
|
||||
#define DEBUG_ME 0
|
||||
|
||||
#ifdef HAVE_SYS_WAIT_H
|
||||
#include <sys/wait.h>
|
||||
#endif
|
||||
#ifdef HAVE_SIGNAL_H
|
||||
#include <signal.h>
|
||||
#endif
|
||||
#ifdef HAVE_PWD_H
|
||||
#include <pwd.h>
|
||||
#endif
|
||||
|
||||
#include "urldata.h"
|
||||
#include "sendf.h"
|
||||
#include "select.h"
|
||||
#include "vauth/ntlm.h"
|
||||
#include "curl_ntlm_wb.h"
|
||||
#include "url.h"
|
||||
#include "strerror.h"
|
||||
/* The last 3 #include files should be in this order */
|
||||
#include "curl_printf.h"
|
||||
#include "curl_memory.h"
|
||||
#include "memdebug.h"
|
||||
|
||||
#if DEBUG_ME
|
||||
# define DEBUG_OUT(x) x
|
||||
#else
|
||||
# define DEBUG_OUT(x) Curl_nop_stmt
|
||||
#endif
|
||||
|
||||
/* Portable 'sclose_nolog' used only in child process instead of 'sclose'
|
||||
to avoid fooling the socket leak detector */
|
||||
#if defined(HAVE_CLOSESOCKET)
|
||||
# define sclose_nolog(x) closesocket((x))
|
||||
#elif defined(HAVE_CLOSESOCKET_CAMEL)
|
||||
# define sclose_nolog(x) CloseSocket((x))
|
||||
#else
|
||||
# define sclose_nolog(x) close((x))
|
||||
#endif
|
||||
|
||||
void Curl_ntlm_wb_cleanup(struct connectdata *conn)
|
||||
{
|
||||
if(conn->ntlm_auth_hlpr_socket != CURL_SOCKET_BAD) {
|
||||
sclose(conn->ntlm_auth_hlpr_socket);
|
||||
conn->ntlm_auth_hlpr_socket = CURL_SOCKET_BAD;
|
||||
}
|
||||
|
||||
if(conn->ntlm_auth_hlpr_pid) {
|
||||
int i;
|
||||
for(i = 0; i < 4; i++) {
|
||||
pid_t ret = waitpid(conn->ntlm_auth_hlpr_pid, NULL, WNOHANG);
|
||||
if(ret == conn->ntlm_auth_hlpr_pid || errno == ECHILD)
|
||||
break;
|
||||
switch(i) {
|
||||
case 0:
|
||||
kill(conn->ntlm_auth_hlpr_pid, SIGTERM);
|
||||
break;
|
||||
case 1:
|
||||
/* Give the process another moment to shut down cleanly before
|
||||
bringing down the axe */
|
||||
Curl_wait_ms(1);
|
||||
break;
|
||||
case 2:
|
||||
kill(conn->ntlm_auth_hlpr_pid, SIGKILL);
|
||||
break;
|
||||
case 3:
|
||||
break;
|
||||
}
|
||||
}
|
||||
conn->ntlm_auth_hlpr_pid = 0;
|
||||
}
|
||||
|
||||
free(conn->challenge_header);
|
||||
conn->challenge_header = NULL;
|
||||
free(conn->response_header);
|
||||
conn->response_header = NULL;
|
||||
}
|
||||
|
||||
static CURLcode ntlm_wb_init(struct connectdata *conn, const char *userp)
|
||||
{
|
||||
curl_socket_t sockfds[2];
|
||||
pid_t child_pid;
|
||||
const char *username;
|
||||
char *slash, *domain = NULL;
|
||||
const char *ntlm_auth = NULL;
|
||||
char *ntlm_auth_alloc = NULL;
|
||||
#if defined(HAVE_GETPWUID_R) && defined(HAVE_GETEUID)
|
||||
struct passwd pw, *pw_res;
|
||||
char pwbuf[1024];
|
||||
#endif
|
||||
int error;
|
||||
|
||||
/* Return if communication with ntlm_auth already set up */
|
||||
if(conn->ntlm_auth_hlpr_socket != CURL_SOCKET_BAD ||
|
||||
conn->ntlm_auth_hlpr_pid)
|
||||
return CURLE_OK;
|
||||
|
||||
username = userp;
|
||||
/* The real ntlm_auth really doesn't like being invoked with an
|
||||
empty username. It won't make inferences for itself, and expects
|
||||
the client to do so (mostly because it's really designed for
|
||||
servers like squid to use for auth, and client support is an
|
||||
afterthought for it). So try hard to provide a suitable username
|
||||
if we don't already have one. But if we can't, provide the
|
||||
empty one anyway. Perhaps they have an implementation of the
|
||||
ntlm_auth helper which *doesn't* need it so we might as well try */
|
||||
if(!username || !username[0]) {
|
||||
username = getenv("NTLMUSER");
|
||||
if(!username || !username[0])
|
||||
username = getenv("LOGNAME");
|
||||
if(!username || !username[0])
|
||||
username = getenv("USER");
|
||||
#if defined(HAVE_GETPWUID_R) && defined(HAVE_GETEUID)
|
||||
if((!username || !username[0]) &&
|
||||
!getpwuid_r(geteuid(), &pw, pwbuf, sizeof(pwbuf), &pw_res) &&
|
||||
pw_res) {
|
||||
username = pw.pw_name;
|
||||
}
|
||||
#endif
|
||||
if(!username || !username[0])
|
||||
username = userp;
|
||||
}
|
||||
slash = strpbrk(username, "\\/");
|
||||
if(slash) {
|
||||
if((domain = strdup(username)) == NULL)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
slash = domain + (slash - username);
|
||||
*slash = '\0';
|
||||
username = username + (slash - domain) + 1;
|
||||
}
|
||||
|
||||
/* For testing purposes, when DEBUGBUILD is defined and environment
|
||||
variable CURL_NTLM_WB_FILE is set a fake_ntlm is used to perform
|
||||
NTLM challenge/response which only accepts commands and output
|
||||
strings pre-written in test case definitions */
|
||||
#ifdef DEBUGBUILD
|
||||
ntlm_auth_alloc = curl_getenv("CURL_NTLM_WB_FILE");
|
||||
if(ntlm_auth_alloc)
|
||||
ntlm_auth = ntlm_auth_alloc;
|
||||
else
|
||||
#endif
|
||||
ntlm_auth = NTLM_WB_FILE;
|
||||
|
||||
if(access(ntlm_auth, X_OK) != 0) {
|
||||
error = ERRNO;
|
||||
failf(conn->data, "Could not access ntlm_auth: %s errno %d: %s",
|
||||
ntlm_auth, error, Curl_strerror(conn, error));
|
||||
goto done;
|
||||
}
|
||||
|
||||
if(socketpair(AF_UNIX, SOCK_STREAM, 0, sockfds)) {
|
||||
error = ERRNO;
|
||||
failf(conn->data, "Could not open socket pair. errno %d: %s",
|
||||
error, Curl_strerror(conn, error));
|
||||
goto done;
|
||||
}
|
||||
|
||||
child_pid = fork();
|
||||
if(child_pid == -1) {
|
||||
error = ERRNO;
|
||||
sclose(sockfds[0]);
|
||||
sclose(sockfds[1]);
|
||||
failf(conn->data, "Could not fork. errno %d: %s",
|
||||
error, Curl_strerror(conn, error));
|
||||
goto done;
|
||||
}
|
||||
else if(!child_pid) {
|
||||
/*
|
||||
* child process
|
||||
*/
|
||||
|
||||
/* Don't use sclose in the child since it fools the socket leak detector */
|
||||
sclose_nolog(sockfds[0]);
|
||||
if(dup2(sockfds[1], STDIN_FILENO) == -1) {
|
||||
error = ERRNO;
|
||||
failf(conn->data, "Could not redirect child stdin. errno %d: %s",
|
||||
error, Curl_strerror(conn, error));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if(dup2(sockfds[1], STDOUT_FILENO) == -1) {
|
||||
error = ERRNO;
|
||||
failf(conn->data, "Could not redirect child stdout. errno %d: %s",
|
||||
error, Curl_strerror(conn, error));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if(domain)
|
||||
execl(ntlm_auth, ntlm_auth,
|
||||
"--helper-protocol", "ntlmssp-client-1",
|
||||
"--use-cached-creds",
|
||||
"--username", username,
|
||||
"--domain", domain,
|
||||
NULL);
|
||||
else
|
||||
execl(ntlm_auth, ntlm_auth,
|
||||
"--helper-protocol", "ntlmssp-client-1",
|
||||
"--use-cached-creds",
|
||||
"--username", username,
|
||||
NULL);
|
||||
|
||||
error = ERRNO;
|
||||
sclose_nolog(sockfds[1]);
|
||||
failf(conn->data, "Could not execl(). errno %d: %s",
|
||||
error, Curl_strerror(conn, error));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
sclose(sockfds[1]);
|
||||
conn->ntlm_auth_hlpr_socket = sockfds[0];
|
||||
conn->ntlm_auth_hlpr_pid = child_pid;
|
||||
free(domain);
|
||||
free(ntlm_auth_alloc);
|
||||
return CURLE_OK;
|
||||
|
||||
done:
|
||||
free(domain);
|
||||
free(ntlm_auth_alloc);
|
||||
return CURLE_REMOTE_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
static CURLcode ntlm_wb_response(struct connectdata *conn,
|
||||
const char *input, curlntlm state)
|
||||
{
|
||||
char *buf = malloc(NTLM_BUFSIZE);
|
||||
size_t len_in = strlen(input), len_out = 0;
|
||||
|
||||
if(!buf)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
while(len_in > 0) {
|
||||
ssize_t written = swrite(conn->ntlm_auth_hlpr_socket, input, len_in);
|
||||
if(written == -1) {
|
||||
/* Interrupted by a signal, retry it */
|
||||
if(errno == EINTR)
|
||||
continue;
|
||||
/* write failed if other errors happen */
|
||||
goto done;
|
||||
}
|
||||
input += written;
|
||||
len_in -= written;
|
||||
}
|
||||
/* Read one line */
|
||||
while(1) {
|
||||
ssize_t size;
|
||||
char *newbuf;
|
||||
|
||||
size = sread(conn->ntlm_auth_hlpr_socket, buf + len_out, NTLM_BUFSIZE);
|
||||
if(size == -1) {
|
||||
if(errno == EINTR)
|
||||
continue;
|
||||
goto done;
|
||||
}
|
||||
else if(size == 0)
|
||||
goto done;
|
||||
|
||||
len_out += size;
|
||||
if(buf[len_out - 1] == '\n') {
|
||||
buf[len_out - 1] = '\0';
|
||||
break;
|
||||
}
|
||||
newbuf = realloc(buf, len_out + NTLM_BUFSIZE);
|
||||
if(!newbuf) {
|
||||
free(buf);
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
buf = newbuf;
|
||||
}
|
||||
|
||||
/* Samba/winbind installed but not configured */
|
||||
if(state == NTLMSTATE_TYPE1 &&
|
||||
len_out == 3 &&
|
||||
buf[0] == 'P' && buf[1] == 'W')
|
||||
goto done;
|
||||
/* invalid response */
|
||||
if(len_out < 4)
|
||||
goto done;
|
||||
if(state == NTLMSTATE_TYPE1 &&
|
||||
(buf[0]!='Y' || buf[1]!='R' || buf[2]!=' '))
|
||||
goto done;
|
||||
if(state == NTLMSTATE_TYPE2 &&
|
||||
(buf[0]!='K' || buf[1]!='K' || buf[2]!=' ') &&
|
||||
(buf[0]!='A' || buf[1]!='F' || buf[2]!=' '))
|
||||
goto done;
|
||||
|
||||
conn->response_header = aprintf("NTLM %.*s", len_out - 4, buf + 3);
|
||||
free(buf);
|
||||
return CURLE_OK;
|
||||
done:
|
||||
free(buf);
|
||||
return CURLE_REMOTE_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
/*
|
||||
* This is for creating ntlm header output by delegating challenge/response
|
||||
* to Samba's winbind daemon helper ntlm_auth.
|
||||
*/
|
||||
CURLcode Curl_output_ntlm_wb(struct connectdata *conn,
|
||||
bool proxy)
|
||||
{
|
||||
/* point to the address of the pointer that holds the string to send to the
|
||||
server, which is for a plain host or for a HTTP proxy */
|
||||
char **allocuserpwd;
|
||||
/* point to the name and password for this */
|
||||
const char *userp;
|
||||
/* point to the correct struct with this */
|
||||
struct ntlmdata *ntlm;
|
||||
struct auth *authp;
|
||||
|
||||
CURLcode res = CURLE_OK;
|
||||
char *input;
|
||||
|
||||
DEBUGASSERT(conn);
|
||||
DEBUGASSERT(conn->data);
|
||||
|
||||
if(proxy) {
|
||||
allocuserpwd = &conn->allocptr.proxyuserpwd;
|
||||
userp = conn->proxyuser;
|
||||
ntlm = &conn->proxyntlm;
|
||||
authp = &conn->data->state.authproxy;
|
||||
}
|
||||
else {
|
||||
allocuserpwd = &conn->allocptr.userpwd;
|
||||
userp = conn->user;
|
||||
ntlm = &conn->ntlm;
|
||||
authp = &conn->data->state.authhost;
|
||||
}
|
||||
authp->done = FALSE;
|
||||
|
||||
/* not set means empty */
|
||||
if(!userp)
|
||||
userp="";
|
||||
|
||||
switch(ntlm->state) {
|
||||
case NTLMSTATE_TYPE1:
|
||||
default:
|
||||
/* Use Samba's 'winbind' daemon to support NTLM authentication,
|
||||
* by delegating the NTLM challenge/response protocal to a helper
|
||||
* in ntlm_auth.
|
||||
* http://devel.squid-cache.org/ntlm/squid_helper_protocol.html
|
||||
* https://www.samba.org/samba/docs/man/manpages-3/winbindd.8.html
|
||||
* https://www.samba.org/samba/docs/man/manpages-3/ntlm_auth.1.html
|
||||
* Preprocessor symbol 'NTLM_WB_ENABLED' is defined when this
|
||||
* feature is enabled and 'NTLM_WB_FILE' symbol holds absolute
|
||||
* filename of ntlm_auth helper.
|
||||
* If NTLM authentication using winbind fails, go back to original
|
||||
* request handling process.
|
||||
*/
|
||||
/* Create communication with ntlm_auth */
|
||||
res = ntlm_wb_init(conn, userp);
|
||||
if(res)
|
||||
return res;
|
||||
res = ntlm_wb_response(conn, "YR\n", ntlm->state);
|
||||
if(res)
|
||||
return res;
|
||||
|
||||
free(*allocuserpwd);
|
||||
*allocuserpwd = aprintf("%sAuthorization: %s\r\n",
|
||||
proxy ? "Proxy-" : "",
|
||||
conn->response_header);
|
||||
DEBUG_OUT(fprintf(stderr, "**** Header %s\n ", *allocuserpwd));
|
||||
free(conn->response_header);
|
||||
conn->response_header = NULL;
|
||||
break;
|
||||
case NTLMSTATE_TYPE2:
|
||||
input = aprintf("TT %s\n", conn->challenge_header);
|
||||
if(!input)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
res = ntlm_wb_response(conn, input, ntlm->state);
|
||||
free(input);
|
||||
input = NULL;
|
||||
if(res)
|
||||
return res;
|
||||
|
||||
free(*allocuserpwd);
|
||||
*allocuserpwd = aprintf("%sAuthorization: %s\r\n",
|
||||
proxy ? "Proxy-" : "",
|
||||
conn->response_header);
|
||||
DEBUG_OUT(fprintf(stderr, "**** %s\n ", *allocuserpwd));
|
||||
ntlm->state = NTLMSTATE_TYPE3; /* we sent a type-3 */
|
||||
authp->done = TRUE;
|
||||
Curl_ntlm_wb_cleanup(conn);
|
||||
break;
|
||||
case NTLMSTATE_TYPE3:
|
||||
/* connection is already authenticated,
|
||||
* don't send a header in future requests */
|
||||
free(*allocuserpwd);
|
||||
*allocuserpwd=NULL;
|
||||
authp->done = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
#endif /* !CURL_DISABLE_HTTP && USE_NTLM && NTLM_WB_ENABLED */
|
|
@ -1,38 +0,0 @@
|
|||
#ifndef HEADER_CURL_NTLM_WB_H
|
||||
#define HEADER_CURL_NTLM_WB_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#if !defined(CURL_DISABLE_HTTP) && defined(USE_NTLM) && \
|
||||
defined(NTLM_WB_ENABLED)
|
||||
|
||||
/* this is for creating ntlm header output by delegating challenge/response
|
||||
to Samba's winbind daemon helper ntlm_auth */
|
||||
CURLcode Curl_output_ntlm_wb(struct connectdata *conn, bool proxy);
|
||||
|
||||
void Curl_ntlm_wb_cleanup(struct connectdata *conn);
|
||||
|
||||
#endif /* !CURL_DISABLE_HTTP && USE_NTLM && NTLM_WB_ENABLED */
|
||||
|
||||
#endif /* HEADER_CURL_NTLM_WB_H */
|
|
@ -1,56 +0,0 @@
|
|||
#ifndef HEADER_CURL_PRINTF_H
|
||||
#define HEADER_CURL_PRINTF_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/*
|
||||
* This header should be included by ALL code in libcurl that uses any
|
||||
* *rintf() functions.
|
||||
*/
|
||||
|
||||
#include <curl/mprintf.h>
|
||||
|
||||
# undef printf
|
||||
# undef fprintf
|
||||
# undef snprintf
|
||||
# undef vprintf
|
||||
# undef vfprintf
|
||||
# undef vsnprintf
|
||||
# undef aprintf
|
||||
# undef vaprintf
|
||||
# define printf curl_mprintf
|
||||
# define fprintf curl_mfprintf
|
||||
# define snprintf curl_msnprintf
|
||||
# define vprintf curl_mvprintf
|
||||
# define vfprintf curl_mvfprintf
|
||||
# define vsnprintf curl_mvsnprintf
|
||||
# define aprintf curl_maprintf
|
||||
# define vaprintf curl_mvaprintf
|
||||
|
||||
/* We define away the sprintf functions unconditonally since we don't want
|
||||
internal code to be using them, intentionally or by mistake!*/
|
||||
# undef sprintf
|
||||
# undef vsprintf
|
||||
# define sprintf sprintf_was_used
|
||||
# define vsprintf vsprintf_was_used
|
||||
|
||||
#endif /* HEADER_CURL_PRINTF_H */
|
|
@ -1,306 +0,0 @@
|
|||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 2012 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 2010, Howard Chu, <hyc@highlandsun.com>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#ifdef USE_LIBRTMP
|
||||
|
||||
#include "urldata.h"
|
||||
#include "nonblock.h" /* for curlx_nonblock */
|
||||
#include "progress.h" /* for Curl_pgrsSetUploadSize */
|
||||
#include "transfer.h"
|
||||
#include "warnless.h"
|
||||
#include <curl/curl.h>
|
||||
#include <librtmp/rtmp.h>
|
||||
#include "curl_memory.h"
|
||||
/* The last #include file should be: */
|
||||
#include "memdebug.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#define setsockopt(a,b,c,d,e) (setsockopt)(a,b,c,(const char *)d,(int)e)
|
||||
#define SET_RCVTIMEO(tv,s) int tv = s*1000
|
||||
#else
|
||||
#define SET_RCVTIMEO(tv,s) struct timeval tv = {s,0}
|
||||
#endif
|
||||
|
||||
#define DEF_BUFTIME (2*60*60*1000) /* 2 hours */
|
||||
|
||||
static CURLcode rtmp_setup_connection(struct connectdata *conn);
|
||||
static CURLcode rtmp_do(struct connectdata *conn, bool *done);
|
||||
static CURLcode rtmp_done(struct connectdata *conn, CURLcode, bool premature);
|
||||
static CURLcode rtmp_connect(struct connectdata *conn, bool *done);
|
||||
static CURLcode rtmp_disconnect(struct connectdata *conn, bool dead);
|
||||
|
||||
static Curl_recv rtmp_recv;
|
||||
static Curl_send rtmp_send;
|
||||
|
||||
/*
|
||||
* RTMP protocol handler.h, based on https://rtmpdump.mplayerhq.hu
|
||||
*/
|
||||
|
||||
const struct Curl_handler Curl_handler_rtmp = {
|
||||
"RTMP", /* scheme */
|
||||
rtmp_setup_connection, /* setup_connection */
|
||||
rtmp_do, /* do_it */
|
||||
rtmp_done, /* done */
|
||||
ZERO_NULL, /* do_more */
|
||||
rtmp_connect, /* connect_it */
|
||||
ZERO_NULL, /* connecting */
|
||||
ZERO_NULL, /* doing */
|
||||
ZERO_NULL, /* proto_getsock */
|
||||
ZERO_NULL, /* doing_getsock */
|
||||
ZERO_NULL, /* domore_getsock */
|
||||
ZERO_NULL, /* perform_getsock */
|
||||
rtmp_disconnect, /* disconnect */
|
||||
ZERO_NULL, /* readwrite */
|
||||
PORT_RTMP, /* defport */
|
||||
CURLPROTO_RTMP, /* protocol */
|
||||
PROTOPT_NONE /* flags*/
|
||||
};
|
||||
|
||||
const struct Curl_handler Curl_handler_rtmpt = {
|
||||
"RTMPT", /* scheme */
|
||||
rtmp_setup_connection, /* setup_connection */
|
||||
rtmp_do, /* do_it */
|
||||
rtmp_done, /* done */
|
||||
ZERO_NULL, /* do_more */
|
||||
rtmp_connect, /* connect_it */
|
||||
ZERO_NULL, /* connecting */
|
||||
ZERO_NULL, /* doing */
|
||||
ZERO_NULL, /* proto_getsock */
|
||||
ZERO_NULL, /* doing_getsock */
|
||||
ZERO_NULL, /* domore_getsock */
|
||||
ZERO_NULL, /* perform_getsock */
|
||||
rtmp_disconnect, /* disconnect */
|
||||
ZERO_NULL, /* readwrite */
|
||||
PORT_RTMPT, /* defport */
|
||||
CURLPROTO_RTMPT, /* protocol */
|
||||
PROTOPT_NONE /* flags*/
|
||||
};
|
||||
|
||||
const struct Curl_handler Curl_handler_rtmpe = {
|
||||
"RTMPE", /* scheme */
|
||||
rtmp_setup_connection, /* setup_connection */
|
||||
rtmp_do, /* do_it */
|
||||
rtmp_done, /* done */
|
||||
ZERO_NULL, /* do_more */
|
||||
rtmp_connect, /* connect_it */
|
||||
ZERO_NULL, /* connecting */
|
||||
ZERO_NULL, /* doing */
|
||||
ZERO_NULL, /* proto_getsock */
|
||||
ZERO_NULL, /* doing_getsock */
|
||||
ZERO_NULL, /* domore_getsock */
|
||||
ZERO_NULL, /* perform_getsock */
|
||||
rtmp_disconnect, /* disconnect */
|
||||
ZERO_NULL, /* readwrite */
|
||||
PORT_RTMP, /* defport */
|
||||
CURLPROTO_RTMPE, /* protocol */
|
||||
PROTOPT_NONE /* flags*/
|
||||
};
|
||||
|
||||
const struct Curl_handler Curl_handler_rtmpte = {
|
||||
"RTMPTE", /* scheme */
|
||||
rtmp_setup_connection, /* setup_connection */
|
||||
rtmp_do, /* do_it */
|
||||
rtmp_done, /* done */
|
||||
ZERO_NULL, /* do_more */
|
||||
rtmp_connect, /* connect_it */
|
||||
ZERO_NULL, /* connecting */
|
||||
ZERO_NULL, /* doing */
|
||||
ZERO_NULL, /* proto_getsock */
|
||||
ZERO_NULL, /* doing_getsock */
|
||||
ZERO_NULL, /* domore_getsock */
|
||||
ZERO_NULL, /* perform_getsock */
|
||||
rtmp_disconnect, /* disconnect */
|
||||
ZERO_NULL, /* readwrite */
|
||||
PORT_RTMPT, /* defport */
|
||||
CURLPROTO_RTMPTE, /* protocol */
|
||||
PROTOPT_NONE /* flags*/
|
||||
};
|
||||
|
||||
const struct Curl_handler Curl_handler_rtmps = {
|
||||
"RTMPS", /* scheme */
|
||||
rtmp_setup_connection, /* setup_connection */
|
||||
rtmp_do, /* do_it */
|
||||
rtmp_done, /* done */
|
||||
ZERO_NULL, /* do_more */
|
||||
rtmp_connect, /* connect_it */
|
||||
ZERO_NULL, /* connecting */
|
||||
ZERO_NULL, /* doing */
|
||||
ZERO_NULL, /* proto_getsock */
|
||||
ZERO_NULL, /* doing_getsock */
|
||||
ZERO_NULL, /* domore_getsock */
|
||||
ZERO_NULL, /* perform_getsock */
|
||||
rtmp_disconnect, /* disconnect */
|
||||
ZERO_NULL, /* readwrite */
|
||||
PORT_RTMPS, /* defport */
|
||||
CURLPROTO_RTMPS, /* protocol */
|
||||
PROTOPT_NONE /* flags*/
|
||||
};
|
||||
|
||||
const struct Curl_handler Curl_handler_rtmpts = {
|
||||
"RTMPTS", /* scheme */
|
||||
rtmp_setup_connection, /* setup_connection */
|
||||
rtmp_do, /* do_it */
|
||||
rtmp_done, /* done */
|
||||
ZERO_NULL, /* do_more */
|
||||
rtmp_connect, /* connect_it */
|
||||
ZERO_NULL, /* connecting */
|
||||
ZERO_NULL, /* doing */
|
||||
ZERO_NULL, /* proto_getsock */
|
||||
ZERO_NULL, /* doing_getsock */
|
||||
ZERO_NULL, /* domore_getsock */
|
||||
ZERO_NULL, /* perform_getsock */
|
||||
rtmp_disconnect, /* disconnect */
|
||||
ZERO_NULL, /* readwrite */
|
||||
PORT_RTMPS, /* defport */
|
||||
CURLPROTO_RTMPTS, /* protocol */
|
||||
PROTOPT_NONE /* flags*/
|
||||
};
|
||||
|
||||
static CURLcode rtmp_setup_connection(struct connectdata *conn)
|
||||
{
|
||||
RTMP *r = RTMP_Alloc();
|
||||
if(!r)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
RTMP_Init(r);
|
||||
RTMP_SetBufferMS(r, DEF_BUFTIME);
|
||||
if(!RTMP_SetupURL(r, conn->data->change.url)) {
|
||||
RTMP_Free(r);
|
||||
return CURLE_URL_MALFORMAT;
|
||||
}
|
||||
conn->proto.generic = r;
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static CURLcode rtmp_connect(struct connectdata *conn, bool *done)
|
||||
{
|
||||
RTMP *r = conn->proto.generic;
|
||||
SET_RCVTIMEO(tv, 10);
|
||||
|
||||
r->m_sb.sb_socket = conn->sock[FIRSTSOCKET];
|
||||
|
||||
/* We have to know if it's a write before we send the
|
||||
* connect request packet
|
||||
*/
|
||||
if(conn->data->set.upload)
|
||||
r->Link.protocol |= RTMP_FEATURE_WRITE;
|
||||
|
||||
/* For plain streams, use the buffer toggle trick to keep data flowing */
|
||||
if(!(r->Link.lFlags & RTMP_LF_LIVE) &&
|
||||
!(r->Link.protocol & RTMP_FEATURE_HTTP))
|
||||
r->Link.lFlags |= RTMP_LF_BUFX;
|
||||
|
||||
(void)curlx_nonblock(r->m_sb.sb_socket, FALSE);
|
||||
setsockopt(r->m_sb.sb_socket, SOL_SOCKET, SO_RCVTIMEO,
|
||||
(char *)&tv, sizeof(tv));
|
||||
|
||||
if(!RTMP_Connect1(r, NULL))
|
||||
return CURLE_FAILED_INIT;
|
||||
|
||||
/* Clients must send a periodic BytesReceived report to the server */
|
||||
r->m_bSendCounter = true;
|
||||
|
||||
*done = TRUE;
|
||||
conn->recv[FIRSTSOCKET] = rtmp_recv;
|
||||
conn->send[FIRSTSOCKET] = rtmp_send;
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static CURLcode rtmp_do(struct connectdata *conn, bool *done)
|
||||
{
|
||||
RTMP *r = conn->proto.generic;
|
||||
|
||||
if(!RTMP_ConnectStream(r, 0))
|
||||
return CURLE_FAILED_INIT;
|
||||
|
||||
if(conn->data->set.upload) {
|
||||
Curl_pgrsSetUploadSize(conn->data, conn->data->state.infilesize);
|
||||
Curl_setup_transfer(conn, -1, -1, FALSE, NULL, FIRSTSOCKET, NULL);
|
||||
}
|
||||
else
|
||||
Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, NULL, -1, NULL);
|
||||
*done = TRUE;
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static CURLcode rtmp_done(struct connectdata *conn, CURLcode status,
|
||||
bool premature)
|
||||
{
|
||||
(void)conn; /* unused */
|
||||
(void)status; /* unused */
|
||||
(void)premature; /* unused */
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static CURLcode rtmp_disconnect(struct connectdata *conn,
|
||||
bool dead_connection)
|
||||
{
|
||||
RTMP *r = conn->proto.generic;
|
||||
(void)dead_connection;
|
||||
if(r) {
|
||||
conn->proto.generic = NULL;
|
||||
RTMP_Close(r);
|
||||
RTMP_Free(r);
|
||||
}
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static ssize_t rtmp_recv(struct connectdata *conn, int sockindex, char *buf,
|
||||
size_t len, CURLcode *err)
|
||||
{
|
||||
RTMP *r = conn->proto.generic;
|
||||
ssize_t nread;
|
||||
|
||||
(void)sockindex; /* unused */
|
||||
|
||||
nread = RTMP_Read(r, buf, curlx_uztosi(len));
|
||||
if(nread < 0) {
|
||||
if(r->m_read.status == RTMP_READ_COMPLETE ||
|
||||
r->m_read.status == RTMP_READ_EOF) {
|
||||
conn->data->req.size = conn->data->req.bytecount;
|
||||
nread = 0;
|
||||
}
|
||||
else
|
||||
*err = CURLE_RECV_ERROR;
|
||||
}
|
||||
return nread;
|
||||
}
|
||||
|
||||
static ssize_t rtmp_send(struct connectdata *conn, int sockindex,
|
||||
const void *buf, size_t len, CURLcode *err)
|
||||
{
|
||||
RTMP *r = conn->proto.generic;
|
||||
ssize_t num;
|
||||
|
||||
(void)sockindex; /* unused */
|
||||
|
||||
num = RTMP_Write(r, (char *)buf, curlx_uztosi(len));
|
||||
if(num < 0)
|
||||
*err = CURLE_SEND_ERROR;
|
||||
|
||||
return num;
|
||||
}
|
||||
#endif /* USE_LIBRTMP */
|
|
@ -1,33 +0,0 @@
|
|||
#ifndef HEADER_CURL_RTMP_H
|
||||
#define HEADER_CURL_RTMP_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 2010, Howard Chu, <hyc@highlandsun.com>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
#ifdef USE_LIBRTMP
|
||||
extern const struct Curl_handler Curl_handler_rtmp;
|
||||
extern const struct Curl_handler Curl_handler_rtmpt;
|
||||
extern const struct Curl_handler Curl_handler_rtmpe;
|
||||
extern const struct Curl_handler Curl_handler_rtmpte;
|
||||
extern const struct Curl_handler Curl_handler_rtmps;
|
||||
extern const struct Curl_handler Curl_handler_rtmpts;
|
||||
#endif
|
||||
|
||||
#endif /* HEADER_CURL_RTMP_H */
|
|
@ -1,617 +0,0 @@
|
|||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 2012 - 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.
|
||||
*
|
||||
* RFC2195 CRAM-MD5 authentication
|
||||
* RFC2617 Basic and Digest Access Authentication
|
||||
* RFC2831 DIGEST-MD5 authentication
|
||||
* RFC4422 Simple Authentication and Security Layer (SASL)
|
||||
* RFC4616 PLAIN authentication
|
||||
* RFC6749 OAuth 2.0 Authorization Framework
|
||||
* RFC7628 A Set of SASL Mechanisms for OAuth
|
||||
* Draft LOGIN SASL Mechanism <draft-murchison-sasl-login-00.txt>
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#include <curl/curl.h>
|
||||
#include "urldata.h"
|
||||
|
||||
#include "curl_base64.h"
|
||||
#include "curl_md5.h"
|
||||
#include "vauth/vauth.h"
|
||||
#include "vtls/vtls.h"
|
||||
#include "curl_hmac.h"
|
||||
#include "curl_sasl.h"
|
||||
#include "warnless.h"
|
||||
#include "strtok.h"
|
||||
#include "strequal.h"
|
||||
#include "rawstr.h"
|
||||
#include "sendf.h"
|
||||
#include "non-ascii.h" /* included for Curl_convert_... prototypes */
|
||||
/* The last 3 #include files should be in this order */
|
||||
#include "curl_printf.h"
|
||||
#include "curl_memory.h"
|
||||
#include "memdebug.h"
|
||||
|
||||
/* Supported mechanisms */
|
||||
const struct {
|
||||
const char *name; /* Name */
|
||||
size_t len; /* Name length */
|
||||
unsigned int bit; /* Flag bit */
|
||||
} mechtable[] = {
|
||||
{ "LOGIN", 5, SASL_MECH_LOGIN },
|
||||
{ "PLAIN", 5, SASL_MECH_PLAIN },
|
||||
{ "CRAM-MD5", 8, SASL_MECH_CRAM_MD5 },
|
||||
{ "DIGEST-MD5", 10, SASL_MECH_DIGEST_MD5 },
|
||||
{ "GSSAPI", 6, SASL_MECH_GSSAPI },
|
||||
{ "EXTERNAL", 8, SASL_MECH_EXTERNAL },
|
||||
{ "NTLM", 4, SASL_MECH_NTLM },
|
||||
{ "XOAUTH2", 7, SASL_MECH_XOAUTH2 },
|
||||
{ "OAUTHBEARER", 11, SASL_MECH_OAUTHBEARER },
|
||||
{ ZERO_NULL, 0, 0 }
|
||||
};
|
||||
|
||||
/*
|
||||
* Curl_sasl_cleanup()
|
||||
*
|
||||
* This is used to cleanup any libraries or curl modules used by the sasl
|
||||
* functions.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* conn [in] - The connection data.
|
||||
* authused [in] - The authentication mechanism used.
|
||||
*/
|
||||
void Curl_sasl_cleanup(struct connectdata *conn, unsigned int authused)
|
||||
{
|
||||
#if defined(USE_KERBEROS5)
|
||||
/* Cleanup the gssapi structure */
|
||||
if(authused == SASL_MECH_GSSAPI) {
|
||||
Curl_auth_gssapi_cleanup(&conn->krb5);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(USE_NTLM)
|
||||
/* Cleanup the NTLM structure */
|
||||
if(authused == SASL_MECH_NTLM) {
|
||||
Curl_auth_ntlm_cleanup(&conn->ntlm);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(USE_KERBEROS5) && !defined(USE_NTLM)
|
||||
/* Reserved for future use */
|
||||
(void)conn;
|
||||
(void)authused;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_sasl_decode_mech()
|
||||
*
|
||||
* Convert a SASL mechanism name into a token.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* ptr [in] - The mechanism string.
|
||||
* maxlen [in] - Maximum mechanism string length.
|
||||
* len [out] - If not NULL, effective name length.
|
||||
*
|
||||
* Returns the SASL mechanism token or 0 if no match.
|
||||
*/
|
||||
unsigned int Curl_sasl_decode_mech(const char *ptr, size_t maxlen, size_t *len)
|
||||
{
|
||||
unsigned int i;
|
||||
char c;
|
||||
|
||||
for(i = 0; mechtable[i].name; i++) {
|
||||
if(maxlen >= mechtable[i].len &&
|
||||
!memcmp(ptr, mechtable[i].name, mechtable[i].len)) {
|
||||
if(len)
|
||||
*len = mechtable[i].len;
|
||||
|
||||
if(maxlen == mechtable[i].len)
|
||||
return mechtable[i].bit;
|
||||
|
||||
c = ptr[mechtable[i].len];
|
||||
if(!ISUPPER(c) && !ISDIGIT(c) && c != '-' && c != '_')
|
||||
return mechtable[i].bit;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_sasl_parse_url_auth_option()
|
||||
*
|
||||
* Parse the URL login options.
|
||||
*/
|
||||
CURLcode Curl_sasl_parse_url_auth_option(struct SASL *sasl,
|
||||
const char *value, size_t len)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
unsigned int mechbit;
|
||||
size_t mechlen;
|
||||
|
||||
if(!len)
|
||||
return CURLE_URL_MALFORMAT;
|
||||
|
||||
if(sasl->resetprefs) {
|
||||
sasl->resetprefs = FALSE;
|
||||
sasl->prefmech = SASL_AUTH_NONE;
|
||||
}
|
||||
|
||||
if(strnequal(value, "*", len))
|
||||
sasl->prefmech = SASL_AUTH_DEFAULT;
|
||||
else {
|
||||
mechbit = Curl_sasl_decode_mech(value, len, &mechlen);
|
||||
if(mechbit && mechlen == len)
|
||||
sasl->prefmech |= mechbit;
|
||||
else
|
||||
result = CURLE_URL_MALFORMAT;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_sasl_init()
|
||||
*
|
||||
* Initializes the SASL structure.
|
||||
*/
|
||||
void Curl_sasl_init(struct SASL *sasl, const struct SASLproto *params)
|
||||
{
|
||||
sasl->params = params; /* Set protocol dependent parameters */
|
||||
sasl->state = SASL_STOP; /* Not yet running */
|
||||
sasl->authmechs = SASL_AUTH_NONE; /* No known authentication mechanism yet */
|
||||
sasl->prefmech = SASL_AUTH_DEFAULT; /* Prefer all mechanisms */
|
||||
sasl->authused = SASL_AUTH_NONE; /* No the authentication mechanism used */
|
||||
sasl->resetprefs = TRUE; /* Reset prefmech upon AUTH parsing. */
|
||||
sasl->mutual_auth = FALSE; /* No mutual authentication (GSSAPI only) */
|
||||
sasl->force_ir = FALSE; /* Respect external option */
|
||||
}
|
||||
|
||||
/*
|
||||
* state()
|
||||
*
|
||||
* This is the ONLY way to change SASL state!
|
||||
*/
|
||||
static void state(struct SASL *sasl, struct connectdata *conn,
|
||||
saslstate newstate)
|
||||
{
|
||||
#if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS)
|
||||
/* for debug purposes */
|
||||
static const char * const names[]={
|
||||
"STOP",
|
||||
"PLAIN",
|
||||
"LOGIN",
|
||||
"LOGIN_PASSWD",
|
||||
"EXTERNAL",
|
||||
"CRAMMD5",
|
||||
"DIGESTMD5",
|
||||
"DIGESTMD5_RESP",
|
||||
"NTLM",
|
||||
"NTLM_TYPE2MSG",
|
||||
"GSSAPI",
|
||||
"GSSAPI_TOKEN",
|
||||
"GSSAPI_NO_DATA",
|
||||
"OAUTH2",
|
||||
"OAUTH2_RESP",
|
||||
"CANCEL",
|
||||
"FINAL",
|
||||
/* LAST */
|
||||
};
|
||||
|
||||
if(sasl->state != newstate)
|
||||
infof(conn->data, "SASL %p state change from %s to %s\n",
|
||||
(void *)sasl, names[sasl->state], names[newstate]);
|
||||
#else
|
||||
(void) conn;
|
||||
#endif
|
||||
|
||||
sasl->state = newstate;
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_sasl_can_authenticate()
|
||||
*
|
||||
* Check if we have enough auth data and capabilities to authenticate.
|
||||
*/
|
||||
bool Curl_sasl_can_authenticate(struct SASL *sasl, struct connectdata *conn)
|
||||
{
|
||||
/* Have credentials been provided? */
|
||||
if(conn->bits.user_passwd)
|
||||
return TRUE;
|
||||
|
||||
/* EXTERNAL can authenticate without a user name and/or password */
|
||||
if(sasl->authmechs & sasl->prefmech & SASL_MECH_EXTERNAL)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_sasl_start()
|
||||
*
|
||||
* Calculate the required login details for SASL authentication.
|
||||
*/
|
||||
CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn,
|
||||
bool force_ir, saslprogress *progress)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
unsigned int enabledmechs;
|
||||
const char *mech = NULL;
|
||||
char *resp = NULL;
|
||||
size_t len = 0;
|
||||
saslstate state1 = SASL_STOP;
|
||||
saslstate state2 = SASL_FINAL;
|
||||
#if defined(USE_KERBEROS5)
|
||||
const char* service = data->set.str[STRING_SERVICE_NAME] ?
|
||||
data->set.str[STRING_SERVICE_NAME] :
|
||||
sasl->params->service;
|
||||
#endif
|
||||
|
||||
sasl->force_ir = force_ir; /* Latch for future use */
|
||||
sasl->authused = 0; /* No mechanism used yet */
|
||||
enabledmechs = sasl->authmechs & sasl->prefmech;
|
||||
*progress = SASL_IDLE;
|
||||
|
||||
/* Calculate the supported authentication mechanism, by decreasing order of
|
||||
security, as well as the initial response where appropriate */
|
||||
if((enabledmechs & SASL_MECH_EXTERNAL) && !conn->passwd[0]) {
|
||||
mech = SASL_MECH_STRING_EXTERNAL;
|
||||
state1 = SASL_EXTERNAL;
|
||||
sasl->authused = SASL_MECH_EXTERNAL;
|
||||
|
||||
if(force_ir || data->set.sasl_ir)
|
||||
result = Curl_auth_create_external_message(data, conn->user, &resp,
|
||||
&len);
|
||||
}
|
||||
else if(conn->bits.user_passwd) {
|
||||
#if defined(USE_KERBEROS5)
|
||||
if(enabledmechs & SASL_MECH_GSSAPI) {
|
||||
sasl->mutual_auth = FALSE; /* TODO: Calculate mutual authentication */
|
||||
mech = SASL_MECH_STRING_GSSAPI;
|
||||
state1 = SASL_GSSAPI;
|
||||
state2 = SASL_GSSAPI_TOKEN;
|
||||
sasl->authused = SASL_MECH_GSSAPI;
|
||||
|
||||
if(force_ir || data->set.sasl_ir)
|
||||
result = Curl_auth_create_gssapi_user_message(data, conn->user,
|
||||
conn->passwd,
|
||||
service,
|
||||
data->easy_conn->
|
||||
host.name,
|
||||
sasl->mutual_auth,
|
||||
NULL, &conn->krb5,
|
||||
&resp, &len);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#ifndef CURL_DISABLE_CRYPTO_AUTH
|
||||
if(enabledmechs & SASL_MECH_DIGEST_MD5) {
|
||||
mech = SASL_MECH_STRING_DIGEST_MD5;
|
||||
state1 = SASL_DIGESTMD5;
|
||||
sasl->authused = SASL_MECH_DIGEST_MD5;
|
||||
}
|
||||
else if(enabledmechs & SASL_MECH_CRAM_MD5) {
|
||||
mech = SASL_MECH_STRING_CRAM_MD5;
|
||||
state1 = SASL_CRAMMD5;
|
||||
sasl->authused = SASL_MECH_CRAM_MD5;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#ifdef USE_NTLM
|
||||
if(enabledmechs & SASL_MECH_NTLM) {
|
||||
mech = SASL_MECH_STRING_NTLM;
|
||||
state1 = SASL_NTLM;
|
||||
state2 = SASL_NTLM_TYPE2MSG;
|
||||
sasl->authused = SASL_MECH_NTLM;
|
||||
|
||||
if(force_ir || data->set.sasl_ir)
|
||||
result = Curl_auth_create_ntlm_type1_message(conn->user, conn->passwd,
|
||||
&conn->ntlm, &resp, &len);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if((enabledmechs & SASL_MECH_OAUTHBEARER) && conn->oauth_bearer) {
|
||||
mech = SASL_MECH_STRING_OAUTHBEARER;
|
||||
state1 = SASL_OAUTH2;
|
||||
state2 = SASL_OAUTH2_RESP;
|
||||
sasl->authused = SASL_MECH_OAUTHBEARER;
|
||||
|
||||
if(force_ir || data->set.sasl_ir)
|
||||
result = Curl_auth_create_oauth_bearer_message(data, conn->user,
|
||||
conn->host.name,
|
||||
conn->port,
|
||||
conn->oauth_bearer,
|
||||
&resp, &len);
|
||||
}
|
||||
else if((enabledmechs & SASL_MECH_XOAUTH2) && conn->oauth_bearer) {
|
||||
mech = SASL_MECH_STRING_XOAUTH2;
|
||||
state1 = SASL_OAUTH2;
|
||||
sasl->authused = SASL_MECH_XOAUTH2;
|
||||
|
||||
if(force_ir || data->set.sasl_ir)
|
||||
result = Curl_auth_create_oauth_bearer_message(data, conn->user,
|
||||
NULL, 0,
|
||||
conn->oauth_bearer,
|
||||
&resp, &len);
|
||||
}
|
||||
else if(enabledmechs & SASL_MECH_LOGIN) {
|
||||
mech = SASL_MECH_STRING_LOGIN;
|
||||
state1 = SASL_LOGIN;
|
||||
state2 = SASL_LOGIN_PASSWD;
|
||||
sasl->authused = SASL_MECH_LOGIN;
|
||||
|
||||
if(force_ir || data->set.sasl_ir)
|
||||
result = Curl_auth_create_login_message(data, conn->user, &resp, &len);
|
||||
}
|
||||
else if(enabledmechs & SASL_MECH_PLAIN) {
|
||||
mech = SASL_MECH_STRING_PLAIN;
|
||||
state1 = SASL_PLAIN;
|
||||
sasl->authused = SASL_MECH_PLAIN;
|
||||
|
||||
if(force_ir || data->set.sasl_ir)
|
||||
result = Curl_auth_create_plain_message(data, conn->user, conn->passwd,
|
||||
&resp, &len);
|
||||
}
|
||||
}
|
||||
|
||||
if(!result && mech) {
|
||||
if(resp && sasl->params->maxirlen &&
|
||||
strlen(mech) + len > sasl->params->maxirlen) {
|
||||
free(resp);
|
||||
resp = NULL;
|
||||
}
|
||||
|
||||
result = sasl->params->sendauth(conn, mech, resp);
|
||||
if(!result) {
|
||||
*progress = SASL_INPROGRESS;
|
||||
state(sasl, conn, resp ? state2 : state1);
|
||||
}
|
||||
}
|
||||
|
||||
free(resp);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_sasl_continue()
|
||||
*
|
||||
* Continue the authentication.
|
||||
*/
|
||||
CURLcode Curl_sasl_continue(struct SASL *sasl, struct connectdata *conn,
|
||||
int code, saslprogress *progress)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
saslstate newstate = SASL_FINAL;
|
||||
char *resp = NULL;
|
||||
#if !defined(CURL_DISABLE_CRYPTO_AUTH)
|
||||
char *serverdata;
|
||||
char *chlg = NULL;
|
||||
size_t chlglen = 0;
|
||||
#endif
|
||||
#if !defined(CURL_DISABLE_CRYPTO_AUTH) || defined(USE_KERBEROS5)
|
||||
const char *service = data->set.str[STRING_SERVICE_NAME] ?
|
||||
data->set.str[STRING_SERVICE_NAME] :
|
||||
sasl->params->service;
|
||||
#endif
|
||||
size_t len = 0;
|
||||
|
||||
*progress = SASL_INPROGRESS;
|
||||
|
||||
if(sasl->state == SASL_FINAL) {
|
||||
if(code != sasl->params->finalcode)
|
||||
result = CURLE_LOGIN_DENIED;
|
||||
*progress = SASL_DONE;
|
||||
state(sasl, conn, SASL_STOP);
|
||||
return result;
|
||||
}
|
||||
|
||||
if(sasl->state != SASL_CANCEL && sasl->state != SASL_OAUTH2_RESP &&
|
||||
code != sasl->params->contcode) {
|
||||
*progress = SASL_DONE;
|
||||
state(sasl, conn, SASL_STOP);
|
||||
return CURLE_LOGIN_DENIED;
|
||||
}
|
||||
|
||||
switch(sasl->state) {
|
||||
case SASL_STOP:
|
||||
*progress = SASL_DONE;
|
||||
return result;
|
||||
case SASL_PLAIN:
|
||||
result = Curl_auth_create_plain_message(data, conn->user, conn->passwd,
|
||||
&resp,
|
||||
&len);
|
||||
break;
|
||||
case SASL_LOGIN:
|
||||
result = Curl_auth_create_login_message(data, conn->user, &resp, &len);
|
||||
newstate = SASL_LOGIN_PASSWD;
|
||||
break;
|
||||
case SASL_LOGIN_PASSWD:
|
||||
result = Curl_auth_create_login_message(data, conn->passwd, &resp, &len);
|
||||
break;
|
||||
case SASL_EXTERNAL:
|
||||
result = Curl_auth_create_external_message(data, conn->user, &resp, &len);
|
||||
break;
|
||||
|
||||
#ifndef CURL_DISABLE_CRYPTO_AUTH
|
||||
case SASL_CRAMMD5:
|
||||
sasl->params->getmessage(data->state.buffer, &serverdata);
|
||||
result = Curl_auth_decode_cram_md5_message(serverdata, &chlg, &chlglen);
|
||||
if(!result)
|
||||
result = Curl_auth_create_cram_md5_message(data, chlg, conn->user,
|
||||
conn->passwd, &resp, &len);
|
||||
free(chlg);
|
||||
break;
|
||||
case SASL_DIGESTMD5:
|
||||
sasl->params->getmessage(data->state.buffer, &serverdata);
|
||||
result = Curl_auth_create_digest_md5_message(data, serverdata,
|
||||
conn->user, conn->passwd,
|
||||
service,
|
||||
&resp, &len);
|
||||
newstate = SASL_DIGESTMD5_RESP;
|
||||
break;
|
||||
case SASL_DIGESTMD5_RESP:
|
||||
resp = strdup("");
|
||||
if(!resp)
|
||||
result = CURLE_OUT_OF_MEMORY;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef USE_NTLM
|
||||
case SASL_NTLM:
|
||||
/* Create the type-1 message */
|
||||
result = Curl_auth_create_ntlm_type1_message(conn->user, conn->passwd,
|
||||
&conn->ntlm, &resp, &len);
|
||||
newstate = SASL_NTLM_TYPE2MSG;
|
||||
break;
|
||||
case SASL_NTLM_TYPE2MSG:
|
||||
/* Decode the type-2 message */
|
||||
sasl->params->getmessage(data->state.buffer, &serverdata);
|
||||
result = Curl_auth_decode_ntlm_type2_message(data, serverdata,
|
||||
&conn->ntlm);
|
||||
if(!result)
|
||||
result = Curl_auth_create_ntlm_type3_message(data, conn->user,
|
||||
conn->passwd, &conn->ntlm,
|
||||
&resp, &len);
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(USE_KERBEROS5)
|
||||
case SASL_GSSAPI:
|
||||
result = Curl_auth_create_gssapi_user_message(data, conn->user,
|
||||
conn->passwd,
|
||||
service,
|
||||
data->easy_conn->host.name,
|
||||
sasl->mutual_auth, NULL,
|
||||
&conn->krb5,
|
||||
&resp, &len);
|
||||
newstate = SASL_GSSAPI_TOKEN;
|
||||
break;
|
||||
case SASL_GSSAPI_TOKEN:
|
||||
sasl->params->getmessage(data->state.buffer, &serverdata);
|
||||
if(sasl->mutual_auth) {
|
||||
/* Decode the user token challenge and create the optional response
|
||||
message */
|
||||
result = Curl_auth_create_gssapi_user_message(data, NULL, NULL,
|
||||
NULL, NULL,
|
||||
sasl->mutual_auth,
|
||||
serverdata, &conn->krb5,
|
||||
&resp, &len);
|
||||
newstate = SASL_GSSAPI_NO_DATA;
|
||||
}
|
||||
else
|
||||
/* Decode the security challenge and create the response message */
|
||||
result = Curl_auth_create_gssapi_security_message(data, serverdata,
|
||||
&conn->krb5,
|
||||
&resp, &len);
|
||||
break;
|
||||
case SASL_GSSAPI_NO_DATA:
|
||||
sasl->params->getmessage(data->state.buffer, &serverdata);
|
||||
/* Decode the security challenge and create the response message */
|
||||
result = Curl_auth_create_gssapi_security_message(data, serverdata,
|
||||
&conn->krb5,
|
||||
&resp, &len);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case SASL_OAUTH2:
|
||||
/* Create the authorisation message */
|
||||
if(sasl->authused == SASL_MECH_OAUTHBEARER) {
|
||||
result = Curl_auth_create_oauth_bearer_message(data, conn->user,
|
||||
conn->host.name,
|
||||
conn->port,
|
||||
conn->oauth_bearer,
|
||||
&resp, &len);
|
||||
|
||||
/* Failures maybe sent by the server as continuations for OAUTHBEARER */
|
||||
newstate = SASL_OAUTH2_RESP;
|
||||
}
|
||||
else
|
||||
result = Curl_auth_create_oauth_bearer_message(data, conn->user,
|
||||
NULL, 0,
|
||||
conn->oauth_bearer,
|
||||
&resp, &len);
|
||||
break;
|
||||
|
||||
case SASL_OAUTH2_RESP:
|
||||
/* The continuation is optional so check the response code */
|
||||
if(code == sasl->params->finalcode) {
|
||||
/* Final response was received so we are done */
|
||||
*progress = SASL_DONE;
|
||||
state(sasl, conn, SASL_STOP);
|
||||
return result;
|
||||
}
|
||||
else if(code == sasl->params->contcode) {
|
||||
/* Acknowledge the continuation by sending a 0x01 response base64
|
||||
encoded */
|
||||
resp = strdup("AQ==");
|
||||
if(!resp)
|
||||
result = CURLE_OUT_OF_MEMORY;
|
||||
break;
|
||||
}
|
||||
else {
|
||||
*progress = SASL_DONE;
|
||||
state(sasl, conn, SASL_STOP);
|
||||
return CURLE_LOGIN_DENIED;
|
||||
}
|
||||
|
||||
case SASL_CANCEL:
|
||||
/* Remove the offending mechanism from the supported list */
|
||||
sasl->authmechs ^= sasl->authused;
|
||||
|
||||
/* Start an alternative SASL authentication */
|
||||
result = Curl_sasl_start(sasl, conn, sasl->force_ir, progress);
|
||||
newstate = sasl->state; /* Use state from Curl_sasl_start() */
|
||||
break;
|
||||
default:
|
||||
failf(data, "Unsupported SASL authentication mechanism");
|
||||
result = CURLE_UNSUPPORTED_PROTOCOL; /* Should not happen */
|
||||
break;
|
||||
}
|
||||
|
||||
switch(result) {
|
||||
case CURLE_BAD_CONTENT_ENCODING:
|
||||
/* Cancel dialog */
|
||||
result = sasl->params->sendcont(conn, "*");
|
||||
newstate = SASL_CANCEL;
|
||||
break;
|
||||
case CURLE_OK:
|
||||
if(resp)
|
||||
result = sasl->params->sendcont(conn, resp);
|
||||
break;
|
||||
default:
|
||||
newstate = SASL_STOP; /* Stop on error */
|
||||
*progress = SASL_DONE;
|
||||
break;
|
||||
}
|
||||
|
||||
free(resp);
|
||||
|
||||
state(sasl, conn, newstate);
|
||||
|
||||
return result;
|
||||
}
|
|
@ -1,143 +0,0 @@
|
|||
#ifndef HEADER_CURL_SASL_H
|
||||
#define HEADER_CURL_SASL_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 2012 - 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
struct SessionHandle;
|
||||
struct connectdata;
|
||||
|
||||
/* Authentication mechanism flags */
|
||||
#define SASL_MECH_LOGIN (1 << 0)
|
||||
#define SASL_MECH_PLAIN (1 << 1)
|
||||
#define SASL_MECH_CRAM_MD5 (1 << 2)
|
||||
#define SASL_MECH_DIGEST_MD5 (1 << 3)
|
||||
#define SASL_MECH_GSSAPI (1 << 4)
|
||||
#define SASL_MECH_EXTERNAL (1 << 5)
|
||||
#define SASL_MECH_NTLM (1 << 6)
|
||||
#define SASL_MECH_XOAUTH2 (1 << 7)
|
||||
#define SASL_MECH_OAUTHBEARER (1 << 8)
|
||||
|
||||
/* Authentication mechanism values */
|
||||
#define SASL_AUTH_NONE 0
|
||||
#define SASL_AUTH_ANY ~0U
|
||||
#define SASL_AUTH_DEFAULT (SASL_AUTH_ANY & ~SASL_MECH_EXTERNAL)
|
||||
|
||||
/* Authentication mechanism strings */
|
||||
#define SASL_MECH_STRING_LOGIN "LOGIN"
|
||||
#define SASL_MECH_STRING_PLAIN "PLAIN"
|
||||
#define SASL_MECH_STRING_CRAM_MD5 "CRAM-MD5"
|
||||
#define SASL_MECH_STRING_DIGEST_MD5 "DIGEST-MD5"
|
||||
#define SASL_MECH_STRING_GSSAPI "GSSAPI"
|
||||
#define SASL_MECH_STRING_EXTERNAL "EXTERNAL"
|
||||
#define SASL_MECH_STRING_NTLM "NTLM"
|
||||
#define SASL_MECH_STRING_XOAUTH2 "XOAUTH2"
|
||||
#define SASL_MECH_STRING_OAUTHBEARER "OAUTHBEARER"
|
||||
|
||||
/* SASL machine states */
|
||||
typedef enum {
|
||||
SASL_STOP,
|
||||
SASL_PLAIN,
|
||||
SASL_LOGIN,
|
||||
SASL_LOGIN_PASSWD,
|
||||
SASL_EXTERNAL,
|
||||
SASL_CRAMMD5,
|
||||
SASL_DIGESTMD5,
|
||||
SASL_DIGESTMD5_RESP,
|
||||
SASL_NTLM,
|
||||
SASL_NTLM_TYPE2MSG,
|
||||
SASL_GSSAPI,
|
||||
SASL_GSSAPI_TOKEN,
|
||||
SASL_GSSAPI_NO_DATA,
|
||||
SASL_OAUTH2,
|
||||
SASL_OAUTH2_RESP,
|
||||
SASL_CANCEL,
|
||||
SASL_FINAL
|
||||
} saslstate;
|
||||
|
||||
/* Progress indicator */
|
||||
typedef enum {
|
||||
SASL_IDLE,
|
||||
SASL_INPROGRESS,
|
||||
SASL_DONE
|
||||
} saslprogress;
|
||||
|
||||
/* Protocol dependent SASL parameters */
|
||||
struct SASLproto {
|
||||
const char *service; /* The service name */
|
||||
int contcode; /* Code to receive when continuation is expected */
|
||||
int finalcode; /* Code to receive upon authentication success */
|
||||
size_t maxirlen; /* Maximum initial response length */
|
||||
CURLcode (*sendauth)(struct connectdata *conn,
|
||||
const char *mech, const char *ir);
|
||||
/* Send authentication command */
|
||||
CURLcode (*sendcont)(struct connectdata *conn, const char *contauth);
|
||||
/* Send authentication continuation */
|
||||
void (*getmessage)(char *buffer, char **outptr);
|
||||
/* Get SASL response message */
|
||||
};
|
||||
|
||||
/* Per-connection parameters */
|
||||
struct SASL {
|
||||
const struct SASLproto *params; /* Protocol dependent parameters */
|
||||
saslstate state; /* Current machine state */
|
||||
unsigned int authmechs; /* Accepted authentication mechanisms */
|
||||
unsigned int prefmech; /* Preferred authentication mechanism */
|
||||
unsigned int authused; /* Auth mechanism used for the connection */
|
||||
bool resetprefs; /* For URL auth option parsing. */
|
||||
bool mutual_auth; /* Mutual authentication enabled (GSSAPI only) */
|
||||
bool force_ir; /* Protocol always supports initial response */
|
||||
};
|
||||
|
||||
/* This is used to test whether the line starts with the given mechanism */
|
||||
#define sasl_mech_equal(line, wordlen, mech) \
|
||||
(wordlen == (sizeof(mech) - 1) / sizeof(char) && \
|
||||
!memcmp(line, mech, wordlen))
|
||||
|
||||
/* This is used to cleanup any libraries or curl modules used by the sasl
|
||||
functions */
|
||||
void Curl_sasl_cleanup(struct connectdata *conn, unsigned int authused);
|
||||
|
||||
/* Convert a mechanism name to a token */
|
||||
unsigned int Curl_sasl_decode_mech(const char *ptr,
|
||||
size_t maxlen, size_t *len);
|
||||
|
||||
/* Parse the URL login options */
|
||||
CURLcode Curl_sasl_parse_url_auth_option(struct SASL *sasl,
|
||||
const char *value, size_t len);
|
||||
|
||||
/* Initializes an SASL structure */
|
||||
void Curl_sasl_init(struct SASL *sasl, const struct SASLproto *params);
|
||||
|
||||
/* Check if we have enough auth data and capabilities to authenticate */
|
||||
bool Curl_sasl_can_authenticate(struct SASL *sasl, struct connectdata *conn);
|
||||
|
||||
/* Calculate the required login details for SASL authentication */
|
||||
CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn,
|
||||
bool force_ir, saslprogress *progress);
|
||||
|
||||
/* Continue an SASL authentication */
|
||||
CURLcode Curl_sasl_continue(struct SASL *sasl, struct connectdata *conn,
|
||||
int code, saslprogress *progress);
|
||||
|
||||
#endif /* HEADER_CURL_SASL_H */
|
|
@ -1,51 +0,0 @@
|
|||
#ifndef HEADER_CURL_SECURITY_H
|
||||
#define HEADER_CURL_SECURITY_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
struct Curl_sec_client_mech {
|
||||
const char *name;
|
||||
size_t size;
|
||||
int (*init)(void *);
|
||||
int (*auth)(void *, struct connectdata *);
|
||||
void (*end)(void *);
|
||||
int (*check_prot)(void *, int);
|
||||
int (*overhead)(void *, int, int);
|
||||
int (*encode)(void *, const void*, int, int, void**);
|
||||
int (*decode)(void *, void*, int, int, struct connectdata *);
|
||||
};
|
||||
|
||||
#define AUTH_OK 0
|
||||
#define AUTH_CONTINUE 1
|
||||
#define AUTH_ERROR 2
|
||||
|
||||
#ifdef HAVE_GSSAPI
|
||||
int Curl_sec_read_msg (struct connectdata *conn, char *,
|
||||
enum protection_level);
|
||||
void Curl_sec_end (struct connectdata *);
|
||||
CURLcode Curl_sec_login (struct connectdata *);
|
||||
int Curl_sec_request_prot (struct connectdata *conn, const char *level);
|
||||
|
||||
extern struct Curl_sec_client_mech Curl_krb5_client_mech;
|
||||
#endif
|
||||
|
||||
#endif /* HEADER_CURL_SECURITY_H */
|
|
@ -1,740 +0,0 @@
|
|||
#ifndef HEADER_CURL_SETUP_H
|
||||
#define HEADER_CURL_SETUP_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/*
|
||||
* Define WIN32 when build target is Win32 API
|
||||
*/
|
||||
|
||||
#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) && \
|
||||
!defined(__SYMBIAN32__)
|
||||
#define WIN32
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Include configuration script results or hand-crafted
|
||||
* configuration file for platforms which lack config tool.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
||||
#include "curl_config.h"
|
||||
|
||||
#else /* HAVE_CONFIG_H */
|
||||
|
||||
#ifdef _WIN32_WCE
|
||||
# include "config-win32ce.h"
|
||||
#else
|
||||
# ifdef WIN32
|
||||
# include "config-win32.h"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(macintosh) && defined(__MRC__)
|
||||
# include "config-mac.h"
|
||||
#endif
|
||||
|
||||
#ifdef __riscos__
|
||||
# include "config-riscos.h"
|
||||
#endif
|
||||
|
||||
#ifdef __AMIGA__
|
||||
# include "config-amigaos.h"
|
||||
#endif
|
||||
|
||||
#ifdef __SYMBIAN32__
|
||||
# include "config-symbian.h"
|
||||
#endif
|
||||
|
||||
#ifdef __OS400__
|
||||
# include "config-os400.h"
|
||||
#endif
|
||||
|
||||
#ifdef TPF
|
||||
# include "config-tpf.h"
|
||||
#endif
|
||||
|
||||
#ifdef __VXWORKS__
|
||||
# include "config-vxworks.h"
|
||||
#endif
|
||||
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
/* ================================================================ */
|
||||
/* Definition of preprocessor macros/symbols which modify compiler */
|
||||
/* behavior or generated code characteristics must be done here, */
|
||||
/* as appropriate, before any system header file is included. It is */
|
||||
/* also possible to have them defined in the config file included */
|
||||
/* before this point. As a result of all this we frown inclusion of */
|
||||
/* system header files in our config files, avoid this at any cost. */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* AIX 4.3 and newer needs _THREAD_SAFE defined to build
|
||||
* proper reentrant code. Others may also need it.
|
||||
*/
|
||||
|
||||
#ifdef NEED_THREAD_SAFE
|
||||
# ifndef _THREAD_SAFE
|
||||
# define _THREAD_SAFE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Tru64 needs _REENTRANT set for a few function prototypes and
|
||||
* things to appear in the system header files. Unixware needs it
|
||||
* to build proper reentrant code. Others may also need it.
|
||||
*/
|
||||
|
||||
#ifdef NEED_REENTRANT
|
||||
# ifndef _REENTRANT
|
||||
# define _REENTRANT
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Solaris needs this to get a POSIX-conformant getpwuid_r */
|
||||
#if defined(sun) || defined(__sun)
|
||||
# ifndef _POSIX_PTHREAD_SEMANTICS
|
||||
# define _POSIX_PTHREAD_SEMANTICS 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* ================================================================ */
|
||||
/* If you need to include a system header file for your platform, */
|
||||
/* please, do it beyond the point further indicated in this file. */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* libcurl's external interface definitions are also used internally,
|
||||
* and might also include required system header files to define them.
|
||||
*/
|
||||
|
||||
#include <curl/curlbuild.h>
|
||||
|
||||
/*
|
||||
* Compile time sanity checks must also be done when building the library.
|
||||
*/
|
||||
|
||||
#include <curl/curlrules.h>
|
||||
|
||||
/*
|
||||
* Ensure that no one is using the old SIZEOF_CURL_OFF_T macro
|
||||
*/
|
||||
|
||||
#ifdef SIZEOF_CURL_OFF_T
|
||||
# error "SIZEOF_CURL_OFF_T shall not be defined!"
|
||||
Error Compilation_aborted_SIZEOF_CURL_OFF_T_shall_not_be_defined
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Disable other protocols when http is the only one desired.
|
||||
*/
|
||||
|
||||
#ifdef HTTP_ONLY
|
||||
# ifndef CURL_DISABLE_TFTP
|
||||
# define CURL_DISABLE_TFTP
|
||||
# endif
|
||||
# ifndef CURL_DISABLE_FTP
|
||||
# define CURL_DISABLE_FTP
|
||||
# endif
|
||||
# ifndef CURL_DISABLE_LDAP
|
||||
# define CURL_DISABLE_LDAP
|
||||
# endif
|
||||
# ifndef CURL_DISABLE_TELNET
|
||||
# define CURL_DISABLE_TELNET
|
||||
# endif
|
||||
# ifndef CURL_DISABLE_DICT
|
||||
# define CURL_DISABLE_DICT
|
||||
# endif
|
||||
# ifndef CURL_DISABLE_FILE
|
||||
# define CURL_DISABLE_FILE
|
||||
# endif
|
||||
# ifndef CURL_DISABLE_RTSP
|
||||
# define CURL_DISABLE_RTSP
|
||||
# endif
|
||||
# ifndef CURL_DISABLE_POP3
|
||||
# define CURL_DISABLE_POP3
|
||||
# endif
|
||||
# ifndef CURL_DISABLE_IMAP
|
||||
# define CURL_DISABLE_IMAP
|
||||
# endif
|
||||
# ifndef CURL_DISABLE_SMTP
|
||||
# define CURL_DISABLE_SMTP
|
||||
# endif
|
||||
# ifndef CURL_DISABLE_RTMP
|
||||
# define CURL_DISABLE_RTMP
|
||||
# endif
|
||||
# ifndef CURL_DISABLE_GOPHER
|
||||
# define CURL_DISABLE_GOPHER
|
||||
# endif
|
||||
# ifndef CURL_DISABLE_SMB
|
||||
# define CURL_DISABLE_SMB
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* When http is disabled rtsp is not supported.
|
||||
*/
|
||||
|
||||
#if defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_RTSP)
|
||||
# define CURL_DISABLE_RTSP
|
||||
#endif
|
||||
|
||||
/* ================================================================ */
|
||||
/* No system header file shall be included in this file before this */
|
||||
/* point. The only allowed ones are those included from curlbuild.h */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* OS/400 setup file includes some system headers.
|
||||
*/
|
||||
|
||||
#ifdef __OS400__
|
||||
# include "setup-os400.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* VMS setup file includes some system headers.
|
||||
*/
|
||||
|
||||
#ifdef __VMS
|
||||
# include "setup-vms.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Include header files for windows builds before redefining anything.
|
||||
* Use this preprocessor block only to include or exclude windows.h,
|
||||
* winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs
|
||||
* to any other further and independent block. Under Cygwin things work
|
||||
* just as under linux (e.g. <sys/socket.h>) and the winsock headers should
|
||||
* never be included when __CYGWIN__ is defined. configure script takes
|
||||
* care of this, not defining HAVE_WINDOWS_H, HAVE_WINSOCK_H, HAVE_WINSOCK2_H,
|
||||
* neither HAVE_WS2TCPIP_H when __CYGWIN__ is defined.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
# if defined(UNICODE) && !defined(_UNICODE)
|
||||
# define _UNICODE
|
||||
# endif
|
||||
# if defined(_UNICODE) && !defined(UNICODE)
|
||||
# define UNICODE
|
||||
# endif
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# endif
|
||||
# include <windows.h>
|
||||
# ifdef HAVE_WINSOCK2_H
|
||||
# include <winsock2.h>
|
||||
# ifdef HAVE_WS2TCPIP_H
|
||||
# include <ws2tcpip.h>
|
||||
# endif
|
||||
# else
|
||||
# ifdef HAVE_WINSOCK_H
|
||||
# include <winsock.h>
|
||||
# endif
|
||||
# endif
|
||||
# include <tchar.h>
|
||||
# ifdef UNICODE
|
||||
typedef wchar_t *(*curl_wcsdup_callback)(const wchar_t *str);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Define USE_WINSOCK to 2 if we have and use WINSOCK2 API, else
|
||||
* define USE_WINSOCK to 1 if we have and use WINSOCK API, else
|
||||
* undefine USE_WINSOCK.
|
||||
*/
|
||||
|
||||
#undef USE_WINSOCK
|
||||
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
# define USE_WINSOCK 2
|
||||
#else
|
||||
# ifdef HAVE_WINSOCK_H
|
||||
# define USE_WINSOCK 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef USE_LWIPSOCK
|
||||
# include <lwip/init.h>
|
||||
# include <lwip/sockets.h>
|
||||
# include <lwip/netdb.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_EXTRA_STRICMP_H
|
||||
# include <extra/stricmp.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_EXTRA_STRDUP_H
|
||||
# include <extra/strdup.h>
|
||||
#endif
|
||||
|
||||
#ifdef TPF
|
||||
# include <strings.h> /* for bzero, strcasecmp, and strncasecmp */
|
||||
# include <string.h> /* for strcpy and strlen */
|
||||
# include <stdlib.h> /* for rand and srand */
|
||||
# include <sys/socket.h> /* for select and ioctl*/
|
||||
# include <netdb.h> /* for in_addr_t definition */
|
||||
# include <tpf/sysapi.h> /* for tpf_process_signals */
|
||||
/* change which select is used for libcurl */
|
||||
# define select(a,b,c,d,e) tpf_select_libcurl(a,b,c,d,e)
|
||||
#endif
|
||||
|
||||
#ifdef __VXWORKS__
|
||||
# include <sockLib.h> /* for generic BSD socket functions */
|
||||
# include <ioLib.h> /* for basic I/O interface functions */
|
||||
#endif
|
||||
|
||||
#ifdef __AMIGA__
|
||||
# ifndef __ixemul__
|
||||
# include <exec/types.h>
|
||||
# include <exec/execbase.h>
|
||||
# include <proto/exec.h>
|
||||
# include <proto/dos.h>
|
||||
# define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,0)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_ASSERT_H
|
||||
#include <assert.h>
|
||||
#endif
|
||||
|
||||
#ifdef __TANDEM /* for nsr-tandem-nsk systems */
|
||||
#include <floss.h>
|
||||
#endif
|
||||
|
||||
#ifndef STDC_HEADERS /* no standard C headers! */
|
||||
#include <curl/stdcheaders.h>
|
||||
#endif
|
||||
|
||||
#ifdef __POCC__
|
||||
# include <sys/types.h>
|
||||
# include <unistd.h>
|
||||
# define sys_nerr EILSEQ
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Salford-C kludge section (mostly borrowed from wxWidgets).
|
||||
*/
|
||||
#ifdef __SALFORDC__
|
||||
#pragma suppress 353 /* Possible nested comments */
|
||||
#pragma suppress 593 /* Define not used */
|
||||
#pragma suppress 61 /* enum has no name */
|
||||
#pragma suppress 106 /* unnamed, unused parameter */
|
||||
#include <clib.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Large file (>2Gb) support using WIN32 functions.
|
||||
*/
|
||||
|
||||
#ifdef USE_WIN32_LARGE_FILES
|
||||
# include <io.h>
|
||||
# include <sys/types.h>
|
||||
# include <sys/stat.h>
|
||||
# undef lseek
|
||||
# define lseek(fdes,offset,whence) _lseeki64(fdes, offset, whence)
|
||||
# undef fstat
|
||||
# define fstat(fdes,stp) _fstati64(fdes, stp)
|
||||
# undef stat
|
||||
# define stat(fname,stp) _stati64(fname, stp)
|
||||
# define struct_stat struct _stati64
|
||||
# define LSEEK_ERROR (__int64)-1
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Small file (<2Gb) support using WIN32 functions.
|
||||
*/
|
||||
|
||||
#ifdef USE_WIN32_SMALL_FILES
|
||||
# include <io.h>
|
||||
# include <sys/types.h>
|
||||
# include <sys/stat.h>
|
||||
# ifndef _WIN32_WCE
|
||||
# undef lseek
|
||||
# define lseek(fdes,offset,whence) _lseek(fdes, (long)offset, whence)
|
||||
# define fstat(fdes,stp) _fstat(fdes, stp)
|
||||
# define stat(fname,stp) _stat(fname, stp)
|
||||
# define struct_stat struct _stat
|
||||
# endif
|
||||
# define LSEEK_ERROR (long)-1
|
||||
#endif
|
||||
|
||||
#ifndef struct_stat
|
||||
# define struct_stat struct stat
|
||||
#endif
|
||||
|
||||
#ifndef LSEEK_ERROR
|
||||
# define LSEEK_ERROR (off_t)-1
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Default sizeof(off_t) in case it hasn't been defined in config file.
|
||||
*/
|
||||
|
||||
#ifndef SIZEOF_OFF_T
|
||||
# if defined(__VMS) && !defined(__VAX)
|
||||
# if defined(_LARGEFILE)
|
||||
# define SIZEOF_OFF_T 8
|
||||
# endif
|
||||
# elif defined(__OS400__) && defined(__ILEC400__)
|
||||
# if defined(_LARGE_FILES)
|
||||
# define SIZEOF_OFF_T 8
|
||||
# endif
|
||||
# elif defined(__MVS__) && defined(__IBMC__)
|
||||
# if defined(_LP64) || defined(_LARGE_FILES)
|
||||
# define SIZEOF_OFF_T 8
|
||||
# endif
|
||||
# elif defined(__370__) && defined(__IBMC__)
|
||||
# if defined(_LP64) || defined(_LARGE_FILES)
|
||||
# define SIZEOF_OFF_T 8
|
||||
# endif
|
||||
# endif
|
||||
# ifndef SIZEOF_OFF_T
|
||||
# define SIZEOF_OFF_T 4
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Arg 2 type for gethostname in case it hasn't been defined in config file.
|
||||
*/
|
||||
|
||||
#ifndef GETHOSTNAME_TYPE_ARG2
|
||||
# ifdef USE_WINSOCK
|
||||
# define GETHOSTNAME_TYPE_ARG2 int
|
||||
# else
|
||||
# define GETHOSTNAME_TYPE_ARG2 size_t
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Below we define some functions. They should
|
||||
|
||||
4. set the SIGALRM signal timeout
|
||||
5. set dir/file naming defines
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
# define DIR_CHAR "\\"
|
||||
# define DOT_CHAR "_"
|
||||
|
||||
#else /* WIN32 */
|
||||
|
||||
# ifdef MSDOS /* Watt-32 */
|
||||
|
||||
# include <sys/ioctl.h>
|
||||
# define select(n,r,w,x,t) select_s(n,r,w,x,t)
|
||||
# define ioctl(x,y,z) ioctlsocket(x,y,(char *)(z))
|
||||
# include <tcp.h>
|
||||
# ifdef word
|
||||
# undef word
|
||||
# endif
|
||||
# ifdef byte
|
||||
# undef byte
|
||||
# endif
|
||||
|
||||
# endif /* MSDOS */
|
||||
|
||||
# ifdef __minix
|
||||
/* Minix 3 versions up to at least 3.1.3 are missing these prototypes */
|
||||
extern char * strtok_r(char *s, const char *delim, char **last);
|
||||
extern struct tm * gmtime_r(const time_t * const timep, struct tm *tmp);
|
||||
# endif
|
||||
|
||||
# define DIR_CHAR "/"
|
||||
# ifndef DOT_CHAR
|
||||
# define DOT_CHAR "."
|
||||
# endif
|
||||
|
||||
# ifdef MSDOS
|
||||
# undef DOT_CHAR
|
||||
# define DOT_CHAR "_"
|
||||
# endif
|
||||
|
||||
# ifndef fileno /* sunos 4 have this as a macro! */
|
||||
int fileno(FILE *stream);
|
||||
# endif
|
||||
|
||||
#endif /* WIN32 */
|
||||
|
||||
/*
|
||||
* msvc 6.0 requires PSDK in order to have INET6_ADDRSTRLEN
|
||||
* defined in ws2tcpip.h as well as to provide IPv6 support.
|
||||
* Does not apply if lwIP is used.
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__POCC__) && !defined(USE_LWIPSOCK)
|
||||
# if !defined(HAVE_WS2TCPIP_H) || \
|
||||
((_MSC_VER < 1300) && !defined(INET6_ADDRSTRLEN))
|
||||
# undef HAVE_GETADDRINFO_THREADSAFE
|
||||
# undef HAVE_FREEADDRINFO
|
||||
# undef HAVE_GETADDRINFO
|
||||
# undef HAVE_GETNAMEINFO
|
||||
# undef ENABLE_IPV6
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* resolver specialty compile-time defines */
|
||||
/* CURLRES_* defines to use in the host*.c sources */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* lcc-win32 doesn't have _beginthreadex(), lacks threads support.
|
||||
*/
|
||||
|
||||
#if defined(__LCC__) && defined(WIN32)
|
||||
# undef USE_THREADS_POSIX
|
||||
# undef USE_THREADS_WIN32
|
||||
#endif
|
||||
|
||||
/*
|
||||
* MSVC threads support requires a multi-threaded runtime library.
|
||||
* _beginthreadex() is not available in single-threaded ones.
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__POCC__) && !defined(_MT)
|
||||
# undef USE_THREADS_POSIX
|
||||
# undef USE_THREADS_WIN32
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Mutually exclusive CURLRES_* definitions.
|
||||
*/
|
||||
|
||||
#ifdef USE_ARES
|
||||
# define CURLRES_ASYNCH
|
||||
# define CURLRES_ARES
|
||||
/* now undef the stock libc functions just to avoid them being used */
|
||||
# undef HAVE_GETADDRINFO
|
||||
# undef HAVE_FREEADDRINFO
|
||||
# undef HAVE_GETHOSTBYNAME
|
||||
#elif defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32)
|
||||
# define CURLRES_ASYNCH
|
||||
# define CURLRES_THREADED
|
||||
#else
|
||||
# define CURLRES_SYNCH
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_IPV6
|
||||
# define CURLRES_IPV6
|
||||
#else
|
||||
# define CURLRES_IPV4
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* When using WINSOCK, TELNET protocol requires WINSOCK2 API.
|
||||
*/
|
||||
|
||||
#if defined(USE_WINSOCK) && (USE_WINSOCK != 2)
|
||||
# define CURL_DISABLE_TELNET 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
* msvc 6.0 does not have struct sockaddr_storage and
|
||||
* does not define IPPROTO_ESP in winsock2.h. But both
|
||||
* are available if PSDK is properly installed.
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__POCC__)
|
||||
# if !defined(HAVE_WINSOCK2_H) || ((_MSC_VER < 1300) && !defined(IPPROTO_ESP))
|
||||
# undef HAVE_STRUCT_SOCKADDR_STORAGE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Intentionally fail to build when using msvc 6.0 without PSDK installed.
|
||||
* The brave of heart can circumvent this, defining ALLOW_MSVC6_WITHOUT_PSDK
|
||||
* in lib/config-win32.h although absolutely discouraged and unsupported.
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__POCC__)
|
||||
# if !defined(HAVE_WINDOWS_H) || ((_MSC_VER < 1300) && !defined(_FILETIME_))
|
||||
# if !defined(ALLOW_MSVC6_WITHOUT_PSDK)
|
||||
# error MSVC 6.0 requires "February 2003 Platform SDK" a.k.a. \
|
||||
"Windows Server 2003 PSDK"
|
||||
# else
|
||||
# define CURL_DISABLE_LDAP 1
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef NETWARE
|
||||
int netware_init(void);
|
||||
#ifndef __NOVELL_LIBC__
|
||||
#include <sys/bsdskt.h>
|
||||
#include <sys/timeval.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_LIBIDN) && defined(HAVE_TLD_H)
|
||||
/* The lib was present and the tld.h header (which is missing in libidn 0.3.X
|
||||
but we only work with libidn 0.4.1 or later) */
|
||||
#define USE_LIBIDN
|
||||
#endif
|
||||
|
||||
#ifndef SIZEOF_TIME_T
|
||||
/* assume default size of time_t to be 32 bit */
|
||||
#define SIZEOF_TIME_T 4
|
||||
#endif
|
||||
|
||||
#define LIBIDN_REQUIRED_VERSION "0.4.1"
|
||||
|
||||
#if defined(USE_GNUTLS) || defined(USE_OPENSSL) || defined(USE_NSS) || \
|
||||
defined(USE_POLARSSL) || defined(USE_AXTLS) || defined(USE_MBEDTLS) || \
|
||||
defined(USE_CYASSL) || defined(USE_SCHANNEL) || \
|
||||
defined(USE_DARWINSSL) || defined(USE_GSKIT)
|
||||
#define USE_SSL /* SSL support has been enabled */
|
||||
#endif
|
||||
|
||||
/* Single point where USE_SPNEGO definition might be defined */
|
||||
#if !defined(CURL_DISABLE_CRYPTO_AUTH) && \
|
||||
(defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI))
|
||||
#define USE_SPNEGO
|
||||
#endif
|
||||
|
||||
/* Single point where USE_KERBEROS5 definition might be defined */
|
||||
#if !defined(CURL_DISABLE_CRYPTO_AUTH) && \
|
||||
(defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI))
|
||||
#define USE_KERBEROS5
|
||||
#endif
|
||||
|
||||
/* Single point where USE_NTLM definition might be defined */
|
||||
#if !defined(CURL_DISABLE_NTLM) && !defined(CURL_DISABLE_CRYPTO_AUTH)
|
||||
#if defined(USE_OPENSSL) || defined(USE_WINDOWS_SSPI) || \
|
||||
defined(USE_GNUTLS) || defined(USE_NSS) || defined(USE_DARWINSSL) || \
|
||||
defined(USE_OS400CRYPTO) || defined(USE_WIN32_CRYPTO)
|
||||
|
||||
#define USE_NTLM
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* non-configure builds may define CURL_WANTS_CA_BUNDLE_ENV */
|
||||
#if defined(CURL_WANTS_CA_BUNDLE_ENV) && !defined(CURL_CA_BUNDLE)
|
||||
#define CURL_CA_BUNDLE getenv("CURL_CA_BUNDLE")
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Provide a mechanism to silence picky compilers, such as gcc 4.6+.
|
||||
* Parameters should of course normally not be unused, but for example when
|
||||
* we have multiple implementations of the same interface it may happen.
|
||||
*/
|
||||
|
||||
#if defined(__GNUC__) && ((__GNUC__ >= 3) || \
|
||||
((__GNUC__ == 2) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ >= 7)))
|
||||
# define UNUSED_PARAM __attribute__((__unused__))
|
||||
# define WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||
#else
|
||||
# define UNUSED_PARAM /*NOTHING*/
|
||||
# define WARN_UNUSED_RESULT
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Include macros and defines that should only be processed once.
|
||||
*/
|
||||
|
||||
#ifndef HEADER_CURL_SETUP_ONCE_H
|
||||
#include "curl_setup_once.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Definition of our NOP statement Object-like macro
|
||||
*/
|
||||
|
||||
#ifndef Curl_nop_stmt
|
||||
# define Curl_nop_stmt do { } WHILE_FALSE
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Ensure that Winsock and lwIP TCP/IP stacks are not mixed.
|
||||
*/
|
||||
|
||||
#if defined(__LWIP_OPT_H__) || defined(LWIP_HDR_OPT_H)
|
||||
# if defined(SOCKET) || \
|
||||
defined(USE_WINSOCK) || \
|
||||
defined(HAVE_WINSOCK_H) || \
|
||||
defined(HAVE_WINSOCK2_H) || \
|
||||
defined(HAVE_WS2TCPIP_H)
|
||||
# error "Winsock and lwIP TCP/IP stack definitions shall not coexist!"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Portable symbolic names for Winsock shutdown() mode flags.
|
||||
*/
|
||||
|
||||
#ifdef USE_WINSOCK
|
||||
# define SHUT_RD 0x00
|
||||
# define SHUT_WR 0x01
|
||||
# define SHUT_RDWR 0x02
|
||||
#endif
|
||||
|
||||
/* Define S_ISREG if not defined by system headers, f.e. MSVC */
|
||||
#if !defined(S_ISREG) && defined(S_IFMT) && defined(S_IFREG)
|
||||
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
|
||||
#endif
|
||||
|
||||
/* Define S_ISDIR if not defined by system headers, f.e. MSVC */
|
||||
#if !defined(S_ISDIR) && defined(S_IFMT) && defined(S_IFDIR)
|
||||
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
#endif
|
||||
|
||||
/* In Windows the default file mode is text but an application can override it.
|
||||
Therefore we specify it explicitly. https://github.com/curl/curl/pull/258
|
||||
*/
|
||||
#if defined(WIN32) || defined(MSDOS)
|
||||
#define FOPEN_READTEXT "rt"
|
||||
#define FOPEN_WRITETEXT "wt"
|
||||
#elif defined(__CYGWIN__)
|
||||
/* Cygwin has specific behavior we need to address when WIN32 is not defined.
|
||||
https://cygwin.com/cygwin-ug-net/using-textbinary.html
|
||||
For write we want our output to have line endings of LF and be compatible with
|
||||
other Cygwin utilities. For read we want to handle input that may have line
|
||||
endings either CRLF or LF so 't' is appropriate.
|
||||
*/
|
||||
#define FOPEN_READTEXT "rt"
|
||||
#define FOPEN_WRITETEXT "w"
|
||||
#else
|
||||
#define FOPEN_READTEXT "r"
|
||||
#define FOPEN_WRITETEXT "w"
|
||||
#endif
|
||||
|
||||
/* WinSock destroys recv() buffer when send() failed.
|
||||
* Enabled automatically for Windows and for Cygwin as Cygwin sockets are
|
||||
* wrappers for WinSock sockets. https://github.com/curl/curl/issues/657
|
||||
* Define DONT_USE_RECV_BEFORE_SEND_WORKAROUND to force disable workaround.
|
||||
*/
|
||||
#if !defined(DONT_USE_RECV_BEFORE_SEND_WORKAROUND)
|
||||
# if defined(WIN32) || defined(__CYGWIN__)
|
||||
# define USE_RECV_BEFORE_SEND_WORKAROUND
|
||||
# endif
|
||||
#else /* DONT_USE_RECV_BEFORE_SEND_WORKAROUNDS */
|
||||
# ifdef USE_RECV_BEFORE_SEND_WORKAROUND
|
||||
# undef USE_RECV_BEFORE_SEND_WORKAROUND
|
||||
# endif
|
||||
#endif /* DONT_USE_RECV_BEFORE_SEND_WORKAROUNDS */
|
||||
|
||||
#endif /* HEADER_CURL_SETUP_H */
|
|
@ -1,551 +0,0 @@
|
|||
#ifndef HEADER_CURL_SETUP_ONCE_H
|
||||
#define HEADER_CURL_SETUP_ONCE_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
/*
|
||||
* Inclusion of common header files.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef HAVE_ERRNO_H
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#ifdef NEED_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#ifdef NEED_MEMORY_H
|
||||
#include <memory.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_STAT_H
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
#include <time.h>
|
||||
#endif
|
||||
#else
|
||||
#ifdef HAVE_TIME_H
|
||||
#include <time.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#include <io.h>
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_STDBOOL_H) && defined(HAVE_BOOL_T)
|
||||
#include <stdbool.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef __hpux
|
||||
# if !defined(_XOPEN_SOURCE_EXTENDED) || defined(_KERNEL)
|
||||
# ifdef _APP32_64BIT_OFF_T
|
||||
# define OLD_APP32_64BIT_OFF_T _APP32_64BIT_OFF_T
|
||||
# undef _APP32_64BIT_OFF_T
|
||||
# else
|
||||
# undef OLD_APP32_64BIT_OFF_T
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
#ifdef __hpux
|
||||
# if !defined(_XOPEN_SOURCE_EXTENDED) || defined(_KERNEL)
|
||||
# ifdef OLD_APP32_64BIT_OFF_T
|
||||
# define _APP32_64BIT_OFF_T OLD_APP32_64BIT_OFF_T
|
||||
# undef OLD_APP32_64BIT_OFF_T
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Definition of timeval struct for platforms that don't have it.
|
||||
*/
|
||||
|
||||
#ifndef HAVE_STRUCT_TIMEVAL
|
||||
struct timeval {
|
||||
long tv_sec;
|
||||
long tv_usec;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* If we have the MSG_NOSIGNAL define, make sure we use
|
||||
* it as the fourth argument of function send()
|
||||
*/
|
||||
|
||||
#ifdef HAVE_MSG_NOSIGNAL
|
||||
#define SEND_4TH_ARG MSG_NOSIGNAL
|
||||
#else
|
||||
#define SEND_4TH_ARG 0
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__minix)
|
||||
/* Minix doesn't support recv on TCP sockets */
|
||||
#define sread(x,y,z) (ssize_t)read((RECV_TYPE_ARG1)(x), \
|
||||
(RECV_TYPE_ARG2)(y), \
|
||||
(RECV_TYPE_ARG3)(z))
|
||||
|
||||
#elif defined(HAVE_RECV)
|
||||
/*
|
||||
* The definitions for the return type and arguments types
|
||||
* of functions recv() and send() belong and come from the
|
||||
* configuration file. Do not define them in any other place.
|
||||
*
|
||||
* HAVE_RECV is defined if you have a function named recv()
|
||||
* which is used to read incoming data from sockets. If your
|
||||
* function has another name then don't define HAVE_RECV.
|
||||
*
|
||||
* If HAVE_RECV is defined then RECV_TYPE_ARG1, RECV_TYPE_ARG2,
|
||||
* RECV_TYPE_ARG3, RECV_TYPE_ARG4 and RECV_TYPE_RETV must also
|
||||
* be defined.
|
||||
*
|
||||
* HAVE_SEND is defined if you have a function named send()
|
||||
* which is used to write outgoing data on a connected socket.
|
||||
* If yours has another name then don't define HAVE_SEND.
|
||||
*
|
||||
* If HAVE_SEND is defined then SEND_TYPE_ARG1, SEND_QUAL_ARG2,
|
||||
* SEND_TYPE_ARG2, SEND_TYPE_ARG3, SEND_TYPE_ARG4 and
|
||||
* SEND_TYPE_RETV must also be defined.
|
||||
*/
|
||||
|
||||
#if !defined(RECV_TYPE_ARG1) || \
|
||||
!defined(RECV_TYPE_ARG2) || \
|
||||
!defined(RECV_TYPE_ARG3) || \
|
||||
!defined(RECV_TYPE_ARG4) || \
|
||||
!defined(RECV_TYPE_RETV)
|
||||
/* */
|
||||
Error Missing_definition_of_return_and_arguments_types_of_recv
|
||||
/* */
|
||||
#else
|
||||
#define sread(x,y,z) (ssize_t)recv((RECV_TYPE_ARG1)(x), \
|
||||
(RECV_TYPE_ARG2)(y), \
|
||||
(RECV_TYPE_ARG3)(z), \
|
||||
(RECV_TYPE_ARG4)(0))
|
||||
#endif
|
||||
#else /* HAVE_RECV */
|
||||
#ifndef sread
|
||||
/* */
|
||||
Error Missing_definition_of_macro_sread
|
||||
/* */
|
||||
#endif
|
||||
#endif /* HAVE_RECV */
|
||||
|
||||
|
||||
#if defined(__minix)
|
||||
/* Minix doesn't support send on TCP sockets */
|
||||
#define swrite(x,y,z) (ssize_t)write((SEND_TYPE_ARG1)(x), \
|
||||
(SEND_TYPE_ARG2)(y), \
|
||||
(SEND_TYPE_ARG3)(z))
|
||||
|
||||
#elif defined(HAVE_SEND)
|
||||
#if !defined(SEND_TYPE_ARG1) || \
|
||||
!defined(SEND_QUAL_ARG2) || \
|
||||
!defined(SEND_TYPE_ARG2) || \
|
||||
!defined(SEND_TYPE_ARG3) || \
|
||||
!defined(SEND_TYPE_ARG4) || \
|
||||
!defined(SEND_TYPE_RETV)
|
||||
/* */
|
||||
Error Missing_definition_of_return_and_arguments_types_of_send
|
||||
/* */
|
||||
#else
|
||||
#define swrite(x,y,z) (ssize_t)send((SEND_TYPE_ARG1)(x), \
|
||||
(SEND_TYPE_ARG2)(y), \
|
||||
(SEND_TYPE_ARG3)(z), \
|
||||
(SEND_TYPE_ARG4)(SEND_4TH_ARG))
|
||||
#endif
|
||||
#else /* HAVE_SEND */
|
||||
#ifndef swrite
|
||||
/* */
|
||||
Error Missing_definition_of_macro_swrite
|
||||
/* */
|
||||
#endif
|
||||
#endif /* HAVE_SEND */
|
||||
|
||||
|
||||
#if 0
|
||||
#if defined(HAVE_RECVFROM)
|
||||
/*
|
||||
* Currently recvfrom is only used on udp sockets.
|
||||
*/
|
||||
#if !defined(RECVFROM_TYPE_ARG1) || \
|
||||
!defined(RECVFROM_TYPE_ARG2) || \
|
||||
!defined(RECVFROM_TYPE_ARG3) || \
|
||||
!defined(RECVFROM_TYPE_ARG4) || \
|
||||
!defined(RECVFROM_TYPE_ARG5) || \
|
||||
!defined(RECVFROM_TYPE_ARG6) || \
|
||||
!defined(RECVFROM_TYPE_RETV)
|
||||
/* */
|
||||
Error Missing_definition_of_return_and_arguments_types_of_recvfrom
|
||||
/* */
|
||||
#else
|
||||
#define sreadfrom(s,b,bl,f,fl) (ssize_t)recvfrom((RECVFROM_TYPE_ARG1) (s), \
|
||||
(RECVFROM_TYPE_ARG2 *)(b), \
|
||||
(RECVFROM_TYPE_ARG3) (bl), \
|
||||
(RECVFROM_TYPE_ARG4) (0), \
|
||||
(RECVFROM_TYPE_ARG5 *)(f), \
|
||||
(RECVFROM_TYPE_ARG6 *)(fl))
|
||||
#endif
|
||||
#else /* HAVE_RECVFROM */
|
||||
#ifndef sreadfrom
|
||||
/* */
|
||||
Error Missing_definition_of_macro_sreadfrom
|
||||
/* */
|
||||
#endif
|
||||
#endif /* HAVE_RECVFROM */
|
||||
|
||||
|
||||
#ifdef RECVFROM_TYPE_ARG6_IS_VOID
|
||||
# define RECVFROM_ARG6_T int
|
||||
#else
|
||||
# define RECVFROM_ARG6_T RECVFROM_TYPE_ARG6
|
||||
#endif
|
||||
#endif /* if 0 */
|
||||
|
||||
|
||||
/*
|
||||
* Function-like macro definition used to close a socket.
|
||||
*/
|
||||
|
||||
#if defined(HAVE_CLOSESOCKET)
|
||||
# define sclose(x) closesocket((x))
|
||||
#elif defined(HAVE_CLOSESOCKET_CAMEL)
|
||||
# define sclose(x) CloseSocket((x))
|
||||
#elif defined(HAVE_CLOSE_S)
|
||||
# define sclose(x) close_s((x))
|
||||
#elif defined(USE_LWIPSOCK)
|
||||
# define sclose(x) lwip_close((x))
|
||||
#else
|
||||
# define sclose(x) close((x))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Stack-independent version of fcntl() on sockets:
|
||||
*/
|
||||
#if defined(USE_LWIPSOCK)
|
||||
# define sfcntl lwip_fcntl
|
||||
#else
|
||||
# define sfcntl fcntl
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Uppercase macro versions of ANSI/ISO is*() functions/macros which
|
||||
* avoid negative number inputs with argument byte codes > 127.
|
||||
*/
|
||||
|
||||
#define ISSPACE(x) (isspace((int) ((unsigned char)x)))
|
||||
#define ISDIGIT(x) (isdigit((int) ((unsigned char)x)))
|
||||
#define ISALNUM(x) (isalnum((int) ((unsigned char)x)))
|
||||
#define ISXDIGIT(x) (isxdigit((int) ((unsigned char)x)))
|
||||
#define ISGRAPH(x) (isgraph((int) ((unsigned char)x)))
|
||||
#define ISALPHA(x) (isalpha((int) ((unsigned char)x)))
|
||||
#define ISPRINT(x) (isprint((int) ((unsigned char)x)))
|
||||
#define ISUPPER(x) (isupper((int) ((unsigned char)x)))
|
||||
#define ISLOWER(x) (islower((int) ((unsigned char)x)))
|
||||
#define ISASCII(x) (isascii((int) ((unsigned char)x)))
|
||||
|
||||
#define ISBLANK(x) (int)((((unsigned char)x) == ' ') || \
|
||||
(((unsigned char)x) == '\t'))
|
||||
|
||||
#define TOLOWER(x) (tolower((int) ((unsigned char)x)))
|
||||
|
||||
|
||||
/*
|
||||
* 'bool' stuff compatible with HP-UX headers.
|
||||
*/
|
||||
|
||||
#if defined(__hpux) && !defined(HAVE_BOOL_T)
|
||||
typedef int bool;
|
||||
# define false 0
|
||||
# define true 1
|
||||
# define HAVE_BOOL_T
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* 'bool' exists on platforms with <stdbool.h>, i.e. C99 platforms.
|
||||
* On non-C99 platforms there's no bool, so define an enum for that.
|
||||
* On C99 platforms 'false' and 'true' also exist. Enum uses a
|
||||
* global namespace though, so use bool_false and bool_true.
|
||||
*/
|
||||
|
||||
#ifndef HAVE_BOOL_T
|
||||
typedef enum {
|
||||
bool_false = 0,
|
||||
bool_true = 1
|
||||
} bool;
|
||||
|
||||
/*
|
||||
* Use a define to let 'true' and 'false' use those enums. There
|
||||
* are currently no use of true and false in libcurl proper, but
|
||||
* there are some in the examples. This will cater for any later
|
||||
* code happening to use true and false.
|
||||
*/
|
||||
# define false bool_false
|
||||
# define true bool_true
|
||||
# define HAVE_BOOL_T
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Redefine TRUE and FALSE too, to catch current use. With this
|
||||
* change, 'bool found = 1' will give a warning on MIPSPro, but
|
||||
* 'bool found = TRUE' will not. Change tested on IRIX/MIPSPro,
|
||||
* AIX 5.1/Xlc, Tru64 5.1/cc, w/make test too.
|
||||
*/
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE true
|
||||
#endif
|
||||
#ifndef FALSE
|
||||
#define FALSE false
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Macro WHILE_FALSE may be used to build single-iteration do-while loops,
|
||||
* avoiding compiler warnings. Mostly intended for other macro definitions.
|
||||
*/
|
||||
|
||||
#define WHILE_FALSE while(0)
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__POCC__)
|
||||
# undef WHILE_FALSE
|
||||
# if (_MSC_VER < 1500)
|
||||
# define WHILE_FALSE while(1, 0)
|
||||
# else
|
||||
# define WHILE_FALSE \
|
||||
__pragma(warning(push)) \
|
||||
__pragma(warning(disable:4127)) \
|
||||
while(0) \
|
||||
__pragma(warning(pop))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Typedef to 'int' if sig_atomic_t is not an available 'typedefed' type.
|
||||
*/
|
||||
|
||||
#ifndef HAVE_SIG_ATOMIC_T
|
||||
typedef int sig_atomic_t;
|
||||
#define HAVE_SIG_ATOMIC_T
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Convenience SIG_ATOMIC_T definition
|
||||
*/
|
||||
|
||||
#ifdef HAVE_SIG_ATOMIC_T_VOLATILE
|
||||
#define SIG_ATOMIC_T static sig_atomic_t
|
||||
#else
|
||||
#define SIG_ATOMIC_T static volatile sig_atomic_t
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Default return type for signal handlers.
|
||||
*/
|
||||
|
||||
#ifndef RETSIGTYPE
|
||||
#define RETSIGTYPE void
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Macro used to include code only in debug builds.
|
||||
*/
|
||||
|
||||
#ifdef DEBUGBUILD
|
||||
#define DEBUGF(x) x
|
||||
#else
|
||||
#define DEBUGF(x) do { } WHILE_FALSE
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Macro used to include assertion code only in debug builds.
|
||||
*/
|
||||
|
||||
#if defined(DEBUGBUILD) && defined(HAVE_ASSERT_H)
|
||||
#define DEBUGASSERT(x) assert(x)
|
||||
#else
|
||||
#define DEBUGASSERT(x) do { } WHILE_FALSE
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Macro SOCKERRNO / SET_SOCKERRNO() returns / sets the *socket-related* errno
|
||||
* (or equivalent) on this platform to hide platform details to code using it.
|
||||
*/
|
||||
|
||||
#ifdef USE_WINSOCK
|
||||
#define SOCKERRNO ((int)WSAGetLastError())
|
||||
#define SET_SOCKERRNO(x) (WSASetLastError((int)(x)))
|
||||
#else
|
||||
#define SOCKERRNO (errno)
|
||||
#define SET_SOCKERRNO(x) (errno = (x))
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Macro ERRNO / SET_ERRNO() returns / sets the NOT *socket-related* errno
|
||||
* (or equivalent) on this platform to hide platform details to code using it.
|
||||
*/
|
||||
|
||||
#if defined(WIN32) && !defined(USE_LWIPSOCK)
|
||||
#define ERRNO ((int)GetLastError())
|
||||
#define SET_ERRNO(x) (SetLastError((DWORD)(x)))
|
||||
#else
|
||||
#define ERRNO (errno)
|
||||
#define SET_ERRNO(x) (errno = (x))
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Portable error number symbolic names defined to Winsock error codes.
|
||||
*/
|
||||
|
||||
#ifdef USE_WINSOCK
|
||||
#undef EBADF /* override definition in errno.h */
|
||||
#define EBADF WSAEBADF
|
||||
#undef EINTR /* override definition in errno.h */
|
||||
#define EINTR WSAEINTR
|
||||
#undef EINVAL /* override definition in errno.h */
|
||||
#define EINVAL WSAEINVAL
|
||||
#undef EWOULDBLOCK /* override definition in errno.h */
|
||||
#define EWOULDBLOCK WSAEWOULDBLOCK
|
||||
#undef EINPROGRESS /* override definition in errno.h */
|
||||
#define EINPROGRESS WSAEINPROGRESS
|
||||
#undef EALREADY /* override definition in errno.h */
|
||||
#define EALREADY WSAEALREADY
|
||||
#undef ENOTSOCK /* override definition in errno.h */
|
||||
#define ENOTSOCK WSAENOTSOCK
|
||||
#undef EDESTADDRREQ /* override definition in errno.h */
|
||||
#define EDESTADDRREQ WSAEDESTADDRREQ
|
||||
#undef EMSGSIZE /* override definition in errno.h */
|
||||
#define EMSGSIZE WSAEMSGSIZE
|
||||
#undef EPROTOTYPE /* override definition in errno.h */
|
||||
#define EPROTOTYPE WSAEPROTOTYPE
|
||||
#undef ENOPROTOOPT /* override definition in errno.h */
|
||||
#define ENOPROTOOPT WSAENOPROTOOPT
|
||||
#undef EPROTONOSUPPORT /* override definition in errno.h */
|
||||
#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
|
||||
#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
|
||||
#undef EOPNOTSUPP /* override definition in errno.h */
|
||||
#define EOPNOTSUPP WSAEOPNOTSUPP
|
||||
#define EPFNOSUPPORT WSAEPFNOSUPPORT
|
||||
#undef EAFNOSUPPORT /* override definition in errno.h */
|
||||
#define EAFNOSUPPORT WSAEAFNOSUPPORT
|
||||
#undef EADDRINUSE /* override definition in errno.h */
|
||||
#define EADDRINUSE WSAEADDRINUSE
|
||||
#undef EADDRNOTAVAIL /* override definition in errno.h */
|
||||
#define EADDRNOTAVAIL WSAEADDRNOTAVAIL
|
||||
#undef ENETDOWN /* override definition in errno.h */
|
||||
#define ENETDOWN WSAENETDOWN
|
||||
#undef ENETUNREACH /* override definition in errno.h */
|
||||
#define ENETUNREACH WSAENETUNREACH
|
||||
#undef ENETRESET /* override definition in errno.h */
|
||||
#define ENETRESET WSAENETRESET
|
||||
#undef ECONNABORTED /* override definition in errno.h */
|
||||
#define ECONNABORTED WSAECONNABORTED
|
||||
#undef ECONNRESET /* override definition in errno.h */
|
||||
#define ECONNRESET WSAECONNRESET
|
||||
#undef ENOBUFS /* override definition in errno.h */
|
||||
#define ENOBUFS WSAENOBUFS
|
||||
#undef EISCONN /* override definition in errno.h */
|
||||
#define EISCONN WSAEISCONN
|
||||
#undef ENOTCONN /* override definition in errno.h */
|
||||
#define ENOTCONN WSAENOTCONN
|
||||
#define ESHUTDOWN WSAESHUTDOWN
|
||||
#define ETOOMANYREFS WSAETOOMANYREFS
|
||||
#undef ETIMEDOUT /* override definition in errno.h */
|
||||
#define ETIMEDOUT WSAETIMEDOUT
|
||||
#undef ECONNREFUSED /* override definition in errno.h */
|
||||
#define ECONNREFUSED WSAECONNREFUSED
|
||||
#undef ELOOP /* override definition in errno.h */
|
||||
#define ELOOP WSAELOOP
|
||||
#ifndef ENAMETOOLONG /* possible previous definition in errno.h */
|
||||
#define ENAMETOOLONG WSAENAMETOOLONG
|
||||
#endif
|
||||
#define EHOSTDOWN WSAEHOSTDOWN
|
||||
#undef EHOSTUNREACH /* override definition in errno.h */
|
||||
#define EHOSTUNREACH WSAEHOSTUNREACH
|
||||
#ifndef ENOTEMPTY /* possible previous definition in errno.h */
|
||||
#define ENOTEMPTY WSAENOTEMPTY
|
||||
#endif
|
||||
#define EPROCLIM WSAEPROCLIM
|
||||
#define EUSERS WSAEUSERS
|
||||
#define EDQUOT WSAEDQUOT
|
||||
#define ESTALE WSAESTALE
|
||||
#define EREMOTE WSAEREMOTE
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Macro argv_item_t hides platform details to code using it.
|
||||
*/
|
||||
|
||||
#ifdef __VMS
|
||||
#define argv_item_t __char_ptr32
|
||||
#else
|
||||
#define argv_item_t char *
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* We use this ZERO_NULL to avoid picky compiler warnings,
|
||||
* when assigning a NULL pointer to a function pointer var.
|
||||
*/
|
||||
|
||||
#define ZERO_NULL 0
|
||||
|
||||
|
||||
#endif /* HEADER_CURL_SETUP_ONCE_H */
|
||||
|
|
@ -1,258 +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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#ifdef USE_WINDOWS_SSPI
|
||||
|
||||
#include <curl/curl.h>
|
||||
#include "curl_sspi.h"
|
||||
#include "curl_multibyte.h"
|
||||
#include "system_win32.h"
|
||||
#include "warnless.h"
|
||||
|
||||
/* The last #include files should be: */
|
||||
#include "curl_memory.h"
|
||||
#include "memdebug.h"
|
||||
|
||||
/* We use our own typedef here since some headers might lack these */
|
||||
typedef PSecurityFunctionTable (APIENTRY *INITSECURITYINTERFACE_FN)(VOID);
|
||||
|
||||
/* See definition of SECURITY_ENTRYPOINT in sspi.h */
|
||||
#ifdef UNICODE
|
||||
# ifdef _WIN32_WCE
|
||||
# define SECURITYENTRYPOINT L"InitSecurityInterfaceW"
|
||||
# else
|
||||
# define SECURITYENTRYPOINT "InitSecurityInterfaceW"
|
||||
# endif
|
||||
#else
|
||||
# define SECURITYENTRYPOINT "InitSecurityInterfaceA"
|
||||
#endif
|
||||
|
||||
/* Handle of security.dll or secur32.dll, depending on Windows version */
|
||||
HMODULE s_hSecDll = NULL;
|
||||
|
||||
/* Pointer to SSPI dispatch table */
|
||||
PSecurityFunctionTable s_pSecFn = NULL;
|
||||
|
||||
/*
|
||||
* Curl_sspi_global_init()
|
||||
*
|
||||
* This is used to load the Security Service Provider Interface (SSPI)
|
||||
* dynamic link library portably across all Windows versions, without
|
||||
* the need to directly link libcurl, nor the application using it, at
|
||||
* build time.
|
||||
*
|
||||
* Once this function has been executed, Windows SSPI functions can be
|
||||
* called through the Security Service Provider Interface dispatch table.
|
||||
*/
|
||||
CURLcode Curl_sspi_global_init(void)
|
||||
{
|
||||
bool securityDll = FALSE;
|
||||
INITSECURITYINTERFACE_FN pInitSecurityInterface;
|
||||
|
||||
/* If security interface is not yet initialized try to do this */
|
||||
if(!s_hSecDll) {
|
||||
/* Security Service Provider Interface (SSPI) functions are located in
|
||||
* security.dll on WinNT 4.0 and in secur32.dll on Win9x. Win2K and XP
|
||||
* have both these DLLs (security.dll forwards calls to secur32.dll) */
|
||||
DWORD majorVersion = 4;
|
||||
DWORD platformId = VER_PLATFORM_WIN32_NT;
|
||||
|
||||
#if !defined(_WIN32_WINNT) || !defined(_WIN32_WINNT_WIN2K) || \
|
||||
(_WIN32_WINNT < _WIN32_WINNT_WIN2K)
|
||||
OSVERSIONINFO osver;
|
||||
|
||||
memset(&osver, 0, sizeof(osver));
|
||||
osver.dwOSVersionInfoSize = sizeof(osver);
|
||||
|
||||
/* Find out Windows version */
|
||||
if(!GetVersionEx(&osver))
|
||||
return CURLE_FAILED_INIT;
|
||||
|
||||
/* Verify the major version number == 4 and platform id == WIN_NT */
|
||||
if(osver.dwMajorVersion == majorVersion &&
|
||||
osver.dwPlatformId == platformId)
|
||||
securityDll = TRUE;
|
||||
#else
|
||||
ULONGLONG cm;
|
||||
OSVERSIONINFOEX osver;
|
||||
|
||||
memset(&osver, 0, sizeof(osver));
|
||||
osver.dwOSVersionInfoSize = sizeof(osver);
|
||||
osver.dwMajorVersion = majorVersion;
|
||||
osver.dwPlatformId = platformId;
|
||||
|
||||
cm = VerSetConditionMask(0, VER_MAJORVERSION, VER_EQUAL);
|
||||
cm = VerSetConditionMask(cm, VER_MINORVERSION, VER_GREATER_EQUAL);
|
||||
cm = VerSetConditionMask(cm, VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL);
|
||||
cm = VerSetConditionMask(cm, VER_SERVICEPACKMINOR, VER_GREATER_EQUAL);
|
||||
cm = VerSetConditionMask(cm, VER_PLATFORMID, VER_EQUAL);
|
||||
|
||||
/* Verify the major version number == 4 and platform id == WIN_NT */
|
||||
if(VerifyVersionInfo(&osver, (VER_MAJORVERSION | VER_MINORVERSION |
|
||||
VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR |
|
||||
VER_PLATFORMID),
|
||||
cm))
|
||||
securityDll = TRUE;
|
||||
#endif
|
||||
|
||||
/* Load SSPI dll into the address space of the calling process */
|
||||
if(securityDll)
|
||||
s_hSecDll = Curl_load_library(TEXT("security.dll"));
|
||||
else
|
||||
s_hSecDll = Curl_load_library(TEXT("secur32.dll"));
|
||||
if(!s_hSecDll)
|
||||
return CURLE_FAILED_INIT;
|
||||
|
||||
/* Get address of the InitSecurityInterfaceA function from the SSPI dll */
|
||||
pInitSecurityInterface = (INITSECURITYINTERFACE_FN)
|
||||
GetProcAddress(s_hSecDll, SECURITYENTRYPOINT);
|
||||
if(!pInitSecurityInterface)
|
||||
return CURLE_FAILED_INIT;
|
||||
|
||||
/* Get pointer to Security Service Provider Interface dispatch table */
|
||||
s_pSecFn = pInitSecurityInterface();
|
||||
if(!s_pSecFn)
|
||||
return CURLE_FAILED_INIT;
|
||||
}
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_sspi_global_cleanup()
|
||||
*
|
||||
* This deinitializes the Security Service Provider Interface from libcurl.
|
||||
*/
|
||||
|
||||
void Curl_sspi_global_cleanup(void)
|
||||
{
|
||||
if(s_hSecDll) {
|
||||
FreeLibrary(s_hSecDll);
|
||||
s_hSecDll = NULL;
|
||||
s_pSecFn = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_create_sspi_identity()
|
||||
*
|
||||
* This is used to populate a SSPI identity structure based on the supplied
|
||||
* username and password.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* userp [in] - The user name in the format User or Domain\User.
|
||||
* passdwp [in] - The user's password.
|
||||
* identity [in/out] - The identity structure.
|
||||
*
|
||||
* Returns CURLE_OK on success.
|
||||
*/
|
||||
CURLcode Curl_create_sspi_identity(const char *userp, const char *passwdp,
|
||||
SEC_WINNT_AUTH_IDENTITY *identity)
|
||||
{
|
||||
xcharp_u useranddomain;
|
||||
xcharp_u user, dup_user;
|
||||
xcharp_u domain, dup_domain;
|
||||
xcharp_u passwd, dup_passwd;
|
||||
size_t domlen = 0;
|
||||
|
||||
domain.const_tchar_ptr = TEXT("");
|
||||
|
||||
/* Initialize the identity */
|
||||
memset(identity, 0, sizeof(*identity));
|
||||
|
||||
useranddomain.tchar_ptr = Curl_convert_UTF8_to_tchar((char *)userp);
|
||||
if(!useranddomain.tchar_ptr)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
user.const_tchar_ptr = _tcschr(useranddomain.const_tchar_ptr, TEXT('\\'));
|
||||
if(!user.const_tchar_ptr)
|
||||
user.const_tchar_ptr = _tcschr(useranddomain.const_tchar_ptr, TEXT('/'));
|
||||
|
||||
if(user.tchar_ptr) {
|
||||
domain.tchar_ptr = useranddomain.tchar_ptr;
|
||||
domlen = user.tchar_ptr - useranddomain.tchar_ptr;
|
||||
user.tchar_ptr++;
|
||||
}
|
||||
else {
|
||||
user.tchar_ptr = useranddomain.tchar_ptr;
|
||||
domain.const_tchar_ptr = TEXT("");
|
||||
domlen = 0;
|
||||
}
|
||||
|
||||
/* Setup the identity's user and length */
|
||||
dup_user.tchar_ptr = _tcsdup(user.tchar_ptr);
|
||||
if(!dup_user.tchar_ptr) {
|
||||
Curl_unicodefree(useranddomain.tchar_ptr);
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
identity->User = dup_user.tbyte_ptr;
|
||||
identity->UserLength = curlx_uztoul(_tcslen(dup_user.tchar_ptr));
|
||||
dup_user.tchar_ptr = NULL;
|
||||
|
||||
/* Setup the identity's domain and length */
|
||||
dup_domain.tchar_ptr = malloc(sizeof(TCHAR) * (domlen + 1));
|
||||
if(!dup_domain.tchar_ptr) {
|
||||
Curl_unicodefree(useranddomain.tchar_ptr);
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
_tcsncpy(dup_domain.tchar_ptr, domain.tchar_ptr, domlen);
|
||||
*(dup_domain.tchar_ptr + domlen) = TEXT('\0');
|
||||
identity->Domain = dup_domain.tbyte_ptr;
|
||||
identity->DomainLength = curlx_uztoul(domlen);
|
||||
dup_domain.tchar_ptr = NULL;
|
||||
|
||||
Curl_unicodefree(useranddomain.tchar_ptr);
|
||||
|
||||
/* Setup the identity's password and length */
|
||||
passwd.tchar_ptr = Curl_convert_UTF8_to_tchar((char *)passwdp);
|
||||
if(!passwd.tchar_ptr)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
dup_passwd.tchar_ptr = _tcsdup(passwd.tchar_ptr);
|
||||
if(!dup_passwd.tchar_ptr) {
|
||||
Curl_unicodefree(passwd.tchar_ptr);
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
identity->Password = dup_passwd.tbyte_ptr;
|
||||
identity->PasswordLength = curlx_uztoul(_tcslen(dup_passwd.tchar_ptr));
|
||||
dup_passwd.tchar_ptr = NULL;
|
||||
|
||||
Curl_unicodefree(passwd.tchar_ptr);
|
||||
|
||||
/* Setup the identity's flags */
|
||||
identity->Flags = SECFLAG_WINNT_AUTH_IDENTITY;
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
void Curl_sspi_free_identity(SEC_WINNT_AUTH_IDENTITY *identity)
|
||||
{
|
||||
if(identity) {
|
||||
Curl_safefree(identity->User);
|
||||
Curl_safefree(identity->Password);
|
||||
Curl_safefree(identity->Domain);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* USE_WINDOWS_SSPI */
|
|
@ -1,350 +0,0 @@
|
|||
#ifndef HEADER_CURL_SSPI_H
|
||||
#define HEADER_CURL_SSPI_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#ifdef USE_WINDOWS_SSPI
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
/*
|
||||
* When including the following three headers, it is mandatory to define either
|
||||
* SECURITY_WIN32 or SECURITY_KERNEL, indicating who is compiling the code.
|
||||
*/
|
||||
|
||||
#undef SECURITY_WIN32
|
||||
#undef SECURITY_KERNEL
|
||||
#define SECURITY_WIN32 1
|
||||
#include <security.h>
|
||||
#include <sspi.h>
|
||||
#include <rpc.h>
|
||||
|
||||
CURLcode Curl_sspi_global_init(void);
|
||||
void Curl_sspi_global_cleanup(void);
|
||||
|
||||
/* This is used to populate the domain in a SSPI identity structure */
|
||||
CURLcode Curl_override_sspi_http_realm(const char *chlg,
|
||||
SEC_WINNT_AUTH_IDENTITY *identity);
|
||||
|
||||
/* This is used to generate an SSPI identity structure */
|
||||
CURLcode Curl_create_sspi_identity(const char *userp, const char *passwdp,
|
||||
SEC_WINNT_AUTH_IDENTITY *identity);
|
||||
|
||||
/* This is used to free an SSPI identity structure */
|
||||
void Curl_sspi_free_identity(SEC_WINNT_AUTH_IDENTITY *identity);
|
||||
|
||||
/* Forward-declaration of global variables defined in curl_sspi.c */
|
||||
extern HMODULE s_hSecDll;
|
||||
extern PSecurityFunctionTable s_pSecFn;
|
||||
|
||||
/* Provide some definitions missing in old headers */
|
||||
#define SP_NAME_DIGEST "WDigest"
|
||||
#define SP_NAME_NTLM "NTLM"
|
||||
#define SP_NAME_NEGOTIATE "Negotiate"
|
||||
#define SP_NAME_KERBEROS "Kerberos"
|
||||
|
||||
#ifndef ISC_REQ_USE_HTTP_STYLE
|
||||
#define ISC_REQ_USE_HTTP_STYLE 0x01000000
|
||||
#endif
|
||||
|
||||
#ifndef ISC_RET_REPLAY_DETECT
|
||||
#define ISC_RET_REPLAY_DETECT 0x00000004
|
||||
#endif
|
||||
|
||||
#ifndef ISC_RET_SEQUENCE_DETECT
|
||||
#define ISC_RET_SEQUENCE_DETECT 0x00000008
|
||||
#endif
|
||||
|
||||
#ifndef ISC_RET_CONFIDENTIALITY
|
||||
#define ISC_RET_CONFIDENTIALITY 0x00000010
|
||||
#endif
|
||||
|
||||
#ifndef ISC_RET_ALLOCATED_MEMORY
|
||||
#define ISC_RET_ALLOCATED_MEMORY 0x00000100
|
||||
#endif
|
||||
|
||||
#ifndef ISC_RET_STREAM
|
||||
#define ISC_RET_STREAM 0x00008000
|
||||
#endif
|
||||
|
||||
#ifndef SEC_E_INSUFFICIENT_MEMORY
|
||||
# define SEC_E_INSUFFICIENT_MEMORY ((HRESULT)0x80090300L)
|
||||
#endif
|
||||
#ifndef SEC_E_INVALID_HANDLE
|
||||
# define SEC_E_INVALID_HANDLE ((HRESULT)0x80090301L)
|
||||
#endif
|
||||
#ifndef SEC_E_UNSUPPORTED_FUNCTION
|
||||
# define SEC_E_UNSUPPORTED_FUNCTION ((HRESULT)0x80090302L)
|
||||
#endif
|
||||
#ifndef SEC_E_TARGET_UNKNOWN
|
||||
# define SEC_E_TARGET_UNKNOWN ((HRESULT)0x80090303L)
|
||||
#endif
|
||||
#ifndef SEC_E_INTERNAL_ERROR
|
||||
# define SEC_E_INTERNAL_ERROR ((HRESULT)0x80090304L)
|
||||
#endif
|
||||
#ifndef SEC_E_SECPKG_NOT_FOUND
|
||||
# define SEC_E_SECPKG_NOT_FOUND ((HRESULT)0x80090305L)
|
||||
#endif
|
||||
#ifndef SEC_E_NOT_OWNER
|
||||
# define SEC_E_NOT_OWNER ((HRESULT)0x80090306L)
|
||||
#endif
|
||||
#ifndef SEC_E_CANNOT_INSTALL
|
||||
# define SEC_E_CANNOT_INSTALL ((HRESULT)0x80090307L)
|
||||
#endif
|
||||
#ifndef SEC_E_INVALID_TOKEN
|
||||
# define SEC_E_INVALID_TOKEN ((HRESULT)0x80090308L)
|
||||
#endif
|
||||
#ifndef SEC_E_CANNOT_PACK
|
||||
# define SEC_E_CANNOT_PACK ((HRESULT)0x80090309L)
|
||||
#endif
|
||||
#ifndef SEC_E_QOP_NOT_SUPPORTED
|
||||
# define SEC_E_QOP_NOT_SUPPORTED ((HRESULT)0x8009030AL)
|
||||
#endif
|
||||
#ifndef SEC_E_NO_IMPERSONATION
|
||||
# define SEC_E_NO_IMPERSONATION ((HRESULT)0x8009030BL)
|
||||
#endif
|
||||
#ifndef SEC_E_LOGON_DENIED
|
||||
# define SEC_E_LOGON_DENIED ((HRESULT)0x8009030CL)
|
||||
#endif
|
||||
#ifndef SEC_E_UNKNOWN_CREDENTIALS
|
||||
# define SEC_E_UNKNOWN_CREDENTIALS ((HRESULT)0x8009030DL)
|
||||
#endif
|
||||
#ifndef SEC_E_NO_CREDENTIALS
|
||||
# define SEC_E_NO_CREDENTIALS ((HRESULT)0x8009030EL)
|
||||
#endif
|
||||
#ifndef SEC_E_MESSAGE_ALTERED
|
||||
# define SEC_E_MESSAGE_ALTERED ((HRESULT)0x8009030FL)
|
||||
#endif
|
||||
#ifndef SEC_E_OUT_OF_SEQUENCE
|
||||
# define SEC_E_OUT_OF_SEQUENCE ((HRESULT)0x80090310L)
|
||||
#endif
|
||||
#ifndef SEC_E_NO_AUTHENTICATING_AUTHORITY
|
||||
# define SEC_E_NO_AUTHENTICATING_AUTHORITY ((HRESULT)0x80090311L)
|
||||
#endif
|
||||
#ifndef SEC_E_BAD_PKGID
|
||||
# define SEC_E_BAD_PKGID ((HRESULT)0x80090316L)
|
||||
#endif
|
||||
#ifndef SEC_E_CONTEXT_EXPIRED
|
||||
# define SEC_E_CONTEXT_EXPIRED ((HRESULT)0x80090317L)
|
||||
#endif
|
||||
#ifndef SEC_E_INCOMPLETE_MESSAGE
|
||||
# define SEC_E_INCOMPLETE_MESSAGE ((HRESULT)0x80090318L)
|
||||
#endif
|
||||
#ifndef SEC_E_INCOMPLETE_CREDENTIALS
|
||||
# define SEC_E_INCOMPLETE_CREDENTIALS ((HRESULT)0x80090320L)
|
||||
#endif
|
||||
#ifndef SEC_E_BUFFER_TOO_SMALL
|
||||
# define SEC_E_BUFFER_TOO_SMALL ((HRESULT)0x80090321L)
|
||||
#endif
|
||||
#ifndef SEC_E_WRONG_PRINCIPAL
|
||||
# define SEC_E_WRONG_PRINCIPAL ((HRESULT)0x80090322L)
|
||||
#endif
|
||||
#ifndef SEC_E_TIME_SKEW
|
||||
# define SEC_E_TIME_SKEW ((HRESULT)0x80090324L)
|
||||
#endif
|
||||
#ifndef SEC_E_UNTRUSTED_ROOT
|
||||
# define SEC_E_UNTRUSTED_ROOT ((HRESULT)0x80090325L)
|
||||
#endif
|
||||
#ifndef SEC_E_ILLEGAL_MESSAGE
|
||||
# define SEC_E_ILLEGAL_MESSAGE ((HRESULT)0x80090326L)
|
||||
#endif
|
||||
#ifndef SEC_E_CERT_UNKNOWN
|
||||
# define SEC_E_CERT_UNKNOWN ((HRESULT)0x80090327L)
|
||||
#endif
|
||||
#ifndef SEC_E_CERT_EXPIRED
|
||||
# define SEC_E_CERT_EXPIRED ((HRESULT)0x80090328L)
|
||||
#endif
|
||||
#ifndef SEC_E_ENCRYPT_FAILURE
|
||||
# define SEC_E_ENCRYPT_FAILURE ((HRESULT)0x80090329L)
|
||||
#endif
|
||||
#ifndef SEC_E_DECRYPT_FAILURE
|
||||
# define SEC_E_DECRYPT_FAILURE ((HRESULT)0x80090330L)
|
||||
#endif
|
||||
#ifndef SEC_E_ALGORITHM_MISMATCH
|
||||
# define SEC_E_ALGORITHM_MISMATCH ((HRESULT)0x80090331L)
|
||||
#endif
|
||||
#ifndef SEC_E_SECURITY_QOS_FAILED
|
||||
# define SEC_E_SECURITY_QOS_FAILED ((HRESULT)0x80090332L)
|
||||
#endif
|
||||
#ifndef SEC_E_UNFINISHED_CONTEXT_DELETED
|
||||
# define SEC_E_UNFINISHED_CONTEXT_DELETED ((HRESULT)0x80090333L)
|
||||
#endif
|
||||
#ifndef SEC_E_NO_TGT_REPLY
|
||||
# define SEC_E_NO_TGT_REPLY ((HRESULT)0x80090334L)
|
||||
#endif
|
||||
#ifndef SEC_E_NO_IP_ADDRESSES
|
||||
# define SEC_E_NO_IP_ADDRESSES ((HRESULT)0x80090335L)
|
||||
#endif
|
||||
#ifndef SEC_E_WRONG_CREDENTIAL_HANDLE
|
||||
# define SEC_E_WRONG_CREDENTIAL_HANDLE ((HRESULT)0x80090336L)
|
||||
#endif
|
||||
#ifndef SEC_E_CRYPTO_SYSTEM_INVALID
|
||||
# define SEC_E_CRYPTO_SYSTEM_INVALID ((HRESULT)0x80090337L)
|
||||
#endif
|
||||
#ifndef SEC_E_MAX_REFERRALS_EXCEEDED
|
||||
# define SEC_E_MAX_REFERRALS_EXCEEDED ((HRESULT)0x80090338L)
|
||||
#endif
|
||||
#ifndef SEC_E_MUST_BE_KDC
|
||||
# define SEC_E_MUST_BE_KDC ((HRESULT)0x80090339L)
|
||||
#endif
|
||||
#ifndef SEC_E_STRONG_CRYPTO_NOT_SUPPORTED
|
||||
# define SEC_E_STRONG_CRYPTO_NOT_SUPPORTED ((HRESULT)0x8009033AL)
|
||||
#endif
|
||||
#ifndef SEC_E_TOO_MANY_PRINCIPALS
|
||||
# define SEC_E_TOO_MANY_PRINCIPALS ((HRESULT)0x8009033BL)
|
||||
#endif
|
||||
#ifndef SEC_E_NO_PA_DATA
|
||||
# define SEC_E_NO_PA_DATA ((HRESULT)0x8009033CL)
|
||||
#endif
|
||||
#ifndef SEC_E_PKINIT_NAME_MISMATCH
|
||||
# define SEC_E_PKINIT_NAME_MISMATCH ((HRESULT)0x8009033DL)
|
||||
#endif
|
||||
#ifndef SEC_E_SMARTCARD_LOGON_REQUIRED
|
||||
# define SEC_E_SMARTCARD_LOGON_REQUIRED ((HRESULT)0x8009033EL)
|
||||
#endif
|
||||
#ifndef SEC_E_SHUTDOWN_IN_PROGRESS
|
||||
# define SEC_E_SHUTDOWN_IN_PROGRESS ((HRESULT)0x8009033FL)
|
||||
#endif
|
||||
#ifndef SEC_E_KDC_INVALID_REQUEST
|
||||
# define SEC_E_KDC_INVALID_REQUEST ((HRESULT)0x80090340L)
|
||||
#endif
|
||||
#ifndef SEC_E_KDC_UNABLE_TO_REFER
|
||||
# define SEC_E_KDC_UNABLE_TO_REFER ((HRESULT)0x80090341L)
|
||||
#endif
|
||||
#ifndef SEC_E_KDC_UNKNOWN_ETYPE
|
||||
# define SEC_E_KDC_UNKNOWN_ETYPE ((HRESULT)0x80090342L)
|
||||
#endif
|
||||
#ifndef SEC_E_UNSUPPORTED_PREAUTH
|
||||
# define SEC_E_UNSUPPORTED_PREAUTH ((HRESULT)0x80090343L)
|
||||
#endif
|
||||
#ifndef SEC_E_DELEGATION_REQUIRED
|
||||
# define SEC_E_DELEGATION_REQUIRED ((HRESULT)0x80090345L)
|
||||
#endif
|
||||
#ifndef SEC_E_BAD_BINDINGS
|
||||
# define SEC_E_BAD_BINDINGS ((HRESULT)0x80090346L)
|
||||
#endif
|
||||
#ifndef SEC_E_MULTIPLE_ACCOUNTS
|
||||
# define SEC_E_MULTIPLE_ACCOUNTS ((HRESULT)0x80090347L)
|
||||
#endif
|
||||
#ifndef SEC_E_NO_KERB_KEY
|
||||
# define SEC_E_NO_KERB_KEY ((HRESULT)0x80090348L)
|
||||
#endif
|
||||
#ifndef SEC_E_CERT_WRONG_USAGE
|
||||
# define SEC_E_CERT_WRONG_USAGE ((HRESULT)0x80090349L)
|
||||
#endif
|
||||
#ifndef SEC_E_DOWNGRADE_DETECTED
|
||||
# define SEC_E_DOWNGRADE_DETECTED ((HRESULT)0x80090350L)
|
||||
#endif
|
||||
#ifndef SEC_E_SMARTCARD_CERT_REVOKED
|
||||
# define SEC_E_SMARTCARD_CERT_REVOKED ((HRESULT)0x80090351L)
|
||||
#endif
|
||||
#ifndef SEC_E_ISSUING_CA_UNTRUSTED
|
||||
# define SEC_E_ISSUING_CA_UNTRUSTED ((HRESULT)0x80090352L)
|
||||
#endif
|
||||
#ifndef SEC_E_REVOCATION_OFFLINE_C
|
||||
# define SEC_E_REVOCATION_OFFLINE_C ((HRESULT)0x80090353L)
|
||||
#endif
|
||||
#ifndef SEC_E_PKINIT_CLIENT_FAILURE
|
||||
# define SEC_E_PKINIT_CLIENT_FAILURE ((HRESULT)0x80090354L)
|
||||
#endif
|
||||
#ifndef SEC_E_SMARTCARD_CERT_EXPIRED
|
||||
# define SEC_E_SMARTCARD_CERT_EXPIRED ((HRESULT)0x80090355L)
|
||||
#endif
|
||||
#ifndef SEC_E_NO_S4U_PROT_SUPPORT
|
||||
# define SEC_E_NO_S4U_PROT_SUPPORT ((HRESULT)0x80090356L)
|
||||
#endif
|
||||
#ifndef SEC_E_CROSSREALM_DELEGATION_FAILURE
|
||||
# define SEC_E_CROSSREALM_DELEGATION_FAILURE ((HRESULT)0x80090357L)
|
||||
#endif
|
||||
#ifndef SEC_E_REVOCATION_OFFLINE_KDC
|
||||
# define SEC_E_REVOCATION_OFFLINE_KDC ((HRESULT)0x80090358L)
|
||||
#endif
|
||||
#ifndef SEC_E_ISSUING_CA_UNTRUSTED_KDC
|
||||
# define SEC_E_ISSUING_CA_UNTRUSTED_KDC ((HRESULT)0x80090359L)
|
||||
#endif
|
||||
#ifndef SEC_E_KDC_CERT_EXPIRED
|
||||
# define SEC_E_KDC_CERT_EXPIRED ((HRESULT)0x8009035AL)
|
||||
#endif
|
||||
#ifndef SEC_E_KDC_CERT_REVOKED
|
||||
# define SEC_E_KDC_CERT_REVOKED ((HRESULT)0x8009035BL)
|
||||
#endif
|
||||
#ifndef SEC_E_INVALID_PARAMETER
|
||||
# define SEC_E_INVALID_PARAMETER ((HRESULT)0x8009035DL)
|
||||
#endif
|
||||
#ifndef SEC_E_DELEGATION_POLICY
|
||||
# define SEC_E_DELEGATION_POLICY ((HRESULT)0x8009035EL)
|
||||
#endif
|
||||
#ifndef SEC_E_POLICY_NLTM_ONLY
|
||||
# define SEC_E_POLICY_NLTM_ONLY ((HRESULT)0x8009035FL)
|
||||
#endif
|
||||
|
||||
#ifndef SEC_I_CONTINUE_NEEDED
|
||||
# define SEC_I_CONTINUE_NEEDED ((HRESULT)0x00090312L)
|
||||
#endif
|
||||
#ifndef SEC_I_COMPLETE_NEEDED
|
||||
# define SEC_I_COMPLETE_NEEDED ((HRESULT)0x00090313L)
|
||||
#endif
|
||||
#ifndef SEC_I_COMPLETE_AND_CONTINUE
|
||||
# define SEC_I_COMPLETE_AND_CONTINUE ((HRESULT)0x00090314L)
|
||||
#endif
|
||||
#ifndef SEC_I_LOCAL_LOGON
|
||||
# define SEC_I_LOCAL_LOGON ((HRESULT)0x00090315L)
|
||||
#endif
|
||||
#ifndef SEC_I_CONTEXT_EXPIRED
|
||||
# define SEC_I_CONTEXT_EXPIRED ((HRESULT)0x00090317L)
|
||||
#endif
|
||||
#ifndef SEC_I_INCOMPLETE_CREDENTIALS
|
||||
# define SEC_I_INCOMPLETE_CREDENTIALS ((HRESULT)0x00090320L)
|
||||
#endif
|
||||
#ifndef SEC_I_RENEGOTIATE
|
||||
# define SEC_I_RENEGOTIATE ((HRESULT)0x00090321L)
|
||||
#endif
|
||||
#ifndef SEC_I_NO_LSA_CONTEXT
|
||||
# define SEC_I_NO_LSA_CONTEXT ((HRESULT)0x00090323L)
|
||||
#endif
|
||||
#ifndef SEC_I_SIGNATURE_NEEDED
|
||||
# define SEC_I_SIGNATURE_NEEDED ((HRESULT)0x0009035CL)
|
||||
#endif
|
||||
|
||||
#ifndef CRYPT_E_REVOKED
|
||||
# define CRYPT_E_REVOKED ((HRESULT)0x80092010L)
|
||||
#endif
|
||||
|
||||
#ifdef UNICODE
|
||||
# define SECFLAG_WINNT_AUTH_IDENTITY \
|
||||
(unsigned long)SEC_WINNT_AUTH_IDENTITY_UNICODE
|
||||
#else
|
||||
# define SECFLAG_WINNT_AUTH_IDENTITY \
|
||||
(unsigned long)SEC_WINNT_AUTH_IDENTITY_ANSI
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Definitions required from ntsecapi.h are directly provided below this point
|
||||
* to avoid including ntsecapi.h due to a conflict with OpenSSL's safestack.h
|
||||
*/
|
||||
#define KERB_WRAP_NO_ENCRYPT 0x80000001
|
||||
|
||||
#endif /* USE_WINDOWS_SSPI */
|
||||
|
||||
#endif /* HEADER_CURL_SSPI_H */
|
|
@ -1,138 +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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
#if defined(USE_THREADS_POSIX)
|
||||
# ifdef HAVE_PTHREAD_H
|
||||
# include <pthread.h>
|
||||
# endif
|
||||
#elif defined(USE_THREADS_WIN32)
|
||||
# ifdef HAVE_PROCESS_H
|
||||
# include <process.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include "curl_threads.h"
|
||||
#include "curl_memory.h"
|
||||
/* The last #include file should be: */
|
||||
#include "memdebug.h"
|
||||
|
||||
#if defined(USE_THREADS_POSIX)
|
||||
|
||||
struct curl_actual_call {
|
||||
unsigned int (*func)(void *);
|
||||
void *arg;
|
||||
};
|
||||
|
||||
static void *curl_thread_create_thunk(void *arg)
|
||||
{
|
||||
struct curl_actual_call * ac = arg;
|
||||
unsigned int (*func)(void *) = ac->func;
|
||||
void *real_arg = ac->arg;
|
||||
|
||||
free(ac);
|
||||
|
||||
(*func)(real_arg);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
curl_thread_t Curl_thread_create(unsigned int (*func) (void*), void *arg)
|
||||
{
|
||||
curl_thread_t t = malloc(sizeof(pthread_t));
|
||||
struct curl_actual_call *ac = malloc(sizeof(struct curl_actual_call));
|
||||
if(!(ac && t))
|
||||
goto err;
|
||||
|
||||
ac->func = func;
|
||||
ac->arg = arg;
|
||||
|
||||
if(pthread_create(t, NULL, curl_thread_create_thunk, ac) != 0)
|
||||
goto err;
|
||||
|
||||
return t;
|
||||
|
||||
err:
|
||||
free(t);
|
||||
free(ac);
|
||||
return curl_thread_t_null;
|
||||
}
|
||||
|
||||
void Curl_thread_destroy(curl_thread_t hnd)
|
||||
{
|
||||
if(hnd != curl_thread_t_null) {
|
||||
pthread_detach(*hnd);
|
||||
free(hnd);
|
||||
}
|
||||
}
|
||||
|
||||
int Curl_thread_join(curl_thread_t *hnd)
|
||||
{
|
||||
int ret = (pthread_join(**hnd, NULL) == 0);
|
||||
|
||||
free(*hnd);
|
||||
*hnd = curl_thread_t_null;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#elif defined(USE_THREADS_WIN32)
|
||||
|
||||
curl_thread_t Curl_thread_create(unsigned int (CURL_STDCALL *func) (void*),
|
||||
void *arg)
|
||||
{
|
||||
#ifdef _WIN32_WCE
|
||||
return CreateThread(NULL, 0, func, arg, 0, NULL);
|
||||
#else
|
||||
curl_thread_t t;
|
||||
t = (curl_thread_t)_beginthreadex(NULL, 0, func, arg, 0, NULL);
|
||||
if((t == 0) || (t == (curl_thread_t)-1L))
|
||||
return curl_thread_t_null;
|
||||
return t;
|
||||
#endif
|
||||
}
|
||||
|
||||
void Curl_thread_destroy(curl_thread_t hnd)
|
||||
{
|
||||
CloseHandle(hnd);
|
||||
}
|
||||
|
||||
int Curl_thread_join(curl_thread_t *hnd)
|
||||
{
|
||||
#if !defined(_WIN32_WINNT) || !defined(_WIN32_WINNT_VISTA) || \
|
||||
(_WIN32_WINNT < _WIN32_WINNT_VISTA)
|
||||
int ret = (WaitForSingleObject(*hnd, INFINITE) == WAIT_OBJECT_0);
|
||||
#else
|
||||
int ret = (WaitForSingleObjectEx(*hnd, INFINITE, FALSE) == WAIT_OBJECT_0);
|
||||
#endif
|
||||
|
||||
Curl_thread_destroy(*hnd);
|
||||
|
||||
*hnd = curl_thread_t_null;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* USE_THREADS_* */
|
|
@ -1,62 +0,0 @@
|
|||
#ifndef HEADER_CURL_THREADS_H
|
||||
#define HEADER_CURL_THREADS_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
#include "curl_setup.h"
|
||||
|
||||
#if defined(USE_THREADS_POSIX)
|
||||
# define CURL_STDCALL
|
||||
# define curl_mutex_t pthread_mutex_t
|
||||
# define curl_thread_t pthread_t *
|
||||
# define curl_thread_t_null (pthread_t *)0
|
||||
# define Curl_mutex_init(m) pthread_mutex_init(m, NULL)
|
||||
# define Curl_mutex_acquire(m) pthread_mutex_lock(m)
|
||||
# define Curl_mutex_release(m) pthread_mutex_unlock(m)
|
||||
# define Curl_mutex_destroy(m) pthread_mutex_destroy(m)
|
||||
#elif defined(USE_THREADS_WIN32)
|
||||
# define CURL_STDCALL __stdcall
|
||||
# define curl_mutex_t CRITICAL_SECTION
|
||||
# define curl_thread_t HANDLE
|
||||
# define curl_thread_t_null (HANDLE)0
|
||||
# if !defined(_WIN32_WINNT) || !defined(_WIN32_WINNT_VISTA) || \
|
||||
(_WIN32_WINNT < _WIN32_WINNT_VISTA)
|
||||
# define Curl_mutex_init(m) InitializeCriticalSection(m)
|
||||
# else
|
||||
# define Curl_mutex_init(m) InitializeCriticalSectionEx(m, 0, 1)
|
||||
# endif
|
||||
# define Curl_mutex_acquire(m) EnterCriticalSection(m)
|
||||
# define Curl_mutex_release(m) LeaveCriticalSection(m)
|
||||
# define Curl_mutex_destroy(m) DeleteCriticalSection(m)
|
||||
#endif
|
||||
|
||||
#if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32)
|
||||
|
||||
curl_thread_t Curl_thread_create(unsigned int (CURL_STDCALL *func) (void*),
|
||||
void *arg);
|
||||
|
||||
void Curl_thread_destroy(curl_thread_t hnd);
|
||||
|
||||
int Curl_thread_join(curl_thread_t *hnd);
|
||||
|
||||
#endif /* USE_THREADS_POSIX || USE_THREADS_WIN32 */
|
||||
|
||||
#endif /* HEADER_CURL_THREADS_H */
|
|
@ -1,118 +0,0 @@
|
|||
#ifndef HEADER_CURL_CURLX_H
|
||||
#define HEADER_CURL_CURLX_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/*
|
||||
* Defines protos and includes all header files that provide the curlx_*
|
||||
* functions. The curlx_* functions are not part of the libcurl API, but are
|
||||
* stand-alone functions whose sources can be built and linked by apps if need
|
||||
* be.
|
||||
*/
|
||||
|
||||
#include <curl/mprintf.h>
|
||||
/* this is still a public header file that provides the curl_mprintf()
|
||||
functions while they still are offered publicly. They will be made library-
|
||||
private one day */
|
||||
|
||||
#include "strequal.h"
|
||||
/* "strequal.h" provides the strequal protos */
|
||||
|
||||
#include "strtoofft.h"
|
||||
/* "strtoofft.h" provides this function: curlx_strtoofft(), returns a
|
||||
curl_off_t number from a given string.
|
||||
*/
|
||||
|
||||
#include "timeval.h"
|
||||
/*
|
||||
"timeval.h" sets up a 'struct timeval' even for platforms that otherwise
|
||||
don't have one and has protos for these functions:
|
||||
|
||||
curlx_tvnow()
|
||||
curlx_tvdiff()
|
||||
curlx_tvdiff_secs()
|
||||
*/
|
||||
|
||||
#include "nonblock.h"
|
||||
/* "nonblock.h" provides curlx_nonblock() */
|
||||
|
||||
#include "warnless.h"
|
||||
/* "warnless.h" provides functions:
|
||||
|
||||
curlx_ultous()
|
||||
curlx_ultouc()
|
||||
curlx_uztosi()
|
||||
*/
|
||||
|
||||
/* Now setup curlx_ * names for the functions that are to become curlx_ and
|
||||
be removed from a future libcurl official API:
|
||||
curlx_getenv
|
||||
curlx_mprintf (and its variations)
|
||||
curlx_strequal
|
||||
curlx_strnequal
|
||||
|
||||
*/
|
||||
|
||||
#define curlx_getenv curl_getenv
|
||||
#define curlx_strequal curl_strequal
|
||||
#define curlx_strnequal curl_strnequal
|
||||
#define curlx_raw_equal Curl_raw_equal
|
||||
#define curlx_mvsnprintf curl_mvsnprintf
|
||||
#define curlx_msnprintf curl_msnprintf
|
||||
#define curlx_maprintf curl_maprintf
|
||||
#define curlx_mvaprintf curl_mvaprintf
|
||||
#define curlx_msprintf curl_msprintf
|
||||
#define curlx_mprintf curl_mprintf
|
||||
#define curlx_mfprintf curl_mfprintf
|
||||
#define curlx_mvsprintf curl_mvsprintf
|
||||
#define curlx_mvprintf curl_mvprintf
|
||||
#define curlx_mvfprintf curl_mvfprintf
|
||||
|
||||
#ifdef ENABLE_CURLX_PRINTF
|
||||
/* If this define is set, we define all "standard" printf() functions to use
|
||||
the curlx_* version instead. It makes the source code transparent and
|
||||
easier to understand/patch. Undefine them first. */
|
||||
# undef printf
|
||||
# undef fprintf
|
||||
# undef sprintf
|
||||
# undef snprintf
|
||||
# undef vprintf
|
||||
# undef vfprintf
|
||||
# undef vsprintf
|
||||
# undef vsnprintf
|
||||
# undef aprintf
|
||||
# undef vaprintf
|
||||
|
||||
# define printf curlx_mprintf
|
||||
# define fprintf curlx_mfprintf
|
||||
# define sprintf curlx_msprintf
|
||||
# define snprintf curlx_msnprintf
|
||||
# define vprintf curlx_mvprintf
|
||||
# define vfprintf curlx_mvfprintf
|
||||
# define vsprintf curlx_mvsprintf
|
||||
# define vsnprintf curlx_mvsnprintf
|
||||
# define aprintf curlx_maprintf
|
||||
# define vaprintf curlx_mvaprintf
|
||||
#endif /* ENABLE_CURLX_PRINTF */
|
||||
|
||||
#endif /* HEADER_CURL_CURLX_H */
|
||||
|
|
@ -1,279 +0,0 @@
|
|||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#ifndef CURL_DISABLE_DICT
|
||||
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_NET_IF_H
|
||||
#include <net/if.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_IOCTL_H
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
|
||||
#include "urldata.h"
|
||||
#include <curl/curl.h>
|
||||
#include "transfer.h"
|
||||
#include "sendf.h"
|
||||
|
||||
#include "progress.h"
|
||||
#include "strequal.h"
|
||||
#include "dict.h"
|
||||
#include "rawstr.h"
|
||||
#include "curl_memory.h"
|
||||
/* The last #include file should be: */
|
||||
#include "memdebug.h"
|
||||
|
||||
/*
|
||||
* Forward declarations.
|
||||
*/
|
||||
|
||||
static CURLcode dict_do(struct connectdata *conn, bool *done);
|
||||
|
||||
/*
|
||||
* DICT protocol handler.
|
||||
*/
|
||||
|
||||
const struct Curl_handler Curl_handler_dict = {
|
||||
"DICT", /* scheme */
|
||||
ZERO_NULL, /* setup_connection */
|
||||
dict_do, /* do_it */
|
||||
ZERO_NULL, /* done */
|
||||
ZERO_NULL, /* do_more */
|
||||
ZERO_NULL, /* connect_it */
|
||||
ZERO_NULL, /* connecting */
|
||||
ZERO_NULL, /* doing */
|
||||
ZERO_NULL, /* proto_getsock */
|
||||
ZERO_NULL, /* doing_getsock */
|
||||
ZERO_NULL, /* domore_getsock */
|
||||
ZERO_NULL, /* perform_getsock */
|
||||
ZERO_NULL, /* disconnect */
|
||||
ZERO_NULL, /* readwrite */
|
||||
PORT_DICT, /* defport */
|
||||
CURLPROTO_DICT, /* protocol */
|
||||
PROTOPT_NONE | PROTOPT_NOURLQUERY /* flags */
|
||||
};
|
||||
|
||||
static char *unescape_word(struct SessionHandle *data, const char *inputbuff)
|
||||
{
|
||||
char *newp;
|
||||
char *dictp;
|
||||
char *ptr;
|
||||
int len;
|
||||
char ch;
|
||||
int olen=0;
|
||||
|
||||
newp = curl_easy_unescape(data, inputbuff, 0, &len);
|
||||
if(!newp)
|
||||
return NULL;
|
||||
|
||||
dictp = malloc(((size_t)len)*2 + 1); /* add one for terminating zero */
|
||||
if(dictp) {
|
||||
/* According to RFC2229 section 2.2, these letters need to be escaped with
|
||||
\[letter] */
|
||||
for(ptr = newp;
|
||||
(ch = *ptr) != 0;
|
||||
ptr++) {
|
||||
if((ch <= 32) || (ch == 127) ||
|
||||
(ch == '\'') || (ch == '\"') || (ch == '\\')) {
|
||||
dictp[olen++] = '\\';
|
||||
}
|
||||
dictp[olen++] = ch;
|
||||
}
|
||||
dictp[olen]=0;
|
||||
}
|
||||
free(newp);
|
||||
return dictp;
|
||||
}
|
||||
|
||||
static CURLcode dict_do(struct connectdata *conn, bool *done)
|
||||
{
|
||||
char *word;
|
||||
char *eword;
|
||||
char *ppath;
|
||||
char *database = NULL;
|
||||
char *strategy = NULL;
|
||||
char *nthdef = NULL; /* This is not part of the protocol, but required
|
||||
by RFC 2229 */
|
||||
CURLcode result=CURLE_OK;
|
||||
struct SessionHandle *data=conn->data;
|
||||
curl_socket_t sockfd = conn->sock[FIRSTSOCKET];
|
||||
|
||||
char *path = data->state.path;
|
||||
curl_off_t *bytecount = &data->req.bytecount;
|
||||
|
||||
*done = TRUE; /* unconditionally */
|
||||
|
||||
if(conn->bits.user_passwd) {
|
||||
/* AUTH is missing */
|
||||
}
|
||||
|
||||
if(Curl_raw_nequal(path, DICT_MATCH, sizeof(DICT_MATCH)-1) ||
|
||||
Curl_raw_nequal(path, DICT_MATCH2, sizeof(DICT_MATCH2)-1) ||
|
||||
Curl_raw_nequal(path, DICT_MATCH3, sizeof(DICT_MATCH3)-1)) {
|
||||
|
||||
word = strchr(path, ':');
|
||||
if(word) {
|
||||
word++;
|
||||
database = strchr(word, ':');
|
||||
if(database) {
|
||||
*database++ = (char)0;
|
||||
strategy = strchr(database, ':');
|
||||
if(strategy) {
|
||||
*strategy++ = (char)0;
|
||||
nthdef = strchr(strategy, ':');
|
||||
if(nthdef) {
|
||||
*nthdef = (char)0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if((word == NULL) || (*word == (char)0)) {
|
||||
infof(data, "lookup word is missing\n");
|
||||
word=(char *)"default";
|
||||
}
|
||||
if((database == NULL) || (*database == (char)0)) {
|
||||
database = (char *)"!";
|
||||
}
|
||||
if((strategy == NULL) || (*strategy == (char)0)) {
|
||||
strategy = (char *)".";
|
||||
}
|
||||
|
||||
eword = unescape_word(data, word);
|
||||
if(!eword)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
result = Curl_sendf(sockfd, conn,
|
||||
"CLIENT " LIBCURL_NAME " " LIBCURL_VERSION "\r\n"
|
||||
"MATCH "
|
||||
"%s " /* database */
|
||||
"%s " /* strategy */
|
||||
"%s\r\n" /* word */
|
||||
"QUIT\r\n",
|
||||
|
||||
database,
|
||||
strategy,
|
||||
eword
|
||||
);
|
||||
|
||||
free(eword);
|
||||
|
||||
if(result) {
|
||||
failf(data, "Failed sending DICT request");
|
||||
return result;
|
||||
}
|
||||
Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount,
|
||||
-1, NULL); /* no upload */
|
||||
}
|
||||
else if(Curl_raw_nequal(path, DICT_DEFINE, sizeof(DICT_DEFINE)-1) ||
|
||||
Curl_raw_nequal(path, DICT_DEFINE2, sizeof(DICT_DEFINE2)-1) ||
|
||||
Curl_raw_nequal(path, DICT_DEFINE3, sizeof(DICT_DEFINE3)-1)) {
|
||||
|
||||
word = strchr(path, ':');
|
||||
if(word) {
|
||||
word++;
|
||||
database = strchr(word, ':');
|
||||
if(database) {
|
||||
*database++ = (char)0;
|
||||
nthdef = strchr(database, ':');
|
||||
if(nthdef) {
|
||||
*nthdef = (char)0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if((word == NULL) || (*word == (char)0)) {
|
||||
infof(data, "lookup word is missing\n");
|
||||
word=(char *)"default";
|
||||
}
|
||||
if((database == NULL) || (*database == (char)0)) {
|
||||
database = (char *)"!";
|
||||
}
|
||||
|
||||
eword = unescape_word(data, word);
|
||||
if(!eword)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
result = Curl_sendf(sockfd, conn,
|
||||
"CLIENT " LIBCURL_NAME " " LIBCURL_VERSION "\r\n"
|
||||
"DEFINE "
|
||||
"%s " /* database */
|
||||
"%s\r\n" /* word */
|
||||
"QUIT\r\n",
|
||||
database,
|
||||
eword);
|
||||
|
||||
free(eword);
|
||||
|
||||
if(result) {
|
||||
failf(data, "Failed sending DICT request");
|
||||
return result;
|
||||
}
|
||||
Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount,
|
||||
-1, NULL); /* no upload */
|
||||
}
|
||||
else {
|
||||
|
||||
ppath = strchr(path, '/');
|
||||
if(ppath) {
|
||||
int i;
|
||||
|
||||
ppath++;
|
||||
for(i = 0; ppath[i]; i++) {
|
||||
if(ppath[i] == ':')
|
||||
ppath[i] = ' ';
|
||||
}
|
||||
result = Curl_sendf(sockfd, conn,
|
||||
"CLIENT " LIBCURL_NAME " " LIBCURL_VERSION "\r\n"
|
||||
"%s\r\n"
|
||||
"QUIT\r\n", ppath);
|
||||
if(result) {
|
||||
failf(data, "Failed sending DICT request");
|
||||
return result;
|
||||
}
|
||||
|
||||
Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount, -1, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
#endif /*CURL_DISABLE_DICT*/
|
|
@ -1,29 +0,0 @@
|
|||
#ifndef HEADER_CURL_DICT_H
|
||||
#define HEADER_CURL_DICT_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2009, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef CURL_DISABLE_DICT
|
||||
extern const struct Curl_handler Curl_handler_dict;
|
||||
#endif
|
||||
|
||||
#endif /* HEADER_CURL_DICT_H */
|
|
@ -1,179 +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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
#include "dotdot.h"
|
||||
#include "curl_memory.h"
|
||||
|
||||
/* The last #include file should be: */
|
||||
#include "memdebug.h"
|
||||
|
||||
/*
|
||||
* "Remove Dot Segments"
|
||||
* https://tools.ietf.org/html/rfc3986#section-5.2.4
|
||||
*/
|
||||
|
||||
/*
|
||||
* Curl_dedotdotify()
|
||||
* @unittest: 1395
|
||||
*
|
||||
* This function gets a zero-terminated path with dot and dotdot sequences
|
||||
* passed in and strips them off according to the rules in RFC 3986 section
|
||||
* 5.2.4.
|
||||
*
|
||||
* The function handles a query part ('?' + stuff) appended but it expects
|
||||
* that fragments ('#' + stuff) have already been cut off.
|
||||
*
|
||||
* RETURNS
|
||||
*
|
||||
* an allocated dedotdotified output string
|
||||
*/
|
||||
char *Curl_dedotdotify(const char *input)
|
||||
{
|
||||
size_t inlen = strlen(input);
|
||||
char *clone;
|
||||
size_t clen = inlen; /* the length of the cloned input */
|
||||
char *out = malloc(inlen+1);
|
||||
char *outptr;
|
||||
char *orgclone;
|
||||
char *queryp;
|
||||
if(!out)
|
||||
return NULL; /* out of memory */
|
||||
|
||||
/* get a cloned copy of the input */
|
||||
clone = strdup(input);
|
||||
if(!clone) {
|
||||
free(out);
|
||||
return NULL;
|
||||
}
|
||||
orgclone = clone;
|
||||
outptr = out;
|
||||
|
||||
if(!*clone) {
|
||||
/* zero length string, return that */
|
||||
free(out);
|
||||
return clone;
|
||||
}
|
||||
|
||||
/*
|
||||
* To handle query-parts properly, we must find it and remove it during the
|
||||
* dotdot-operation and then append it again at the end to the output
|
||||
* string.
|
||||
*/
|
||||
queryp = strchr(clone, '?');
|
||||
if(queryp)
|
||||
*queryp = 0;
|
||||
|
||||
do {
|
||||
|
||||
/* A. If the input buffer begins with a prefix of "../" or "./", then
|
||||
remove that prefix from the input buffer; otherwise, */
|
||||
|
||||
if(!strncmp("./", clone, 2)) {
|
||||
clone+=2;
|
||||
clen-=2;
|
||||
}
|
||||
else if(!strncmp("../", clone, 3)) {
|
||||
clone+=3;
|
||||
clen-=3;
|
||||
}
|
||||
|
||||
/* B. if the input buffer begins with a prefix of "/./" or "/.", where
|
||||
"." is a complete path segment, then replace that prefix with "/" in
|
||||
the input buffer; otherwise, */
|
||||
else if(!strncmp("/./", clone, 3)) {
|
||||
clone+=2;
|
||||
clen-=2;
|
||||
}
|
||||
else if(!strcmp("/.", clone)) {
|
||||
clone[1]='/';
|
||||
clone++;
|
||||
clen-=1;
|
||||
}
|
||||
|
||||
/* C. if the input buffer begins with a prefix of "/../" or "/..", where
|
||||
".." is a complete path segment, then replace that prefix with "/" in
|
||||
the input buffer and remove the last segment and its preceding "/" (if
|
||||
any) from the output buffer; otherwise, */
|
||||
|
||||
else if(!strncmp("/../", clone, 4)) {
|
||||
clone+=3;
|
||||
clen-=3;
|
||||
/* remove the last segment from the output buffer */
|
||||
while(outptr > out) {
|
||||
outptr--;
|
||||
if(*outptr == '/')
|
||||
break;
|
||||
}
|
||||
*outptr = 0; /* zero-terminate where it stops */
|
||||
}
|
||||
else if(!strcmp("/..", clone)) {
|
||||
clone[2]='/';
|
||||
clone+=2;
|
||||
clen-=2;
|
||||
/* remove the last segment from the output buffer */
|
||||
while(outptr > out) {
|
||||
outptr--;
|
||||
if(*outptr == '/')
|
||||
break;
|
||||
}
|
||||
*outptr = 0; /* zero-terminate where it stops */
|
||||
}
|
||||
|
||||
/* D. if the input buffer consists only of "." or "..", then remove
|
||||
that from the input buffer; otherwise, */
|
||||
|
||||
else if(!strcmp(".", clone) || !strcmp("..", clone)) {
|
||||
*clone=0;
|
||||
}
|
||||
|
||||
else {
|
||||
/* E. move the first path segment in the input buffer to the end of
|
||||
the output buffer, including the initial "/" character (if any) and
|
||||
any subsequent characters up to, but not including, the next "/"
|
||||
character or the end of the input buffer. */
|
||||
|
||||
do {
|
||||
*outptr++ = *clone++;
|
||||
clen--;
|
||||
} while(*clone && (*clone != '/'));
|
||||
*outptr = 0;
|
||||
}
|
||||
|
||||
} while(*clone);
|
||||
|
||||
if(queryp) {
|
||||
size_t qlen;
|
||||
/* There was a query part, append that to the output. The 'clone' string
|
||||
may now have been altered so we copy from the original input string
|
||||
from the correct index. */
|
||||
size_t oindex = queryp - orgclone;
|
||||
qlen = strlen(&input[oindex]);
|
||||
memcpy(outptr, &input[oindex], qlen+1); /* include the ending zero byte */
|
||||
}
|
||||
|
||||
free(orgclone);
|
||||
return out;
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
#ifndef HEADER_CURL_DOTDOT_H
|
||||
#define HEADER_CURL_DOTDOT_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
char *Curl_dedotdotify(const char *input);
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
|
@ -1,33 +0,0 @@
|
|||
#ifndef HEADER_CURL_EASYIF_H
|
||||
#define HEADER_CURL_EASYIF_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/*
|
||||
* Prototypes for library-wide functions provided by easy.c
|
||||
*/
|
||||
#ifdef CURLDEBUG
|
||||
CURL_EXTERN CURLcode curl_easy_perform_ev(CURL *easy);
|
||||
#endif
|
||||
|
||||
#endif /* HEADER_CURL_EASYIF_H */
|
||||
|
|
@ -1,230 +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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* Escape and unescape URL encoding in strings. The functions return a new
|
||||
* allocated string or NULL if an error occurred. */
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
#include "urldata.h"
|
||||
#include "warnless.h"
|
||||
#include "non-ascii.h"
|
||||
#include "escape.h"
|
||||
/* The last 3 #include files should be in this order */
|
||||
#include "curl_printf.h"
|
||||
#include "curl_memory.h"
|
||||
#include "memdebug.h"
|
||||
|
||||
/* Portable character check (remember EBCDIC). Do not use isalnum() because
|
||||
its behavior is altered by the current locale.
|
||||
See https://tools.ietf.org/html/rfc3986#section-2.3
|
||||
*/
|
||||
static bool Curl_isunreserved(unsigned char in)
|
||||
{
|
||||
switch (in) {
|
||||
case '0': case '1': case '2': case '3': case '4':
|
||||
case '5': case '6': case '7': case '8': case '9':
|
||||
case 'a': case 'b': case 'c': case 'd': case 'e':
|
||||
case 'f': case 'g': case 'h': case 'i': case 'j':
|
||||
case 'k': case 'l': case 'm': case 'n': case 'o':
|
||||
case 'p': case 'q': case 'r': case 's': case 't':
|
||||
case 'u': case 'v': case 'w': case 'x': case 'y': case 'z':
|
||||
case 'A': case 'B': case 'C': case 'D': case 'E':
|
||||
case 'F': case 'G': case 'H': case 'I': case 'J':
|
||||
case 'K': case 'L': case 'M': case 'N': case 'O':
|
||||
case 'P': case 'Q': case 'R': case 'S': case 'T':
|
||||
case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z':
|
||||
case '-': case '.': case '_': case '~':
|
||||
return TRUE;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* for ABI-compatibility with previous versions */
|
||||
char *curl_escape(const char *string, int inlength)
|
||||
{
|
||||
return curl_easy_escape(NULL, string, inlength);
|
||||
}
|
||||
|
||||
/* for ABI-compatibility with previous versions */
|
||||
char *curl_unescape(const char *string, int length)
|
||||
{
|
||||
return curl_easy_unescape(NULL, string, length, NULL);
|
||||
}
|
||||
|
||||
char *curl_easy_escape(CURL *handle, const char *string, int inlength)
|
||||
{
|
||||
size_t alloc = (inlength?(size_t)inlength:strlen(string))+1;
|
||||
char *ns;
|
||||
char *testing_ptr = NULL;
|
||||
unsigned char in; /* we need to treat the characters unsigned */
|
||||
size_t newlen = alloc;
|
||||
size_t strindex=0;
|
||||
size_t length;
|
||||
CURLcode result;
|
||||
|
||||
ns = malloc(alloc);
|
||||
if(!ns)
|
||||
return NULL;
|
||||
|
||||
length = alloc-1;
|
||||
while(length--) {
|
||||
in = *string;
|
||||
|
||||
if(Curl_isunreserved(in))
|
||||
/* just copy this */
|
||||
ns[strindex++]=in;
|
||||
else {
|
||||
/* encode it */
|
||||
newlen += 2; /* the size grows with two, since this'll become a %XX */
|
||||
if(newlen > alloc) {
|
||||
alloc *= 2;
|
||||
testing_ptr = realloc(ns, alloc);
|
||||
if(!testing_ptr) {
|
||||
free(ns);
|
||||
return NULL;
|
||||
}
|
||||
else {
|
||||
ns = testing_ptr;
|
||||
}
|
||||
}
|
||||
|
||||
result = Curl_convert_to_network(handle, &in, 1);
|
||||
if(result) {
|
||||
/* Curl_convert_to_network calls failf if unsuccessful */
|
||||
free(ns);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
snprintf(&ns[strindex], 4, "%%%02X", in);
|
||||
|
||||
strindex+=3;
|
||||
}
|
||||
string++;
|
||||
}
|
||||
ns[strindex]=0; /* terminate it */
|
||||
return ns;
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_urldecode() URL decodes the given string.
|
||||
*
|
||||
* Optionally detects control characters (byte codes lower than 32) in the
|
||||
* data and rejects such data.
|
||||
*
|
||||
* Returns a pointer to a malloced string in *ostring with length given in
|
||||
* *olen. If length == 0, the length is assumed to be strlen(string).
|
||||
*
|
||||
*/
|
||||
CURLcode Curl_urldecode(struct SessionHandle *data,
|
||||
const char *string, size_t length,
|
||||
char **ostring, size_t *olen,
|
||||
bool reject_ctrl)
|
||||
{
|
||||
size_t alloc = (length?length:strlen(string))+1;
|
||||
char *ns = malloc(alloc);
|
||||
unsigned char in;
|
||||
size_t strindex=0;
|
||||
unsigned long hex;
|
||||
CURLcode result;
|
||||
|
||||
if(!ns)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
while(--alloc > 0) {
|
||||
in = *string;
|
||||
if(('%' == in) && (alloc > 2) &&
|
||||
ISXDIGIT(string[1]) && ISXDIGIT(string[2])) {
|
||||
/* this is two hexadecimal digits following a '%' */
|
||||
char hexstr[3];
|
||||
char *ptr;
|
||||
hexstr[0] = string[1];
|
||||
hexstr[1] = string[2];
|
||||
hexstr[2] = 0;
|
||||
|
||||
hex = strtoul(hexstr, &ptr, 16);
|
||||
|
||||
in = curlx_ultouc(hex); /* this long is never bigger than 255 anyway */
|
||||
|
||||
result = Curl_convert_from_network(data, &in, 1);
|
||||
if(result) {
|
||||
/* Curl_convert_from_network calls failf if unsuccessful */
|
||||
free(ns);
|
||||
return result;
|
||||
}
|
||||
|
||||
string+=2;
|
||||
alloc-=2;
|
||||
}
|
||||
|
||||
if(reject_ctrl && (in < 0x20)) {
|
||||
free(ns);
|
||||
return CURLE_URL_MALFORMAT;
|
||||
}
|
||||
|
||||
ns[strindex++] = in;
|
||||
string++;
|
||||
}
|
||||
ns[strindex]=0; /* terminate it */
|
||||
|
||||
if(olen)
|
||||
/* store output size */
|
||||
*olen = strindex;
|
||||
|
||||
/* store output string */
|
||||
*ostring = ns;
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Unescapes the given URL escaped string of given length. Returns a
|
||||
* pointer to a malloced string with length given in *olen.
|
||||
* If length == 0, the length is assumed to be strlen(string).
|
||||
* If olen == NULL, no output length is stored.
|
||||
*/
|
||||
char *curl_easy_unescape(CURL *handle, const char *string, int length,
|
||||
int *olen)
|
||||
{
|
||||
char *str = NULL;
|
||||
size_t inputlen = length;
|
||||
size_t outputlen;
|
||||
CURLcode res = Curl_urldecode(handle, string, inputlen, &str, &outputlen,
|
||||
FALSE);
|
||||
if(res)
|
||||
return NULL;
|
||||
if(olen)
|
||||
*olen = curlx_uztosi(outputlen);
|
||||
return str;
|
||||
}
|
||||
|
||||
/* For operating systems/environments that use different malloc/free
|
||||
systems for the app and for this library, we provide a free that uses
|
||||
the library's memory system */
|
||||
void curl_free(void *p)
|
||||
{
|
||||
free(p);
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
#ifndef HEADER_CURL_ESCAPE_H
|
||||
#define HEADER_CURL_ESCAPE_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
/* Escape and unescape URL encoding in strings. The functions return a new
|
||||
* allocated string or NULL if an error occurred. */
|
||||
|
||||
CURLcode Curl_urldecode(struct SessionHandle *data,
|
||||
const char *string, size_t length,
|
||||
char **ostring, size_t *olen,
|
||||
bool reject_crlf);
|
||||
|
||||
#endif /* HEADER_CURL_ESCAPE_H */
|
||||
|
|
@ -1,593 +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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#ifndef CURL_DISABLE_FILE
|
||||
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_NET_IF_H
|
||||
#include <net/if.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_IOCTL_H
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#include "strtoofft.h"
|
||||
#include "urldata.h"
|
||||
#include <curl/curl.h>
|
||||
#include "progress.h"
|
||||
#include "sendf.h"
|
||||
#include "escape.h"
|
||||
#include "file.h"
|
||||
#include "speedcheck.h"
|
||||
#include "getinfo.h"
|
||||
#include "transfer.h"
|
||||
#include "url.h"
|
||||
#include "parsedate.h" /* for the week day and month names */
|
||||
#include "warnless.h"
|
||||
/* The last 3 #include files should be in this order */
|
||||
#include "curl_printf.h"
|
||||
#include "curl_memory.h"
|
||||
#include "memdebug.h"
|
||||
|
||||
#if defined(WIN32) || defined(MSDOS) || defined(__EMX__) || \
|
||||
defined(__SYMBIAN32__)
|
||||
#define DOS_FILESYSTEM 1
|
||||
#endif
|
||||
|
||||
#ifdef OPEN_NEEDS_ARG3
|
||||
# define open_readonly(p,f) open((p),(f),(0))
|
||||
#else
|
||||
# define open_readonly(p,f) open((p),(f))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Forward declarations.
|
||||
*/
|
||||
|
||||
static CURLcode file_do(struct connectdata *, bool *done);
|
||||
static CURLcode file_done(struct connectdata *conn,
|
||||
CURLcode status, bool premature);
|
||||
static CURLcode file_connect(struct connectdata *conn, bool *done);
|
||||
static CURLcode file_disconnect(struct connectdata *conn,
|
||||
bool dead_connection);
|
||||
static CURLcode file_setup_connection(struct connectdata *conn);
|
||||
|
||||
/*
|
||||
* FILE scheme handler.
|
||||
*/
|
||||
|
||||
const struct Curl_handler Curl_handler_file = {
|
||||
"FILE", /* scheme */
|
||||
file_setup_connection, /* setup_connection */
|
||||
file_do, /* do_it */
|
||||
file_done, /* done */
|
||||
ZERO_NULL, /* do_more */
|
||||
file_connect, /* connect_it */
|
||||
ZERO_NULL, /* connecting */
|
||||
ZERO_NULL, /* doing */
|
||||
ZERO_NULL, /* proto_getsock */
|
||||
ZERO_NULL, /* doing_getsock */
|
||||
ZERO_NULL, /* domore_getsock */
|
||||
ZERO_NULL, /* perform_getsock */
|
||||
file_disconnect, /* disconnect */
|
||||
ZERO_NULL, /* readwrite */
|
||||
0, /* defport */
|
||||
CURLPROTO_FILE, /* protocol */
|
||||
PROTOPT_NONETWORK | PROTOPT_NOURLQUERY /* flags */
|
||||
};
|
||||
|
||||
|
||||
static CURLcode file_setup_connection(struct connectdata *conn)
|
||||
{
|
||||
/* allocate the FILE specific struct */
|
||||
conn->data->req.protop = calloc(1, sizeof(struct FILEPROTO));
|
||||
if(!conn->data->req.protop)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
Check if this is a range download, and if so, set the internal variables
|
||||
properly. This code is copied from the FTP implementation and might as
|
||||
well be factored out.
|
||||
*/
|
||||
static CURLcode file_range(struct connectdata *conn)
|
||||
{
|
||||
curl_off_t from, to;
|
||||
curl_off_t totalsize=-1;
|
||||
char *ptr;
|
||||
char *ptr2;
|
||||
struct SessionHandle *data = conn->data;
|
||||
|
||||
if(data->state.use_range && data->state.range) {
|
||||
from=curlx_strtoofft(data->state.range, &ptr, 0);
|
||||
while(*ptr && (ISSPACE(*ptr) || (*ptr=='-')))
|
||||
ptr++;
|
||||
to=curlx_strtoofft(ptr, &ptr2, 0);
|
||||
if(ptr == ptr2) {
|
||||
/* we didn't get any digit */
|
||||
to=-1;
|
||||
}
|
||||
if((-1 == to) && (from>=0)) {
|
||||
/* X - */
|
||||
data->state.resume_from = from;
|
||||
DEBUGF(infof(data, "RANGE %" CURL_FORMAT_CURL_OFF_T " to end of file\n",
|
||||
from));
|
||||
}
|
||||
else if(from < 0) {
|
||||
/* -Y */
|
||||
data->req.maxdownload = -from;
|
||||
data->state.resume_from = from;
|
||||
DEBUGF(infof(data, "RANGE the last %" CURL_FORMAT_CURL_OFF_T " bytes\n",
|
||||
-from));
|
||||
}
|
||||
else {
|
||||
/* X-Y */
|
||||
totalsize = to-from;
|
||||
data->req.maxdownload = totalsize+1; /* include last byte */
|
||||
data->state.resume_from = from;
|
||||
DEBUGF(infof(data, "RANGE from %" CURL_FORMAT_CURL_OFF_T
|
||||
" getting %" CURL_FORMAT_CURL_OFF_T " bytes\n",
|
||||
from, data->req.maxdownload));
|
||||
}
|
||||
DEBUGF(infof(data, "range-download from %" CURL_FORMAT_CURL_OFF_T
|
||||
" to %" CURL_FORMAT_CURL_OFF_T ", totally %"
|
||||
CURL_FORMAT_CURL_OFF_T " bytes\n",
|
||||
from, to, data->req.maxdownload));
|
||||
}
|
||||
else
|
||||
data->req.maxdownload = -1;
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* file_connect() gets called from Curl_protocol_connect() to allow us to
|
||||
* do protocol-specific actions at connect-time. We emulate a
|
||||
* connect-then-transfer protocol and "connect" to the file here
|
||||
*/
|
||||
static CURLcode file_connect(struct connectdata *conn, bool *done)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
char *real_path;
|
||||
struct FILEPROTO *file = data->req.protop;
|
||||
int fd;
|
||||
#ifdef DOS_FILESYSTEM
|
||||
int i;
|
||||
char *actual_path;
|
||||
#endif
|
||||
int real_path_len;
|
||||
|
||||
real_path = curl_easy_unescape(data, data->state.path, 0, &real_path_len);
|
||||
if(!real_path)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
#ifdef DOS_FILESYSTEM
|
||||
/* If the first character is a slash, and there's
|
||||
something that looks like a drive at the beginning of
|
||||
the path, skip the slash. If we remove the initial
|
||||
slash in all cases, paths without drive letters end up
|
||||
relative to the current directory which isn't how
|
||||
browsers work.
|
||||
|
||||
Some browsers accept | instead of : as the drive letter
|
||||
separator, so we do too.
|
||||
|
||||
On other platforms, we need the slash to indicate an
|
||||
absolute pathname. On Windows, absolute paths start
|
||||
with a drive letter.
|
||||
*/
|
||||
actual_path = real_path;
|
||||
if((actual_path[0] == '/') &&
|
||||
actual_path[1] &&
|
||||
(actual_path[2] == ':' || actual_path[2] == '|')) {
|
||||
actual_path[2] = ':';
|
||||
actual_path++;
|
||||
real_path_len--;
|
||||
}
|
||||
|
||||
/* change path separators from '/' to '\\' for DOS, Windows and OS/2 */
|
||||
for(i=0; i < real_path_len; ++i)
|
||||
if(actual_path[i] == '/')
|
||||
actual_path[i] = '\\';
|
||||
else if(!actual_path[i]) /* binary zero */
|
||||
return CURLE_URL_MALFORMAT;
|
||||
|
||||
fd = open_readonly(actual_path, O_RDONLY|O_BINARY);
|
||||
file->path = actual_path;
|
||||
#else
|
||||
if(memchr(real_path, 0, real_path_len))
|
||||
/* binary zeroes indicate foul play */
|
||||
return CURLE_URL_MALFORMAT;
|
||||
|
||||
fd = open_readonly(real_path, O_RDONLY);
|
||||
file->path = real_path;
|
||||
#endif
|
||||
file->freepath = real_path; /* free this when done */
|
||||
|
||||
file->fd = fd;
|
||||
if(!data->set.upload && (fd == -1)) {
|
||||
failf(data, "Couldn't open file %s", data->state.path);
|
||||
file_done(conn, CURLE_FILE_COULDNT_READ_FILE, FALSE);
|
||||
return CURLE_FILE_COULDNT_READ_FILE;
|
||||
}
|
||||
*done = TRUE;
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static CURLcode file_done(struct connectdata *conn,
|
||||
CURLcode status, bool premature)
|
||||
{
|
||||
struct FILEPROTO *file = conn->data->req.protop;
|
||||
(void)status; /* not used */
|
||||
(void)premature; /* not used */
|
||||
|
||||
if(file) {
|
||||
Curl_safefree(file->freepath);
|
||||
file->path = NULL;
|
||||
if(file->fd != -1)
|
||||
close(file->fd);
|
||||
file->fd = -1;
|
||||
}
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static CURLcode file_disconnect(struct connectdata *conn,
|
||||
bool dead_connection)
|
||||
{
|
||||
struct FILEPROTO *file = conn->data->req.protop;
|
||||
(void)dead_connection; /* not used */
|
||||
|
||||
if(file) {
|
||||
Curl_safefree(file->freepath);
|
||||
file->path = NULL;
|
||||
if(file->fd != -1)
|
||||
close(file->fd);
|
||||
file->fd = -1;
|
||||
}
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
#ifdef DOS_FILESYSTEM
|
||||
#define DIRSEP '\\'
|
||||
#else
|
||||
#define DIRSEP '/'
|
||||
#endif
|
||||
|
||||
static CURLcode file_upload(struct connectdata *conn)
|
||||
{
|
||||
struct FILEPROTO *file = conn->data->req.protop;
|
||||
const char *dir = strchr(file->path, DIRSEP);
|
||||
int fd;
|
||||
int mode;
|
||||
CURLcode result = CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
char *buf = data->state.buffer;
|
||||
size_t nread;
|
||||
size_t nwrite;
|
||||
curl_off_t bytecount = 0;
|
||||
struct timeval now = Curl_tvnow();
|
||||
struct_stat file_stat;
|
||||
const char* buf2;
|
||||
|
||||
/*
|
||||
* Since FILE: doesn't do the full init, we need to provide some extra
|
||||
* assignments here.
|
||||
*/
|
||||
conn->data->req.upload_fromhere = buf;
|
||||
|
||||
if(!dir)
|
||||
return CURLE_FILE_COULDNT_READ_FILE; /* fix: better error code */
|
||||
|
||||
if(!dir[1])
|
||||
return CURLE_FILE_COULDNT_READ_FILE; /* fix: better error code */
|
||||
|
||||
#ifdef O_BINARY
|
||||
#define MODE_DEFAULT O_WRONLY|O_CREAT|O_BINARY
|
||||
#else
|
||||
#define MODE_DEFAULT O_WRONLY|O_CREAT
|
||||
#endif
|
||||
|
||||
if(data->state.resume_from)
|
||||
mode = MODE_DEFAULT|O_APPEND;
|
||||
else
|
||||
mode = MODE_DEFAULT|O_TRUNC;
|
||||
|
||||
fd = open(file->path, mode, conn->data->set.new_file_perms);
|
||||
if(fd < 0) {
|
||||
failf(data, "Can't open %s for writing", file->path);
|
||||
return CURLE_WRITE_ERROR;
|
||||
}
|
||||
|
||||
if(-1 != data->state.infilesize)
|
||||
/* known size of data to "upload" */
|
||||
Curl_pgrsSetUploadSize(data, data->state.infilesize);
|
||||
|
||||
/* treat the negative resume offset value as the case of "-" */
|
||||
if(data->state.resume_from < 0) {
|
||||
if(fstat(fd, &file_stat)) {
|
||||
close(fd);
|
||||
failf(data, "Can't get the size of %s", file->path);
|
||||
return CURLE_WRITE_ERROR;
|
||||
}
|
||||
else
|
||||
data->state.resume_from = (curl_off_t)file_stat.st_size;
|
||||
}
|
||||
|
||||
while(!result) {
|
||||
int readcount;
|
||||
result = Curl_fillreadbuffer(conn, BUFSIZE, &readcount);
|
||||
if(result)
|
||||
break;
|
||||
|
||||
if(readcount <= 0) /* fix questionable compare error. curlvms */
|
||||
break;
|
||||
|
||||
nread = (size_t)readcount;
|
||||
|
||||
/*skip bytes before resume point*/
|
||||
if(data->state.resume_from) {
|
||||
if((curl_off_t)nread <= data->state.resume_from) {
|
||||
data->state.resume_from -= nread;
|
||||
nread = 0;
|
||||
buf2 = buf;
|
||||
}
|
||||
else {
|
||||
buf2 = buf + data->state.resume_from;
|
||||
nread -= (size_t)data->state.resume_from;
|
||||
data->state.resume_from = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
buf2 = buf;
|
||||
|
||||
/* write the data to the target */
|
||||
nwrite = write(fd, buf2, nread);
|
||||
if(nwrite != nread) {
|
||||
result = CURLE_SEND_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
bytecount += nread;
|
||||
|
||||
Curl_pgrsSetUploadCounter(data, bytecount);
|
||||
|
||||
if(Curl_pgrsUpdate(conn))
|
||||
result = CURLE_ABORTED_BY_CALLBACK;
|
||||
else
|
||||
result = Curl_speedcheck(data, now);
|
||||
}
|
||||
if(!result && Curl_pgrsUpdate(conn))
|
||||
result = CURLE_ABORTED_BY_CALLBACK;
|
||||
|
||||
close(fd);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* file_do() is the protocol-specific function for the do-phase, separated
|
||||
* from the connect-phase above. Other protocols merely setup the transfer in
|
||||
* the do-phase, to have it done in the main transfer loop but since some
|
||||
* platforms we support don't allow select()ing etc on file handles (as
|
||||
* opposed to sockets) we instead perform the whole do-operation in this
|
||||
* function.
|
||||
*/
|
||||
static CURLcode file_do(struct connectdata *conn, bool *done)
|
||||
{
|
||||
/* This implementation ignores the host name in conformance with
|
||||
RFC 1738. Only local files (reachable via the standard file system)
|
||||
are supported. This means that files on remotely mounted directories
|
||||
(via NFS, Samba, NT sharing) can be accessed through a file:// URL
|
||||
*/
|
||||
CURLcode result = CURLE_OK;
|
||||
struct_stat statbuf; /* struct_stat instead of struct stat just to allow the
|
||||
Windows version to have a different struct without
|
||||
having to redefine the simple word 'stat' */
|
||||
curl_off_t expected_size=0;
|
||||
bool size_known;
|
||||
bool fstated=FALSE;
|
||||
ssize_t nread;
|
||||
struct SessionHandle *data = conn->data;
|
||||
char *buf = data->state.buffer;
|
||||
curl_off_t bytecount = 0;
|
||||
int fd;
|
||||
struct timeval now = Curl_tvnow();
|
||||
struct FILEPROTO *file;
|
||||
|
||||
*done = TRUE; /* unconditionally */
|
||||
|
||||
Curl_initinfo(data);
|
||||
Curl_pgrsStartNow(data);
|
||||
|
||||
if(data->set.upload)
|
||||
return file_upload(conn);
|
||||
|
||||
file = conn->data->req.protop;
|
||||
|
||||
/* get the fd from the connection phase */
|
||||
fd = file->fd;
|
||||
|
||||
/* VMS: This only works reliable for STREAMLF files */
|
||||
if(-1 != fstat(fd, &statbuf)) {
|
||||
/* we could stat it, then read out the size */
|
||||
expected_size = statbuf.st_size;
|
||||
/* and store the modification time */
|
||||
data->info.filetime = (long)statbuf.st_mtime;
|
||||
fstated = TRUE;
|
||||
}
|
||||
|
||||
if(fstated && !data->state.range && data->set.timecondition) {
|
||||
if(!Curl_meets_timecondition(data, (time_t)data->info.filetime)) {
|
||||
*done = TRUE;
|
||||
return CURLE_OK;
|
||||
}
|
||||
}
|
||||
|
||||
/* If we have selected NOBODY and HEADER, it means that we only want file
|
||||
information. Which for FILE can't be much more than the file size and
|
||||
date. */
|
||||
if(data->set.opt_no_body && data->set.include_header && fstated) {
|
||||
time_t filetime;
|
||||
struct tm buffer;
|
||||
const struct tm *tm = &buffer;
|
||||
snprintf(buf, sizeof(data->state.buffer),
|
||||
"Content-Length: %" CURL_FORMAT_CURL_OFF_T "\r\n", expected_size);
|
||||
result = Curl_client_write(conn, CLIENTWRITE_BOTH, buf, 0);
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
result = Curl_client_write(conn, CLIENTWRITE_BOTH,
|
||||
(char *)"Accept-ranges: bytes\r\n", 0);
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
filetime = (time_t)statbuf.st_mtime;
|
||||
result = Curl_gmtime(filetime, &buffer);
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
/* format: "Tue, 15 Nov 1994 12:45:26 GMT" */
|
||||
snprintf(buf, BUFSIZE-1,
|
||||
"Last-Modified: %s, %02d %s %4d %02d:%02d:%02d GMT\r\n",
|
||||
Curl_wkday[tm->tm_wday?tm->tm_wday-1:6],
|
||||
tm->tm_mday,
|
||||
Curl_month[tm->tm_mon],
|
||||
tm->tm_year + 1900,
|
||||
tm->tm_hour,
|
||||
tm->tm_min,
|
||||
tm->tm_sec);
|
||||
result = Curl_client_write(conn, CLIENTWRITE_BOTH, buf, 0);
|
||||
if(!result)
|
||||
/* set the file size to make it available post transfer */
|
||||
Curl_pgrsSetDownloadSize(data, expected_size);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Check whether file range has been specified */
|
||||
file_range(conn);
|
||||
|
||||
/* Adjust the start offset in case we want to get the N last bytes
|
||||
* of the stream iff the filesize could be determined */
|
||||
if(data->state.resume_from < 0) {
|
||||
if(!fstated) {
|
||||
failf(data, "Can't get the size of file.");
|
||||
return CURLE_READ_ERROR;
|
||||
}
|
||||
else
|
||||
data->state.resume_from += (curl_off_t)statbuf.st_size;
|
||||
}
|
||||
|
||||
if(data->state.resume_from <= expected_size)
|
||||
expected_size -= data->state.resume_from;
|
||||
else {
|
||||
failf(data, "failed to resume file:// transfer");
|
||||
return CURLE_BAD_DOWNLOAD_RESUME;
|
||||
}
|
||||
|
||||
/* A high water mark has been specified so we obey... */
|
||||
if(data->req.maxdownload > 0)
|
||||
expected_size = data->req.maxdownload;
|
||||
|
||||
if(!fstated || (expected_size == 0))
|
||||
size_known = FALSE;
|
||||
else
|
||||
size_known = TRUE;
|
||||
|
||||
/* The following is a shortcut implementation of file reading
|
||||
this is both more efficient than the former call to download() and
|
||||
it avoids problems with select() and recv() on file descriptors
|
||||
in Winsock */
|
||||
if(fstated)
|
||||
Curl_pgrsSetDownloadSize(data, expected_size);
|
||||
|
||||
if(data->state.resume_from) {
|
||||
if(data->state.resume_from !=
|
||||
lseek(fd, data->state.resume_from, SEEK_SET))
|
||||
return CURLE_BAD_DOWNLOAD_RESUME;
|
||||
}
|
||||
|
||||
Curl_pgrsTime(data, TIMER_STARTTRANSFER);
|
||||
|
||||
while(!result) {
|
||||
/* Don't fill a whole buffer if we want less than all data */
|
||||
size_t bytestoread;
|
||||
|
||||
if(size_known) {
|
||||
bytestoread =
|
||||
(expected_size < CURL_OFF_T_C(BUFSIZE) - CURL_OFF_T_C(1)) ?
|
||||
curlx_sotouz(expected_size) : BUFSIZE - 1;
|
||||
}
|
||||
else
|
||||
bytestoread = BUFSIZE-1;
|
||||
|
||||
nread = read(fd, buf, bytestoread);
|
||||
|
||||
if(nread > 0)
|
||||
buf[nread] = 0;
|
||||
|
||||
if(nread <= 0 || (size_known && (expected_size == 0)))
|
||||
break;
|
||||
|
||||
bytecount += nread;
|
||||
if(size_known)
|
||||
expected_size -= nread;
|
||||
|
||||
result = Curl_client_write(conn, CLIENTWRITE_BODY, buf, nread);
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
Curl_pgrsSetDownloadCounter(data, bytecount);
|
||||
|
||||
if(Curl_pgrsUpdate(conn))
|
||||
result = CURLE_ABORTED_BY_CALLBACK;
|
||||
else
|
||||
result = Curl_speedcheck(data, now);
|
||||
}
|
||||
if(Curl_pgrsUpdate(conn))
|
||||
result = CURLE_ABORTED_BY_CALLBACK;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif
|
|
@ -1,41 +0,0 @@
|
|||
#ifndef HEADER_CURL_FILE_H
|
||||
#define HEADER_CURL_FILE_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2009, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* FILE unique setup
|
||||
***************************************************************************/
|
||||
struct FILEPROTO {
|
||||
char *path; /* the path we operate on */
|
||||
char *freepath; /* pointer to the allocated block we must free, this might
|
||||
differ from the 'path' pointer */
|
||||
int fd; /* open file descriptor to read from! */
|
||||
};
|
||||
|
||||
#ifndef CURL_DISABLE_FILE
|
||||
extern const struct Curl_handler Curl_handler_file;
|
||||
#endif
|
||||
|
||||
#endif /* HEADER_CURL_FILE_H */
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 2010 - 2015, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#include "strdup.h"
|
||||
#include "fileinfo.h"
|
||||
#include "curl_memory.h"
|
||||
/* The last #include file should be: */
|
||||
#include "memdebug.h"
|
||||
|
||||
struct curl_fileinfo *Curl_fileinfo_alloc(void)
|
||||
{
|
||||
struct curl_fileinfo *tmp = malloc(sizeof(struct curl_fileinfo));
|
||||
if(!tmp)
|
||||
return NULL;
|
||||
memset(tmp, 0, sizeof(struct curl_fileinfo));
|
||||
return tmp;
|
||||
}
|
||||
|
||||
void Curl_fileinfo_dtor(void *user, void *element)
|
||||
{
|
||||
struct curl_fileinfo *finfo = element;
|
||||
(void) user;
|
||||
if(!finfo)
|
||||
return;
|
||||
|
||||
Curl_safefree(finfo->b_data);
|
||||
|
||||
free(finfo);
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
#ifndef HEADER_CURL_FILEINFO_H
|
||||
#define HEADER_CURL_FILEINFO_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 2010, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
struct curl_fileinfo *Curl_fileinfo_alloc(void);
|
||||
|
||||
void Curl_fileinfo_dtor(void *, void *);
|
||||
|
||||
struct curl_fileinfo *Curl_fileinfo_dup(const struct curl_fileinfo *src);
|
||||
|
||||
#endif /* HEADER_CURL_FILEINFO_H */
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue