From: Marcus Boerger Date: Tue, 22 Feb 2005 11:04:50 +0000 (+0000) Subject: - Compatibility with older libcurl X-Git-Tag: RELEASE_0_5_1~10 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=0b1ae3ce84aba7cf6d2268cd8755865575180834;p=m6w6%2Fext-http - Compatibility with older libcurl --- diff --git a/http_api.c b/http_api.c index 6f39434..f03ac2f 100644 --- a/http_api.c +++ b/http_api.c @@ -58,6 +58,9 @@ #endif +#if !defined(CURLINFO_RESONSE_CODE) && defined(CURLINFO_HTTP_CODE) +#define CURLINFO_RESONSE_CODE CURLINFO_HTTP_CODE +#endif ZEND_DECLARE_MODULE_GLOBALS(http) @@ -567,8 +570,10 @@ static inline char *_http_curl_getinfoname(CURLINFO i TSRMLS_DC) { /* CURLINFO_EFFECTIVE_URL = CURLINFO_STRING +1, */ CASE(EFFECTIVE_URL); +#ifdef CURLINFO_RESONSE_CODE /* CURLINFO_RESPONSE_CODE = CURLINFO_LONG +2, */ CASE(RESPONSE_CODE); +#endif /* CURLINFO_TOTAL_TIME = CURLINFO_DOUBLE +3, */ CASE(TOTAL_TIME); /* CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE +4, */ @@ -609,10 +614,14 @@ static inline char *_http_curl_getinfoname(CURLINFO i TSRMLS_DC) CASE(PRIVATE); /* CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG +22, */ CASE(HTTP_CONNECTCODE); +#ifdef CURLINFO_HTTPAUTH_AVAIL /* CURLINFO_HTTPAUTH_AVAIL = CURLINFO_LONG +23, */ CASE(HTTPAUTH_AVAIL); +#endif +#ifdef CURLINFO_PROXYAUTH_AVAIL /* CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG +24, */ - CASE(PROXYAUTH_AVAIL); + CASE(PROXYAUTH_AVAIL); +#endif } #undef CASE return NULL; @@ -666,8 +675,10 @@ static inline void _http_curl_getinfo(CURL *ch, HashTable *info TSRMLS_DC) #define INFO(I) http_curl_getinfo_ex(ch, CURLINFO_ ##I , &array) /* CURLINFO_EFFECTIVE_URL = CURLINFO_STRING +1, */ INFO(EFFECTIVE_URL); +#ifdef CURLINFO_RESONSE_CODE /* CURLINFO_RESPONSE_CODE = CURLINFO_LONG +2, */ INFO(RESPONSE_CODE); +#endif /* CURLINFO_TOTAL_TIME = CURLINFO_DOUBLE +3, */ INFO(TOTAL_TIME); /* CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE +4, */ @@ -708,10 +719,14 @@ static inline void _http_curl_getinfo(CURL *ch, HashTable *info TSRMLS_DC) INFO(PRIVATE); /* CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG +22, */ INFO(HTTP_CONNECTCODE); +#ifdef CURLINFO_HTTPAUTH_AVAIL /* CURLINFO_HTTPAUTH_AVAIL = CURLINFO_LONG +23, */ INFO(HTTPAUTH_AVAIL); +#endif +#ifdef CURLINFO_PROXYAUTH_AVAIL /* CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG +24, */ INFO(PROXYAUTH_AVAIL); +#endif #undef INFO } /* }}} */