[php-pecl-http/f21] more upstream patch, fix for arm/ppc64

Remi Collet remi at fedoraproject.org
Wed Sep 3 13:58:48 UTC 2014


commit f9c95e9f4fdc6c565add74aafe91c4485c946ce3
Author: Remi Collet <remi at fedoraproject.org>
Date:   Wed Sep 3 15:58:33 2014 +0200

    more upstream patch, fix for arm/ppc64

 pecl_http-offline.patch  |   24 --------------
 pecl_http-upstream.patch |   78 ++++++++++++++++++++++++++++++++++++++++++++++
 php-pecl-http.spec       |   13 +++-----
 3 files changed, 83 insertions(+), 32 deletions(-)
---
diff --git a/pecl_http-upstream.patch b/pecl_http-upstream.patch
new file mode 100644
index 0000000..de09744
--- /dev/null
+++ b/pecl_http-upstream.patch
@@ -0,0 +1,78 @@
+From 530650958e4801374827cf3bbbc95b3fbf3e89d2 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi at php.net>
+Date: Mon, 1 Sep 2014 13:48:46 +0200
+Subject: [PATCH] skip this test for offline build
+
+---
+ tests/client015.phpt | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tests/client015.phpt b/tests/client015.phpt
+index 35981a5..60d3132 100644
+--- a/tests/client015.phpt
++++ b/tests/client015.phpt
+@@ -10,6 +10,7 @@ try {
+ } catch (Exception $e) {
+ 	die("skip ".$e->getMessage()); 
+ }
++skip_online_test();
+ ?>
+ --FILE--
+ <?php
+-- 
+1.8.3.1
+
+diff --git a/php_http_etag.c b/php_http_etag.c
+index 4562324..3604ad8 100644
+--- a/php_http_etag.c
++++ b/php_http_etag.c
+@@ -61,11 +61,15 @@ char *php_http_etag_finish(php_http_etag_t *e)
+ 		unsigned char buf[4];
+ 
+ 		*((uint *) e->ctx) = ~*((uint *) e->ctx);
++#ifdef WORDS_BIGENDIAN
++		etag = php_http_etag_digest((unsigned char *) e->ctx, 4);
++#else
+ 		buf[0] = ((unsigned char *) e->ctx)[3];
+ 		buf[1] = ((unsigned char *) e->ctx)[2];
+ 		buf[2] = ((unsigned char *) e->ctx)[1];
+ 		buf[3] = ((unsigned char *) e->ctx)[0];
+ 		etag = php_http_etag_digest(buf, 4);
++#endif
+ 	} else if ((!strcasecmp(e->mode, "sha1"))) {
+ 		PHP_SHA1Final(digest, e->ctx);
+ 		etag = php_http_etag_digest(digest, 20);
+From 906ccdd174554232371d4f50db47e0817fd91789 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi at php.net>
+Date: Wed, 3 Sep 2014 15:31:33 +0200
+Subject: [PATCH 3/3] fix httpVersion retrieval on bigendian
+
+---
+ php_http_message.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/php_http_message.c b/php_http_message.c
+index 70dcae8..3141065 100644
+--- a/php_http_message.c
++++ b/php_http_message.c
+@@ -941,6 +941,7 @@
+ 	HashTable *props = zend_get_std_object_handlers()->get_properties(object TSRMLS_CC);
+ 	zval array, *parent, *body;
+ 	char *version;
++	int verlen;
+ 
+ 	PHP_HTTP_MESSAGE_OBJECT_INIT(obj);
+ 	
+@@ -965,7 +964,8 @@
+ 	} while(0)
+ 
+ 	ASSOC_PROP(long, "type", msg->type);
+-	ASSOC_STRINGL_EX("httpVersion", version, spprintf(&version, 0, "%u.%u", msg->http.version.major, msg->http.version.minor), 0);
++	verlen = spprintf(&version, 0, "%u.%u", msg->http.version.major, msg->http.version.minor);
++	ASSOC_STRINGL_EX("httpVersion", version, verlen, 0);
+ 
+ 	switch (msg->type) {
+ 		case PHP_HTTP_REQUEST:
+-- 
+1.8.3.1
+
diff --git a/php-pecl-http.spec b/php-pecl-http.spec
index 38bcc2c..77853b7 100644
--- a/php-pecl-http.spec
+++ b/php-pecl-http.spec
@@ -26,7 +26,7 @@
 
 Name:           php-pecl-http
 Version:        2.1.0
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Extended HTTP support
 
 License:        BSD
@@ -37,7 +37,7 @@ Source0:        http://pecl.php.net/get/%{proj_name}-%{version}%{?prever}.tgz
 # From http://www.php.net/manual/en/http.configuration.php
 Source1:        %{proj_name}.ini
 
-Patch0:         %{proj_name}-offline.patch
+Patch0:         %{proj_name}-upstream.patch
 
 BuildRequires:  php-devel >= 5.3.0
 BuildRequires:  php-hash
@@ -207,13 +207,7 @@ rm ?TS/tests/envrequestbody001.phpt \
    ?TS/tests/envresponse015.phpt
 %endif
 
-%ifarch %{ix86} x86_64
 export REPORT_EXIT_STATUS=1
-%else
-# 3 failed tests on arm - under investigation
-export REPORT_EXIT_STATUS=0
-%endif
-
 
 # Shared needed extensions
 modules=""
@@ -289,6 +283,9 @@ fi
 
 
 %changelog
+* Wed Sep  3 2014 Remi Collet <remi at fedoraproject.org> - 2.1.0-2
+- more upstream patch, fix for arm/ppc64
+
 * Mon Sep  1 2014 Remi Collet <remi at fedoraproject.org> - 2.1.0-1
 - Update to 2.1.0
 - ignore known failed tests with PHP 5.3.3


More information about the scm-commits mailing list