com php-src: Deprecate CURLPIPE_HTTP1: NEWS UPGRADING ext/curl/multi.c
| From: | Christoph Michael Becker | Date: | Tue, 07 May 2019 15:05:07 +0000 |
| Subject: | com php-src: Deprecate CURLPIPE_HTTP1: NEWS UPGRADING ext/curl/multi.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-106064@lists.php.net to get a copy of this message | ||
Commit: 72e1da81b6792d4141b4b41f6fc3e92b68aa0f3e
Author: Christoph M. Becker <cmbecker69@gmx.de> Tue, 7 May 2019 17:05:07 +0200
Parents: 6fad150cfdec697cb1b789447d10056f009a208d
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=72e1da81b6792d4141b4b41f6fc3e92b68aa0f3e
Log:
Deprecate CURLPIPE_HTTP1
CURLPIPE_HTTP1 is deprecated and has no effect as of cURL 7.62.0[1].
We therefore deprecate the PHP constant as well, and trigger a warning
that it is no longer supported, if used against cURL 7.62.0 and up.
[1] <https://curl.haxx.se/libcurl/c/CURLMOPT_PIPELINING.html>
Changed paths:
M NEWS
M UPGRADING
M ext/curl/multi.c
Diff:
diff --git a/NEWS b/NEWS
index debd285..01d879f 100644
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,7 @@ PHP NEWS
. Fixed bug #76480 (Use curl_multi_wait() so that timeouts are respected).
(Pierrick)
. Implemented FR #77711 (CURLFile should support UNICODE filenames). (cmb)
+ . Deprecated CURLPIPE_HTTP1. (cmb)
- Date:
. Fixed bug #75232 (print_r of DateTime creating side-effect). (Nikita)
diff --git a/UPGRADING b/UPGRADING
index 3f6dcb7..1b54d10 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -41,6 +41,8 @@ PHP 7.4 UPGRADE NOTES
- Curl:
. Attempting to serialize a CURLFile class will now generate an exception.
Previously the exception was only thrown on unserialization.
+ . Using CURLPIPE_HTTP1 is deprecated, and is no longer supported as of cURL
+ 7.62.0.
- Date:
. Calling var_dump() or similar on a DateTime(Immutable) instance will no
diff --git a/ext/curl/multi.c b/ext/curl/multi.c
index bee0583..fafcad3 100644
--- a/ext/curl/multi.c
+++ b/ext/curl/multi.c
@@ -564,8 +564,19 @@ static int _php_curl_multi_setopt(php_curlm *mh, zend_long option, zval
*zvalue,
case CURLMOPT_MAX_PIPELINE_LENGTH:
case CURLMOPT_MAX_TOTAL_CONNECTIONS:
#endif
- error = curl_multi_setopt(mh->multi, option, zval_get_long(zvalue));
+ {
+ zend_long lval = zval_get_long(zvalue);
+
+ if (option == CURLMOPT_PIPELINING && (lval & 1)) {
+#if LIBCURL_VERSION_NUM >= 0x073e00 /* 7.62.0 */
+ php_error_docref(NULL, E_WARNING, "CURLPIPE_HTTP1 is no longer supported");
+#else
+ php_error_docref(NULL, E_DEPRECATED, "CURLPIPE_HTTP1 is deprecated");
+#endif
+ }
+ error = curl_multi_setopt(mh->multi, option, lval);
break;
+ }
#if LIBCURL_VERSION_NUM > 0x072D00 /* Available since 7.45.0 */
case CURLMOPT_PUSHFUNCTION:
if (mh->handlers->server_push == NULL) {