From: Jim Jagielski Date: Thu, 15 Nov 2007 22:08:30 +0000 (+0000) Subject: Apply backport... fix "conflicts" with CHANGES and ap_mmn.h X-Git-Tag: 2.2.7~231 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3813732dbcf19d878058551e1166270ca8473d15;p=thirdparty%2Fapache%2Fhttpd.git Apply backport... fix "conflicts" with CHANGES and ap_mmn.h git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@595474 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index f5e63c2886f..31487b8d2b6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes with Apache 2.2.7 + *) Event MPM: Add support for running under mod_ssl, by reverting to the + Worker MPM behaviors, when run under an input filter that buffers + its own data. [Paul Querna] + *) mod_charset_lite: Don't crash when the request has no associated filename. [Jeff Trawick] @@ -1658,7 +1662,6 @@ Changes with Apache 2.1.1 *) Rewrite of aaa modules to an authn/authz model. [Dirk-Willem van Gulik, Justin Erenkrantz] - [Apache 2.1.0-dev includes those bug fixes and changes with the Apache 2.0.xx tree as documented, and except as noted, below.] diff --git a/STATUS b/STATUS index 8b254bacf4a..f1ad08adea4 100644 --- a/STATUS +++ b/STATUS @@ -79,17 +79,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - * Event MPM: Add clogging_input_filters to the conn_rec, enabling mod_ssl - to revert to the Worker MPM IO behavoirs, rather than just hanging, when - using the Event MPM. (minor MMN bump) - Trunk version of patch: - http://svn.apache.org/viewvc?view=rev&revision=360257 - http://svn.apache.org/viewvc?view=rev&revision=546328 - http://svn.apache.org/viewvc?view=rev&revision=546650 - http://svn.apache.org/viewvc?view=rev&revision=546715 - 2.2.x version of patch: - http://people.apache.org/~pquerna/eventmpm-ssl-input-2.2.x.patch - +1: pquerna, jim, rpluem PATCHES PROPOSED TO BACKPORT FROM TRUNK: [ New proposals should be added at the end of the list ] diff --git a/include/ap_mmn.h b/include/ap_mmn.h index c9d0be2ca08..80187a2e4ae 100644 --- a/include/ap_mmn.h +++ b/include/ap_mmn.h @@ -115,6 +115,7 @@ * ap_get_server_description() (minor) * 20051115.5 (2.2.5) Added ap_mpm_safe_kill() (minor) * 20051115.6 (2.2.7) Added retry_set to proxy_worker (minor) + * 20051115.7 (2.2.7) Added conn_rec::clogging_input_filters (minor) * */ @@ -123,7 +124,7 @@ #ifndef MODULE_MAGIC_NUMBER_MAJOR #define MODULE_MAGIC_NUMBER_MAJOR 20051115 #endif -#define MODULE_MAGIC_NUMBER_MINOR 6 /* 0...n */ +#define MODULE_MAGIC_NUMBER_MINOR 7 /* 0...n */ /** * Determine if the server's current MODULE_MAGIC_NUMBER is at least a diff --git a/include/httpd.h b/include/httpd.h index 8c784ee5109..15e1f11ddea 100644 --- a/include/httpd.h +++ b/include/httpd.h @@ -1096,6 +1096,11 @@ struct conn_rec { conn_state_t *cs; /** Is there data pending in the input filters? */ int data_in_input_filters; + + /** Are there any filters that clogg/buffer the input stream, breaking + * the event mpm. + */ + int clogging_input_filters; }; /** diff --git a/modules/http/http_core.c b/modules/http/http_core.c index 1e4da5d10f9..be1e1138fca 100644 --- a/modules/http/http_core.c +++ b/modules/http/http_core.c @@ -42,6 +42,8 @@ AP_DECLARE_DATA ap_filter_rec_t *ap_chunk_filter_handle; AP_DECLARE_DATA ap_filter_rec_t *ap_http_outerror_filter_handle; AP_DECLARE_DATA ap_filter_rec_t *ap_byterange_filter_handle; +static int ap_process_http_connection(conn_rec *c); + static const char *set_keep_alive_timeout(cmd_parms *cmd, void *dummy, const char *arg) { @@ -124,6 +126,10 @@ static int ap_process_http_async_connection(conn_rec *c) request_rec *r; conn_state_t *cs = c->cs; + if (c->clogging_input_filters) { + return ap_process_http_connection(c); + } + AP_DEBUG_ASSERT(cs->state == CONN_STATE_READ_REQUEST_LINE); while (cs->state == CONN_STATE_READ_REQUEST_LINE) { diff --git a/modules/ssl/ssl_engine_io.c b/modules/ssl/ssl_engine_io.c index f3917ea10b5..644b57c3ecc 100644 --- a/modules/ssl/ssl_engine_io.c +++ b/modules/ssl/ssl_engine_io.c @@ -1665,6 +1665,9 @@ void ssl_io_filter_init(conn_rec *c, SSL *ssl) filter_ctx->pbioWrite = BIO_new(&bio_filter_out_method); filter_ctx->pbioWrite->ptr = (void *)bio_filter_out_ctx_new(filter_ctx, c); + /* We insert a clogging input filter. Let the core know. */ + c->clogging_input_filters = 1; + ssl_io_input_add_filter(filter_ctx, c, ssl); SSL_set_bio(ssl, filter_ctx->pbioRead, filter_ctx->pbioWrite); diff --git a/server/core.c b/server/core.c index 5ba897d9f8f..7a78dab3375 100644 --- a/server/core.c +++ b/server/core.c @@ -3909,6 +3909,7 @@ static conn_rec *core_create_conn(apr_pool_t *ptrans, server_rec *server, c->id = id; c->bucket_alloc = alloc; + c->clogging_input_filters = 0; return c; } diff --git a/server/mpm/experimental/event/event.c b/server/mpm/experimental/event/event.c index cfff13267f1..261468eaa92 100644 --- a/server/mpm/experimental/event/event.c +++ b/server/mpm/experimental/event/event.c @@ -623,6 +623,15 @@ static int process_socket(apr_pool_t * p, apr_socket_t * sock, c->sbh = sbh; } + if (c->clogging_input_filters && !c->aborted) { + /* Since we have an input filter which 'cloggs' the input stream, + * like mod_ssl, lets just do the normal read from input filters, + * like the Worker MPM does. + */ + ap_run_process_connection(c); + cs->state = CONN_STATE_LINGER; + } + if (cs->state == CONN_STATE_READ_REQUEST_LINE) { if (!c->aborted) { ap_run_process_connection(c); @@ -639,7 +648,6 @@ static int process_socket(apr_pool_t * p, apr_socket_t * sock, if (cs->state == CONN_STATE_LINGER) { ap_lingering_close(c); - apr_bucket_alloc_destroy(cs->bucket_alloc); apr_pool_clear(p); ap_push_pool(worker_queue_info, p); return 1;