summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2018-07-18 06:46:32 +0200
committerRemi Collet <remi@remirepo.net>2018-07-18 06:46:32 +0200
commiteb365bf32ee4a744fd8e2e0a51e0c19e804d5517 (patch)
tree7b5b9b2affe93d8162d4826bd65d07a1d90d8675
parenta967ec1ab12f53031cf393684b2faa888afd68b6 (diff)
rebuld for 7.3.0alpha4 new ABI
-rw-r--r--a81472d0108d16e680980a9e0c1b4af0d629c43a.patch87
-rw-r--r--php-pecl-http.spec13
2 files changed, 98 insertions, 2 deletions
diff --git a/a81472d0108d16e680980a9e0c1b4af0d629c43a.patch b/a81472d0108d16e680980a9e0c1b4af0d629c43a.patch
new file mode 100644
index 0000000..f630939
--- /dev/null
+++ b/a81472d0108d16e680980a9e0c1b4af0d629c43a.patch
@@ -0,0 +1,87 @@
+From a81472d0108d16e680980a9e0c1b4af0d629c43a Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Wed, 18 Jul 2018 06:37:53 +0200
+Subject: [PATCH] fix for 7.3.0alpha4
+
+---
+ src/php_http_header_parser.c | 9 +++++++--
+ src/php_http_message_body.c | 20 +++++++++++++++-----
+ src/php_http_params.c | 4 ++++
+ 3 files changed, 26 insertions(+), 7 deletions(-)
+
+diff --git a/src/php_http_header_parser.c b/src/php_http_header_parser.c
+index b97ae6b..cd76b76 100644
+--- a/src/php_http_header_parser.c
++++ b/src/php_http_header_parser.c
+@@ -74,9 +74,14 @@ void php_http_header_parser_free(php_http_header_parser_t **parser)
+ /* NOTE: 'str' has to be null terminated */
+ static void php_http_header_parser_error(size_t valid_len, char *str, size_t len, const char *eol_str )
+ {
+- zend_string *escaped_str = zend_string_init(str, len, 0);
++ zend_string *escaped_str, *zstr_str = zend_string_init(str, len, 0);
+
+- escaped_str = php_addcslashes(escaped_str, 1, ZEND_STRL("\x0..\x1F\x7F..\xFF"));
++#if PHP_VERSION_ID < 70300
++ escaped_str = php_addcslashes(zstr_str, 1, ZEND_STRL("\x0..\x1F\x7F..\xFF"));
++#else
++ escaped_str = php_addcslashes(zstr_str, ZEND_STRL("\x0..\x1F\x7F..\xFF"));
++ zend_string_release_ex(zstr_str, 0);
++#endif
+
+ if (valid_len != len && (!eol_str || (str+valid_len) != eol_str)) {
+ php_error_docref(NULL, E_WARNING, "Failed to parse headers: unexpected character '\\%03o' at pos %zu of '%s'", str[valid_len], valid_len, escaped_str->val);
+diff --git a/src/php_http_message_body.c b/src/php_http_message_body.c
+index 526c233..518dbc9 100644
+--- a/src/php_http_message_body.c
++++ b/src/php_http_message_body.c
+@@ -262,9 +262,14 @@ void php_http_message_body_add_part(php_http_message_body_t *body, php_http_mess
+
+ ZEND_RESULT_CODE php_http_message_body_add_form_field(php_http_message_body_t *body, const char *name, const char *value_str, size_t value_len)
+ {
+- zend_string *safe_name = zend_string_init(name, strlen(name), 0);
++ zend_string *safe_name, *zstr_name = zend_string_init(name, strlen(name), 0);
+
+- safe_name = php_addslashes(safe_name, 1);
++#if PHP_VERSION_ID < 70300
++ safe_name = php_addslashes(zstr_name, 1);
++#else
++ safe_name = php_addslashes(zstr_name);
++ zend_string_release_ex(zstr_name, 0);
++#endif
+
+ BOUNDARY_OPEN(body);
+ php_http_message_body_appendf(
+@@ -284,9 +289,14 @@ ZEND_RESULT_CODE php_http_message_body_add_form_file(php_http_message_body_t *bo
+ {
+ size_t path_len = strlen(path);
+ char *path_dup = estrndup(path, path_len);
+- zend_string *base_name, *safe_name = zend_string_init(name, strlen(name), 0);
+-
+- safe_name = php_addslashes(safe_name, 1);
++ zend_string *base_name, *safe_name, *zstr_name = zend_string_init(name, strlen(name), 0);
++
++#if PHP_VERSION_ID < 70300
++ safe_name = php_addslashes(zstr_name, 1);
++#else
++ safe_name = php_addslashes(zstr_name);
++ zend_string_release_ex(zstr_name, 0);
++#endif
+ base_name = php_basename(path_dup, path_len, NULL, 0);
+
+ BOUNDARY_OPEN(body);
+diff --git a/src/php_http_params.c b/src/php_http_params.c
+index b22769e..0cbfc7e 100644
+--- a/src/php_http_params.c
++++ b/src/php_http_params.c
+@@ -67,7 +67,11 @@ static inline zend_string *quote_string(zend_string *zs, zend_bool force)
+ {
+ size_t len = (zs)->len;
+
++#if PHP_VERSION_ID < 70300
+ zs = php_addcslashes(zs, 0, ZEND_STRL("\0..\37\173\\\""));
++#else
++ zs = php_addcslashes(zs, ZEND_STRL("\0..\37\173\\\""));
++#endif
+
+ if (force || len != (zs)->len || strpbrk((zs)->val, "()<>@,;:\"[]?={} ")) {
+ int len = (zs)->len + 2;
diff --git a/php-pecl-http.spec b/php-pecl-http.spec
index 34593d5..3791f06 100644
--- a/php-pecl-http.spec
+++ b/php-pecl-http.spec
@@ -47,10 +47,10 @@
Name: %{?sub_prefix}php-pecl-http
Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
%if 0%{?gh_date:1}
-Release: 0.3.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 0.4.%{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: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 3%{?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
@@ -63,6 +63,7 @@ Source1: %{proj_name}.ini
Patch0: https://github.com/m6w6/ext-http/commit/512f733beac73f37ba4acbcf730ebc6c6de849b6.patch
Patch1: https://github.com/m6w6/ext-http/commit/377d576a6e68def5708cf1ffcd3c233c4dddf356.patch
+Patch2: https://github.com/m6w6/ext-http/commit/a81472d0108d16e680980a9e0c1b4af0d629c43a.patch
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel >= 7
@@ -123,6 +124,10 @@ Obsoletes: php71w-pecl-http <= %{version}
Obsoletes: php72u-pecl-http <= %{version}
Obsoletes: php72w-pecl-http <= %{version}
%endif
+%if "%{php_version}" > "7.3"
+Obsoletes: php73u-pecl-http <= %{version}
+Obsoletes: php73w-pecl-http <= %{version}
+%endif
%endif
%if 0%{?fedora} < 20 && 0%{?rhel} < 7
@@ -177,6 +182,7 @@ mv %{proj_name}-%{upstream_version}%{?upstream_prever} NTS
cd NTS
%patch0 -p1 -b .up0
%patch1 -p1 -b .up1
+%patch2 -p1 -b .up2
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
@@ -364,6 +370,9 @@ fi
%changelog
+* Wed Jul 18 2018 Remi Collet <remi@remirepo.net> - 3.2.0~RC1-3
+- rebuld for 7.3.0alpha4 new ABI
+
* Tue Jun 26 2018 Remi Collet <remi@remirepo.net> - 3.2.0~RC1-2
- add upstream patches for PHP 7.3