diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2015-07-17 15:22:07 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2015-07-17 15:22:07 +0900 |
commit | 3e12a8e9c36d61fc9f68df000311af58994f2afe (patch) | |
tree | 842bce8be25883cbedd10979d960e392c6db6c6e /lib/plum/stream.rb | |
parent | 3ce527309d37f645e973b027676e24f59e375219 (diff) | |
download | plum-3e12a8e9c36d61fc9f68df000311af58994f2afe.tar.gz |
stream: raise error on receiving unknown / disallowed frame
Diffstat (limited to 'lib/plum/stream.rb')
-rw-r--r-- | lib/plum/stream.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/plum/stream.rb b/lib/plum/stream.rb index fa0a334..d7a1187 100644 --- a/lib/plum/stream.rb +++ b/lib/plum/stream.rb @@ -25,11 +25,13 @@ module Plum process_window_update(frame) when :continuation process_continuation(frame) - when :settings, :push_promise + when :ping, :goaway, :settings, :push_promise raise Plum::ConnectionError.new(:protocol_error) # stream_id MUST be 0x00 + else + raise Plum::Error.new("unknown frame type: #{frame.inspect}") end - if frame.flags.include?(:end_stream) + if frame.flags.include?(:end_stream) # :data, :headers callback(:complete) @state = :half_closed end |