comparison src/event/ngx_event_pipe.c @ 640:eb208e0cf44d NGINX_1_1_4

nginx 1.1.4 *) Feature: the ngx_http_upstream_keepalive module. *) Feature: the "proxy_http_version" directive. *) Feature: the "fastcgi_keep_conn" directive. *) Feature: the "worker_aio_requests" directive. *) Bugfix: if nginx was built --with-file-aio it could not be run on Linux kernel which did not support AIO. *) Bugfix: in Linux AIO error processing. Thanks to Hagai Avrahami. *) Bugfix: reduced memory consumption for long-lived requests. *) Bugfix: the module ngx_http_mp4_module did not support 64-bit MP4 "co64" atom.
author Igor Sysoev <http://sysoev.ru>
date Tue, 20 Sep 2011 00:00:00 +0400
parents 943566b4d82e
children 615b5ea36fc0
comparison
equal deleted inserted replaced
639:b516b4e38bc9 640:eb208e0cf44d
390 cl->buf->last - cl->buf->pos, 390 cl->buf->last - cl->buf->pos,
391 cl->buf->file_pos, 391 cl->buf->file_pos,
392 cl->buf->file_last - cl->buf->file_pos); 392 cl->buf->file_last - cl->buf->file_pos);
393 } 393 }
394 394
395 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0,
396 "pipe length: %O", p->length);
397
395 #endif 398 #endif
399
400 if (p->free_raw_bufs && p->length != -1) {
401 cl = p->free_raw_bufs;
402
403 if (cl->buf->last - cl->buf->pos >= p->length) {
404
405 /* STUB */ cl->buf->num = p->num++;
406
407 if (p->input_filter(p, cl->buf) == NGX_ERROR) {
408 return NGX_ABORT;
409 }
410
411 p->free_raw_bufs = cl->next;
412 ngx_free_chain(p->pool, cl);
413 }
414 }
415
416 if (p->length == 0) {
417 p->upstream_done = 1;
418 p->read = 1;
419 }
396 420
397 if ((p->upstream_eof || p->upstream_error) && p->free_raw_bufs) { 421 if ((p->upstream_eof || p->upstream_error) && p->free_raw_bufs) {
398 422
399 /* STUB */ p->free_raw_bufs->buf->num = p->num++; 423 /* STUB */ p->free_raw_bufs->buf->num = p->num++;
400 424
631 } 655 }
632 } 656 }
633 657
634 rc = p->output_filter(p->output_ctx, out); 658 rc = p->output_filter(p->output_ctx, out);
635 659
660 ngx_chain_update_chains(p->pool, &p->free, &p->busy, &out, p->tag);
661
636 if (rc == NGX_ERROR) { 662 if (rc == NGX_ERROR) {
637 p->downstream_error = 1; 663 p->downstream_error = 1;
638 return ngx_event_pipe_drain_chains(p); 664 return ngx_event_pipe_drain_chains(p);
639 } 665 }
640
641 ngx_chain_update_chains(&p->free, &p->busy, &out, p->tag);
642 666
643 for (cl = p->free; cl; cl = cl->next) { 667 for (cl = p->free; cl; cl = cl->next) {
644 668
645 if (cl->buf->temp_file) { 669 if (cl->buf->temp_file) {
646 if (p->cacheable || !p->cyclic_temp_file) { 670 if (p->cacheable || !p->cyclic_temp_file) {
846 } else { 870 } else {
847 p->in = cl; 871 p->in = cl;
848 } 872 }
849 p->last_in = &cl->next; 873 p->last_in = &cl->next;
850 874
875 if (p->length == -1) {
876 return NGX_OK;
877 }
878
879 p->length -= b->last - b->pos;
880
851 return NGX_OK; 881 return NGX_OK;
852 } 882 }
853 883
854 884
855 static ngx_inline void 885 static ngx_inline void