curl: add workaround for CURLOPT_INTERFACE for v8.9-8.10
authorMichael Wallner <mike@php.net>
Tue, 27 Aug 2024 17:59:56 +0000 (19:59 +0200)
committerMichael Wallner <mike@php.net>
Tue, 27 Aug 2024 17:59:56 +0000 (19:59 +0200)
src/php_http_client_curl.c

index 4decc7af20c8e7a234ab9492a775fa5f97a6cac1..ed778b148a609abab4937e43ed46c2c939c5d3b7 100644 (file)
@@ -1413,7 +1413,12 @@ static void php_http_curle_options_init(php_http_options_t *registry)
 #endif
 
        /* outgoing interface */
-       php_http_option_register(registry, ZEND_STRL("interface"), CURLOPT_INTERFACE, IS_STRING);
+       if ((opt = php_http_option_register(registry, ZEND_STRL("interface"), CURLOPT_INTERFACE, IS_STRING))) {
+#if PHP_HTTP_CURL_VERSION(8,9,0) && !PHP_HTTP_CURL_VERSION(8,10,0)
+               // NULL support lost in v8.9 and restored in libcurl v8.10
+               opt->flags |= PHP_HTTP_CURLE_OPTION_IGNORE_RC;
+#endif
+       }
        if ((opt = php_http_option_register(registry, ZEND_STRL("portrange"), CURLOPT_LOCALPORT, IS_ARRAY))) {
                opt->setter = php_http_curle_option_set_portrange;
        }