From ffc997f14980ad3beff2c6a9018576aa105b3485 Mon Sep 17 00:00:00 2001 From: Sterling Hughes Date: Wed, 16 May 2001 23:43:30 +0000 Subject: [PATCH] Add a compile check for the cURL version and fix the compile in general. --- ext/curl/config.m4 | 15 +++++++++++++++ ext/curl/curl.c | 2 +- ext/curl/php_curl.h | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ext/curl/config.m4 b/ext/curl/config.m4 index cdccaa7eb4..3bad5d4793 100644 --- a/ext/curl/config.m4 +++ b/ext/curl/config.m4 @@ -23,6 +23,21 @@ if test "$PHP_CURL" != "no"; then easy.h should be in /include/curl/) fi + CURL_CONFIG="curl-config" + AC_MSG_CHECKING(for cURL greater than 7.7.3) + + if ${CURL_DIR}/bin/curl-config --libs print > /dev/null 2>&1; then + CURL_CONFIG=${CURL_DIR}/bin/curl-config + fi + + curl_version_full=`$CURL_CONFIG --version` + curl_version=`echo ${curl_version_full} | sed -e 's/libcurl //' | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` + if test "$curl_version" -ge 7007003; then + AC_MSG_RESULT($curl_version_full) + else + AC_MSG_ERROR(cURL version 7.7.3 or later is required to compile php with cURL support) + fi + PHP_ADD_INCLUDE($CURL_DIR/include) PHP_SUBST(CURL_SHARED_LIBADD) diff --git a/ext/curl/curl.c b/ext/curl/curl.c index 3666bd3644..14bed9afec 100644 --- a/ext/curl/curl.c +++ b/ext/curl/curl.c @@ -187,7 +187,7 @@ PHP_MINIT_FUNCTION(curl) REGISTER_CURL_CONSTANT("CURLOPT_CONNECTTIMEOUT", CURLOPT_CONNECTTIMEOUT); REGISTER_CURL_CONSTANT("CURLOPT_SSL_VERIFYPEER", CURLOPT_SSL_VERIFYPEER); REGISTER_CURL_CONSTANT("CURLOPT_CAINFO", CURLOPT_CAINFO); - REGISTER_CURL_CONSTANT("CURLOPT_BINARYTRANSER", CURLOPT_BINARY); + REGISTER_CURL_CONSTANT("CURLOPT_BINARYTRANSER", CURLOPT_BINARYTRANSFER); /* Constants effecting the way CURLOPT_CLOSEPOLICY works */ REGISTER_CURL_CONSTANT("CURLCLOSEPOLICY_LEAST_RECENTLY_USED", CURLCLOSEPOLICY_LEAST_RECENTLY_USED); diff --git a/ext/curl/php_curl.h b/ext/curl/php_curl.h index 2800f324d4..49d2d6c99f 100644 --- a/ext/curl/php_curl.h +++ b/ext/curl/php_curl.h @@ -57,6 +57,7 @@ typedef struct { FILE *fp; smart_str buf; int method; + int type; } php_curl_write; typedef struct { -- 2.40.0