Mercurial > hg > nginx
comparison src/http/modules/ngx_http_ssi_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 | 6875ee9f93c7 |
children | 4cb8f85c085d |
comparison
equal
deleted
inserted
replaced
757:a138c4e6031f | 758:86bb73dc8d40 |
---|---|
415 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | 415 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
416 "http ssi filter \"%V\" wait", &r->uri); | 416 "http ssi filter \"%V\" wait", &r->uri); |
417 return NGX_AGAIN; | 417 return NGX_AGAIN; |
418 } | 418 } |
419 | 419 |
420 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | 420 if (ctx->wait == r) { |
421 "http ssi filter \"%V\" continue", &r->uri); | 421 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
422 | 422 "http ssi filter \"%V\" continue", &r->uri); |
423 ctx->wait = 0; | 423 ctx->wait = NULL; |
424 } | |
424 } | 425 } |
425 | 426 |
426 slcf = ngx_http_get_module_loc_conf(r, ngx_http_ssi_filter_module); | 427 slcf = ngx_http_get_module_loc_conf(r, ngx_http_ssi_filter_module); |
427 | 428 |
428 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | 429 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
1812 ngx_int_t rc; | 1813 ngx_int_t rc; |
1813 ngx_str_t *uri, *file, *wait, *stub, args; | 1814 ngx_str_t *uri, *file, *wait, *stub, args; |
1814 ngx_buf_t *b; | 1815 ngx_buf_t *b; |
1815 ngx_uint_t flags, i; | 1816 ngx_uint_t flags, i; |
1816 ngx_chain_t *out, *cl, *tl, **ll; | 1817 ngx_chain_t *out, *cl, *tl, **ll; |
1818 ngx_http_request_t *sr; | |
1817 ngx_http_ssi_ctx_t *mctx; | 1819 ngx_http_ssi_ctx_t *mctx; |
1818 ngx_http_ssi_block_t *bl; | 1820 ngx_http_ssi_block_t *bl; |
1819 | 1821 |
1820 uri = params[NGX_HTTP_SSI_INCLUDE_VIRTUAL]; | 1822 uri = params[NGX_HTTP_SSI_INCLUDE_VIRTUAL]; |
1821 file = params[NGX_HTTP_SSI_INCLUDE_FILE]; | 1823 file = params[NGX_HTTP_SSI_INCLUDE_FILE]; |
1934 } else { | 1936 } else { |
1935 out = bl[i].bufs; | 1937 out = bl[i].bufs; |
1936 } | 1938 } |
1937 } | 1939 } |
1938 | 1940 |
1939 rc = ngx_http_subrequest(r, uri, &args, out, flags); | 1941 rc = ngx_http_subrequest(r, uri, &args, &sr, out, flags); |
1940 | 1942 |
1941 if (rc == NGX_ERROR) { | 1943 if (rc == NGX_ERROR) { |
1942 return NGX_HTTP_SSI_ERROR; | 1944 return NGX_HTTP_SSI_ERROR; |
1943 } | 1945 } |
1944 | 1946 |
1945 if (wait == NULL) { | 1947 if (wait == NULL) { |
1946 return NGX_OK; | 1948 return NGX_OK; |
1947 } | 1949 } |
1948 | 1950 |
1949 if (rc == NGX_AGAIN) { | 1951 if (rc == NGX_AGAIN) { |
1950 ctx->wait = 1; | 1952 if (ctx->wait == NULL) { |
1953 ctx->wait = sr; | |
1954 | |
1955 } else { | |
1956 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, | |
1957 "only one subrequest may be waited at the same time"); | |
1958 } | |
1951 } | 1959 } |
1952 | 1960 |
1953 return rc; | 1961 return rc; |
1954 } | 1962 } |
1955 | 1963 |