]> granicus.if.org Git - php/commitdiff
Curl: Add CURLOPT_DOH_URL option
authorAyesh Karunaratne <ayesh@aye.sh>
Sun, 17 Jan 2021 20:26:25 +0000 (03:26 +0700)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 18 Jan 2021 09:00:31 +0000 (10:00 +0100)
From libcurl version 7.62.0 and later, it supports DNS-over-HTTPS with
[`CURLOPT_DOH_URL`](https://curl.se/libcurl/c/CURLOPT_DOH_URL.html) option.
This adds integration with the `CURLOPT_DOH_URL` option if libcurl version
is >= 7.62.0 (0x073E00).

For reference, Ubuntu 20.04+ `libcurl4-openssl-dev`-based PHP builds use Curl 7.68.

Closes GH-6612.

UPGRADING
ext/curl/interface.c

index f30c0fb6bfaa98018c226d6f329ff88b01a3a1ed..a73b35038868918ca6a7daaf2026487c0b93d814 100644 (file)
--- a/UPGRADING
+++ b/UPGRADING
@@ -79,6 +79,9 @@ PHP 8.1 UPGRADE NOTES
     prefix similar to hexadecimal ("0x"/"0X) and binary ("0b"/"0B") integer literals
     RFC: https://wiki.php.net/rfc/explicit_octal_notation
 
+- Curl:
+  . Added CURLOPT_DOH_URL option.
+
 - hash:
   . The following functions have changed signatures:
 
index 39f7b7e5d07ac3a486a7e3a92b747390b74388a1..82f512d29dac3d1c28c45bf114896b0df16bfc39 100644 (file)
@@ -1141,6 +1141,10 @@ PHP_MINIT_FUNCTION(curl)
        REGISTER_CURL_CONSTANT(CURLOPT_TLS13_CIPHERS);
 #endif
 
+#if LIBCURL_VERSION_NUM >= 0x073E00 /* Available since 7.62.0 */
+       REGISTER_CURL_CONSTANT(CURLOPT_DOH_URL);
+#endif
+
 #if LIBCURL_VERSION_NUM >= 0x074000 /* Available since 7.64.0 */
        REGISTER_CURL_CONSTANT(CURLOPT_HTTP09_ALLOWED);
 #endif
@@ -2449,6 +2453,9 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue, bool i
 #endif
 #if LIBCURL_VERSION_NUM >= 0x072800 /* Available since 7.40.0 */
                case CURLOPT_UNIX_SOCKET_PATH:
+#endif
+#if LIBCURL_VERSION_NUM >= 0x073E00 /* Available since 7.62.0 */
+               case CURLOPT_DOH_URL:
 #endif
                case CURLOPT_KRBLEVEL:
                {