aboutsummaryrefslogtreecommitdiffstats
path: root/lib/plum/frame_utils.rb
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2015-08-11 21:49:41 +0900
committerKazuki Yamaguchi <k@rhe.jp>2015-08-11 21:49:41 +0900
commitaaa234f364962f2ff97b3209967658821e17f531 (patch)
treeeb2eebdd7664b0d38f293dfc8c773174ea17de22 /lib/plum/frame_utils.rb
parent3c9fd39d9a008c5d78e0c83b243f1d95e709a07a (diff)
downloadplum-aaa234f364962f2ff97b3209967658821e17f531.tar.gz
fix doc
Diffstat (limited to 'lib/plum/frame_utils.rb')
-rw-r--r--lib/plum/frame_utils.rb8
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