Skip to content

Commit

Permalink
Passing start to String#index breaks things
Browse files Browse the repository at this point in the history
  • Loading branch information
pietern committed Mar 13, 2012
1 parent adccc64 commit 742a390
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/redis/connection/ruby.rb
Expand Up @@ -36,11 +36,9 @@ def read(nbytes)

def gets
crlf = nil
start = 0

while (crlf = @buffer.index(CRLF, start)) == nil
start = @buffer.bytesize
@buffer << _read_from_socket(16384)
while (crlf = @buffer.index(CRLF)) == nil
@buffer << _read_from_socket(1024)
end

@buffer.slice!(0, crlf + CRLF.bytesize)
Expand Down

0 comments on commit 742a390

Please sign in to comment.