fix issue #39
authorMichael Wallner <mike@php.net>
Wed, 27 Apr 2016 06:53:59 +0000 (08:53 +0200)
committerMichael Wallner <mike@php.net>
Wed, 27 Apr 2016 06:53:59 +0000 (08:53 +0200)
src/php_http_client_curl.c
src/php_http_curl.h

index f28f603eda751bc8455cce010237867e90ac5b54..1b65fdfb41a8435a371aa0b48c3406d90e061d6b 100644 (file)
@@ -1261,7 +1261,9 @@ static void php_http_curle_options_init(php_http_options_t *registry TSRMLS_DC)
        }
 #endif
 #if PHP_HTTP_CURL_VERSION(7,43,0)
-       if ((opt = php_http_option_register(registry, ZEND_STRL("proxy_service_name"), CURLOPT_PROXY_SERVICE_NAME, IS_STRING))) {
+       if (PHP_HTTP_CURL_FEATURE(CURL_VERSION_GSSAPI)
+       && (opt = php_http_option_register(registry, ZEND_STRL("proxy_service_name"), CURLOPT_PROXY_SERVICE_NAME, IS_STRING))
+       ) {
                opt->flags |= PHP_HTTP_CURLE_OPTION_CHECK_STRLEN;
        }
 #endif
index ab8b63ceb9835ee57589d42126a1005e17d2c590..0c533bdf839df3a788163c852a8118d7824e7efb 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <curl/curl.h>
 #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))
 
 PHP_MINIT_FUNCTION(http_curl);
 PHP_MSHUTDOWN_FUNCTION(http_curl);