From: Stefan Eissing Date: Fri, 4 Dec 2015 11:24:02 +0000 (+0000) Subject: building against minimum version 1.2.1 of nghttp2 X-Git-Tag: 2.5.0-alpha~2568 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c62da120f051d984d444a85a33076dc02acead3a;p=thirdparty%2Fapache%2Fhttpd.git building against minimum version 1.2.1 of nghttp2 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1717934 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index c28f8ab2960..e81e61422b7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.0 + *) mod_http2: required minimum version of libnghttp2 is 1.2.1 + [Stefan Eissing] + *) mod_proxy_fdpass: Fix AH01153 error when using the default configuration. In earlier version of httpd, you can explicitelly set the 'flusher' parameter to 'flush' as a workaround. (i.e. flusher=flush) diff --git a/modules/http2/config.m4 b/modules/http2/config.m4 index e10bb8158f7..05cf2ba36d0 100644 --- a/modules/http2/config.m4 +++ b/modules/http2/config.m4 @@ -127,12 +127,12 @@ AC_DEFUN([APACHE_CHECK_NGHTTP2],[ fi fi - AC_MSG_CHECKING([for nghttp2 version >= 1.0.0]) + AC_MSG_CHECKING([for nghttp2 version >= 1.2.1]) AC_TRY_COMPILE([#include ],[ #if !defined(NGHTTP2_VERSION_NUM) #error "Missing nghttp2 version" #endif -#if NGHTTP2_VERSION_NUM < 0x010000 +#if NGHTTP2_VERSION_NUM < 0x010201 #error "Unsupported nghttp2 version " NGHTTP2_VERSION_TEXT #endif], [AC_MSG_RESULT(OK) @@ -154,6 +154,10 @@ AC_DEFUN([APACHE_CHECK_NGHTTP2],[ if test "x$liberrors" != "x"; then AC_MSG_WARN([nghttp2 library is unusable]) fi +dnl # nghttp2 >= 1.3.0: access to stream weights + AC_CHECK_FUNCS([nghttp2_stream_get_weight], + [APR_ADDTO(MOD_CPPFLAGS, ["-DH2_NG2_STREAM_API"])], []) +dnl # nghttp2 >= 1.5.0: changing stream priorities AC_CHECK_FUNCS([nghttp2_session_change_stream_priority], [APR_ADDTO(MOD_CPPFLAGS, ["-DH2_NG2_CHANGE_PRIO"])], []) else diff --git a/modules/http2/h2_session.c b/modules/http2/h2_session.c index cce8ca7d5ae..18c481e7823 100644 --- a/modules/http2/h2_session.c +++ b/modules/http2/h2_session.c @@ -94,6 +94,8 @@ h2_stream *h2_session_open_stream(h2_session *session, int stream_id) return stream; } +#ifdef H2_NG2_STREAM_API + /** * Determine the importance of streams when scheduling tasks. * - if both stream depend on the same one, compare weights @@ -147,6 +149,20 @@ static int stream_pri_cmp(int sid1, int sid2, void *ctx) return spri_cmp(sid1, s1, sid2, s2, session); } +#else /* ifdef H2_NG2_STREAM_API */ + +/* In absence of nghttp2_stream API, which gives information about + * priorities since nghttp2 1.3.x, we just sort the streams by + * their identifier, aka. order of arrival. + */ +static int stream_pri_cmp(int sid1, int sid2, void *ctx) +{ + (void)ctx; + return sid1 - sid2; +} + +#endif /* (ifdef else) H2_NG2_STREAM_API */ + static apr_status_t stream_schedule(h2_session *session, h2_stream *stream, int eos) { diff --git a/modules/http2/h2_version.h b/modules/http2/h2_version.h index 10e9b91b99f..728e47d560e 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 "1.0.9-DEV" +#define MOD_HTTP2_VERSION "1.0.10-DEV" /** * @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 0x010009 +#define MOD_HTTP2_VERSION_NUM 0x01000a #endif /* mod_h2_h2_version_h */