lib/protocol/http2/framer.rb in protocol-http2-0.2.0 vs lib/protocol/http2/framer.rb in protocol-http2-0.2.1

- old
+ new

@@ -100,14 +100,15 @@ return frame end def read_header if buffer = @stream.read(9) - return Frame.parse_header(buffer) - else - # TODO: Is this necessary? I thought the IO would throw this. - raise EOFError + if buffer.bytesize == 9 + return Frame.parse_header(buffer) + end end + + raise EOFError, "Could not read frame header!" end end end end