Klaus Demo nginx / 9fcccaf
fix <!--#include virtual=... wait="yes" --> Igor Sysoev 15 years ago
5 changed file(s) with 26 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
123123 ngx_int_t rc;
124124 ngx_uint_t last;
125125 ngx_chain_t *cl;
126 ngx_http_request_t *sr;
126127 ngx_http_addition_ctx_t *ctx;
127128 ngx_http_addition_conf_t *conf;
128129
142143 ctx->before_body_sent = 1;
143144
144145 if (conf->before_body.len) {
145 if (ngx_http_subrequest(r, &conf->before_body, NULL, NULL, 0)
146 if (ngx_http_subrequest(r, &conf->before_body, NULL, &sr, NULL, 0)
146147 == NGX_ERROR)
147148 {
148149 return NGX_ERROR;
166167 return rc;
167168 }
168169
169 if (ngx_http_subrequest(r, &conf->after_body, NULL, NULL, 0) == NGX_ERROR) {
170 if (ngx_http_subrequest(r, &conf->after_body, NULL, &sr, NULL, 0)
171 == NGX_ERROR)
172 {
170173 return NGX_ERROR;
171174 }
172175
416416 return NGX_AGAIN;
417417 }
418418
419 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
420 "http ssi filter \"%V\" continue", &r->uri);
421
422 ctx->wait = 0;
419 if (ctx->wait == r) {
420 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
421 "http ssi filter \"%V\" continue", &r->uri);
422 ctx->wait = NULL;
423 }
423424 }
424425
425426 slcf = ngx_http_get_module_loc_conf(r, ngx_http_ssi_filter_module);
18131814 ngx_buf_t *b;
18141815 ngx_uint_t flags, i;
18151816 ngx_chain_t *out, *cl, *tl, **ll;
1817 ngx_http_request_t *sr;
18161818 ngx_http_ssi_ctx_t *mctx;
18171819 ngx_http_ssi_block_t *bl;
18181820
19351937 }
19361938 }
19371939
1938 rc = ngx_http_subrequest(r, uri, &args, out, flags);
1940 rc = ngx_http_subrequest(r, uri, &args, &sr, out, flags);
19391941
19401942 if (rc == NGX_ERROR) {
19411943 return NGX_HTTP_SSI_ERROR;
19461948 }
19471949
19481950 if (rc == NGX_AGAIN) {
1949 ctx->wait = 1;
1951 if (ctx->wait == NULL) {
1952 ctx->wait = sr;
1953
1954 } else {
1955 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
1956 "only one subrequest may be waited at the same time");
1957 }
19501958 }
19511959
19521960 return rc;
6262 unsigned block:1;
6363 unsigned output:1;
6464 unsigned output_chosen:1;
65 unsigned wait:1;
6665
66 ngx_http_request_t *wait;
6767 void *value_buf;
6868 ngx_str_t timefmt;
6969 ngx_str_t errmsg;
12821282
12831283 ngx_int_t
12841284 ngx_http_subrequest(ngx_http_request_t *r,
1285 ngx_str_t *uri, ngx_str_t *args, ngx_chain_t *out, ngx_uint_t flags)
1285 ngx_str_t *uri, ngx_str_t *args, ngx_http_request_t **psr,
1286 ngx_chain_t *out, ngx_uint_t flags)
12861287 {
12871288 ngx_connection_t *c;
12881289 ngx_http_request_t *sr;
14151416 if (!c->destroyed) {
14161417 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
14171418 "http subrequest done \"%V?%V\"", uri, &sr->args);
1419
1420 *psr = sr;
14181421
14191422 if (sr->fast_subrequest) {
14201423 sr->fast_subrequest = 0;
304304 ngx_int_t ngx_http_auth_basic_user(ngx_http_request_t *r);
305305
306306 ngx_int_t ngx_http_subrequest(ngx_http_request_t *r,
307 ngx_str_t *uri, ngx_str_t *args, ngx_chain_t *out, ngx_uint_t flags);
307 ngx_str_t *uri, ngx_str_t *args, ngx_http_request_t **sr,
308 ngx_chain_t *out, ngx_uint_t flags);
308309 ngx_int_t ngx_http_internal_redirect(ngx_http_request_t *r,
309310 ngx_str_t *uri, ngx_str_t *args);
310311