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 f28f603..1b65fdf 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 ab8b63c..0c533bd 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);