Mercurial > hg > nginx
comparison src/http/modules/ngx_http_addition_filter_module.c @ 758:86bb73dc8d40
fix <!--#include virtual=... wait="yes" -->
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 10 Oct 2006 14:30:39 +0000 |
parents | 7e24168b0853 |
children | 4ab852b691f5 |
comparison
equal
deleted
inserted
replaced
757:a138c4e6031f | 758:86bb73dc8d40 |
---|---|
122 ngx_http_addition_body_filter(ngx_http_request_t *r, ngx_chain_t *in) | 122 ngx_http_addition_body_filter(ngx_http_request_t *r, ngx_chain_t *in) |
123 { | 123 { |
124 ngx_int_t rc; | 124 ngx_int_t rc; |
125 ngx_uint_t last; | 125 ngx_uint_t last; |
126 ngx_chain_t *cl; | 126 ngx_chain_t *cl; |
127 ngx_http_request_t *sr; | |
127 ngx_http_addition_ctx_t *ctx; | 128 ngx_http_addition_ctx_t *ctx; |
128 ngx_http_addition_conf_t *conf; | 129 ngx_http_addition_conf_t *conf; |
129 | 130 |
130 if (in == NULL || r->header_only) { | 131 if (in == NULL || r->header_only) { |
131 return ngx_http_next_body_filter(r, in); | 132 return ngx_http_next_body_filter(r, in); |
141 | 142 |
142 if (!ctx->before_body_sent) { | 143 if (!ctx->before_body_sent) { |
143 ctx->before_body_sent = 1; | 144 ctx->before_body_sent = 1; |
144 | 145 |
145 if (conf->before_body.len) { | 146 if (conf->before_body.len) { |
146 if (ngx_http_subrequest(r, &conf->before_body, NULL, NULL, 0) | 147 if (ngx_http_subrequest(r, &conf->before_body, NULL, &sr, NULL, 0) |
147 == NGX_ERROR) | 148 == NGX_ERROR) |
148 { | 149 { |
149 return NGX_ERROR; | 150 return NGX_ERROR; |
150 } | 151 } |
151 } | 152 } |
165 | 166 |
166 if (rc == NGX_ERROR || !last || conf->after_body.len == 0) { | 167 if (rc == NGX_ERROR || !last || conf->after_body.len == 0) { |
167 return rc; | 168 return rc; |
168 } | 169 } |
169 | 170 |
170 if (ngx_http_subrequest(r, &conf->after_body, NULL, NULL, 0) == NGX_ERROR) { | 171 if (ngx_http_subrequest(r, &conf->after_body, NULL, &sr, NULL, 0) |
172 == NGX_ERROR) | |
173 { | |
171 return NGX_ERROR; | 174 return NGX_ERROR; |
172 } | 175 } |
173 | 176 |
174 ngx_http_set_ctx(r, NULL, ngx_http_addition_filter_module); | 177 ngx_http_set_ctx(r, NULL, ngx_http_addition_filter_module); |
175 | 178 |