-*- coding: utf-8 -*-
Changes with Apache 2.5.0
+ *) mod_http2: MaxKeepAliveRequests now limits the number of times a
+ slave connection gets reused. [Stefan Eissing]
+
*) mod_substitute: Fix spurious AH01328 (Line too long) errors on EBCDIC
systems. [Eric Covener]
apr_allocator_t *allocator;
apr_thread_mutex_t *mutex;
h2_mplx *m;
+ h2_ctx *ctx = h2_ctx_get(c, 0);
ap_assert(conf);
m = apr_pcalloc(parent, sizeof(h2_mplx));
if (m) {
m->id = c->id;
m->c = c;
-
+ m->s = (ctx? h2_ctx_server_get(ctx) : NULL);
+ if (!m->s) {
+ m->s = c->base_server;
+ }
+
/* We create a pool with its own allocator to be used for
* processing slave connections. This is the only way to have the
* processing independant of its parent pool in the sense that it
int reuse_slave = 0;
slave = task->c;
- reuse_slave = ((m->spare_slaves->nelts < (m->limit_active * 3 / 2))
- && !task->rst_error);
+
+ if (m->s->keep_alive_max == 0 || slave->keepalives < m->s->keep_alive_max) {
+ reuse_slave = ((m->spare_slaves->nelts < (m->limit_active * 3 / 2))
+ && !task->rst_error);
+ }
if (slave) {
if (reuse_slave && slave->keepalive == AP_CONN_KEEPALIVE) {
if (!task) {
return APR_ECONNABORTED;
}
-
+ if (task->c) {
+ ++task->c->keepalives;
+ }
+
stream = h2_ihash_get(m->streams, task->stream_id);
if (!stream) {
return APR_ECONNABORTED;
}
if (!stream->task) {
-
- m->c->keepalives++;
+
if (sid > m->max_stream_started) {
m->max_stream_started = sid;
}