comparison src/event/ngx_event_pipe.c @ 132:91372f004adf NGINX_0_3_13

nginx 0.3.13 *) Feature: the IMAP/POP3 proxy supports STARTTLS and STLS. *) Bugfix: the IMAP/POP3 proxy did not work with the select, poll, and /dev/poll methods. *) Bugfix: in SSI handling. *) Bugfix: now Solaris sendfilev() is not used to transfer the client request body to FastCGI-server via the unix domain socket. *) Bugfix: the "auth_basic" directive did not disable the authorization; bug appeared in 0.3.11.
author Igor Sysoev <http://sysoev.ru>
date Mon, 05 Dec 2005 00:00:00 +0300
parents 82d695e3d662
children 3656228c0b56
comparison
equal deleted inserted replaced
131:add6b1e86d38 132:91372f004adf
405 405
406 406
407 static ngx_int_t 407 static ngx_int_t
408 ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p) 408 ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p)
409 { 409 {
410 size_t bsize; 410 size_t bsize;
411 ngx_uint_t flush; 411 ngx_uint_t flush;
412 ngx_chain_t *out, **ll, *cl; 412 ngx_chain_t *out, **ll, *cl;
413 ngx_connection_t *downstream;
414
415 downstream = p->downstream;
413 416
414 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0, 417 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0,
415 "pipe write downstream: %d", p->downstream->write->ready); 418 "pipe write downstream: %d", downstream->write->ready);
416 419
417 for ( ;; ) { 420 for ( ;; ) {
418 if (p->downstream_error) { 421 if (p->downstream_error) {
419 return ngx_event_pipe_drain_chains(p); 422 return ngx_event_pipe_drain_chains(p);
420 } 423 }
450 for (cl = p->in; cl; cl = cl->next) { 453 for (cl = p->in; cl; cl = cl->next) {
451 cl->buf->recycled = 0; 454 cl->buf->recycled = 0;
452 } 455 }
453 456
454 if (p->output_filter(p->output_ctx, p->in) == NGX_ERROR) { 457 if (p->output_filter(p->output_ctx, p->in) == NGX_ERROR) {
458
459 if (downstream->destroyed) {
460 return NGX_ABORT;
461 }
462
455 p->downstream_error = 1; 463 p->downstream_error = 1;
456 return ngx_event_pipe_drain_chains(p); 464 return ngx_event_pipe_drain_chains(p);
457 } 465 }
458 466
459 p->in = NULL; 467 p->in = NULL;
466 474
467 p->downstream_done = 1; 475 p->downstream_done = 1;
468 break; 476 break;
469 } 477 }
470 478
471 if (p->downstream->data != p->output_ctx 479 if (downstream->data != p->output_ctx
472 || !p->downstream->write->ready 480 || !downstream->write->ready
473 || p->downstream->write->delayed) 481 || downstream->write->delayed)
474 { 482 {
475 break; 483 break;
476 } 484 }
477 485
478 /* bsize is the size of the busy recycled bufs */ 486 /* bsize is the size of the busy recycled bufs */