- require libcurl-7.12.3
authorMichael Wallner <mike@php.net>
Sun, 11 Dec 2005 00:12:28 +0000 (00:12 +0000)
committerMichael Wallner <mike@php.net>
Sun, 11 Dec 2005 00:12:28 +0000 (00:12 +0000)
config.m4
http_request_api.c
http_request_object.c
php_http.h

index a99a32dba7d2396b368ce805c72a680676c1a218..169aa1561d2b983a9974f13366aa8da28c91503c 100644 (file)
--- a/config.m4
+++ b/config.m4
@@ -46,7 +46,7 @@ dnl ----
 dnl CURL
 dnl ----
        if test "$PHP_HTTP_CURL_REQUESTS" != "no"; then
-       
+
                AC_MSG_CHECKING([for curl/curl.h])
                CURL_DIR=
                for i in "$PHP_HTTP_CURL_REQUESTS" /usr/local /usr /opt; do
@@ -77,6 +77,14 @@ dnl ----
                        AC_MSG_RESULT([found: $CURL_CONFIG])
                fi
                
+               dnl Debian stable has currently 7.13.2 (this is not a typo)
+               AC_MSG_CHECKING([for curl version >= 7.12.3])
+               CURL_VERSION=`$CURL_CONFIG --version | $SED -e 's/[[^0-9\.]]//g'`
+               AC_MSG_RESULT([$CURL_VERSION])
+               if test `echo $CURL_VERSION | $AWK '{print $1*10000 + $2*100 + $3}'` -lt 71203; then
+                       AC_MSG_ERROR([libcurl version greater or equal to 7.12.3 required])
+               fi
+               
                CURL_LIBS=`$CURL_CONFIG --libs`
                
                CURL_ZLIB=`$CURL_CONFIG --features | $EGREP libz`
index 38eadf45f24343b653faa7aae58e5d748fbc59be..372304ca9b8d064b26ca620c42c47b5ec83bf6b5 100644 (file)
@@ -86,12 +86,10 @@ PHP_MINIT_FUNCTION(http_request)
                return FAILURE;
        }
        
-#if LIBCURL_VERSION_NUM >= 0x070a05
        HTTP_LONG_CONSTANT("HTTP_AUTH_BASIC", CURLAUTH_BASIC);
        HTTP_LONG_CONSTANT("HTTP_AUTH_DIGEST", CURLAUTH_DIGEST);
        HTTP_LONG_CONSTANT("HTTP_AUTH_NTLM", CURLAUTH_NTLM);
        HTTP_LONG_CONSTANT("HTTP_AUTH_ANY", CURLAUTH_ANY);
-#endif /* LIBCURL_VERSION_NUM */
 
        return SUCCESS;
 }
@@ -106,7 +104,7 @@ PHP_MSHUTDOWN_FUNCTION(http_request)
 }
 
 #ifndef HAVE_CURL_EASY_STRERROR
-#      define curl_easy_strerror(code) HTTP_G(request).error
+#      define curl_easy_strerror(dummy) "unkown error"
 #endif
 
 #define HTTP_CURL_INFO(I) HTTP_CURL_INFO_EX(I, I)
