comparison src/http/modules/ngx_http_addition_filter_module.c @ 2377:87b8c44906b5

*) refactor subrequest handling, now they run as separate posted requests *) now $upstream_addr, $upstream_status, $upstream_response_time can be used with log_subrequest
author Igor Sysoev <igor@sysoev.ru>
date Mon, 08 Dec 2008 14:23:20 +0000
parents 2cdefc40cabd
children c7d57b539248
comparison
equal deleted inserted replaced
2376:29d89920a749 2377:87b8c44906b5
149 149
150 if (!ctx->before_body_sent) { 150 if (!ctx->before_body_sent) {
151 ctx->before_body_sent = 1; 151 ctx->before_body_sent = 1;
152 152
153 if (conf->before_body.len) { 153 if (conf->before_body.len) {
154 rc = ngx_http_subrequest(r, &conf->before_body, NULL, &sr, NULL, 0); 154 if (ngx_http_subrequest(r, &conf->before_body, NULL, &sr, NULL, 0)
155 155 != NGX_OK)
156 if (rc == NGX_ERROR || rc == NGX_DONE) { 156 {
157 return rc; 157 return NGX_ERROR;
158 } 158 }
159 } 159 }
160 } 160 }
161 161
162 if (conf->after_body.len == 0) { 162 if (conf->after_body.len == 0) {
178 178
179 if (rc == NGX_ERROR || !last || conf->after_body.len == 0) { 179 if (rc == NGX_ERROR || !last || conf->after_body.len == 0) {
180 return rc; 180 return rc;
181 } 181 }
182 182
183 rc = ngx_http_subrequest(r, &conf->after_body, NULL, &sr, NULL, 0); 183 if (ngx_http_subrequest(r, &conf->after_body, NULL, &sr, NULL, 0)
184 184 != NGX_OK)
185 if (rc == NGX_ERROR || rc == NGX_DONE) { 185 {
186 return rc; 186 return NGX_ERROR;
187 } 187 }
188 188
189 ngx_http_set_ctx(r, NULL, ngx_http_addition_filter_module); 189 ngx_http_set_ctx(r, NULL, ngx_http_addition_filter_module);
190 190
191 return ngx_http_send_special(r, NGX_HTTP_LAST); 191 return ngx_http_send_special(r, NGX_HTTP_LAST);