Skip to content

Commit

Permalink
Merge branch 'master' into script
Browse files Browse the repository at this point in the history
Conflicts:
	ngx_http_subrange_module.c
  • Loading branch information
renyongquan committed Jun 19, 2014
2 parents 72019d8 + 1e8bce3 commit 80ed4d9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions ngx_http_subrange_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ static ngx_str_t ngx_http_subrange_get_range(ngx_http_request_t *r, ngx_int_t st
return range;
}
range.data = data;
range.len = ngx_sprintf(range.data, "bytes=%ud-%ud", start, offset)
range.len = ngx_sprintf(range.data, "bytes=%ui-%ui", start, offset)
- range.data;
return range;
}
Expand Down Expand Up @@ -582,11 +582,11 @@ static ngx_int_t ngx_http_subrange_create_subrequest(ngx_http_request_t *r, ngx_
if(ctx->range.end && ctx->range_request &&
end > ctx->range.end){
end = ctx->range.end;
range_value.len = ngx_sprintf(range_value.data, "bytes=%i-%i", ctx->offset, end)
range_value.len = ngx_sprintf(range_value.data, "bytes=%ui-%ui", ctx->offset, end)
- range_value.data;
ctx->done = 1;
}else{
range_value.len = ngx_sprintf(range_value.data, "bytes=%i-%i", ctx->offset, end)
range_value.len = ngx_sprintf(range_value.data, "bytes=%ui-%ui", ctx->offset, end)
- range_value.data;
}
ngx_http_subrange_set_header(sr, &sr->headers_in.headers, range_key, range_value, &hdr);
Expand Down
2 changes: 1 addition & 1 deletion ngx_http_subrange_module.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef NGX_HTTP_SUBRANGE_MODULE_H
#define NGX_HTTP_SUBRANGE_MODULE_H
#define NGX_HTTP_SUBRANGE_VERSION 0.4.9
#define NGX_HTTP_SUBRANGE_VERSION 0.5.0
#endif
5 changes: 3 additions & 2 deletions test/unit/test_subrange.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void test_ngx_http_subrange_parse(){
ngx_str_t rangekey = ngx_string("Range");
ngx_str_t rangeval_normal = ngx_string("Bytes = 0-1023");
ngx_str_t rangeval_absent_start = ngx_string("Bytes = -1023");
ngx_str_t rangeval_absent_end = ngx_string("Bytes = 0-");
ngx_str_t rangeval_absent_end = ngx_string("Bytes = 5250276732-");
ngx_str_t rangeval_invalid = ngx_string("Bytes = abc");

ngx_table_elt_t rangehdr;
Expand Down Expand Up @@ -148,9 +148,10 @@ void test_ngx_http_subrange_parse(){
/*test absent range end case*/
rangehdr.value = rangeval_absent_end;
ngx_http_subrange_parse(&r, &ctx, &range);
assert(range.start == 0);
assert(range.start == 5250276732);
assert(range.end == (ngx_uint_t) -1);
assert(range.total == 0);
printf("%lu, %lu, %lu", range.start, range.end, range.total);
pass("test_ngx_http_subrange_parse: range absent end");

/*test invalid range case*/
Expand Down

0 comments on commit 80ed4d9

Please sign in to comment.