summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2019-06-07 15:45:29 +0200
committerRemi Collet <remi@remirepo.net>2019-06-07 15:45:29 +0200
commit4ae1088d45d67b77ec035c1d08625eae4b14a926 (patch)
treec7b93cae838e23a7b6837cd97a4f18d34d8df0c0
parent5ba9458dcbb7f62f366841e007deefaf205e6b68 (diff)
v3.2.1
-rw-r--r--85.patch262
-rw-r--r--PHPINFO8
-rw-r--r--REFLECTION156
-rw-r--r--pecl_http-upstream.patch701
-rw-r--r--php-pecl-http.spec33
5 files changed, 157 insertions, 1003 deletions
diff --git a/85.patch b/85.patch
deleted file mode 100644
index 87b4a26..0000000
--- a/85.patch
+++ /dev/null
@@ -1,262 +0,0 @@
-From 597b66905b295d3a7ed408a92751a5f29e19fe01 Mon Sep 17 00:00:00 2001
-From: Remi Collet <remi@remirepo.net>
-Date: Mon, 4 Feb 2019 15:23:37 +0100
-Subject: [PATCH] Fix [-Wformat-extra-args] build warnings
-
-Tested with GCC 4.4, 4.8, 7.1 and 8.0
-See https://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html
----
- src/php_http_client.c | 16 ++++++++--------
- src/php_http_client_response.c | 2 +-
- src/php_http_encoding.c | 2 +-
- src/php_http_exception.h | 2 +-
- src/php_http_message.c | 26 +++++++++++++-------------
- src/php_http_querystring.c | 2 +-
- 6 files changed, 25 insertions(+), 25 deletions(-)
-
-diff --git a/src/php_http_client.c b/src/php_http_client.c
-index 2f8b4ae..317b494 100644
---- a/src/php_http_client.c
-+++ b/src/php_http_client.c
-@@ -583,7 +583,7 @@ static PHP_METHOD(HttpClient, __construct)
- php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|S!S!", &driver_name, &persistent_handle_name), invalid_arg, return);
-
- if (!zend_hash_num_elements(&php_http_client_drivers)) {
-- php_http_throw(unexpected_val, "No http\\Client drivers available", NULL);
-+ php_http_throw(unexpected_val, "No http\\Client drivers available");
- return;
- }
- if (!(driver = php_http_client_driver_get(driver_name))) {
-@@ -697,7 +697,7 @@ static PHP_METHOD(HttpClient, enqueue)
- msg_obj = PHP_HTTP_OBJ(NULL, request);
-
- if (php_http_client_enqueued(obj->client, msg_obj->message, NULL)) {
-- php_http_throw(bad_method_call, "Failed to enqueue request; request already in queue", NULL);
-+ php_http_throw(bad_method_call, "Failed to enqueue request; request already in queue");
- return;
- }
-
-@@ -749,7 +749,7 @@ static PHP_METHOD(HttpClient, dequeue)
- msg_obj = PHP_HTTP_OBJ(NULL, request);
-
- if (!php_http_client_enqueued(obj->client, msg_obj->message, NULL)) {
-- php_http_throw(bad_method_call, "Failed to dequeue request; request not in queue", NULL);
-+ php_http_throw(bad_method_call, "Failed to dequeue request; request not in queue");
- return;
- }
-
-@@ -843,7 +843,7 @@ static PHP_METHOD(HttpClient, getResponse)
- }
-
- /* not found for the request! */
-- php_http_throw(unexpected_val, "Could not find response for the request", NULL);
-+ php_http_throw(unexpected_val, "Could not find response for the request");
- return;
- }
-
-@@ -999,7 +999,7 @@ static PHP_METHOD(HttpClient, notify)
- observers = zend_read_property(php_http_client_class_entry, getThis(), ZEND_STRL("observers"), 0, &observers_tmp);
-
- if (Z_TYPE_P(observers) != IS_OBJECT) {
-- php_http_throw(unexpected_val, "Observer storage is corrupted", NULL);
-+ php_http_throw(unexpected_val, "Observer storage is corrupted");
- return;
- }
-
-@@ -1045,7 +1045,7 @@ static PHP_METHOD(HttpClient, attach)
- observers = zend_read_property(php_http_client_class_entry, getThis(), ZEND_STRL("observers"), 0, &observers_tmp);
-
- if (Z_TYPE_P(observers) != IS_OBJECT) {
-- php_http_throw(unexpected_val, "Observer storage is corrupted", NULL);
-+ php_http_throw(unexpected_val, "Observer storage is corrupted");
- return;
- }
-
-@@ -1072,7 +1072,7 @@ static PHP_METHOD(HttpClient, detach)
- observers = zend_read_property(php_http_client_class_entry, getThis(), ZEND_STRL("observers"), 0, &observers_tmp);
-
- if (Z_TYPE_P(observers) != IS_OBJECT) {
-- php_http_throw(unexpected_val, "Observer storage is corrupted", NULL);
-+ php_http_throw(unexpected_val, "Observer storage is corrupted");
- return;
- }
-
-@@ -1094,7 +1094,7 @@ static PHP_METHOD(HttpClient, getObservers)
- observers = zend_read_property(php_http_client_class_entry, getThis(), ZEND_STRL("observers"), 0, &observers_tmp);
-
- if (Z_TYPE_P(observers) != IS_OBJECT) {
-- php_http_throw(unexpected_val, "Observer storage is corrupted", NULL);
-+ php_http_throw(unexpected_val, "Observer storage is corrupted");
- return;
- }
-
-diff --git a/src/php_http_client_response.c b/src/php_http_client_response.c
-index 5acddae..34748aa 100644
---- a/src/php_http_client_response.c
-+++ b/src/php_http_client_response.c
-@@ -105,7 +105,7 @@ static PHP_METHOD(HttpClientResponse, getTransferInfo)
-
- /* request completed? */
- if (Z_TYPE_P(info) != IS_OBJECT) {
-- php_http_throw(bad_method_call, "Incomplete state", NULL);
-+ php_http_throw(bad_method_call, "Incomplete state");
- return;
- }
-
-diff --git a/src/php_http_encoding.c b/src/php_http_encoding.c
-index c3e9a3a..4e25de3 100644
---- a/src/php_http_encoding.c
-+++ b/src/php_http_encoding.c
-@@ -528,7 +528,7 @@ static PHP_METHOD(HttpEncodingStream, __construct)
- obj = PHP_HTTP_OBJ(NULL, getThis());
-
- if (UNEXPECTED(obj->stream)) {
-- php_http_throw(bad_method_call, "http\\Encoding\\Stream cannot be initialized twice", NULL);
-+ php_http_throw(bad_method_call, "http\\Encoding\\Stream cannot be initialized twice");
- return;
- }
-
-diff --git a/src/php_http_exception.h b/src/php_http_exception.h
-index e3e66f1..7638e67 100644
---- a/src/php_http_exception.h
-+++ b/src/php_http_exception.h
-@@ -15,7 +15,7 @@
-
- /* short hand for zend_throw_exception_ex */
- #define php_http_throw(e, fmt, ...) \
-- zend_throw_exception_ex(php_http_get_exception_ ##e## _class_entry(), 0, fmt, __VA_ARGS__)
-+ zend_throw_exception_ex(php_http_get_exception_ ##e## _class_entry(), 0, fmt, ##__VA_ARGS__)
-
- /* wrap a call with replaced zend_error_handling */
- #define php_http_expect(test, e, fail) \
-diff --git a/src/php_http_message.c b/src/php_http_message.c
-index d70ced4..aa09736 100644
---- a/src/php_http_message.c
-+++ b/src/php_http_message.c
-@@ -776,7 +776,7 @@ ZEND_RESULT_CODE php_http_message_object_set_body(php_http_message_object_t *msg
- case IS_RESOURCE:
- php_stream_from_zval_no_verify(s, zbody);
- if (!s) {
-- php_http_throw(unexpected_val, "The stream is not a valid resource", NULL);
-+ php_http_throw(unexpected_val, "The stream is not a valid resource");
- return FAILURE;
- }
-
-@@ -1076,7 +1076,7 @@ static PHP_METHOD(HttpMessage, __construct)
- php_http_buffer_init_ex(&buf, 0x1000, PHP_HTTP_BUFFER_INIT_PREALLOC);
- if (PHP_HTTP_MESSAGE_PARSER_STATE_FAILURE == php_http_message_parser_parse_stream(&p, &buf, s, flags, &msg)) {
- if (!EG(exception)) {
-- php_http_throw(bad_message, "Could not parse message from stream", NULL);
-+ php_http_throw(bad_message, "Could not parse message from stream");
- }
- }
- php_http_buffer_dtor(&buf);
-@@ -1084,7 +1084,7 @@ static PHP_METHOD(HttpMessage, __construct)
- }
-
- if (!msg && !EG(exception)) {
-- php_http_throw(bad_message, "Empty message received from stream", NULL);
-+ php_http_throw(bad_message, "Empty message received from stream");
- }
- } else if (zmessage) {
- zend_string *zs_msg = zval_get_string(zmessage);
-@@ -1092,7 +1092,7 @@ static PHP_METHOD(HttpMessage, __construct)
- msg = php_http_message_parse(NULL, zs_msg->val, zs_msg->len, greedy);
-
- if (!msg && !EG(exception)) {
-- php_http_throw(bad_message, "Could not parse message: %.*s", MIN(25, zs_msg->len), zs_msg->val);
-+ php_http_throw(bad_message, "Could not parse message: %.*s", (int)MIN(25, zs_msg->len), zs_msg->val);
- }
- zend_string_release(zs_msg);
- }
-@@ -1492,7 +1492,7 @@ static PHP_METHOD(HttpMessage, setResponseCode)
- PHP_HTTP_MESSAGE_OBJECT_INIT(obj);
-
- if (obj->message->type != PHP_HTTP_RESPONSE) {
-- php_http_throw(bad_method_call, "http\\Message is not of type response", NULL);
-+ php_http_throw(bad_method_call, "http\\Message is not of type response");
- return;
- }
-
-@@ -1544,7 +1544,7 @@ static PHP_METHOD(HttpMessage, setResponseStatus)
- PHP_HTTP_MESSAGE_OBJECT_INIT(obj);
-
- if (obj->message->type != PHP_HTTP_RESPONSE) {
-- php_http_throw(bad_method_call, "http\\Message is not of type response", NULL);
-+ php_http_throw(bad_method_call, "http\\Message is not of type response");
- }
-
- PTR_SET(obj->message->http.info.response.status, estrndup(status, status_len));
-@@ -1589,12 +1589,12 @@ static PHP_METHOD(HttpMessage, setRequestMethod)
- PHP_HTTP_MESSAGE_OBJECT_INIT(obj);
-
- if (obj->message->type != PHP_HTTP_REQUEST) {
-- php_http_throw(bad_method_call, "http\\Message is not of type request", NULL);
-+ php_http_throw(bad_method_call, "http\\Message is not of type request");
- return;
- }
-
- if (method_len < 1) {
-- php_http_throw(invalid_arg, "Cannot set http\\Message's request method to an empty string", NULL);
-+ php_http_throw(invalid_arg, "Cannot set http\\Message's request method to an empty string");
- return;
- }
-
-@@ -1645,7 +1645,7 @@ static PHP_METHOD(HttpMessage, setRequestUrl)
- PHP_HTTP_MESSAGE_OBJECT_INIT(obj);
-
- if (obj->message->type != PHP_HTTP_REQUEST) {
-- php_http_throw(bad_method_call, "http\\Message is not of type request", NULL);
-+ php_http_throw(bad_method_call, "http\\Message is not of type request");
- return;
- }
-
-@@ -1655,7 +1655,7 @@ static PHP_METHOD(HttpMessage, setRequestUrl)
-
- if (url && php_http_url_is_empty(url)) {
- php_http_url_free(&url);
-- php_http_throw(invalid_arg, "Cannot set http\\Message's request url to an empty string", NULL);
-+ php_http_throw(invalid_arg, "Cannot set http\\Message's request url to an empty string");
- } else if (url) {
- PTR_SET(obj->message->http.info.request.url, url);
- }
-@@ -1675,7 +1675,7 @@ static PHP_METHOD(HttpMessage, getParentMessage)
- PHP_HTTP_MESSAGE_OBJECT_INIT(obj);
-
- if (!obj->message->parent) {
-- php_http_throw(unexpected_val, "http\\Message has not parent message", NULL);
-+ php_http_throw(unexpected_val, "http\\Message has not parent message");
- return;
- }
-
-@@ -1832,7 +1832,7 @@ static PHP_METHOD(HttpMessage, prepend)
- for (msg[0] = obj->message; msg[0]; msg[0] = msg[0]->parent) {
- for (msg[1] = prepend_obj->message; msg[1]; msg[1] = msg[1]->parent) {
- if (msg[0] == msg[1]) {
-- php_http_throw(unexpected_val, "Cannot prepend a message located within the same message chain", NULL);
-+ php_http_throw(unexpected_val, "Cannot prepend a message located within the same message chain");
- return;
- }
- }
-@@ -1892,7 +1892,7 @@ static PHP_METHOD(HttpMessage, splitMultipartBody)
- PHP_HTTP_MESSAGE_OBJECT_INIT(obj);
-
- if (!php_http_message_is_multipart(obj->message, &boundary)) {
-- php_http_throw(bad_method_call, "http\\Message is not a multipart message", NULL);
-+ php_http_throw(bad_method_call, "http\\Message is not a multipart message");
- return;
- }
-
-diff --git a/src/php_http_querystring.c b/src/php_http_querystring.c
-index a302bbd..566d434 100644
---- a/src/php_http_querystring.c
-+++ b/src/php_http_querystring.c
-@@ -386,7 +386,7 @@ PHP_METHOD(HttpQueryString, getGlobalInstance)
- ZVAL_MAKE_REF(_GET);
- zend_update_property(php_http_querystring_class_entry, return_value, ZEND_STRL("queryArray"), _GET);
- } else {
-- php_http_throw(unexpected_val, "Could not acquire reference to superglobal GET array", NULL);
-+ php_http_throw(unexpected_val, "Could not acquire reference to superglobal GET array");
- }
-
- }
diff --git a/PHPINFO b/PHPINFO
index c5c34ec..48ba19d 100644
--- a/PHPINFO
+++ b/PHPINFO
@@ -2,13 +2,13 @@
http
HTTP Support => enabled
-Extension Version => 3.2.0
+Extension Version => 3.2.1
Used Library => Compiled => Linked
libz => 1.2.11 => 1.2.11
-libcurl => 7.55.1 => 7.55.1
-libevent => 2.0.22-stable => 2.0.22-stable
-libicu (IDNA2008/IDNA2003) => 57.1 => 57.1
+libcurl => 7.61.1 => 7.61.1
+libevent => 2.1.8-stable => 2.1.8-stable
+libicu (IDNA2008/IDNA2003) => 62.2 => 62.2
libidn2 (IDNA2008) => disabled => disabled
libidn (IDNA2003) => disabled => disabled
libidnkit2 (IDNA2008) => disabled => disabled
diff --git a/REFLECTION b/REFLECTION
index 6b95397..ac4802f 100644
--- a/REFLECTION
+++ b/REFLECTION
@@ -1,4 +1,4 @@
-Extension [ <persistent> extension #186 http version 3.2.0 ] {
+Extension [ <persistent> extension #194 http version 3.2.1 ] {
- Dependencies {
Dependency [ raphf (Required) ]
@@ -14,7 +14,7 @@ Extension [ <persistent> extension #186 http version 3.2.0 ] {
}
- Constants [56] {
- Constant [ integer http\Client\Curl\FEATURES ] { 4179869 }
+ Constant [ integer http\Client\Curl\FEATURES ] { 12568477 }
Constant [ integer http\Client\Curl\Features\IPV6 ] { 1 }
Constant [ integer http\Client\Curl\Features\KERBEROS4 ] { 2 }
Constant [ integer http\Client\Curl\Features\KERBEROS5 ] { 262144 }
@@ -33,9 +33,9 @@ Extension [ <persistent> extension #186 http version 3.2.0 ] {
Constant [ integer http\Client\Curl\Features\HTTP2 ] { 65536 }
Constant [ integer http\Client\Curl\Features\UNIX_SOCKETS ] { 524288 }
Constant [ integer http\Client\Curl\Features\PSL ] { 1048576 }
- Constant [ string http\Client\Curl\VERSIONS ] { libcurl/7.55.1 OpenSSL/1.1.0h zlib/1.2.11 libidn2/2.0.5 libpsl/0.18.0 (+libidn2/2.0.4) libssh2/1.8.0 nghttp2/1.31.1 }
- Constant [ string http\Client\Curl\Versions\CURL ] { 7.55.1 }
- Constant [ string http\Client\Curl\Versions\SSL ] { OpenSSL/1.1.0h }
+ Constant [ string http\Client\Curl\VERSIONS ] { libcurl/7.61.1 OpenSSL/1.1.1b zlib/1.2.11 brotli/1.0.5 libidn2/2.1.1 libpsl/0.20.2 (+libidn2/2.0.5) libssh/0.8.7/openssl/zlib nghttp2/1.34.0 }
+ Constant [ string http\Client\Curl\Versions\CURL ] { 7.61.1 }
+ Constant [ string http\Client\Curl\Versions\SSL ] { OpenSSL/1.1.1b }
Constant [ string http\Client\Curl\Versions\LIBZ ] { 1.2.11 }
Constant [ integer http\Client\Curl\HTTP_VERSION_1_0 ] { 1 }
Constant [ integer http\Client\Curl\HTTP_VERSION_1_1 ] { 2 }
@@ -72,7 +72,7 @@ Extension [ <persistent> extension #186 http version 3.2.0 ] {
Constant [ integer http\Client\Curl\POSTREDIR_ALL ] { 7 }
}
- - Classes [31] {
+ - Classes [33] {
Interface [ <internal:http> interface http\Exception ] {
- Constants [0] {
@@ -1041,6 +1041,132 @@ Extension [ <persistent> extension #186 http version 3.2.0 ] {
}
}
+ Class [ <internal:http> class http\Encoding\Stream\Enbrotli extends http\Encoding\Stream ] {
+
+ - Constants [12] {
+ Constant [ public integer FLUSH_NONE ] { 0 }
+ Constant [ public integer FLUSH_SYNC ] { 1048576 }
+ Constant [ public integer FLUSH_FULL ] { 2097152 }
+ Constant [ public integer LEVEL_MIN ] { 1 }
+ Constant [ public integer LEVEL_DEF ] { 4 }
+ Constant [ public integer LEVEL_MAX ] { 11 }
+ Constant [ public integer WBITS_MIN ] { 160 }
+ Constant [ public integer WBITS_DEF ] { 352 }
+ Constant [ public integer WBITS_MAX ] { 384 }
+ Constant [ public integer MODE_GENERIC ] { 0 }
+ Constant [ public integer MODE_TEXT ] { 4096 }
+ Constant [ public integer MODE_FONT ] { 8192 }
+ }
+
+ - Static properties [0] {
+ }
+
+ - Static methods [1] {
+ Method [ <internal:http> static public method encode ] {
+
+ - Parameters [2] {
+ Parameter #0 [ <required> $data ]
+ Parameter #1 [ <optional> $flags ]
+ }
+ }
+ }
+
+ - Properties [0] {
+ }
+
+ - Methods [5] {
+ Method [ <internal:http, inherits http\Encoding\Stream, ctor> public method __construct ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <optional> $flags ]
+ }
+ }
+
+ Method [ <internal:http, inherits http\Encoding\Stream> public method update ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $data ]
+ }
+ }
+
+ Method [ <internal:http, inherits http\Encoding\Stream> public method flush ] {
+
+ - Parameters [0] {
+ }
+ }
+
+ Method [ <internal:http, inherits http\Encoding\Stream> public method done ] {
+
+ - Parameters [0] {
+ }
+ }
+
+ Method [ <internal:http, inherits http\Encoding\Stream> public method finish ] {
+
+ - Parameters [0] {
+ }
+ }
+ }
+ }
+
+ Class [ <internal:http> class http\Encoding\Stream\Debrotli extends http\Encoding\Stream ] {
+
+ - Constants [3] {
+ Constant [ public integer FLUSH_NONE ] { 0 }
+ Constant [ public integer FLUSH_SYNC ] { 1048576 }
+ Constant [ public integer FLUSH_FULL ] { 2097152 }
+ }
+
+ - Static properties [0] {
+ }
+
+ - Static methods [1] {
+ Method [ <internal:http> static public method decode ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $data ]
+ }
+ }
+ }
+
+ - Properties [0] {
+ }
+
+ - Methods [5] {
+ Method [ <internal:http, inherits http\Encoding\Stream, ctor> public method __construct ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <optional> $flags ]
+ }
+ }
+
+ Method [ <internal:http, inherits http\Encoding\Stream> public method update ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $data ]
+ }
+ }
+
+ Method [ <internal:http, inherits http\Encoding\Stream> public method flush ] {
+
+ - Parameters [0] {
+ }
+ }
+
+ Method [ <internal:http, inherits http\Encoding\Stream> public method done ] {
+
+ - Parameters [0] {
+ }
+ }
+
+ Method [ <internal:http, inherits http\Encoding\Stream> public method finish ] {
+
+ - Parameters [0] {
+ }
+ }
+ }
+ }
+
Class [ <internal:http> class http\Header implements Serializable ] {
- Constants [5] {
@@ -1968,8 +2094,9 @@ Extension [ <persistent> extension #186 http version 3.2.0 ] {
Method [ <internal:http, prototype SplSubject> public method notify ] {
- - Parameters [1] {
+ - Parameters [2] {
Parameter #0 [ <optional> http\Client\Request or NULL $request ]
+ Parameter #1 [ <optional> $progress ]
}
}
@@ -2931,7 +3058,7 @@ Extension [ <persistent> extension #186 http version 3.2.0 ] {
Class [ <internal:http> class http\Env\Url extends http\Url ] {
- - Constants [19] {
+ - Constants [22] {
Constant [ public integer REPLACE ] { 0 }
Constant [ public integer JOIN_PATH ] { 1 }
Constant [ public integer JOIN_QUERY ] { 2 }
@@ -2951,6 +3078,9 @@ Extension [ <persistent> extension #186 http version 3.2.0 ] {
Constant [ public integer PARSE_TOIDN_2003 ] { 9437184 }
Constant [ public integer PARSE_TOIDN_2008 ] { 5242880 }
Constant [ public integer PARSE_TOPCT ] { 2097152 }
+ Constant [ public integer IGNORE_ERRORS ] { 268435456 }
+ Constant [ public integer SILENT_ERRORS ] { 536870912 }
+ Constant [ public integer STDFLAGS ] { 3350531 }
}
- Static properties [0] {
@@ -2971,7 +3101,7 @@ Extension [ <persistent> extension #186 http version 3.2.0 ] {
}
- Methods [5] {
- Method [ <internal:http, overwrites http\Url, ctor> public method __construct ] {
+ Method [ <internal:http, inherits http\Url, ctor> public method __construct ] {
- Parameters [3] {
Parameter #0 [ <optional> $old_url ]
@@ -2980,7 +3110,7 @@ Extension [ <persistent> extension #186 http version 3.2.0 ] {
}
}
- Method [ <internal:http, overwrites http\Url, prototype http\Url> public method mod ] {
+ Method [ <internal:http, inherits http\Url> public method mod ] {
- Parameters [2] {
Parameter #0 [ <required> $more_url_parts ]
@@ -2988,19 +3118,19 @@ Extension [ <persistent> extension #186 http version 3.2.0 ] {
}
}
- Method [ <internal:http, overwrites http\Url, prototype http\Url> public method toString ] {
+ Method [ <internal:http, inherits http\Url> public method toString ] {
- Parameters [0] {
}
}
- Method [ <internal:http, overwrites http\Url, prototype http\Url> public method __toString ] {
+ Method [ <internal:http, inherits http\Url> public method __toString ] {
- Parameters [0] {
}
}
- Method [ <internal:http, overwrites http\Url, prototype http\Url> public method toArray ] {
+ Method [ <internal:http, inherits http\Url> public method toArray ] {
- Parameters [0] {
}
diff --git a/pecl_http-upstream.patch b/pecl_http-upstream.patch
deleted file mode 100644
index e7a547f..0000000
--- a/pecl_http-upstream.patch
+++ /dev/null
@@ -1,701 +0,0 @@
-Create using git diff RELEASE_3_2_0 -- src >/tmp/pp
-
-
-diff --git a/src/php_http_api.h b/src/php_http_api.h
-index 91b2eb6..bca57f1 100644
---- a/src/php_http_api.h
-+++ b/src/php_http_api.h
-@@ -13,6 +13,14 @@
- #ifndef PHP_HTTP_API_H
- #define PHP_HTTP_API_H
-
-+#ifdef __COVERITY_GCC_VERSION_AT_LEAST
-+# define _Float128 float
-+# define _Float64 float
-+# define _Float32 float
-+# define _Float64x float
-+# define _Float32x float
-+#endif
-+
- #ifdef HAVE_CONFIG_H
- #include "config.h"
- #endif
-diff --git a/src/php_http_buffer.c b/src/php_http_buffer.c
-index c865065..5913cfc 100644
---- a/src/php_http_buffer.c
-+++ b/src/php_http_buffer.c
-@@ -10,7 +10,7 @@
- +--------------------------------------------------------------------+
- */
-
--#include "php.h"
-+#include "php_http_api.h"
- #include "php_http_buffer.h"
-
- PHP_HTTP_BUFFER_API php_http_buffer_t *php_http_buffer_init_ex(
-diff --git a/src/php_http_client.c b/src/php_http_client.c
-index 0749825..ed38522 100644
---- a/src/php_http_client.c
-+++ b/src/php_http_client.c
-@@ -583,7 +583,7 @@ static PHP_METHOD(HttpClient, __construct)
- php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|S!S!", &driver_name, &persistent_handle_name), invalid_arg, return);
-
- if (!zend_hash_num_elements(&php_http_client_drivers)) {
-- php_http_throw(unexpected_val, "No http\\Client drivers available", NULL);
-+ php_http_throw(unexpected_val, "No http\\Client drivers available");
- return;
- }
- if (!(driver = php_http_client_driver_get(driver_name))) {
-@@ -697,7 +697,7 @@ static PHP_METHOD(HttpClient, enqueue)
- msg_obj = PHP_HTTP_OBJ(NULL, request);
-
- if (php_http_client_enqueued(obj->client, msg_obj->message, NULL)) {
-- php_http_throw(bad_method_call, "Failed to enqueue request; request already in queue", NULL);
-+ php_http_throw(bad_method_call, "Failed to enqueue request; request already in queue");
- return;
- }
-
-@@ -749,7 +749,7 @@ static PHP_METHOD(HttpClient, dequeue)
- msg_obj = PHP_HTTP_OBJ(NULL, request);
-
- if (!php_http_client_enqueued(obj->client, msg_obj->message, NULL)) {
-- php_http_throw(bad_method_call, "Failed to dequeue request; request not in queue", NULL);
-+ php_http_throw(bad_method_call, "Failed to dequeue request; request not in queue");
- return;
- }
-
-@@ -843,7 +843,7 @@ static PHP_METHOD(HttpClient, getResponse)
- }
-
- /* not found for the request! */
-- php_http_throw(unexpected_val, "Could not find response for the request", NULL);
-+ php_http_throw(unexpected_val, "Could not find response for the request");
- return;
- }
-
-@@ -986,6 +986,7 @@ static int notify(zend_object_iterator *iter, void *puser)
-
- ZEND_BEGIN_ARG_INFO_EX(ai_HttpClient_notify, 0, 0, 0)
- ZEND_ARG_OBJ_INFO(0, request, http\\Client\\Request, 1)
-+ ZEND_ARG_INFO(0, progress)
- ZEND_END_ARG_INFO();
- static PHP_METHOD(HttpClient, notify)
- {
-@@ -999,7 +1000,7 @@ static PHP_METHOD(HttpClient, notify)
- observers = zend_read_property(php_http_client_class_entry, getThis(), ZEND_STRL("observers"), 0, &observers_tmp);
-
- if (Z_TYPE_P(observers) != IS_OBJECT) {
-- php_http_throw(unexpected_val, "Observer storage is corrupted", NULL);
-+ php_http_throw(unexpected_val, "Observer storage is corrupted");
- return;
- }
-
-@@ -1045,7 +1046,7 @@ static PHP_METHOD(HttpClient, attach)
- observers = zend_read_property(php_http_client_class_entry, getThis(), ZEND_STRL("observers"), 0, &observers_tmp);
-
- if (Z_TYPE_P(observers) != IS_OBJECT) {
-- php_http_throw(unexpected_val, "Observer storage is corrupted", NULL);
-+ php_http_throw(unexpected_val, "Observer storage is corrupted");
- return;
- }
-
-@@ -1072,7 +1073,7 @@ static PHP_METHOD(HttpClient, detach)
- observers = zend_read_property(php_http_client_class_entry, getThis(), ZEND_STRL("observers"), 0, &observers_tmp);
-
- if (Z_TYPE_P(observers) != IS_OBJECT) {
-- php_http_throw(unexpected_val, "Observer storage is corrupted", NULL);
-+ php_http_throw(unexpected_val, "Observer storage is corrupted");
- return;
- }
-
-@@ -1094,7 +1095,7 @@ static PHP_METHOD(HttpClient, getObservers)
- observers = zend_read_property(php_http_client_class_entry, getThis(), ZEND_STRL("observers"), 0, &observers_tmp);
-
- if (Z_TYPE_P(observers) != IS_OBJECT) {
-- php_http_throw(unexpected_val, "Observer storage is corrupted", NULL);
-+ php_http_throw(unexpected_val, "Observer storage is corrupted");
- return;
- }
-
-@@ -1314,7 +1315,7 @@ static PHP_METHOD(HttpClient, setDebug)
- }
-
- static zend_function_entry php_http_client_methods[] = {
-- PHP_ME(HttpClient, __construct, ai_HttpClient_construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
-+ PHP_ME(HttpClient, __construct, ai_HttpClient_construct, ZEND_ACC_PUBLIC)
- PHP_ME(HttpClient, reset, ai_HttpClient_reset, ZEND_ACC_PUBLIC)
- PHP_ME(HttpClient, enqueue, ai_HttpClient_enqueue, ZEND_ACC_PUBLIC)
- PHP_ME(HttpClient, dequeue, ai_HttpClient_dequeue, ZEND_ACC_PUBLIC)
-diff --git a/src/php_http_client_curl.c b/src/php_http_client_curl.c
-index b17d8a6..45515fa 100644
---- a/src/php_http_client_curl.c
-+++ b/src/php_http_client_curl.c
-@@ -516,7 +516,11 @@ static ZEND_RESULT_CODE php_http_curle_get_info(CURL *ch, HashTable *info)
- zval ti_array, subarray;
- struct curl_tlssessioninfo *ti;
-
-+#if PHP_HTTP_CURL_VERSION(7,48,0)
-+ if (CURLE_OK == curl_easy_getinfo(ch, CURLINFO_TLS_SSL_PTR, &ti)) {
-+#else
- if (CURLE_OK == curl_easy_getinfo(ch, CURLINFO_TLS_SESSION, &ti)) {
-+#endif
- char *backend;
-
- ZVAL_NULL(&subarray);
-@@ -530,15 +534,22 @@ static ZEND_RESULT_CODE php_http_curle_get_info(CURL *ch, HashTable *info)
- backend = "openssl";
- #if PHP_HTTP_HAVE_LIBCURL_OPENSSL
- {
-+#if PHP_HTTP_CURL_VERSION(7,48,0)
-+ SSL *ssl = ti->internals;
-+ SSL_CTX *ctx = ssl ? SSL_get_SSL_CTX(ssl) : NULL;
-+#else
- SSL_CTX *ctx = ti->internals;
-+#endif
-
- array_init(&subarray);
-- add_assoc_long_ex(&subarray, ZEND_STRL("number"), SSL_CTX_sess_number(ctx));
-- add_assoc_long_ex(&subarray, ZEND_STRL("connect"), SSL_CTX_sess_connect(ctx));
-- add_assoc_long_ex(&subarray, ZEND_STRL("connect_good"), SSL_CTX_sess_connect_good(ctx));
-- add_assoc_long_ex(&subarray, ZEND_STRL("connect_renegotiate"), SSL_CTX_sess_connect_renegotiate(ctx));
-- add_assoc_long_ex(&subarray, ZEND_STRL("hits"), SSL_CTX_sess_hits(ctx));
-- add_assoc_long_ex(&subarray, ZEND_STRL("cache_full"), SSL_CTX_sess_cache_full(ctx));
-+ if (ctx) {
-+ add_assoc_long_ex(&subarray, ZEND_STRL("number"), SSL_CTX_sess_number(ctx));
-+ add_assoc_long_ex(&subarray, ZEND_STRL("connect"), SSL_CTX_sess_connect(ctx));
-+ add_assoc_long_ex(&subarray, ZEND_STRL("connect_good"), SSL_CTX_sess_connect_good(ctx));
-+ add_assoc_long_ex(&subarray, ZEND_STRL("connect_renegotiate"), SSL_CTX_sess_connect_renegotiate(ctx));
-+ add_assoc_long_ex(&subarray, ZEND_STRL("hits"), SSL_CTX_sess_hits(ctx));
-+ add_assoc_long_ex(&subarray, ZEND_STRL("cache_full"), SSL_CTX_sess_cache_full(ctx));
-+ }
- }
- #endif
- break;
-@@ -550,11 +561,13 @@ static ZEND_RESULT_CODE php_http_curle_get_info(CURL *ch, HashTable *info)
- char *desc;
-
- array_init(&subarray);
-- if ((desc = gnutls_session_get_desc(sess))) {
-- add_assoc_string_ex(&subarray, ZEND_STRL("desc"), desc);
-- gnutls_free(desc);
-+ if (sess) {
-+ if ((desc = gnutls_session_get_desc(sess))) {
-+ add_assoc_string_ex(&subarray, ZEND_STRL("desc"), desc);
-+ gnutls_free(desc);
-+ }
-+ add_assoc_bool_ex(&subarray, ZEND_STRL("resumed"), gnutls_session_is_resumed(sess));
- }
-- add_assoc_bool_ex(&subarray, ZEND_STRL("resumed"), gnutls_session_is_resumed(sess));
- }
- #endif
- break;
-@@ -2061,6 +2074,8 @@ static void php_http_client_curl_handler_clear(php_http_client_curl_handler_t *h
- curl_easy_setopt(handler->handle, CURLOPT_DEBUGFUNCTION, NULL);
- curl_easy_setopt(handler->handle, CURLOPT_COOKIELIST, "FLUSH");
- curl_easy_setopt(handler->handle, CURLOPT_SHARE, NULL);
-+ /* see gh issue #84 */
-+ curl_easy_setopt(handler->handle, CURLOPT_COOKIEJAR, NULL);
- }
-
- static void php_http_client_curl_handler_dtor(php_http_client_curl_handler_t *handler)
-diff --git a/src/php_http_client_curl.h b/src/php_http_client_curl.h
-index 21b6834..61723b9 100644
---- a/src/php_http_client_curl.h
-+++ b/src/php_http_client_curl.h
-@@ -43,13 +43,27 @@ typedef struct php_http_client_curl {
-
- static inline void php_http_client_curl_get_timeout(php_http_client_curl_t *curl, long max_tout, struct timeval *timeout)
- {
-- if ((CURLM_OK == curl_multi_timeout(curl->handle->multi, &max_tout)) && (max_tout > 0)) {
-- timeout->tv_sec = max_tout / 1000;
-- timeout->tv_usec = (max_tout % 1000) * 1000;
-- } else {
-- timeout->tv_sec = 0;
-- timeout->tv_usec = 1000;
-+ timeout->tv_sec = 0;
-+ timeout->tv_usec = 0;
-+
-+ /* always returns CURLM_OK, check max_tout instead */
-+ curl_multi_timeout(curl->handle->multi, &max_tout);
-+
-+ if (!max_tout) {
-+ /* immediately */
-+ return;
- }
-+
-+ if (max_tout < 0) {
-+ /* 5ms */
-+ max_tout = 5;
-+ } else if (max_tout > 1000) {
-+ /* 1s */
-+ max_tout = 1000;
-+ }
-+
-+ timeout->tv_sec = max_tout / 1000;
-+ timeout->tv_usec = (max_tout % 1000) * 1000;
- }
-
- PHP_HTTP_API void php_http_client_curl_responsehandler(php_http_client_t *client);
-diff --git a/src/php_http_client_request.c b/src/php_http_client_request.c
-index 71a9129..9055f49 100644
---- a/src/php_http_client_request.c
-+++ b/src/php_http_client_request.c
-@@ -273,7 +273,7 @@ static PHP_METHOD(HttpClientRequest, getSslOptions)
- }
-
- static zend_function_entry php_http_client_request_methods[] = {
-- PHP_ME(HttpClientRequest, __construct, ai_HttpClientRequest___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
-+ PHP_ME(HttpClientRequest, __construct, ai_HttpClientRequest___construct, ZEND_ACC_PUBLIC)
- PHP_ME(HttpClientRequest, setContentType, ai_HttpClientRequest_setContentType, ZEND_ACC_PUBLIC)
- PHP_ME(HttpClientRequest, getContentType, ai_HttpClientRequest_getContentType, ZEND_ACC_PUBLIC)
- PHP_ME(HttpClientRequest, setQuery, ai_HttpClientRequest_setQuery, ZEND_ACC_PUBLIC)
-diff --git a/src/php_http_client_response.c b/src/php_http_client_response.c
-index 5acddae..34748aa 100644
---- a/src/php_http_client_response.c
-+++ b/src/php_http_client_response.c
-@@ -105,7 +105,7 @@ static PHP_METHOD(HttpClientResponse, getTransferInfo)
-
- /* request completed? */
- if (Z_TYPE_P(info) != IS_OBJECT) {
-- php_http_throw(bad_method_call, "Incomplete state", NULL);
-+ php_http_throw(bad_method_call, "Incomplete state");
- return;
- }
-
-diff --git a/src/php_http_encoding.c b/src/php_http_encoding.c
-index c20e163..4e25de3 100644
---- a/src/php_http_encoding.c
-+++ b/src/php_http_encoding.c
-@@ -528,7 +528,7 @@ static PHP_METHOD(HttpEncodingStream, __construct)
- obj = PHP_HTTP_OBJ(NULL, getThis());
-
- if (UNEXPECTED(obj->stream)) {
-- php_http_throw(bad_method_call, "http\\Encoding\\Stream cannot be initialized twice", NULL);
-+ php_http_throw(bad_method_call, "http\\Encoding\\Stream cannot be initialized twice");
- return;
- }
-
-@@ -640,7 +640,7 @@ static PHP_METHOD(HttpEncodingStream, finish)
- }
-
- static zend_function_entry php_http_encoding_stream_methods[] = {
-- PHP_ME(HttpEncodingStream, __construct, ai_HttpEncodingStream___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
-+ PHP_ME(HttpEncodingStream, __construct, ai_HttpEncodingStream___construct, ZEND_ACC_PUBLIC)
- PHP_ME(HttpEncodingStream, update, ai_HttpEncodingStream_update, ZEND_ACC_PUBLIC)
- PHP_ME(HttpEncodingStream, flush, ai_HttpEncodingStream_flush, ZEND_ACC_PUBLIC)
- PHP_ME(HttpEncodingStream, done, ai_HttpEncodingStream_done, ZEND_ACC_PUBLIC)
-diff --git a/src/php_http_env.c b/src/php_http_env.c
-index 21bd89a..4afcd31 100644
---- a/src/php_http_env.c
-+++ b/src/php_http_env.c
-@@ -501,7 +501,7 @@ ZEND_RESULT_CODE php_http_env_set_response_header_value(long http_code, const ch
- return FAILURE;
- }
- h.response_code = http_code;
-- h.line_len = spprintf(&h.line, 0, "%.*s: %.*s", (int) name_len, name_str, data->len, data->val);
-+ h.line_len = spprintf(&h.line, 0, "%s: %s", name_str, data->val);
-
- ret = sapi_header_op(replace ? SAPI_HEADER_REPLACE : SAPI_HEADER_ADD, (void *) &h);
-
-diff --git a/src/php_http_env_request.c b/src/php_http_env_request.c
-index b5454ed..7c6eea8 100644
---- a/src/php_http_env_request.c
-+++ b/src/php_http_env_request.c
-@@ -245,7 +245,7 @@ static PHP_METHOD(HttpEnvRequest, getFiles)
- }
-
- static zend_function_entry php_http_env_request_methods[] = {
-- PHP_ME(HttpEnvRequest, __construct, ai_HttpEnvRequest___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
-+ PHP_ME(HttpEnvRequest, __construct, ai_HttpEnvRequest___construct, ZEND_ACC_PUBLIC)
- PHP_ME(HttpEnvRequest, getForm, ai_HttpEnvRequest_getForm, ZEND_ACC_PUBLIC)
- PHP_ME(HttpEnvRequest, getQuery, ai_HttpEnvRequest_getQuery, ZEND_ACC_PUBLIC)
- PHP_ME(HttpEnvRequest, getCookie, ai_HttpEnvRequest_getCookie, ZEND_ACC_PUBLIC)
-diff --git a/src/php_http_env_response.c b/src/php_http_env_response.c
-index 40ef4fe..f5d2da9 100644
---- a/src/php_http_env_response.c
-+++ b/src/php_http_env_response.c
-@@ -1393,7 +1393,7 @@ static PHP_METHOD(HttpEnvResponse, send)
- }
-
- static zend_function_entry php_http_env_response_methods[] = {
-- PHP_ME(HttpEnvResponse, __construct, ai_HttpEnvResponse___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
-+ PHP_ME(HttpEnvResponse, __construct, ai_HttpEnvResponse___construct, ZEND_ACC_PUBLIC)
- PHP_ME(HttpEnvResponse, __invoke, ai_HttpEnvResponse___invoke, ZEND_ACC_PUBLIC)
- PHP_ME(HttpEnvResponse, setEnvRequest, ai_HttpEnvResponse_setEnvRequest, ZEND_ACC_PUBLIC)
- PHP_ME(HttpEnvResponse, setCookie, ai_HttpEnvResponse_setCookie, ZEND_ACC_PUBLIC)
-diff --git a/src/php_http_exception.h b/src/php_http_exception.h
-index e3e66f1..a7a0f7e 100644
---- a/src/php_http_exception.h
-+++ b/src/php_http_exception.h
-@@ -14,8 +14,8 @@
- #define PHP_HTTP_EXCEPTION_H
-
- /* short hand for zend_throw_exception_ex */
--#define php_http_throw(e, fmt, ...) \
-- zend_throw_exception_ex(php_http_get_exception_ ##e## _class_entry(), 0, fmt, __VA_ARGS__)
-+#define php_http_throw(e, ...) \
-+ zend_throw_exception_ex(php_http_get_exception_ ##e## _class_entry(), 0, __VA_ARGS__)
-
- /* wrap a call with replaced zend_error_handling */
- #define php_http_expect(test, e, fail) \
-diff --git a/src/php_http_header.c b/src/php_http_header.c
-index 8c71cde..4c9a702 100644
---- a/src/php_http_header.c
-+++ b/src/php_http_header.c
-@@ -398,7 +398,7 @@ PHP_METHOD(HttpHeader, parse)
- }
-
- static zend_function_entry php_http_header_methods[] = {
-- PHP_ME(HttpHeader, __construct, ai_HttpHeader___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
-+ PHP_ME(HttpHeader, __construct, ai_HttpHeader___construct, ZEND_ACC_PUBLIC)
- PHP_ME(HttpHeader, serialize, ai_HttpHeader_serialize, ZEND_ACC_PUBLIC)
- ZEND_MALIAS(HttpHeader, __toString, serialize, ai_HttpHeader_serialize, ZEND_ACC_PUBLIC)
- ZEND_MALIAS(HttpHeader, toString, serialize, ai_HttpHeader_serialize, ZEND_ACC_PUBLIC)
-diff --git a/src/php_http_message.c b/src/php_http_message.c
-index 49aa0f9..55fdb81 100644
---- a/src/php_http_message.c
-+++ b/src/php_http_message.c
-@@ -510,7 +510,8 @@ zend_class_entry *php_http_message_get_class_entry(void)
- }
-
- static zval *php_http_message_object_read_prop(zval *object, zval *member, int type, void **cache_slot, zval *rv);
--static void php_http_message_object_write_prop(zval *object, zval *member, zval *value, void **cache_slot);
-+
-+static PHP_WRITE_PROP_HANDLER_TYPE php_http_message_object_write_prop(zval *object, zval *member, zval *value, void **cache_slot);
-
- static zend_object_handlers php_http_message_object_handlers;
- static HashTable php_http_message_object_prophandlers;
-@@ -776,7 +777,7 @@ ZEND_RESULT_CODE php_http_message_object_set_body(php_http_message_object_t *msg
- case IS_RESOURCE:
- php_stream_from_zval_no_verify(s, zbody);
- if (!s) {
-- php_http_throw(unexpected_val, "The stream is not a valid resource", NULL);
-+ php_http_throw(unexpected_val, "The stream is not a valid resource");
- return FAILURE;
- }
-
-@@ -894,6 +895,13 @@ void php_http_message_object_free(zend_object *object)
- zend_object_std_dtor(object);
- }
-
-+#if PHP_VERSION_ID >= 70400
-+static zval *php_http_message_object_get_prop_ptr(zval *object, zval *member, int type, void **cache_slot)
-+{
-+ return NULL;
-+}
-+#endif
-+
- static zval *php_http_message_object_read_prop(zval *object, zval *member, int type, void **cache_slot, zval *tmp)
- {
- zval *return_value;
-@@ -923,7 +931,7 @@ static zval *php_http_message_object_read_prop(zval *object, zval *member, int t
- return return_value;
- }
-
--static void php_http_message_object_write_prop(zval *object, zval *member, zval *value, void **cache_slot)
-+static PHP_WRITE_PROP_HANDLER_TYPE php_http_message_object_write_prop(zval *object, zval *member, zval *value, void **cache_slot)
- {
- php_http_message_object_t *obj = PHP_HTTP_OBJ(NULL, object);
- php_http_message_object_prophandler_t *handler;
-@@ -938,6 +946,7 @@ static void php_http_message_object_write_prop(zval *object, zval *member, zval
- }
-
- zend_string_release(member_name);
-+ PHP_WRITE_PROP_HANDLER_RETURN(value);
- }
-
- static HashTable *php_http_message_object_get_debug_info(zval *object, int *is_temp)
-@@ -1076,7 +1085,7 @@ static PHP_METHOD(HttpMessage, __construct)
- php_http_buffer_init_ex(&buf, 0x1000, PHP_HTTP_BUFFER_INIT_PREALLOC);
- if (PHP_HTTP_MESSAGE_PARSER_STATE_FAILURE == php_http_message_parser_parse_stream(&p, &buf, s, flags, &msg)) {
- if (!EG(exception)) {
-- php_http_throw(bad_message, "Could not parse message from stream", NULL);
-+ php_http_throw(bad_message, "Could not parse message from stream");
- }
- }
- php_http_buffer_dtor(&buf);
-@@ -1084,7 +1093,7 @@ static PHP_METHOD(HttpMessage, __construct)
- }
-
- if (!msg && !EG(exception)) {
-- php_http_throw(bad_message, "Empty message received from stream", NULL);
-+ php_http_throw(bad_message, "Empty message received from stream");
- }
- } else if (zmessage) {
- zend_string *zs_msg = zval_get_string(zmessage);
-@@ -1092,7 +1101,7 @@ static PHP_METHOD(HttpMessage, __construct)
- msg = php_http_message_parse(NULL, zs_msg->val, zs_msg->len, greedy);
-
- if (!msg && !EG(exception)) {
-- php_http_throw(bad_message, "Could not parse message: %.*s", MIN(25, zs_msg->len), zs_msg->val);
-+ php_http_throw(bad_message, "Could not parse message: %.*s", (int) MIN(25, zs_msg->len), zs_msg->val);
- }
- zend_string_release(zs_msg);
- }
-@@ -1492,7 +1501,7 @@ static PHP_METHOD(HttpMessage, setResponseCode)
- PHP_HTTP_MESSAGE_OBJECT_INIT(obj);
-
- if (obj->message->type != PHP_HTTP_RESPONSE) {
-- php_http_throw(bad_method_call, "http\\Message is not of type response", NULL);
-+ php_http_throw(bad_method_call, "http\\Message is not of type response");
- return;
- }
-
-@@ -1544,7 +1553,7 @@ static PHP_METHOD(HttpMessage, setResponseStatus)
- PHP_HTTP_MESSAGE_OBJECT_INIT(obj);
-
- if (obj->message->type != PHP_HTTP_RESPONSE) {
-- php_http_throw(bad_method_call, "http\\Message is not of type response", NULL);
-+ php_http_throw(bad_method_call, "http\\Message is not of type response");
- }
-
- PTR_SET(obj->message->http.info.response.status, estrndup(status, status_len));
-@@ -1589,12 +1598,12 @@ static PHP_METHOD(HttpMessage, setRequestMethod)
- PHP_HTTP_MESSAGE_OBJECT_INIT(obj);
-
- if (obj->message->type != PHP_HTTP_REQUEST) {
-- php_http_throw(bad_method_call, "http\\Message is not of type request", NULL);
-+ php_http_throw(bad_method_call, "http\\Message is not of type request");
- return;
- }
-
- if (method_len < 1) {
-- php_http_throw(invalid_arg, "Cannot set http\\Message's request method to an empty string", NULL);
-+ php_http_throw(invalid_arg, "Cannot set http\\Message's request method to an empty string");
- return;
- }
-
-@@ -1645,7 +1654,7 @@ static PHP_METHOD(HttpMessage, setRequestUrl)
- PHP_HTTP_MESSAGE_OBJECT_INIT(obj);
-
- if (obj->message->type != PHP_HTTP_REQUEST) {
-- php_http_throw(bad_method_call, "http\\Message is not of type request", NULL);
-+ php_http_throw(bad_method_call, "http\\Message is not of type request");
- return;
- }
-
-@@ -1655,7 +1664,7 @@ static PHP_METHOD(HttpMessage, setRequestUrl)
-
- if (url && php_http_url_is_empty(url)) {
- php_http_url_free(&url);
-- php_http_throw(invalid_arg, "Cannot set http\\Message's request url to an empty string", NULL);
-+ php_http_throw(invalid_arg, "Cannot set http\\Message's request url to an empty string");
- } else if (url) {
- PTR_SET(obj->message->http.info.request.url, url);
- }
-@@ -1675,7 +1684,7 @@ static PHP_METHOD(HttpMessage, getParentMessage)
- PHP_HTTP_MESSAGE_OBJECT_INIT(obj);
-
- if (!obj->message->parent) {
-- php_http_throw(unexpected_val, "http\\Message has not parent message", NULL);
-+ php_http_throw(unexpected_val, "http\\Message has no parent message");
- return;
- }
-
-@@ -1832,7 +1841,7 @@ static PHP_METHOD(HttpMessage, prepend)
- for (msg[0] = obj->message; msg[0]; msg[0] = msg[0]->parent) {
- for (msg[1] = prepend_obj->message; msg[1]; msg[1] = msg[1]->parent) {
- if (msg[0] == msg[1]) {
-- php_http_throw(unexpected_val, "Cannot prepend a message located within the same message chain", NULL);
-+ php_http_throw(unexpected_val, "Cannot prepend a message located within the same message chain");
- return;
- }
- }
-@@ -1892,7 +1901,7 @@ static PHP_METHOD(HttpMessage, splitMultipartBody)
- PHP_HTTP_MESSAGE_OBJECT_INIT(obj);
-
- if (!php_http_message_is_multipart(obj->message, &boundary)) {
-- php_http_throw(bad_method_call, "http\\Message is not a multipart message", NULL);
-+ php_http_throw(bad_method_call, "http\\Message is not a multipart message");
- return;
- }
-
-@@ -1993,7 +2002,7 @@ static PHP_METHOD(HttpMessage, current)
- }
-
- static zend_function_entry php_http_message_methods[] = {
-- PHP_ME(HttpMessage, __construct, ai_HttpMessage___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
-+ PHP_ME(HttpMessage, __construct, ai_HttpMessage___construct, ZEND_ACC_PUBLIC)
- PHP_ME(HttpMessage, getBody, ai_HttpMessage_getBody, ZEND_ACC_PUBLIC)
- PHP_ME(HttpMessage, setBody, ai_HttpMessage_setBody, ZEND_ACC_PUBLIC)
- PHP_ME(HttpMessage, addBody, ai_HttpMessage_addBody, ZEND_ACC_PUBLIC)
-@@ -2062,7 +2071,11 @@ PHP_MINIT_FUNCTION(http_message)
- php_http_message_object_handlers.read_property = php_http_message_object_read_prop;
- php_http_message_object_handlers.write_property = php_http_message_object_write_prop;
- php_http_message_object_handlers.get_debug_info = php_http_message_object_get_debug_info;
-+#if PHP_VERSION_ID >= 70400
-+ php_http_message_object_handlers.get_property_ptr_ptr = php_http_message_object_get_prop_ptr;
-+#else
- php_http_message_object_handlers.get_property_ptr_ptr = NULL;
-+#endif
- php_http_message_object_handlers.get_gc = php_http_message_object_get_gc;
-
- zend_class_implements(php_http_message_class_entry, 3, spl_ce_Countable, zend_ce_serializable, zend_ce_iterator);
-diff --git a/src/php_http_message_body.c b/src/php_http_message_body.c
-index 518dbc9..79c8bf7 100644
---- a/src/php_http_message_body.c
-+++ b/src/php_http_message_body.c
-@@ -907,7 +907,7 @@ PHP_METHOD(HttpMessageBody, stat)
- }
-
- static zend_function_entry php_http_message_body_methods[] = {
-- PHP_ME(HttpMessageBody, __construct, ai_HttpMessageBody___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
-+ PHP_ME(HttpMessageBody, __construct, ai_HttpMessageBody___construct, ZEND_ACC_PUBLIC)
- PHP_ME(HttpMessageBody, __toString, ai_HttpMessageBody___toString, ZEND_ACC_PUBLIC)
- PHP_MALIAS(HttpMessageBody, toString, __toString, ai_HttpMessageBody___toString, ZEND_ACC_PUBLIC)
- PHP_MALIAS(HttpMessageBody, serialize, __toString, ai_HttpMessageBody___toString, ZEND_ACC_PUBLIC)
-diff --git a/src/php_http_misc.h b/src/php_http_misc.h
-index 35de35e..b91638e 100644
---- a/src/php_http_misc.h
-+++ b/src/php_http_misc.h
-@@ -99,7 +99,11 @@ static inline const char *php_http_locate_bin_eol(const char *bin, size_t len, i
-
- #if PHP_DEBUG
- # undef HASH_OF
--# define HASH_OF(p) ((HashTable*)(Z_TYPE_P(p)==IS_ARRAY ? Z_ARRVAL_P(p) : ((Z_TYPE_P(p)==IS_OBJECT ? Z_OBJ_HT_P(p)->get_properties((p)) : NULL))))
-+# if PHP_VERSION_ID >= 70500
-+# define HASH_OF(p) ((HashTable*)(Z_TYPE_P(p)==IS_ARRAY ? Z_ARRVAL_P(p) : ((Z_TYPE_P(p)==IS_OBJECT ? Z_OBJ_HT_P(p)->get_properties(Z_OBJ_P(p)) : NULL))))
-+# else
-+# define HASH_OF(p) ((HashTable*)(Z_TYPE_P(p)==IS_ARRAY ? Z_ARRVAL_P(p) : ((Z_TYPE_P(p)==IS_OBJECT ? Z_OBJ_HT_P(p)->get_properties((p)) : NULL))))
-+# endif
- #endif
-
- #ifndef GC_SET_REFCOUNT
-@@ -128,6 +132,14 @@ static inline const char *php_http_locate_bin_eol(const char *bin, size_t len, i
- # define HT_UNPROTECT_RECURSION(ht) GC_UNPROTECT_RECURSION(ht)
- #endif
-
-+#if PHP_VERSION_ID >= 70400
-+# define PHP_WRITE_PROP_HANDLER_TYPE zval *
-+# define PHP_WRITE_PROP_HANDLER_RETURN(v) return v
-+#else
-+# define PHP_WRITE_PROP_HANDLER_TYPE void
-+# define PHP_WRITE_PROP_HANDLER_RETURN(v)
-+#endif
-+
- static inline void *PHP_HTTP_OBJ(zend_object *zo, zval *zv)
- {
- if (!zo) {
-diff --git a/src/php_http_params.c b/src/php_http_params.c
-index 0cbfc7e..92c1441 100644
---- a/src/php_http_params.c
-+++ b/src/php_http_params.c
-@@ -1290,7 +1290,7 @@ PHP_METHOD(HttpParams, offsetSet)
- }
-
- static zend_function_entry php_http_params_methods[] = {
-- PHP_ME(HttpParams, __construct, ai_HttpParams___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR|ZEND_ACC_FINAL)
-+ PHP_ME(HttpParams, __construct, ai_HttpParams___construct, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
-
- PHP_ME(HttpParams, toArray, ai_HttpParams_toArray, ZEND_ACC_PUBLIC)
- PHP_ME(HttpParams, toString, ai_HttpParams_toString, ZEND_ACC_PUBLIC)
-diff --git a/src/php_http_querystring.c b/src/php_http_querystring.c
-index 96b58a7..bd3afe5 100644
---- a/src/php_http_querystring.c
-+++ b/src/php_http_querystring.c
-@@ -103,7 +103,7 @@ ZEND_RESULT_CODE php_http_querystring_xlate(zval *dst, zval *src, const char *ie
- {
- if (key.key) {
- if (PHP_ICONV_ERR_SUCCESS != php_iconv_string(key.key->val, key.key->len, &xkey, oe, ie)) {
-- php_error_docref(NULL, E_WARNING, "Failed to convert '%.*s' from '%s' to '%s'", key.key->len, key.key->val, ie, oe);
-+ php_error_docref(NULL, E_WARNING, "Failed to convert '%.*s' from '%s' to '%s'", (int) key.key->len, key.key->val, ie, oe);
- return FAILURE;
- }
- }
-@@ -113,7 +113,7 @@ ZEND_RESULT_CODE php_http_querystring_xlate(zval *dst, zval *src, const char *ie
- if (key.key) {
- zend_string_release(xkey);
- }
-- php_error_docref(NULL, E_WARNING, "Failed to convert '%.*s' from '%s' to '%s'", Z_STRLEN_P(entry), Z_STRVAL_P(entry), ie, oe);
-+ php_error_docref(NULL, E_WARNING, "Failed to convert '%.*s' from '%s' to '%s'", (int) Z_STRLEN_P(entry), Z_STRVAL_P(entry), ie, oe);
- return FAILURE;
- }
- if (key.key) {
-@@ -370,23 +370,28 @@ ZEND_END_ARG_INFO();
- PHP_METHOD(HttpQueryString, getGlobalInstance)
- {
- zval *instance, *_GET;
-- zend_string *zs;
-
- php_http_expect(SUCCESS == zend_parse_parameters_none(), invalid_arg, return);
-
-- zs = zend_string_init(ZEND_STRL("instance"), 0);
-- instance = zend_std_get_static_property(php_http_querystring_class_entry, zs, 0);
-- zend_string_release(zs);
-+ instance = zend_read_static_property(php_http_querystring_class_entry, ZEND_STRL("instance"), 0);
-
- if (Z_TYPE_P(instance) == IS_OBJECT) {
- RETVAL_ZVAL(instance, 1, 0);
- } else if ((_GET = php_http_env_get_superglobal(ZEND_STRL("_GET")))) {
-+ zval tmp, *qa;
-+
- ZVAL_OBJ(return_value, php_http_querystring_object_new(php_http_querystring_class_entry));
-
-- ZVAL_MAKE_REF(_GET);
-- zend_update_property(php_http_querystring_class_entry, return_value, ZEND_STRL("queryArray"), _GET);
-+ ZVAL_STRING(&tmp, "queryArray");
-+ qa = Z_OBJ_HT_P(return_value)->get_property_ptr_ptr(return_value, &tmp, BP_VAR_RW, NULL);
-+ zval_ptr_dtor(&tmp);
-+
-+ ZVAL_NEW_REF(_GET, _GET);
-+ ZVAL_COPY(qa, _GET);
-+
-+ zend_update_static_property(php_http_querystring_class_entry, ZEND_STRL("instance"), return_value);
- } else {
-- php_http_throw(unexpected_val, "Could not acquire reference to superglobal GET array", NULL);
-+ php_http_throw(unexpected_val, "Could not acquire reference to superglobal GET array");
- }
-
- }
-@@ -680,7 +685,7 @@ PHP_METHOD(HttpQueryString, offsetUnset)
- }
-
- static zend_function_entry php_http_querystring_methods[] = {
-- PHP_ME(HttpQueryString, __construct, ai_HttpQueryString___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR|ZEND_ACC_FINAL)
-+ PHP_ME(HttpQueryString, __construct, ai_HttpQueryString___construct, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
-
- PHP_ME(HttpQueryString, toArray, ai_HttpQueryString_toArray, ZEND_ACC_PUBLIC)
- PHP_ME(HttpQueryString, toString, ai_HttpQueryString_toString, ZEND_ACC_PUBLIC)
-diff --git a/src/php_http_url.c b/src/php_http_url.c
-index 71ca6e9..24a13ff 100644
---- a/src/php_http_url.c
-+++ b/src/php_http_url.c
-@@ -2035,7 +2035,7 @@ PHP_METHOD(HttpUrl, toArray)
- }
-
- static zend_function_entry php_http_url_methods[] = {
-- PHP_ME(HttpUrl, __construct, ai_HttpUrl___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
-+ PHP_ME(HttpUrl, __construct, ai_HttpUrl___construct, ZEND_ACC_PUBLIC)
- PHP_ME(HttpUrl, mod, ai_HttpUrl_mod, ZEND_ACC_PUBLIC)
- PHP_ME(HttpUrl, toString, ai_HttpUrl_toString, ZEND_ACC_PUBLIC)
- ZEND_MALIAS(HttpUrl, __toString, toString, ai_HttpUrl_toString, ZEND_ACC_PUBLIC)
-@@ -2088,14 +2088,14 @@ PHP_MINIT_FUNCTION(http_url)
- #endif
- zend_declare_class_constant_long(php_http_url_class_entry, ZEND_STRL("PARSE_TOPCT"), PHP_HTTP_URL_PARSE_TOPCT);
-
-- INIT_NS_CLASS_ENTRY(ce, "http\\Env", "Url", php_http_url_methods);
-- php_http_env_url_class_entry = zend_register_internal_class_ex(&ce, php_http_url_class_entry);
--
- zend_declare_class_constant_long(php_http_url_class_entry, ZEND_STRL("IGNORE_ERRORS"), PHP_HTTP_URL_IGNORE_ERRORS);
- zend_declare_class_constant_long(php_http_url_class_entry, ZEND_STRL("SILENT_ERRORS"), PHP_HTTP_URL_SILENT_ERRORS);
-
- zend_declare_class_constant_long(php_http_url_class_entry, ZEND_STRL("STDFLAGS"), PHP_HTTP_URL_STDFLAGS);
-
-+ INIT_NS_CLASS_ENTRY(ce, "http\\Env", "Url", NULL);
-+ php_http_env_url_class_entry = zend_register_internal_class_ex(&ce, php_http_url_class_entry);
-+
- return SUCCESS;
- }
-
-diff --git a/src/php_http_url.h b/src/php_http_url.h
-index 6d4b09d..eead59a 100644
---- a/src/php_http_url.h
-+++ b/src/php_http_url.h
-@@ -62,7 +62,6 @@
- #define PHP_HTTP_URL_STDFLAGS 0x00332003
-
- typedef struct php_http_url {
-- /* compatible to php_url, but do not use php_url_free() */
- char *scheme;
- char *user;
- char *pass;
diff --git a/php-pecl-http.spec b/php-pecl-http.spec
index 7535e60..5030a27 100644
--- a/php-pecl-http.spec
+++ b/php-pecl-http.spec
@@ -41,7 +41,7 @@
%global with_tests 0%{!?_without_tests:1}
%endif
-%global upstream_version 3.2.0
+%global upstream_version 3.2.1
#global upstream_prever RC1
Name: %{?sub_prefix}php-pecl-http
@@ -50,7 +50,7 @@ Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
Release: 0.5.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{pecl_name}-%{version}-%{gh_short}.tar.gz
%else
-Release: 5%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Source0: http://pecl.php.net/get/%{proj_name}-%{upstream_version}%{?upstream_prever}.tgz
%endif
Summary: Extended HTTP support
@@ -61,9 +61,6 @@ URL: http://pecl.php.net/package/pecl_http
# From http://www.php.net/manual/en/http.configuration.php
Source1: %{proj_name}.ini
-Patch0: https://patch-diff.githubusercontent.com/raw/m6w6/ext-http/pull/85.patch
-Patch1: %{proj_name}-upstream.patch
-
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel >= 7
BuildRequires: %{?scl_prefix}php-hash
@@ -173,14 +170,6 @@ mv %{proj_name}-%{upstream_version}%{?upstream_prever} NTS
%{?_licensedir:sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml}
cd NTS
-%if "%{php_version}" > "7.4"
-%patch1 -p1 -b .up
-rm tests/etag001.phpt
-rm tests/message015.phpt
-%else
-%patch0 -p1 -b .pr85
-%endif
-
extver=$(sed -n '/#define PHP_PECL_HTTP_VERSION/{s/.* "//;s/".*$//;p}' php_http.h)
if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}%{?gh_date:dev}"; then
: Error: Upstream HTTP version is now ${extver}, expecting %{upstream_version}%{?upstream_prever}%{?gh_date:dev}.
@@ -268,7 +257,8 @@ export REPORT_EXIT_STATUS=1
user=$(id -un)
: all tests when rpmbuild is used
if [ "$user" = "remi" ]; then
-export SKIP_ONLINE_TESTS=1
+rm ?TS/tests/gh-issue50.phpt
+export SKIP_ONLINE_TESTS=0
else
: only local tests when mock is used
export SKIP_ONLINE_TESTS=1
@@ -290,15 +280,8 @@ done
%if %{with_tests}
: ignore tests with erratic results
-rm ?TS/tests/client022.phpt
-rm ?TS/tests/client027.phpt
-%if 0%{?fedora} >= 30
-: https://github.com/m6w6/ext-http/issues/84
-rm ?TS/tests/client002.phpt
-rm ?TS/tests/client008.phpt
-rm ?TS/tests/client018.phpt
-rm ?TS/tests/client021.phpt
-%endif
+#rm ?TS/tests/client022.phpt
+#rm ?TS/tests/client027.phpt
: Upstream test suite NTS extension
cd NTS
@@ -369,6 +352,10 @@ fi
%changelog
+* Fri Jun 7 2019 Remi Collet <remi@remirepo.net> - 3.2.1-1
+- update to 3.2.1
+- drop patch merged upstream
+
* Thu Jun 6 2019 Remi Collet <remi@remirepo.net> - 3.2.0-5
- add upstream patch for 7.4