From 1199d6fdb4d35b10f9f790ff53567778f5ada28e Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 29 May 2013 12:35:00 +0000 Subject: [PATCH] mergeinfo for r1487458 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1487459 13f79535-47bb-0310-9956-ffa450edef68 --- modules/experimental/mod_example.c | 8 ++++---- modules/filters/mod_ext_filter.c | 11 ++++++++++- modules/http/http_request.c | 18 +++++++++--------- server/main.c | 8 ++++++++ 4 files changed, 31 insertions(+), 14 deletions(-) diff --git a/modules/experimental/mod_example.c b/modules/experimental/mod_example.c index a351e6bfd56..60a757f80bb 100644 --- a/modules/experimental/mod_example.c +++ b/modules/experimental/mod_example.c @@ -922,7 +922,7 @@ static const char *x_http_scheme(const request_rec *r) /* * Log the call and exit. */ - trace_add(r->server, NULL, cfg, "x_http_scheme()"); + trace_add(r->server, r, cfg, "x_http_scheme()"); return "example"; } @@ -941,7 +941,7 @@ static apr_port_t x_default_port(const request_rec *r) /* * Log the call and exit. */ - trace_add(r->server, NULL, cfg, "x_default_port()"); + trace_add(r->server, r, cfg, "x_default_port()"); return 80; } #endif /*0*/ @@ -961,7 +961,7 @@ static void x_insert_filter(request_rec *r) /* * Log the call and exit. */ - trace_add(r->server, NULL, cfg, "x_insert_filter()"); + trace_add(r->server, r, cfg, "x_insert_filter()"); } /* @@ -979,7 +979,7 @@ static int x_quick_handler(request_rec *r, int lookup_uri) /* * Log the call and exit. */ - trace_add(r->server, NULL, cfg, "x_quick_handler()"); + trace_add(r->server, r, cfg, "x_quick_handler()"); return DECLINED; } diff --git a/modules/filters/mod_ext_filter.c b/modules/filters/mod_ext_filter.c index fe92271625e..7a5a0c6f80c 100644 --- a/modules/filters/mod_ext_filter.c +++ b/modules/filters/mod_ext_filter.c @@ -67,7 +67,7 @@ typedef struct ef_ctx_t { apr_procattr_t *procattr; ef_dir_t *dc; ef_filter_t *filter; - int noop; + int noop, hit_eos; #if APR_FILES_AS_SOCKETS apr_pollset_t *pollset; #endif @@ -856,6 +856,7 @@ static int ef_unified_filter(ap_filter_t *f, apr_bucket_brigade *bb) if (eos) { b = apr_bucket_eos_create(c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(bb, b); + ctx->hit_eos = 1; } return APR_SUCCESS; @@ -939,6 +940,14 @@ static int ef_input_filter(ap_filter_t *f, apr_bucket_brigade *bb, ctx = f->ctx; } + if (ctx->hit_eos) { + /* Match behaviour of HTTP_IN if filter is re-invoked after + * hitting EOS: give back another EOS. */ + apr_bucket *e = apr_bucket_eos_create(f->c->bucket_alloc); + APR_BRIGADE_INSERT_TAIL(bb, e); + return APR_SUCCESS; + } + if (ctx->noop) { ap_remove_input_filter(f); return ap_get_brigade(f->next, bb, mode, block, readbytes); diff --git a/modules/http/http_request.c b/modules/http/http_request.c index 9d63aca816b..38d5aefb624 100644 --- a/modules/http/http_request.c +++ b/modules/http/http_request.c @@ -243,16 +243,16 @@ static void check_pipeline_flush(request_rec *r) } } - e = apr_bucket_flush_create(c->bucket_alloc); + e = apr_bucket_flush_create(c->bucket_alloc); - /* We just send directly to the connection based filters. At - * this point, we know that we have seen all of the data - * (request finalization sent an EOS bucket, which empties all - * of the request filters). We just want to flush the buckets - * if something hasn't been sent to the network yet. - */ - APR_BRIGADE_INSERT_HEAD(bb, e); - ap_pass_brigade(r->connection->output_filters, bb); + /* We just send directly to the connection based filters. At + * this point, we know that we have seen all of the data + * (request finalization sent an EOS bucket, which empties all + * of the request filters). We just want to flush the buckets + * if something hasn't been sent to the network yet. + */ + APR_BRIGADE_INSERT_HEAD(bb, e); + ap_pass_brigade(r->connection->output_filters, bb); } void ap_process_request(request_rec *r) diff --git a/server/main.c b/server/main.c index 0892b1f9ed0..66e72fc9a76 100644 --- a/server/main.c +++ b/server/main.c @@ -626,6 +626,10 @@ int main(int argc, const char * const argv[]) */ ap_server_root = def_server_root; + if (ap_server_root_relative(ptemp, "foo") == NULL) { + fail(); + } + if (temp_error_log) { ap_replace_stderr_log(process->pool, temp_error_log); } @@ -707,6 +711,10 @@ int main(int argc, const char * const argv[]) apr_pool_create(&ptemp, pconf); apr_pool_tag(ptemp, "ptemp"); ap_server_root = def_server_root; + if (ap_server_root_relative(ptemp, "foo") == NULL) { + fail(); + } + server_conf = ap_read_config(process, ptemp, confname, &ap_conftree); if (!server_conf) { destroy_and_exit_process(process, 1); -- 2.47.2