summaryrefslogtreecommitdiffstats
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
parent3c9fd39d9a008c5d78e0c83b243f1d95e709a07a (diff)
downloadplum-aaa234f364962f2ff97b3209967658821e17f531.tar.gz
fix doc
-rw-r--r--lib/plum/frame_utils.rb8
-rw-r--r--lib/plum/stream_utils.rb2
2 files changed, 7 insertions, 3 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
diff --git a/lib/plum/stream_utils.rb b/lib/plum/stream_utils.rb
index 0c4f4a6..0bcceec 100644
--- a/lib/plum/stream_utils.rb
+++ b/lib/plum/stream_utils.rb
@@ -15,7 +15,7 @@ module Plum
end
end
- # Reserves a stream to server push. Sends PUSH_STREAM and create new stream.
+ # Reserves a stream to server push. Sends PUSH_PROMISE and create new stream.
#
# @param headers [Hash<String, String>] The *request* headers. It must contain all of them: ':authority', ':method', ':scheme' and ':path'.
# @return [Stream] The stream to send push response.