From 960100e371cdaa1986929ac8cd2f4f515160c7a6 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Fri, 13 Oct 2006 15:20:10 +0000 Subject: --- src/http/modules/ngx_http_addition_filter_module.c | 16 +- src/http/modules/ngx_http_fastcgi_module.c | 7 + src/http/modules/ngx_http_ssi_filter_module.c | 218 ++++++++++++++++----- src/http/modules/ngx_http_ssi_filter_module.h | 2 +- src/http/ngx_http_core_module.c | 11 +- src/http/ngx_http_core_module.h | 2 +- src/http/ngx_http_request.c | 22 +-- src/http/ngx_http_request.h | 13 ++ src/http/ngx_http_upstream.c | 111 ++++++++++- 9 files changed, 316 insertions(+), 86 deletions(-) (limited to 'src') diff --git a/src/http/modules/ngx_http_addition_filter_module.c b/src/http/modules/ngx_http_addition_filter_module.c index 6f15a72cc..26517147c 100644 --- a/src/http/modules/ngx_http_addition_filter_module.c +++ b/src/http/modules/ngx_http_addition_filter_module.c @@ -144,10 +144,10 @@ ngx_http_addition_body_filter(ngx_http_request_t *r, ngx_chain_t *in) ctx->before_body_sent = 1; if (conf->before_body.len) { - if (ngx_http_subrequest(r, &conf->before_body, NULL, &sr, NULL, 0) - == NGX_ERROR) - { - return NGX_ERROR; + rc = ngx_http_subrequest(r, &conf->before_body, NULL, &sr, NULL, 0); + + if (rc == NGX_ERROR || rc == NGX_DONE) { + return rc; } } } @@ -168,10 +168,10 @@ ngx_http_addition_body_filter(ngx_http_request_t *r, ngx_chain_t *in) return rc; } - if (ngx_http_subrequest(r, &conf->after_body, NULL, &sr, NULL, 0) - == NGX_ERROR) - { - return NGX_ERROR; + rc = ngx_http_subrequest(r, &conf->after_body, NULL, &sr, NULL, 0); + + if (rc == NGX_ERROR || rc == NGX_DONE) { + return rc; } ngx_http_set_ctx(r, NULL, ngx_http_addition_filter_module); diff --git a/src/http/modules/ngx_http_fastcgi_module.c b/src/http/modules/ngx_http_fastcgi_module.c index cce31010c..f22de517a 100644 --- a/src/http/modules/ngx_http_fastcgi_module.c +++ b/src/http/modules/ngx_http_fastcgi_module.c @@ -395,6 +395,13 @@ ngx_http_fastcgi_handler(ngx_http_request_t *r) ngx_http_upstream_t *u; ngx_http_fastcgi_loc_conf_t *flcf; + if (r->subrequest_in_memory) { + ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, + "ngx_http_fastcgi_module does not support " + "subrequest in memeory"); + return NGX_HTTP_INTERNAL_SERVER_ERROR; + } + flcf = ngx_http_get_module_loc_conf(r, ngx_http_fastcgi_module); u = ngx_pcalloc(r->pool, sizeof(ngx_http_upstream_t)); diff --git a/src/http/modules/ngx_http_ssi_filter_module.c b/src/http/modules/ngx_http_ssi_filter_module.c index 21bd81946..945a4e5e5 100644 --- a/src/http/modules/ngx_http_ssi_filter_module.c +++ b/src/http/modules/ngx_http_ssi_filter_module.c @@ -78,6 +78,10 @@ static ngx_int_t ngx_http_ssi_evaluate_string(ngx_http_request_t *r, static ngx_int_t ngx_http_ssi_include(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx, ngx_str_t **params); +static ngx_int_t ngx_http_ssi_stub_output(ngx_http_request_t *r, void *data, + ngx_int_t rc); +static ngx_int_t ngx_http_ssi_set_variable(ngx_http_request_t *r, void *data, + ngx_int_t rc); static ngx_int_t ngx_http_ssi_echo(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx, ngx_str_t **params); static ngx_int_t ngx_http_ssi_config(ngx_http_request_t *r, @@ -197,11 +201,14 @@ static ngx_http_output_body_filter_pt ngx_http_next_body_filter; static u_char ngx_http_ssi_string[] = "