ruby-changes:14507
From: nobu <ko1@a...>
Date: Mon, 18 Jan 2010 15:50:06 +0900 (JST)
Subject: [ruby-changes:14507] Ruby:r26344 (ruby_1_8, trunk): * lib/net/http.rb (Net::HTTPHeader#{content_range,range_length}):
nobu 2010-01-18 15:49:46 +0900 (Mon, 18 Jan 2010) New Revision: 26344 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26344 Log: * lib/net/http.rb (Net::HTTPHeader#{content_range,range_length}): use inclusive range same as the header representation. Modified files: branches/ruby_1_8/ChangeLog branches/ruby_1_8/lib/net/http.rb trunk/ChangeLog trunk/lib/net/http.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 26343) +++ ChangeLog (revision 26344) @@ -1,3 +1,8 @@ +Mon Jan 18 15:49:42 2010 Nobuyoshi Nakada <nobu@r...> + + * lib/net/http.rb (Net::HTTPHeader#{content_range,range_length}): + use inclusive range same as the header representation. + Mon Jan 18 03:59:57 2010 Akinori MUSHA <knu@i...> * ext/digest/digest.c (rb_digest_instance_hexdigest_bang): Fix Index: lib/net/http.rb =================================================================== --- lib/net/http.rb (revision 26343) +++ lib/net/http.rb (revision 26344) @@ -1520,13 +1520,13 @@ return nil unless @header['content-range'] m = %r<bytes\s+(\d+)-(\d+)/(\d+|\*)>i.match(self['Content-Range']) or raise HTTPHeaderSyntaxError, 'wrong Content-Range format' - m[1].to_i .. m[2].to_i + 1 + m[1].to_i .. m[2].to_i end # The length of the range represented in Content-Range: header. def range_length r = content_range() or return nil - r.end - r.begin + r.end - r.begin + 1 end # Returns a content type string such as "text/html". Index: ruby_1_8/ChangeLog =================================================================== --- ruby_1_8/ChangeLog (revision 26343) +++ ruby_1_8/ChangeLog (revision 26344) @@ -1,3 +1,8 @@ +Mon Jan 18 15:49:42 2010 Nobuyoshi Nakada <nobu@r...> + + * lib/net/http.rb (Net::HTTPHeader#{content_range,range_length}): + use inclusive range same as the header representation. + Mon Jan 18 04:15:58 2010 Akinori MUSHA <knu@i...> * ext/digest/digest.c (rb_digest_instance_digest) Index: ruby_1_8/lib/net/http.rb =================================================================== --- ruby_1_8/lib/net/http.rb (revision 26343) +++ ruby_1_8/lib/net/http.rb (revision 26344) @@ -1364,13 +1364,13 @@ return nil unless @header['content-range'] m = %r<bytes\s+(\d+)-(\d+)/(\d+|\*)>i.match(self['Content-Range']) or raise HTTPHeaderSyntaxError, 'wrong Content-Range format' - m[1].to_i .. m[2].to_i + 1 + m[1].to_i .. m[2].to_i end # The length of the range represented in Content-Range: header. def range_length r = content_range() or return nil - r.end - r.begin + r.end - r.begin + 1 end # Returns a content type string such as "text/html". -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/