From dede56b14dc6ba76822103ca30fd1b1734616b1d Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Thu, 30 Mar 2006 18:32:53 +0000 Subject: [PATCH] Document the removal of the flushing bandaid to a runtime param. Since other protocols might benefit from this, remove the ajp_ prefixes, to make it more generic looking. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@390210 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ include/ap_mmn.h | 2 ++ modules/proxy/mod_proxy.c | 18 +++++++++--------- modules/proxy/mod_proxy.h | 12 ++++++------ modules/proxy/mod_proxy_ajp.c | 6 +++--- modules/proxy/proxy_util.c | 4 ++-- 6 files changed, 26 insertions(+), 20 deletions(-) diff --git a/CHANGES b/CHANGES index fe91480dec..fea55b0e02 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,10 @@ Changes with Apache 2.3.0 [Remove entries to the current 2.0 and 2.2 section below, when backported] + *) mod_proxy_ajp: Flushing of the output after each AJP chunk is now + configurable at runtime via the 'flushpackets' and 'flushwait' worker + params. [Jim Jagielski] + *) mod_proxy_http: Do send keep-alive header if the client sent connection: keep-alive and do not close backend connection if the client sent connection: close. PR 38524. [Ruediger Pluem, Joe Orton] diff --git a/include/ap_mmn.h b/include/ap_mmn.h index 1819bd7e4b..f83a9189f9 100644 --- a/include/ap_mmn.h +++ b/include/ap_mmn.h @@ -117,6 +117,8 @@ * removal of Satisfy, Allow, Deny, Order * 20060110.1 (2.3.0-dev) minex and minex_set members added to * cache_server_conf (minor) + * 20060110.2 (2.3.0-dev) flush_packets and flush_wait members added to + * proxy_server (minor) */ #define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */ diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c index 4c0b950edf..37c1b3a4e6 100644 --- a/modules/proxy/mod_proxy.c +++ b/modules/proxy/mod_proxy.c @@ -218,25 +218,25 @@ static const char *set_worker_param(apr_pool_t *p, } } } - else if (!strcasecmp(key, "ajpflushpackets")) { + else if (!strcasecmp(key, "flushpackets")) { if (!strcasecmp(val, "on")) - worker->ajp_flush_packets = ajp_flush_on; + worker->flush_packets = flush_on; else if (!strcasecmp(val, "off")) - worker->ajp_flush_packets = ajp_flush_off; + worker->flush_packets = flush_off; else if (!strcasecmp(val, "auto")) - worker->ajp_flush_packets = ajp_flush_auto; + worker->flush_packets = flush_auto; else - return "FlushPackets must be On|Off|Auto"; + return "flushpackets must be on|off|auto"; } - else if (!strcasecmp(key, "ajpflushwait")) { + else if (!strcasecmp(key, "flushwait")) { ival = atoi(val); if (ival > 1000 || ival < 0) { - return "AJPFlushWait must be <= 1000, or 0 for system default of 10 millseconds."; + return "flushwait must be <= 1000, or 0 for system default of 10 millseconds."; } if (ival == 0) - worker->ajp_flush_wait = AJP_FLUSH_WAIT; + worker->flush_wait = PROXY_FLUSH_WAIT; else - worker->ajp_flush_wait = ival * 1000; /* change to microseconds */ + worker->flush_wait = ival * 1000; /* change to microseconds */ } else { return "unknown Worker parameter"; diff --git a/modules/proxy/mod_proxy.h b/modules/proxy/mod_proxy.h index d54fd45f87..11ce04aff0 100644 --- a/modules/proxy/mod_proxy.h +++ b/modules/proxy/mod_proxy.h @@ -303,18 +303,18 @@ struct proxy_worker { #endif void *context; /* general purpose storage */ enum { - ajp_flush_off, - ajp_flush_on, - ajp_flush_auto - } ajp_flush_packets; /* control AJP flushing */ - int ajp_flush_wait; /* poll wait time in microseconds if flush_auto */ + flush_off, + flush_on, + flush_auto + } flush_packets; /* control AJP flushing */ + int flush_wait; /* poll wait time in microseconds if flush_auto */ }; /* * Wait 10000 microseconds to find out if more data is currently * available at the backend. Just an arbitrary choose. */ -#define AJP_FLUSH_WAIT 10000 +#define PROXY_FLUSH_WAIT 10000 struct proxy_balancer { apr_array_header_t *workers; /* array of proxy_workers */ diff --git a/modules/proxy/mod_proxy_ajp.c b/modules/proxy/mod_proxy_ajp.c index 2a7ec32988..9b65590a47 100644 --- a/modules/proxy/mod_proxy_ajp.c +++ b/modules/proxy/mod_proxy_ajp.c @@ -317,10 +317,10 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r, r->connection->bucket_alloc); APR_BRIGADE_INSERT_TAIL(output_brigade, e); - if ( (conn->worker->ajp_flush_packets == ajp_flush_on) || - ( (conn->worker->ajp_flush_packets == ajp_flush_auto) && + if ( (conn->worker->flush_packets == flush_on) || + ( (conn->worker->flush_packets == flush_auto) && (apr_poll(conn_poll, 1, &conn_poll_fd, - conn->worker->ajp_flush_wait) + conn->worker->flush_wait) == APR_TIMEUP) ) ) { e = apr_bucket_flush_create(r->connection->bucket_alloc); APR_BRIGADE_INSERT_TAIL(output_brigade, e); diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 3a8f288a63..e28687ec25 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -1318,8 +1318,8 @@ PROXY_DECLARE(const char *) ap_proxy_add_worker(proxy_worker **worker, (*worker)->hostname = uri.hostname; (*worker)->port = uri.port; (*worker)->id = proxy_lb_workers; - (*worker)->ajp_flush_packets = ajp_flush_off; - (*worker)->ajp_flush_wait = AJP_FLUSH_WAIT; + (*worker)->flush_packets = flush_off; + (*worker)->flush_wait = PROXY_FLUSH_WAIT; /* Increase the total worker count */ proxy_lb_workers++; init_conn_pool(p, *worker); -- 2.40.0