Mercurial > hg > nginx-vendor-1-0
comparison src/http/modules/ngx_http_range_filter_module.c @ 646:09a689c5e494 NGINX_1_0_13
nginx 1.0.13
*) Feature: the "return" and "error_page" directives can now be used to
return 307 redirections.
*) Bugfix: a segmentation fault might occur in a worker process if the
"resolver" directive was used and there was no "error_log" directive
specified at global level.
Thanks to Roman Arutyunyan.
*) Bugfix: memory leaks.
Thanks to Lanshun Zhou.
*) Bugfix: nginx might log incorrect error "upstream prematurely closed
connection" instead of correct "upstream sent too big header" one.
Thanks to Feibo Li.
*) Bugfix: on ZFS filesystem disk cache size might be calculated
incorrectly; the bug had appeared in 1.0.1.
*) Bugfix: the number of internal redirects to named locations was not
limited.
*) Bugfix: temporary files might be not removed if the "proxy_store"
directive was used with SSI includes.
*) Bugfix: in some cases non-cacheable variables (such as the $args
variable) returned old empty cached value.
*) Bugfix: the "proxy_redirect" directives might be inherited
incorrectly.
*) Bugfix: nginx could not be built with the ngx_http_perl_module if the
--with-openssl option was used.
*) Bugfix: nginx could not be built by the icc 12.1 compiler.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 05 Mar 2012 00:00:00 +0400 |
parents | ad25218fd14b |
children |
comparison
equal
deleted
inserted
replaced
645:60344e6faa47 | 646:09a689c5e494 |
---|---|
593 } | 593 } |
594 | 594 |
595 buf = in->buf; | 595 buf = in->buf; |
596 | 596 |
597 if (!buf->last_buf) { | 597 if (!buf->last_buf) { |
598 | 598 start = ctx->offset; |
599 if (buf->in_file) { | 599 last = ctx->offset + ngx_buf_size(buf); |
600 start = buf->file_pos + ctx->offset; | |
601 last = buf->file_last + ctx->offset; | |
602 | |
603 } else { | |
604 start = buf->pos - buf->start + ctx->offset; | |
605 last = buf->last - buf->start + ctx->offset; | |
606 } | |
607 | 600 |
608 range = ctx->ranges.elts; | 601 range = ctx->ranges.elts; |
609 for (i = 0; i < ctx->ranges.nelts; i++) { | 602 for (i = 0; i < ctx->ranges.nelts; i++) { |
610 if (start > range[i].start || last < range[i].end) { | 603 if (start > range[i].start || last < range[i].end) { |
611 goto overlapped; | 604 goto overlapped; |
714 | 707 |
715 static ngx_int_t | 708 static ngx_int_t |
716 ngx_http_range_multipart_body(ngx_http_request_t *r, | 709 ngx_http_range_multipart_body(ngx_http_request_t *r, |
717 ngx_http_range_filter_ctx_t *ctx, ngx_chain_t *in) | 710 ngx_http_range_filter_ctx_t *ctx, ngx_chain_t *in) |
718 { | 711 { |
719 off_t body_start; | |
720 ngx_buf_t *b, *buf; | 712 ngx_buf_t *b, *buf; |
721 ngx_uint_t i; | 713 ngx_uint_t i; |
722 ngx_chain_t *out, *hcl, *rcl, *dcl, **ll; | 714 ngx_chain_t *out, *hcl, *rcl, *dcl, **ll; |
723 ngx_http_range_t *range; | 715 ngx_http_range_t *range; |
724 | 716 |
725 ll = &out; | 717 ll = &out; |
726 buf = in->buf; | 718 buf = in->buf; |
727 range = ctx->ranges.elts; | 719 range = ctx->ranges.elts; |
728 | |
729 #if (NGX_HTTP_CACHE) | |
730 body_start = r->cached ? r->cache->body_start : 0; | |
731 #else | |
732 body_start = 0; | |
733 #endif | |
734 | 720 |
735 for (i = 0; i < ctx->ranges.nelts; i++) { | 721 for (i = 0; i < ctx->ranges.nelts; i++) { |
736 | 722 |
737 /* | 723 /* |
738 * The boundary header of the range: | 724 * The boundary header of the range: |
790 b->memory = buf->memory; | 776 b->memory = buf->memory; |
791 b->mmap = buf->mmap; | 777 b->mmap = buf->mmap; |
792 b->file = buf->file; | 778 b->file = buf->file; |
793 | 779 |
794 if (buf->in_file) { | 780 if (buf->in_file) { |
795 b->file_pos = body_start + range[i].start; | 781 b->file_pos = buf->file_pos + range[i].start; |
796 b->file_last = body_start + range[i].end; | 782 b->file_last = buf->file_pos + range[i].end; |
797 } | 783 } |
798 | 784 |
799 if (ngx_buf_in_memory(buf)) { | 785 if (ngx_buf_in_memory(buf)) { |
800 b->pos = buf->start + (size_t) range[i].start; | 786 b->pos = buf->pos + (size_t) range[i].start; |
801 b->last = buf->start + (size_t) range[i].end; | 787 b->last = buf->pos + (size_t) range[i].end; |
802 } | 788 } |
803 | 789 |
804 dcl = ngx_alloc_chain_link(r->pool); | 790 dcl = ngx_alloc_chain_link(r->pool); |
805 if (dcl == NULL) { | 791 if (dcl == NULL) { |
806 return NGX_ERROR; | 792 return NGX_ERROR; |