diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2015-08-11 21:49:41 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2015-08-11 21:49:41 +0900 |
commit | aaa234f364962f2ff97b3209967658821e17f531 (patch) | |
tree | eb2eebdd7664b0d38f293dfc8c773174ea17de22 /lib/plum/frame_utils.rb | |
parent | 3c9fd39d9a008c5d78e0c83b243f1d95e709a07a (diff) | |
download | plum-aaa234f364962f2ff97b3209967658821e17f531.tar.gz |
fix doc
Diffstat (limited to 'lib/plum/frame_utils.rb')
-rw-r--r-- | lib/plum/frame_utils.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/plum/frame_utils.rb b/lib/plum/frame_utils.rb index d897c22..66be18d 100644 --- a/lib/plum/frame_utils.rb +++ b/lib/plum/frame_utils.rb @@ -2,7 +2,7 @@ using Plum::BinaryString module Plum module FrameUtils - # Splits the frame into multiple frames if the payload size exceeds max size. + # Splits the DATA frame into multiple frames if the payload size exceeds max size. # # @param max [Integer] The maximum size of a frame payload. # @return [Array<Frame>] The splitted frames. @@ -21,9 +21,13 @@ module Plum frames end + # Splits the HEADERS or PUSH_PROMISE frame into multiple frames if the payload size exceeds max size. + # + # @param max [Integer] The maximum size of a frame payload. + # @return [Array<Frame>] The splitted frames. def split_headers(max) return [self] if self.length <= max - raise "Frame type must be DATA" unless [:headers, :push_promise].include?(self.type) + raise "Frame type must be HEADERS or PUSH_PROMISE" unless [:headers, :push_promise].include?(self.type) fragments = self.payload.each_byteslice(max).to_a |