Permalink
Browse files

Fix for empty chunk lengths.

  • Loading branch information...
1 parent 7851974 commit c3bdce9866bee27d5d5af66070d9e44ac7f9986a @bittersweet committed Feb 9, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/httpclient/session.rb
@@ -67,7 +67,7 @@ def hash # :nodoc:
def to_s # :nodoc:
addr
end
-
+
# Returns true if scheme, host and port of the given URI matches with this.
def match(uri)
(@scheme == uri.scheme) and (@host == uri.host) and (@port == uri.port.to_i)
@@ -904,7 +904,7 @@ def read_body_chunked(&block)
buf = ''
while true
len = @socket.gets(RS)
- @chunk_length = len.hex
+ @chunk_length = len.hex rescue 0
if @chunk_length == 0
@content_length = 0
@socket.gets(RS)

0 comments on commit c3bdce9

Please sign in to comment.