Skip to content

Commit 72e1da8

Browse files
committed
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>
1 parent 6fad150 commit 72e1da8

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ PHP NEWS
2525
. Fixed bug #76480 (Use curl_multi_wait() so that timeouts are respected).
2626
(Pierrick)
2727
. Implemented FR #77711 (CURLFile should support UNICODE filenames). (cmb)
28+
. Deprecated CURLPIPE_HTTP1. (cmb)
2829

2930
- Date:
3031
. Fixed bug #75232 (print_r of DateTime creating side-effect). (Nikita)

UPGRADING

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ PHP 7.4 UPGRADE NOTES
4141
- Curl:
4242
. Attempting to serialize a CURLFile class will now generate an exception.
4343
Previously the exception was only thrown on unserialization.
44+
. Using CURLPIPE_HTTP1 is deprecated, and is no longer supported as of cURL
45+
7.62.0.
4446

4547
- Date:
4648
. Calling var_dump() or similar on a DateTime(Immutable) instance will no

ext/curl/multi.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,8 +564,19 @@ static int _php_curl_multi_setopt(php_curlm *mh, zend_long option, zval *zvalue,
564564
case CURLMOPT_MAX_PIPELINE_LENGTH:
565565
case CURLMOPT_MAX_TOTAL_CONNECTIONS:
566566
#endif
567-
error = curl_multi_setopt(mh->multi, option, zval_get_long(zvalue));
567+
{
568+
zend_long lval = zval_get_long(zvalue);
569+
570+
if (option == CURLMOPT_PIPELINING && (lval & 1)) {
571+
#if LIBCURL_VERSION_NUM >= 0x073e00 /* 7.62.0 */
572+
php_error_docref(NULL, E_WARNING, "CURLPIPE_HTTP1 is no longer supported");
573+
#else
574+
php_error_docref(NULL, E_DEPRECATED, "CURLPIPE_HTTP1 is deprecated");
575+
#endif
576+
}
577+
error = curl_multi_setopt(mh->multi, option, lval);
568578
break;
579+
}
569580
#if LIBCURL_VERSION_NUM > 0x072D00 /* Available since 7.45.0 */
570581
case CURLMOPT_PUSHFUNCTION:
571582
if (mh->handlers->server_push == NULL) {

0 commit comments

Comments
 (0)