From: Stefan Eissing Date: Mon, 30 Apr 2018 07:42:13 +0000 (+0000) Subject: On the trunk: X-Git-Tag: 2.5.0-alpha2-ci-test-only~2645 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8649251637209a8ca5b95c446da3a57ad0129d0;p=thirdparty%2Fapache%2Fhttpd.git On the trunk: mod_http2: adding an abort function to slave connections' pools, so out-of-memory events lead to a control process abort, as on HTTP/1.x connections. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1830534 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 86f7b71782e..c876a72cafd 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.1 + *) mod_http2: adding an abort function to slave connections' pools, so out-of-memory + events lead to a control process abort, as on HTTP/1.x connections. [Stefan Eissing] + *) mod_http2: adding regular memory cleanup when transferring large response bodies. This reduces memory footprint and avoids memory exhaustion when transferring large files on 32-bit architectures. Fixes PR 62325. [Stefan Eissing] diff --git a/modules/http2/h2_conn.c b/modules/http2/h2_conn.c index 862d4c19596..26802e4727e 100644 --- a/modules/http2/h2_conn.c +++ b/modules/http2/h2_conn.c @@ -245,6 +245,13 @@ apr_status_t h2_conn_pre_close(struct h2_ctx *ctx, conn_rec *c) return DONE; } +/* APR callback invoked if allocation fails. */ +static int abort_on_oom(int retcode) +{ + ap_abort_on_oom(); + return retcode; /* unreachable, hopefully. */ +} + conn_rec *h2_slave_create(conn_rec *master, int slave_id, apr_pool_t *parent) { apr_allocator_t *allocator; @@ -274,8 +281,9 @@ conn_rec *h2_slave_create(conn_rec *master, int slave_id, apr_pool_t *parent) return NULL; } apr_allocator_owner_set(allocator, pool); + apr_pool_abort_set(abort_on_oom, pool); apr_pool_tag(pool, "h2_slave_conn"); - + c = (conn_rec *) apr_palloc(pool, sizeof(conn_rec)); if (c == NULL) { ap_log_cerror(APLOG_MARK, APLOG_ERR, APR_ENOMEM, master, diff --git a/modules/http2/h2_version.h b/modules/http2/h2_version.h index 91c71960755..1e68d8d9cd2 100644 --- a/modules/http2/h2_version.h +++ b/modules/http2/h2_version.h @@ -27,7 +27,7 @@ * @macro * Version number of the http2 module as c string */ -#define MOD_HTTP2_VERSION "1.10.19-DEV" +#define MOD_HTTP2_VERSION "1.10.20-DEV" /** * @macro @@ -35,7 +35,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 0x010a13 +#define MOD_HTTP2_VERSION_NUM 0x010a14 #endif /* mod_h2_h2_version_h */