diff options
author | Remi Collet <fedora@famillecollet.com> | 2016-07-28 12:03:29 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2016-07-28 12:03:29 +0200 |
commit | 7a7496d927a79602a0030114b74af8a6b5fb8f9c (patch) | |
tree | 89b6660b6f5bb6e40aefea3f444dc0c0360b13f1 | |
parent | e3aea2dc42987bfcc6b46f7a920a543f41adbe3a (diff) |
php-pecl-swoole: rebuild with upstream patch
-rw-r--r-- | REFLECTION | 2 | ||||
-rw-r--r-- | php-pecl-swoole.spec | 11 | ||||
-rw-r--r-- | swoole-upstream.patch | 50 |
3 files changed, 59 insertions, 4 deletions
@@ -1,4 +1,4 @@ -Extension [ <persistent> extension #114 swoole version 1.8.8 ] { +Extension [ <persistent> extension #115 swoole version 1.8.8 ] { - INI { Entry [ swoole.aio_thread_num <ALL> ] diff --git a/php-pecl-swoole.spec b/php-pecl-swoole.spec index 503f91a..ef69ddd 100644 --- a/php-pecl-swoole.spec +++ b/php-pecl-swoole.spec @@ -26,8 +26,7 @@ %endif %if 0%{?fedora} >= 22 || 0%{?rhel} >= 6 -# See https://github.com/swoole/swoole-src/issues/787 -%global with_nghttpd2 0 +%global with_nghttpd2 1 %else %global with_nghttpd2 0 %endif @@ -36,12 +35,14 @@ Summary: PHP's asynchronous concurrent distributed networking framework Name: %{?sub_prefix}php-pecl-%{pecl_name} Version: 1.8.8 -Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: BSD Group: Development/Languages URL: http://pecl.php.net/package/%{pecl_name} Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz +Patch0: %{pecl_name}-upstream.patch + BuildRequires: %{?scl_prefix}php-devel >= 5.3.10 BuildRequires: %{?scl_prefix}php-pear BuildRequires: %{?scl_prefix}php-sockets @@ -136,6 +137,7 @@ sed -e 's/role="test"/role="src"/' \ cd NTS +%patch0 -p1 -b .upstream # Sanity check, really often broken extver=$(sed -n '/#define PHP_SWOOLE_VERSION/{s/.* "//;s/".*$//;p}' php_swoole.h) @@ -270,6 +272,9 @@ cd ../ZTS %changelog +* Thu Jul 28 2016 Remi Collet <remi@fedoraproject.org> - 1.8.8-2 +- add upstream patch and add back --enable-http2 build option + * Thu Jul 28 2016 Remi Collet <remi@fedoraproject.org> - 1.8.8-1 - Update to 1.8.8 - drop --enable-http2 build option (broken) diff --git a/swoole-upstream.patch b/swoole-upstream.patch new file mode 100644 index 0000000..fa98e35 --- /dev/null +++ b/swoole-upstream.patch @@ -0,0 +1,50 @@ +From 8b86b44ada511935dd1fb1bd7a2ed3d9c2489f0a Mon Sep 17 00:00:00 2001 +From: matyhtf <mikan.tenny@gmail.com> +Date: Thu, 28 Jul 2016 13:12:58 +0800 +Subject: [PATCH] fixed #787, compile failed with --enable-http2 + +--- + swoole_http_v2_server.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/swoole_http_v2_server.c b/swoole_http_v2_server.c +index bcbea68..b04ffd7 100644 +--- a/swoole_http_v2_server.c ++++ b/swoole_http_v2_server.c +@@ -30,7 +30,7 @@ static sw_inline void http2_add_header(nghttp2_nv *headers, char *k, int kl, cha + headers->valuelen = vl; + } + +-static void http2_onRequest(http_context *ctx TSRMLS_DC) ++static sw_inline void http2_onRequest(http_context *ctx, int server_fd TSRMLS_DC) + { + zval *retval; + zval **args[2]; +@@ -41,7 +41,8 @@ static void http2_onRequest(http_context *ctx TSRMLS_DC) + args[0] = &zrequest_object; + args[1] = &zresponse_object; + +- if (sw_call_user_function_ex(EG(function_table), NULL, php_sw_http_server_callbacks[HTTP_CALLBACK_onRequest], &retval, 2, args, 0, NULL TSRMLS_CC) == FAILURE) ++ zval *zcallback = php_swoole_server_get_callback(SwooleG.serv, server_fd, SW_SERVER_CB_onRequest); ++ if (sw_call_user_function_ex(EG(function_table), NULL, zcallback, &retval, 2, args, 0, NULL TSRMLS_CC) == FAILURE) + { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "onRequest handler error"); + } +@@ -509,7 +510,7 @@ int swoole_http2_onFrame(swoole_http_client *client, swEventData *req) + + if (flags & SW_HTTP2_FLAG_END_STREAM) + { +- http2_onRequest(ctx TSRMLS_CC); ++ http2_onRequest(ctx, req->info.from_fd TSRMLS_CC); + } + else + { +@@ -557,7 +558,7 @@ int swoole_http2_onFrame(swoole_http_client *client, swEventData *req) + swoole_php_fatal_error(E_WARNING, "parse multipart body failed."); + } + } +- http2_onRequest(ctx TSRMLS_CC); ++ http2_onRequest(ctx, req->info.from_fd TSRMLS_CC); + } + } + else if (type == SW_HTTP2_TYPE_PING) |