Make debug_libcurl.cc compile with libcurl 7.21 and higher
This commit is contained in:
@@ -8,6 +8,13 @@
|
||||
#include "debug_libcurl.h"
|
||||
#include "../llcommon/llerror.h"
|
||||
|
||||
#define CURL_VERSION(major, minor, patch) \
|
||||
(LIBCURL_VERSION_MAJOR > major || \
|
||||
(LIBCURL_VERSION_MAJOR == major && \
|
||||
LIBCURL_VERSION_MINOR > minor || \
|
||||
(LIBCURL_VERSION_MINOR == minor && \
|
||||
LIBCURL_VERSION_PATCH >= patch)))
|
||||
|
||||
static struct curl_slist unchanged_slist;
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, struct curl_slist const& slist)
|
||||
@@ -93,15 +100,21 @@ std::ostream& operator<<(std::ostream& os, CURLcode code)
|
||||
CASEPRINT(CURLE_UNSUPPORTED_PROTOCOL);
|
||||
CASEPRINT(CURLE_FAILED_INIT);
|
||||
CASEPRINT(CURLE_URL_MALFORMAT);
|
||||
#if CURL_VERSION(7, 21, 5)
|
||||
CASEPRINT(CURLE_NOT_BUILT_IN);
|
||||
#endif
|
||||
CASEPRINT(CURLE_COULDNT_RESOLVE_PROXY);
|
||||
CASEPRINT(CURLE_COULDNT_RESOLVE_HOST);
|
||||
CASEPRINT(CURLE_COULDNT_CONNECT);
|
||||
CASEPRINT(CURLE_FTP_WEIRD_SERVER_REPLY);
|
||||
CASEPRINT(CURLE_REMOTE_ACCESS_DENIED);
|
||||
#if 0
|
||||
CASEPRINT(CURLE_FTP_ACCEPT_FAILED);
|
||||
#endif
|
||||
CASEPRINT(CURLE_FTP_WEIRD_PASS_REPLY);
|
||||
#if 0
|
||||
CASEPRINT(CURLE_FTP_ACCEPT_TIMEOUT);
|
||||
#endif
|
||||
CASEPRINT(CURLE_FTP_WEIRD_PASV_REPLY);
|
||||
CASEPRINT(CURLE_FTP_WEIRD_227_FORMAT);
|
||||
CASEPRINT(CURLE_FTP_CANT_GET_HOST);
|
||||
@@ -137,7 +150,11 @@ std::ostream& operator<<(std::ostream& os, CURLcode code)
|
||||
CASEPRINT(CURLE_INTERFACE_FAILED);
|
||||
CASEPRINT(CURLE_OBSOLETE46);
|
||||
CASEPRINT(CURLE_TOO_MANY_REDIRECTS );
|
||||
#if CURL_VERSION(7, 21, 5)
|
||||
CASEPRINT(CURLE_UNKNOWN_OPTION);
|
||||
#else
|
||||
CASEPRINT(CURLE_UNKNOWN_TELNET_OPTION);
|
||||
#endif
|
||||
CASEPRINT(CURLE_TELNET_OPTION_SYNTAX );
|
||||
CASEPRINT(CURLE_OBSOLETE50);
|
||||
CASEPRINT(CURLE_PEER_FAILED_VERIFICATION);
|
||||
@@ -294,7 +311,11 @@ std::ostream& operator<<(std::ostream& os, CURLoption option)
|
||||
CASEPRINT(CURLOPT_NOSIGNAL);
|
||||
CASEPRINT(CURLOPT_SHARE);
|
||||
CASEPRINT(CURLOPT_PROXYTYPE);
|
||||
#if CURL_VERSION(7, 21, 6)
|
||||
CASEPRINT(CURLOPT_ACCEPT_ENCODING);
|
||||
#else
|
||||
CASEPRINT(CURLOPT_ENCODING);
|
||||
#endif
|
||||
CASEPRINT(CURLOPT_PRIVATE);
|
||||
CASEPRINT(CURLOPT_HTTP200ALIASES);
|
||||
CASEPRINT(CURLOPT_UNRESTRICTED_AUTH);
|
||||
@@ -386,21 +407,37 @@ std::ostream& operator<<(std::ostream& os, CURLoption option)
|
||||
CASEPRINT(CURLOPT_FNMATCH_FUNCTION);
|
||||
CASEPRINT(CURLOPT_CHUNK_DATA);
|
||||
CASEPRINT(CURLOPT_FNMATCH_DATA);
|
||||
#if CURL_VERSION(7, 21, 3)
|
||||
CASEPRINT(CURLOPT_RESOLVE);
|
||||
#endif
|
||||
#if CURL_VERSION(7, 21, 4)
|
||||
CASEPRINT(CURLOPT_TLSAUTH_USERNAME);
|
||||
CASEPRINT(CURLOPT_TLSAUTH_PASSWORD);
|
||||
CASEPRINT(CURLOPT_TLSAUTH_TYPE);
|
||||
#endif
|
||||
#if CURL_VERSION(7, 21, 6)
|
||||
CASEPRINT(CURLOPT_TRANSFER_ENCODING);
|
||||
#endif
|
||||
#if CURL_VERSION(7, 21, 7)
|
||||
CASEPRINT(CURLOPT_CLOSESOCKETFUNCTION);
|
||||
CASEPRINT(CURLOPT_CLOSESOCKETDATA);
|
||||
#endif
|
||||
#if CURL_VERSION(7, 22, 0)
|
||||
CASEPRINT(CURLOPT_GSSAPI_DELEGATION);
|
||||
#endif
|
||||
#if CURL_VERSION(7, 24, 0)
|
||||
CASEPRINT(CURLOPT_DNS_SERVERS);
|
||||
CASEPRINT(CURLOPT_ACCEPTTIMEOUT_MS);
|
||||
#endif
|
||||
#if CURL_VERSION(7, 25, 0)
|
||||
CASEPRINT(CURLOPT_TCP_KEEPALIVE);
|
||||
CASEPRINT(CURLOPT_TCP_KEEPIDLE);
|
||||
CASEPRINT(CURLOPT_TCP_KEEPINTVL);
|
||||
#endif
|
||||
CASEPRINT(CURLOPT_SSL_OPTIONS);
|
||||
#if CURL_VERSION(7, 25, 0)
|
||||
CASEPRINT(CURLOPT_MAIL_AUTH);
|
||||
#endif
|
||||
default:
|
||||
os << "<unknown CURLoption value (" << (int)option << ")>";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user