From 2ab560de18edfd9486eb6d12f802b7cc15c73d4d Mon Sep 17 00:00:00 2001 From: Javier Spagnoletti Date: Thu, 2 May 2019 12:25:16 -0300 Subject: [PATCH 01/12] [cURL] Update cURL features list --- ext/curl/interface.c | 34 ++++++++++++++ ext/curl/tests/check_features_unix.phpt | 60 ++++++++++++++++++++++++ ext/curl/tests/check_features_win.phpt | 61 +++++++++++++++++++++++++ ext/curl/tests/check_win_config.phpt | 1 + 4 files changed, 156 insertions(+) create mode 100644 ext/curl/tests/check_features_unix.phpt create mode 100644 ext/curl/tests/check_features_win.phpt diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 3292458d63554..20916909fb70c 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -274,6 +274,7 @@ PHP_MINFO_FUNCTION(curl) {"SSL", CURL_VERSION_SSL}, {"SSPI", CURL_VERSION_SSPI}, {"TLS-SRP", CURL_VERSION_TLSAUTH_SRP}, + {"TrackMemory", CURL_VERSION_CURLDEBUG}, #if LIBCURL_VERSION_NUM >= 0x072100 /* 7.33.0 */ {"HTTP2", CURL_VERSION_HTTP2}, #endif @@ -295,6 +296,22 @@ PHP_MINFO_FUNCTION(curl) #endif #if LIBCURL_VERSION_NUM >= 0x073900 /* 7.57.0 */ {"BROTLI", CURL_VERSION_BROTLI}, +#endif +#if LIBCURL_VERSION_NUM >= 0x074001 /* 7.64.1 */ + {"Alt-Svc", CURL_VERSION_ALTSVC}, +#endif +#if LIBCURL_VERSION_NUM >= 0x074200 /* 7.66.0 */ + {"HTTP3", CURL_VERSION_HTTP3}, +#endif +#if LIBCURL_VERSION_NUM >= 0x074800 /* 7.72.0 */ + {"Unicode", CURL_VERSION_UNICODE}, + {"Zstandard", CURL_VERSION_ZSTD}, +#endif +#if LIBCURL_VERSION_NUM >= 0x074a00 /* 7.74.0 */ + {"HSTS", CURL_VERSION_HSTS}, +#endif +#if LIBCURL_VERSION_NUM >= 0x074c00 /* 7.76.0 */ + {"Libgsasl", CURL_VERSION_GSASL}, #endif {NULL, 0} }; @@ -1155,6 +1172,10 @@ PHP_MINIT_FUNCTION(curl) REGISTER_CURL_CONSTANT(CURL_VERSION_ALTSVC); #endif +#if LIBCURL_VERSION_NUM >= 0x074200 /* Available since 7.66.0 */ + REGISTER_CURL_CONSTANT(CURL_VERSION_HTTP3); +#endif + #if LIBCURL_VERSION_NUM >= 0x074700 /* Available since 7.71.0 */ REGISTER_CURL_CONSTANT(CURLOPT_ISSUERCERT_BLOB); REGISTER_CURL_CONSTANT(CURLOPT_PROXY_ISSUERCERT); @@ -1165,6 +1186,19 @@ PHP_MINIT_FUNCTION(curl) REGISTER_CURL_CONSTANT(CURLOPT_SSLKEY_BLOB); #endif +#if LIBCURL_VERSION_NUM >= 0x074800 /* Available since 7.72.0 */ + REGISTER_CURL_CONSTANT(CURL_VERSION_UNICODE); + REGISTER_CURL_CONSTANT(CURL_VERSION_ZSTD); +#endif + +#if LIBCURL_VERSION_NUM >= 0x074a00 /* Available since 7.74.0 */ + REGISTER_CURL_CONSTANT(CURL_VERSION_HSTS); +#endif + +#if LIBCURL_VERSION_NUM >= 0x074c00 /* Available since 7.76.0 */ + REGISTER_CURL_CONSTANT(CURL_VERSION_GSASL); +#endif + REGISTER_CURL_CONSTANT(CURLOPT_SAFE_UPLOAD); #ifdef PHP_CURL_NEED_OPENSSL_TSL diff --git a/ext/curl/tests/check_features_unix.phpt b/ext/curl/tests/check_features_unix.phpt new file mode 100644 index 0000000000000..fa3f1dd448555 --- /dev/null +++ b/ext/curl/tests/check_features_unix.phpt @@ -0,0 +1,60 @@ +--TEST-- +Check libcurl features list +--SKIPIF-- += 7.29.0'); +} + +?> +--FILE-- + +--EXPECTF-- +cURL support => enabled +cURL Information => %s +Age => %d +Features +AsynchDNS => Yes +CharConv => No +Debug => No +GSS-Negotiate => No +IDN => Yes +IPv6 => Yes +krb4 => No +Largefile => Yes +libz => Yes +NTLM => Yes +NTLMWB => Yes +SPNEGO => Yes +SSL => Yes +SSPI => No +TLS-SRP => Yes +TrackMemory => No +HTTP2 => Yes +GSSAPI => Yes +KERBEROS5 => Yes +UNIX_SOCKETS => Yes +PSL => Yes +HTTPS_PROXY => Yes +MULTI_SSL => No +BROTLI => No +Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtmp, rtsp, smb, smbs, smtp, smtps, telnet, tftp +Host => %s +SSL Version => GnuTLS/%s +ZLib Version => %s diff --git a/ext/curl/tests/check_features_win.phpt b/ext/curl/tests/check_features_win.phpt new file mode 100644 index 0000000000000..1e9cef2658bd9 --- /dev/null +++ b/ext/curl/tests/check_features_win.phpt @@ -0,0 +1,61 @@ +--TEST-- +Check libcurl features list +--SKIPIF-- += 7.29.0'); +} + +?> +--FILE-- + +--EXPECTF-- +cURL support => enabled +cURL Information => %s +Age => %d +Features +AsynchDNS => Yes +CharConv => No +Debug => No +GSS-Negotiate => Yes +IDN => Yes +IPv6 => Yes +krb4 => No +Largefile => Yes +libz => Yes +NTLM => Yes +NTLMWB => No +SPNEGO => No +SSL => Yes +SSPI => Yes +TLS-SRP => No +TrackMemory => No +HTTP2 => Yes +GSSAPI => Yes +KERBEROS5 => Yes +UNIX_SOCKETS => Yes +PSL => Yes +HTTPS_PROXY => Yes +MULTI_SSL => %s +BROTLI => %s +Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtmp, rtsp, smb, smbs, smtp, smtps, telnet, tftp +Host => %s-pc-win32 +SSL Version => OpenSSL/%s +ZLib Version => %s +libSSH Version => libssh2/%s diff --git a/ext/curl/tests/check_win_config.phpt b/ext/curl/tests/check_win_config.phpt index a8dc4252d2fae..ad7acc9a98a4f 100644 --- a/ext/curl/tests/check_win_config.phpt +++ b/ext/curl/tests/check_win_config.phpt @@ -35,6 +35,7 @@ krb4 => No Largefile => Yes libz => Yes NTLM => Yes +TrackMemory => No NTLMWB => No SPNEGO => Yes SSL => Yes From 39bd7a37d3f1da44872945d92294370ef14668ca Mon Sep 17 00:00:00 2001 From: Javier Spagnoletti Date: Sat, 8 Jan 2022 05:08:14 -0300 Subject: [PATCH 02/12] Update `check_features_unix.phpt` --- ext/curl/tests/check_features_unix.phpt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ext/curl/tests/check_features_unix.phpt b/ext/curl/tests/check_features_unix.phpt index fa3f1dd448555..12cb57c81fcc2 100644 --- a/ext/curl/tests/check_features_unix.phpt +++ b/ext/curl/tests/check_features_unix.phpt @@ -53,8 +53,9 @@ UNIX_SOCKETS => Yes PSL => Yes HTTPS_PROXY => Yes MULTI_SSL => No -BROTLI => No -Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtmp, rtsp, smb, smbs, smtp, smtps, telnet, tftp +BROTLI => %s +Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtmp, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp Host => %s -SSL Version => GnuTLS/%s +SSL Version => %s/%s ZLib Version => %s +libSSH Version => libssh/%s/openssl/zlib From 3e1772a62670825443d1a5ff9e84c1deafbccc1f Mon Sep 17 00:00:00 2001 From: Javier Spagnoletti Date: Sat, 8 Jan 2022 05:15:08 -0300 Subject: [PATCH 03/12] Update `check_features_unix.phpt` (add placeholder to protocols) --- ext/curl/tests/check_features_unix.phpt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ext/curl/tests/check_features_unix.phpt b/ext/curl/tests/check_features_unix.phpt index 12cb57c81fcc2..f708c5fca8999 100644 --- a/ext/curl/tests/check_features_unix.phpt +++ b/ext/curl/tests/check_features_unix.phpt @@ -54,8 +54,7 @@ PSL => Yes HTTPS_PROXY => Yes MULTI_SSL => No BROTLI => %s -Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtmp, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp +Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtmp, rtsp, %ssmb, smbs, smtp, smtps, telnet, tftp Host => %s SSL Version => %s/%s ZLib Version => %s -libSSH Version => libssh/%s/openssl/zlib From 19fcbffc63f8bd5763788da09915be065245bb90 Mon Sep 17 00:00:00 2001 From: Javier Spagnoletti Date: Sat, 8 Jan 2022 05:22:10 -0300 Subject: [PATCH 04/12] Update `check_features_unix.phpt` (use placeholder in protocols) --- ext/curl/tests/check_features_unix.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/curl/tests/check_features_unix.phpt b/ext/curl/tests/check_features_unix.phpt index f708c5fca8999..33053e33c96f1 100644 --- a/ext/curl/tests/check_features_unix.phpt +++ b/ext/curl/tests/check_features_unix.phpt @@ -54,7 +54,7 @@ PSL => Yes HTTPS_PROXY => Yes MULTI_SSL => No BROTLI => %s -Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtmp, rtsp, %ssmb, smbs, smtp, smtps, telnet, tftp +Protocols => %s Host => %s SSL Version => %s/%s ZLib Version => %s From 15a77a769c81f68b874f0c941dcd2ef25beb0352 Mon Sep 17 00:00:00 2001 From: Javier Spagnoletti Date: Sat, 8 Jan 2022 05:49:47 -0300 Subject: [PATCH 05/12] Update `check_features_unix.phpt` (use placeholder in IDN and PSL) --- ext/curl/tests/check_features_unix.phpt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/curl/tests/check_features_unix.phpt b/ext/curl/tests/check_features_unix.phpt index 33053e33c96f1..7e9a2540ea11c 100644 --- a/ext/curl/tests/check_features_unix.phpt +++ b/ext/curl/tests/check_features_unix.phpt @@ -34,7 +34,7 @@ AsynchDNS => Yes CharConv => No Debug => No GSS-Negotiate => No -IDN => Yes +IDN => %s IPv6 => Yes krb4 => No Largefile => Yes @@ -50,7 +50,7 @@ HTTP2 => Yes GSSAPI => Yes KERBEROS5 => Yes UNIX_SOCKETS => Yes -PSL => Yes +PSL => %s HTTPS_PROXY => Yes MULTI_SSL => No BROTLI => %s From 7176a79df032a5185a4924d0b3807ce1006d482a Mon Sep 17 00:00:00 2001 From: Javier Spagnoletti Date: Sat, 12 Feb 2022 19:46:51 -0300 Subject: [PATCH 06/12] Add "Alt-Svc", "HTTP3", "Unicode", "Zstandard" and "HSTS" to `check_features_unix.phpt` --- ext/curl/tests/check_features_unix.phpt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/curl/tests/check_features_unix.phpt b/ext/curl/tests/check_features_unix.phpt index 7e9a2540ea11c..dddcb5cbf999d 100644 --- a/ext/curl/tests/check_features_unix.phpt +++ b/ext/curl/tests/check_features_unix.phpt @@ -53,6 +53,11 @@ UNIX_SOCKETS => Yes PSL => %s HTTPS_PROXY => Yes MULTI_SSL => No +Alt-Svc => %s +HTTP3 => %s +Unicode => %s +Zstandard => %s +HSTS => %s BROTLI => %s Protocols => %s Host => %s From 58e35928b57b4d297357c5a8a834618784476641 Mon Sep 17 00:00:00 2001 From: Javier Spagnoletti Date: Sat, 12 Feb 2022 20:04:29 -0300 Subject: [PATCH 07/12] Make optional "Alt-Svc", "HTTP3", "Unicode", "Zstandard" and "HSTS" in `check_features_unix.phpt` --- ext/curl/tests/check_features_unix.phpt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ext/curl/tests/check_features_unix.phpt b/ext/curl/tests/check_features_unix.phpt index dddcb5cbf999d..741bfa9861c3c 100644 --- a/ext/curl/tests/check_features_unix.phpt +++ b/ext/curl/tests/check_features_unix.phpt @@ -53,11 +53,7 @@ UNIX_SOCKETS => Yes PSL => %s HTTPS_PROXY => Yes MULTI_SSL => No -Alt-Svc => %s -HTTP3 => %s -Unicode => %s -Zstandard => %s -HSTS => %s +%A BROTLI => %s Protocols => %s Host => %s From b0111c0ed5cf357c09b170a8c71362f7ecad141a Mon Sep 17 00:00:00 2001 From: Javier Spagnoletti Date: Sat, 12 Feb 2022 20:07:22 -0300 Subject: [PATCH 08/12] Use "%S" as placehoder in "Protocols" at `check_features_unix.phpt` --- ext/curl/tests/check_features_unix.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/curl/tests/check_features_unix.phpt b/ext/curl/tests/check_features_unix.phpt index 741bfa9861c3c..40ac2e18f3af5 100644 --- a/ext/curl/tests/check_features_unix.phpt +++ b/ext/curl/tests/check_features_unix.phpt @@ -55,7 +55,7 @@ HTTPS_PROXY => Yes MULTI_SSL => No %A BROTLI => %s -Protocols => %s +Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtmp, rtsp, %Ssmb, smbs, smtp, smtps, telnet, tftp Host => %s SSL Version => %s/%s ZLib Version => %s From a581db282b6db5134e7499bb93207b09c5a74753 Mon Sep 17 00:00:00 2001 From: Javier Spagnoletti Date: Sat, 12 Feb 2022 20:24:06 -0300 Subject: [PATCH 09/12] Remove "BROTLI" at `check_features_unix.phpt` --- ext/curl/tests/check_features_unix.phpt | 1 - 1 file changed, 1 deletion(-) diff --git a/ext/curl/tests/check_features_unix.phpt b/ext/curl/tests/check_features_unix.phpt index 40ac2e18f3af5..cea0958e7970e 100644 --- a/ext/curl/tests/check_features_unix.phpt +++ b/ext/curl/tests/check_features_unix.phpt @@ -54,7 +54,6 @@ PSL => %s HTTPS_PROXY => Yes MULTI_SSL => No %A -BROTLI => %s Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtmp, rtsp, %Ssmb, smbs, smtp, smtps, telnet, tftp Host => %s SSL Version => %s/%s From 619a6cc4f511bdceb8c111b8061b998405a69416 Mon Sep 17 00:00:00 2001 From: Javier Spagnoletti Date: Sat, 12 Feb 2022 20:51:51 -0300 Subject: [PATCH 10/12] Update "Protocols" at `check_features_unix.phpt` --- ext/curl/tests/check_features_unix.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/curl/tests/check_features_unix.phpt b/ext/curl/tests/check_features_unix.phpt index cea0958e7970e..851ac6a0df2f8 100644 --- a/ext/curl/tests/check_features_unix.phpt +++ b/ext/curl/tests/check_features_unix.phpt @@ -54,7 +54,7 @@ PSL => %s HTTPS_PROXY => Yes MULTI_SSL => No %A -Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtmp, rtsp, %Ssmb, smbs, smtp, smtps, telnet, tftp +Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps%s Host => %s SSL Version => %s/%s ZLib Version => %s From 282c65238fb7748d26a14dea50dc7de582a250f4 Mon Sep 17 00:00:00 2001 From: Javier Spagnoletti Date: Sat, 12 Feb 2022 21:27:30 -0300 Subject: [PATCH 11/12] Add `--EXTENSIONS--` section --- ext/curl/tests/check_features_unix.phpt | 2 ++ ext/curl/tests/check_features_win.phpt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ext/curl/tests/check_features_unix.phpt b/ext/curl/tests/check_features_unix.phpt index 851ac6a0df2f8..c73c0edb39334 100644 --- a/ext/curl/tests/check_features_unix.phpt +++ b/ext/curl/tests/check_features_unix.phpt @@ -1,5 +1,7 @@ --TEST-- Check libcurl features list +--EXTENSIONS-- +curl --SKIPIF-- Date: Sun, 13 Feb 2022 09:40:07 -0300 Subject: [PATCH 12/12] Skip if curl extension is not loaded --- ext/curl/tests/check_features_unix.phpt | 6 ++++-- ext/curl/tests/check_features_win.phpt | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ext/curl/tests/check_features_unix.phpt b/ext/curl/tests/check_features_unix.phpt index c73c0edb39334..a4dcb4e918a64 100644 --- a/ext/curl/tests/check_features_unix.phpt +++ b/ext/curl/tests/check_features_unix.phpt @@ -1,7 +1,5 @@ --TEST-- Check libcurl features list ---EXTENSIONS-- -curl --SKIPIF--