couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [35/50] mochiweb commit: updated refs/heads/upstream to b66b68d
Date Wed, 29 Jul 2015 15:55:04 GMT
Merge pull request #147 from kuenishi/ku-range-fix

Accept range end position which exceededs the resource size

Project: http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/commit/35c6bcaf
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/tree/35c6bcaf
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/diff/35c6bcaf

Branch: refs/heads/upstream
Commit: 35c6bcaf2b9809d8a1574f4a22aa8d8ca672eb2f
Parents: 4270ab6 d273c0c
Author: Bob Ippolito <bob@redivi.com>
Authored: Fri Jan 16 09:35:30 2015 -0800
Committer: Bob Ippolito <bob@redivi.com>
Committed: Fri Jan 16 09:35:30 2015 -0800

----------------------------------------------------------------------
 src/mochiweb_http.erl | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/blob/35c6bcaf/src/mochiweb_http.erl
----------------------------------------------------------------------
diff --cc src/mochiweb_http.erl
index e3c56fa,24bf28c..271531b
--- a/src/mochiweb_http.erl
+++ b/src/mochiweb_http.erl
@@@ -150,11 -134,9 +150,9 @@@ after_response(Body, Req) -
          false ->
              Req:cleanup(),
              erlang:garbage_collect(),
 -            ?MODULE:loop(Socket, Body)
 +            ?MODULE:loop(Socket, mochiweb_request:get(opts, Req), Body)
      end.
  
- parse_range_request("bytes=0-") ->
-     undefined;
  parse_range_request(RawRange) when is_list(RawRange) ->
      try
          "bytes=" ++ RangeString = RawRange,
@@@ -186,10 -167,8 +184,10 @@@ range_skip_length(Spec, Size) -
              {R, Size - R};
          {_OutOfRange, none} ->
              invalid_range;
-         {Start, End} when 0 =< Start, Start =< End, End < Size ->
+         {Start, End} when 0 =< Start, Start < Size, Start =< End ->
              {Start, End - Start + 1};
 +        {Start, End} when 0 =< Start, Start =< End, End >= Size ->
 +            {Start, Size - Start};
          {_OutOfRange, _End} ->
              invalid_range
      end.


Mime
View raw message