]> granicus.if.org Git - apache/commitdiff
On the trunk:
authorStefan Eissing <icing@apache.org>
Mon, 30 Apr 2018 07:42:13 +0000 (07:42 +0000)
committerStefan Eissing <icing@apache.org>
Mon, 30 Apr 2018 07:42:13 +0000 (07:42 +0000)
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

CHANGES
modules/http2/h2_conn.c
modules/http2/h2_version.h

diff --git a/CHANGES b/CHANGES
index 86f7b71782ec6367dbecff81ffbf9b78b15071de..c876a72cafd183a79c04972d1d8bcb8aef40af87 100644 (file)
--- 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]
index 862d4c19596f64c5362b63facd16729b177676bb..26802e4727e1021d6937a617dbe892883197a51c 100644 (file)
@@ -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, 
index 91c71960755ad1fde8e05706c6b62fd30ca158b0..1e68d8d9cd2437e5a4ac9444f9128906be23bd19 100644 (file)
@@ -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 */