lib/protocol/http/body/stream.rb in protocol-http-0.40.0 vs lib/protocol/http/body/stream.rb in protocol-http-0.41.0

- old
+ new

@@ -200,10 +200,11 @@ separator = NEWLINE end # If no separator is given, this is the same as a read operation: if separator.nil? - return read(limit) + # I tried using `read(limit)` here but it will block until the limit is reached, which is not usually desirable behaviour. + return read_partial(limit) end # We don't want to split on the separator, so we subtract the size of the separator: split_offset = separator.bytesize - 1