diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2019-05-07 17:05:07 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2019-05-07 17:05:07 +0200 |
commit | 72e1da81b6792d4141b4b41f6fc3e92b68aa0f3e (patch) | |
tree | e8aeac0a0a57d467fbfabbc22be806f1d8bf1362 /ext/curl/multi.c | |
parent | 6fad150cfdec697cb1b789447d10056f009a208d (diff) | |
download | php-git-72e1da81b6792d4141b4b41f6fc3e92b68aa0f3e.tar.gz |
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>
Diffstat (limited to 'ext/curl/multi.c')
-rw-r--r-- | ext/curl/multi.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/ext/curl/multi.c b/ext/curl/multi.c index bee05838fa..fafcad3263 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) { |