- Compatibility with older libcurl
authorMarcus Boerger <helly@php.net>
Tue, 22 Feb 2005 11:04:50 +0000 (11:04 +0000)
committerMarcus Boerger <helly@php.net>
Tue, 22 Feb 2005 11:04:50 +0000 (11:04 +0000)
http_api.c

index 6f39434d7b76ef6e429db5b5cce86ad8a1fcb77d..f03ac2fb509bc2c1495509406c64074105a25310 100644 (file)
@@ -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
 }
 /* }}} */