]> granicus.if.org Git - php/commitdiff
Deprecate CURLPIPE_HTTP1
authorChristoph M. Becker <cmbecker69@gmx.de>
Tue, 7 May 2019 15:05:07 +0000 (17:05 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Tue, 7 May 2019 15:05:07 +0000 (17:05 +0200)
`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>

NEWS
UPGRADING
ext/curl/multi.c

diff --git a/NEWS b/NEWS
index debd28573d92bc31dafa4acd366d416239f450c5..01d879f3b09de567b99f8998a5f7b0c8a0f1b23b 100644 (file)
--- 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)
index 3f6dcb742784ee524494aaa7987b3ad62691c30b..1b54d10482c426df985dc4870129ff07952cd459 100644 (file)
--- 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
index bee05838fa6a2a80adbd515bde5558dd1fd182a1..fafcad32638dd4297dbc0328ee98e513c22ebb28 100644 (file)
@@ -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) {