comparison src/http/modules/ngx_http_ssi_filter_module.c @ 767:cad7543dc419

fix <!--#include virtual=... wait="yes" --> r766 did not fix the bug too
author Igor Sysoev <igor@sysoev.ru>
date Wed, 11 Oct 2006 14:33:38 +0000
parents 4cb8f85c085d
children 4ab852b691f5
comparison
equal deleted inserted replaced
766:791ea37bc944 767:cad7543dc419
381 ngx_buf_t *b; 381 ngx_buf_t *b;
382 ngx_uint_t i, index; 382 ngx_uint_t i, index;
383 ngx_chain_t *cl, **ll; 383 ngx_chain_t *cl, **ll;
384 ngx_table_elt_t *param; 384 ngx_table_elt_t *param;
385 ngx_connection_t *c; 385 ngx_connection_t *c;
386 ngx_http_request_t *pr;
386 ngx_http_ssi_ctx_t *ctx, *mctx; 387 ngx_http_ssi_ctx_t *ctx, *mctx;
387 ngx_http_ssi_block_t *bl; 388 ngx_http_ssi_block_t *bl;
388 ngx_http_ssi_param_t *prm; 389 ngx_http_ssi_param_t *prm;
389 ngx_http_ssi_command_t *cmd; 390 ngx_http_ssi_command_t *cmd;
390 ngx_http_ssi_loc_conf_t *slcf; 391 ngx_http_ssi_loc_conf_t *slcf;
409 return NGX_ERROR; 410 return NGX_ERROR;
410 } 411 }
411 } 412 }
412 413
413 if (ctx->wait) { 414 if (ctx->wait) {
414 if (ctx->wait != r) { 415 if (r->connection->data != r) {
415 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 416 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
416 "http ssi filter \"%V\" wait", &r->uri); 417 "http ssi filter \"%V\" wait", &r->uri);
417 return NGX_AGAIN; 418 return NGX_AGAIN;
418 } 419 }
419 420
420 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 421 for (pr = ctx->wait->parent; pr; pr = pr->parent) {
421 "http ssi filter \"%V\" continue", &r->uri); 422 if (pr == r) {
422 423 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
423 ctx->wait = NULL; 424 "http ssi filter \"%V\" flush", &r->uri);
425
426 rc = ngx_http_next_body_filter(r, NULL);
427
428 if (ctx->wait->done) {
429 ctx->wait = NULL;
430 }
431
432 if (rc == NGX_ERROR || rc == NGX_AGAIN) {
433 return rc;
434 }
435 }
436 }
437
438 if (ctx->wait == r) {
439 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
440 "http ssi filter \"%V\" continue", &r->uri);
441 ctx->wait = NULL;
442 }
424 } 443 }
425 444
426 slcf = ngx_http_get_module_loc_conf(r, ngx_http_ssi_filter_module); 445 slcf = ngx_http_get_module_loc_conf(r, ngx_http_ssi_filter_module);
427 446
428 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 447 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,