comparison src/event/ngx_event_pipe.c @ 346:05693816539c NGINX_0_6_17

nginx 0.6.17 *) Feature: the "If-Range" request header line support. Thanks to Alexander V. Inyukhin. *) Bugfix: URL double escaping in a redirect of the "msie_refresh" directive; bug appeared in 0.6.4. *) Bugfix: the "autoindex" directive did not work with the "alias /" directive. *) Bugfix: a segmentation fault might occur in worker process if subrequests were used. *) Bugfix: the big responses may be transferred truncated if SSL and gzip were used. *) Bugfix: the $status variable was equal to 0 if a proxied server returned response in HTTP/0.9 version.
author Igor Sysoev <http://sysoev.ru>
date Thu, 15 Nov 2007 00:00:00 +0300
parents eae74a780a84
children d13234035cad
comparison
equal deleted inserted replaced
345:4279bc4cdec6 346:05693816539c
419 static ngx_int_t 419 static ngx_int_t
420 ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p) 420 ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p)
421 { 421 {
422 u_char *prev; 422 u_char *prev;
423 size_t bsize; 423 size_t bsize;
424 ngx_int_t rc;
424 ngx_uint_t flush, prev_last_shadow; 425 ngx_uint_t flush, prev_last_shadow;
425 ngx_chain_t *out, **ll, *cl; 426 ngx_chain_t *out, **ll, *cl;
426 ngx_connection_t *downstream; 427 ngx_connection_t *downstream;
427 428
428 downstream = p->downstream; 429 downstream = p->downstream;
449 450
450 for (cl = p->out; cl; cl = cl->next) { 451 for (cl = p->out; cl; cl = cl->next) {
451 cl->buf->recycled = 0; 452 cl->buf->recycled = 0;
452 } 453 }
453 454
454 if (p->output_filter(p->output_ctx, p->out) == NGX_ERROR) { 455 rc = p->output_filter(p->output_ctx, p->out);
456
457 if (downstream->destroyed) {
458 return NGX_ABORT;
459 }
460
461 if (rc == NGX_ERROR) {
455 p->downstream_error = 1; 462 p->downstream_error = 1;
456 return ngx_event_pipe_drain_chains(p); 463 return ngx_event_pipe_drain_chains(p);
457 } 464 }
458 465
459 p->out = NULL; 466 p->out = NULL;
465 472
466 for (cl = p->in; cl; cl = cl->next) { 473 for (cl = p->in; cl; cl = cl->next) {
467 cl->buf->recycled = 0; 474 cl->buf->recycled = 0;
468 } 475 }
469 476
470 if (p->output_filter(p->output_ctx, p->in) == NGX_ERROR) { 477 rc = p->output_filter(p->output_ctx, p->in);
471 478
472 if (downstream->destroyed) { 479 if (downstream->destroyed) {
473 return NGX_ABORT; 480 return NGX_ABORT;
474 } 481 }
475 482
483 if (rc == NGX_ERROR) {
476 p->downstream_error = 1; 484 p->downstream_error = 1;
477 return ngx_event_pipe_drain_chains(p); 485 return ngx_event_pipe_drain_chains(p);
478 } 486 }
479 487
480 p->in = NULL; 488 p->in = NULL;
600 608
601 if (out == NULL && !flush) { 609 if (out == NULL && !flush) {
602 break; 610 break;
603 } 611 }
604 612
605 if (p->output_filter(p->output_ctx, out) == NGX_ERROR) { 613 rc = p->output_filter(p->output_ctx, out);
614
615 if (downstream->destroyed) {
616 return NGX_ABORT;
617 }
618
619 if (rc == NGX_ERROR) {
606 p->downstream_error = 1; 620 p->downstream_error = 1;
607 return ngx_event_pipe_drain_chains(p); 621 return ngx_event_pipe_drain_chains(p);
608 } 622 }
609 623
610 ngx_chain_update_chains(&p->free, &p->busy, &out, p->tag); 624 ngx_chain_update_chains(&p->free, &p->busy, &out, p->tag);