@@ -412,12 +410,9 @@ PHP_HTTP_API STATUS _http_request_init(CURL *ch, http_request_method meth, char
        HTTP_CURL_OPT(VERBOSE, 1);
        HTTP_CURL_OPT(DEBUGFUNCTION, http_curl_raw_callback);
 
-#if defined(ZTS) && (LIBCURL_VERSION_NUM >= 0x070a00)
+#if defined(ZTS)
        HTTP_CURL_OPT(NOSIGNAL, 1);
 #endif
-#if LIBCURL_VERSION_NUM < 0x070c00
-       HTTP_CURL_OPT(ERRORBUFFER, HTTP_G(request).error);
-#endif
 
        /* progress callback */
        if ((zoption = http_curl_getopt(options, "onprogress", 0))) {
@@ -437,12 +432,10 @@ PHP_HTTP_API STATUS _http_request_init(CURL *ch, http_request_method meth, char
                if ((zoption = http_curl_getopt(options, "proxyauth", IS_STRING))) {
                        HTTP_CURL_OPT(PROXYUSERPWD, http_request_data_copy(COPY_STRING, Z_STRVAL_P(zoption)));
                }
-#if LIBCURL_VERSION_NUM >= 0x070a07
                /* auth method */
                if ((zoption = http_curl_getopt(options, "proxyauthtype", IS_LONG))) {
                        HTTP_CURL_OPT(PROXYAUTH, Z_LVAL_P(zoption));
                }
-#endif
        }
 
        /* outgoing interface */
@@ -459,11 +452,9 @@ PHP_HTTP_API STATUS _http_request_init(CURL *ch, http_request_method meth, char
        if ((zoption = http_curl_getopt(options, "httpauth", IS_STRING))) {
                HTTP_CURL_OPT(USERPWD, http_request_data_copy(COPY_STRING, Z_STRVAL_P(zoption)));
        }
-#if LIBCURL_VERSION_NUM >= 0x070a06
        if ((zoption = http_curl_getopt(options, "httpauthtype", IS_LONG))) {
                HTTP_CURL_OPT(HTTPAUTH, Z_LVAL_P(zoption));
        }
-#endif
 
        /* compress, empty string enables all supported if libcurl was build with zlib support */
        if ((zoption = http_curl_getopt(options, "compress", IS_BOOL)) && Z_LVAL_P(zoption)) {
@@ -607,9 +598,7 @@ PHP_HTTP_API STATUS _http_request_init(CURL *ch, http_request_method meth, char
                FOREACH_KEYVAL(pos, zoption, key, idx, param) {
                        if (key) {
                                HTTP_CURL_OPT_SSL_STRING(CERT);
-#if LIBCURL_VERSION_NUM >= 0x070903
                                HTTP_CURL_OPT_SSL_STRING(CERTTYPE);
-#endif
                                HTTP_CURL_OPT_SSL_STRING(CERTPASSWD);
 
                                HTTP_CURL_OPT_SSL_STRING(KEY);
@@ -624,9 +613,7 @@ PHP_HTTP_API STATUS _http_request_init(CURL *ch, http_request_method meth, char
                                HTTP_CURL_OPT_SSL_STRING_(CIPHER_LIST);
 
                                HTTP_CURL_OPT_STRING(CAINFO);
-#if LIBCURL_VERSION_NUM >= 0x070908
                                HTTP_CURL_OPT_STRING(CAPATH);
-#endif
                                HTTP_CURL_OPT_STRING(RANDOM_FILE);
                                HTTP_CURL_OPT_STRING(EGDSOCKET);
 
@@ -733,24 +720,17 @@ PHP_HTTP_API void _http_request_info(CURL *ch, HashTable *info TSRMLS_DC)
        INIT_ZARR(array, info);
 
        HTTP_CURL_INFO(EFFECTIVE_URL);
-#if LIBCURL_VERSION_NUM >= 0x070a07
        HTTP_CURL_INFO(RESPONSE_CODE);
-#else
        HTTP_CURL_INFO_EX(HTTP_CODE, RESPONSE_CODE);
-#endif
        HTTP_CURL_INFO(HTTP_CONNECTCODE);
-#if LIBCURL_VERSION_NUM >= 0x070500
        HTTP_CURL_INFO(FILETIME);
-#endif
        HTTP_CURL_INFO(TOTAL_TIME);
        HTTP_CURL_INFO(NAMELOOKUP_TIME);
        HTTP_CURL_INFO(CONNECT_TIME);
        HTTP_CURL_INFO(PRETRANSFER_TIME);
        HTTP_CURL_INFO(STARTTRANSFER_TIME);
-#if LIBCURL_VERSION_NUM >= 0x070907
        HTTP_CURL_INFO(REDIRECT_TIME);
        HTTP_CURL_INFO(REDIRECT_COUNT);
-#endif
        HTTP_CURL_INFO(SIZE_UPLOAD);
        HTTP_CURL_INFO(SIZE_DOWNLOAD);
        HTTP_CURL_INFO(SPEED_DOWNLOAD);
@@ -758,25 +738,15 @@ PHP_HTTP_API void _http_request_info(CURL *ch, HashTable *info TSRMLS_DC)
        HTTP_CURL_INFO(HEADER_SIZE);
        HTTP_CURL_INFO(REQUEST_SIZE);
        HTTP_CURL_INFO(SSL_VERIFYRESULT);
-#if LIBCURL_VERSION_NUM >= 0x070c03
        /*HTTP_CURL_INFO(SSL_ENGINES); todo: CURLINFO_SLIST */
-#endif
        HTTP_CURL_INFO(CONTENT_LENGTH_DOWNLOAD);
        HTTP_CURL_INFO(CONTENT_LENGTH_UPLOAD);
        HTTP_CURL_INFO(CONTENT_TYPE);
-#if LIBCURL_VERSION_NUM >= 0x070a03
        /*HTTP_CURL_INFO(PRIVATE);*/
-#endif
-#if LIBCURL_VERSION_NUM >= 0x070a08
        HTTP_CURL_INFO(HTTPAUTH_AVAIL);
        HTTP_CURL_INFO(PROXYAUTH_AVAIL);
-#endif
-#if LIBCURL_VERSION_NUM >= 0x070c02
        /*HTTP_CURL_INFO(OS_ERRNO);*/
-#endif
-#if LIBCURL_VERSION_NUM >= 0x070c03
        HTTP_CURL_INFO(NUM_CONNECTS);
-#endif
 }
 /* }}} */
 
@@ -1022,15 +992,11 @@ static inline void _http_curl_defaults(CURL *ch)
        HTTP_CURL_OPT(PROXY, NULL);
        HTTP_CURL_OPT(PROXYPORT, 0);
        HTTP_CURL_OPT(PROXYUSERPWD, NULL);
-#if LIBCURL_VERSION_NUM >= 0x070a07
        HTTP_CURL_OPT(PROXYAUTH, 0);
-#endif
        HTTP_CURL_OPT(INTERFACE, NULL);
        HTTP_CURL_OPT(PORT, 0);
        HTTP_CURL_OPT(USERPWD, NULL);
-#if LIBCURL_VERSION_NUM >= 0x070a06
        HTTP_CURL_OPT(HTTPAUTH, 0);
-#endif
        HTTP_CURL_OPT(ENCODING, 0);
        HTTP_CURL_OPT(FOLLOWLOCATION, 0);
        HTTP_CURL_OPT(UNRESTRICTED_AUTH, 0);
@@ -1047,9 +1013,7 @@ static inline void _http_curl_defaults(CURL *ch)
        HTTP_CURL_OPT(TIMEOUT, 0);
        HTTP_CURL_OPT(CONNECTTIMEOUT, 3);
        HTTP_CURL_OPT(SSLCERT, NULL);
-#if LIBCURL_VERSION_NUM >= 0x070903
        HTTP_CURL_OPT(SSLCERTTYPE, NULL);
-#endif
        HTTP_CURL_OPT(SSLCERTPASSWD, NULL);
        HTTP_CURL_OPT(SSLKEY, NULL);
        HTTP_CURL_OPT(SSLKEYTYPE, NULL);
@@ -1060,9 +1024,7 @@ static inline void _http_curl_defaults(CURL *ch)
        HTTP_CURL_OPT(SSL_VERIFYHOST, 0);
        HTTP_CURL_OPT(SSL_CIPHER_LIST, NULL);
        HTTP_CURL_OPT(CAINFO, NULL);
-#if LIBCURL_VERSION_NUM >= 0x070908
        HTTP_CURL_OPT(CAPATH, NULL);
-#endif
        HTTP_CURL_OPT(RANDOM_FILE, NULL);
        HTTP_CURL_OPT(EGDSOCKET, NULL);
        HTTP_CURL_OPT(POSTFIELDS, NULL);
index 9bebb438b7f1e1cf8f8bf35f7c95f3f31e1e7948..2e34c919e52cf467adc184bc89a615225056a6c1 100644 (file)
@@ -405,12 +405,10 @@ static inline void _http_request_object_declare_default_properties(TSRMLS_D)
        /*
         * Auth Constants
         */
-#      if LIBCURL_VERSION_NUM >= 0x070a05
        DCL_CONST(long, "AUTH_BASIC", CURLAUTH_BASIC);
        DCL_CONST(long, "AUTH_DIGEST", CURLAUTH_DIGEST);
        DCL_CONST(long, "AUTH_NTLM", CURLAUTH_NTLM);
        DCL_CONST(long, "AUTH_ANY", CURLAUTH_ANY);
-#      endif /* LIBCURL_VERSION_NUM */
 #endif /* WONKY */
 }
 
index 8e724af7ba09dcd259b6d08f46754dcbcd4ece4c..3a64383772be388346818bb0ec343eb46ceb4ec9 100644 (file)
@@ -93,9 +93,6 @@ ZEND_BEGIN_MODULE_GLOBALS(http)
                        zend_llist contexts;
                        zend_llist convs;
                } copies;
-#      ifndef HAVE_CURL_EASY_STRERROR
-               char error[CURL_ERROR_SIZE + 1];
-#      endif
 #endif /* HTTP_HAVE_CURL */
        } request;