lib/protocol/http2/client.rb in protocol-http2-0.4.1 vs lib/protocol/http2/client.rb in protocol-http2-0.5.0
- old
+ new
@@ -45,9 +45,20 @@
else
raise ProtocolError, "Cannot send connection preface in state #{@state}"
end
end
+ # Accept an incoming push promise from the other side of the connection.
+ # On the client side, we accept push promise streams.
+ # On the server side, streams create push promise streams.
+ def accept_push_promise_stream(stream_id, &block)
+ accept_stream(stream_id, &block)
+ end
+
+ def create_push_promise_stream
+ raise ProtocolError, "Cannot create push promises from client!"
+ end
+
def receive_push_promise(frame)
if frame.stream_id == 0
raise ProtocolError, "Cannot receive headers for stream 0!"
end