From 7f176b21742b58b6934d0bb833b922ff6ca54bff Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Tue, 24 May 2016 20:10:19 +0200 Subject: [PATCH] we need libcurl 7.21.5 for UNKNOWN_OPTION and 7.23 for ssl session sharing --- src/php_http_client_curl.c | 4 ++++ src/php_http_curl.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/php_http_client_curl.c b/src/php_http_client_curl.c index 15f2ff7..d4f0517 100644 --- a/src/php_http_client_curl.c +++ b/src/php_http_client_curl.c @@ -1780,6 +1780,7 @@ static ZEND_RESULT_CODE php_http_curlm_option_set_share_cookies(php_http_option_ return SUCCESS; } +#if PHP_HTTP_CURL_VERSION(7,23,0) static ZEND_RESULT_CODE php_http_curlm_option_set_share_ssl(php_http_option_t *opt, zval *value, void *userdata) { php_http_client_t *client = userdata; @@ -1799,6 +1800,7 @@ static ZEND_RESULT_CODE php_http_curlm_option_set_share_ssl(php_http_option_t *o } return SUCCESS; } +#endif static void php_http_curlm_options_init(php_http_options_t *registry TSRMLS_DC) { @@ -1856,10 +1858,12 @@ static void php_http_curlm_options_init(php_http_options_t *registry TSRMLS_DC) opt->setter = php_http_curlm_option_set_share_cookies; ZVAL_BOOL(&opt->defval, 1); } +#if PHP_HTTP_CURL_VERSION(7,23,0) if ((opt = php_http_option_register(registry, ZEND_STRL("share_ssl"), 0, IS_BOOL))) { opt->setter = php_http_curlm_option_set_share_ssl; ZVAL_BOOL(&opt->defval, 1); } +#endif } static ZEND_RESULT_CODE php_http_curlm_set_option(php_http_option_t *opt, zval *val, void *userdata) diff --git a/src/php_http_curl.h b/src/php_http_curl.h index 0c533bd..7a9821c 100644 --- a/src/php_http_curl.h +++ b/src/php_http_curl.h @@ -19,6 +19,10 @@ #define PHP_HTTP_CURL_VERSION(x, y, z) (LIBCURL_VERSION_NUM >= (((x)<<16) + ((y)<<8) + (z))) #define PHP_HTTP_CURL_FEATURE(f) (curl_version_info(CURLVERSION_NOW)->features & (f)) +#if !PHP_HTTP_CURL_VERSION(7,21,5) +# define CURLE_UNKNOWN_OPTION CURLE_FAILED_INIT +#endif + PHP_MINIT_FUNCTION(http_curl); PHP_MSHUTDOWN_FUNCTION(http_curl); -- 2.30.2