From: Stefan Eissing Date: Thu, 8 Oct 2015 10:03:30 +0000 (+0000) Subject: fix for empty responses with nghttp2 v1.3.x, bump version to 1.0.0 X-Git-Tag: 2.5.0-alpha~2742 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=058f05006298d7a54bceb2d867753b2b9b25d45c;p=thirdparty%2Fapache%2Fhttpd.git fix for empty responses with nghttp2 v1.3.x, bump version to 1.0.0 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1707468 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http2/h2_util.c b/modules/http2/h2_util.c index c0c383797b4..c688c84afa6 100644 --- a/modules/http2/h2_util.c +++ b/modules/http2/h2_util.c @@ -484,19 +484,38 @@ int h2_util_has_flush_or_eos(apr_bucket_brigade *bb) { int h2_util_has_eos(apr_bucket_brigade *bb, apr_size_t len) { - apr_bucket *b, *end; + apr_bucket *b; - apr_status_t status = last_not_included(bb, len, 0, 0, &end); - if (status != APR_SUCCESS) { - return status; + if (len == 0) { + /* special case: this is only true, if there are only meta + * and an eos bucket in the brigade head. + */ + for (b = APR_BRIGADE_FIRST(bb); + b != APR_BRIGADE_SENTINEL(bb); + b = APR_BUCKET_NEXT(b)) + { + if (!APR_BUCKET_IS_METADATA(b) && b->length != 0) { + break; + } + else if (APR_BUCKET_IS_EOS(b)) { + return 1; + } + } } - - for (b = APR_BRIGADE_FIRST(bb); - b != APR_BRIGADE_SENTINEL(bb) && b != end; - b = APR_BUCKET_NEXT(b)) - { - if (APR_BUCKET_IS_EOS(b)) { - return 1; + else { + apr_bucket *end; + apr_status_t status = last_not_included(bb, len, 0, 0, &end); + if (status != APR_SUCCESS) { + return status; + } + + for (b = APR_BRIGADE_FIRST(bb); + b != APR_BRIGADE_SENTINEL(bb) && b != end; + b = APR_BUCKET_NEXT(b)) + { + if (APR_BUCKET_IS_EOS(b)) { + return 1; + } } } return 0; diff --git a/modules/http2/h2_version.h b/modules/http2/h2_version.h index 7ed711ffed0..7a03865c87c 100644 --- a/modules/http2/h2_version.h +++ b/modules/http2/h2_version.h @@ -20,7 +20,7 @@ * @macro * Version number of the h2 module as c string */ -#define MOD_HTTP2_VERSION "0.9.9" +#define MOD_HTTP2_VERSION "1.0.0" /** * @macro @@ -28,7 +28,7 @@ * release. This is a 24 bit number with 8 bits for major number, 8 bits * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203. */ -#define MOD_HTTP2_VERSION_NUM 0x000909 +#define MOD_HTTP2_VERSION_NUM 0x010000 #endif /* mod_h2_h2_version_h */