// Called when a HEADERS frame is received.
// Note that header block data is not included. See
// OnControlFrameHeaderData().
- virtual void OnHeaders(SpdyStreamId stream_id, bool fin, bool end) = 0;
+ virtual void OnHeaders(SpdyStreamId stream_id,
+ bool has_priority,
+ SpdyPriority priority,
+ bool fin,
+ bool end) = 0;
// Called when a WINDOW_UPDATE frame has been parsed.
virtual void OnWindowUpdate(SpdyStreamId stream_id,
SPDY_AUTO_RESET,
SPDY_READING_COMMON_HEADER,
SPDY_CONTROL_FRAME_PAYLOAD,
- SPDY_READ_PADDING_LENGTH,
+ SPDY_READ_DATA_FRAME_PADDING_LENGTH,
SPDY_CONSUME_PADDING,
SPDY_IGNORE_REMAINING_PAYLOAD,
SPDY_FORWARD_STREAM_FRAME,
UnclosedStreamDataCompressorsOneByteAtATime);
FRIEND_TEST_ALL_PREFIXES(SpdyFramerTest,
UncompressLargerThanFrameBufferInitialSize);
+ FRIEND_TEST_ALL_PREFIXES(SpdyFramerTest,
+ CreatePushPromiseThenContinuationUncompressed);
FRIEND_TEST_ALL_PREFIXES(SpdyFramerTest, ReadLargeSettingsFrame);
FRIEND_TEST_ALL_PREFIXES(SpdyFramerTest,
ReadLargeSettingsFrameInSmallChunks);
size_t ProcessControlFrameHeaderBlock(const char* data,
size_t len,
bool is_hpack_header_block);
- size_t ProcessFramePaddingLength(const char* data, size_t len);
+ size_t ProcessDataFramePaddingLength(const char* data, size_t len);
size_t ProcessFramePadding(const char* data, size_t len);
size_t ProcessDataFramePayload(const char* data, size_t len);
size_t ProcessGoAwayFramePayload(const char* data, size_t len);
void WritePayloadWithContinuation(SpdyFrameBuilder* builder,
const std::string& hpack_encoding,
SpdyStreamId stream_id,
- SpdyFrameType type);
+ SpdyFrameType type,
+ int padding_payload_len);
private:
// Deliver the given control frame's uncompressed headers block to the
// Set the error code and moves the framer into the error state.
void set_error(SpdyError error);
- // The maximum size of the control frames that we support.
- // This limit is arbitrary. We can enforce it here or at the application
- // layer. We chose the framing layer, but this can be changed (or removed)
- // if necessary later down the line.
- size_t GetControlFrameBufferMaxSize() const {
- // The theoretical maximum for SPDY3 and earlier is (2^24 - 1) +
- // 8, since the length field does not count the size of the
- // header.
- if (spdy_version_ == SPDY2) {
- return 64 * 1024;
- }
- if (spdy_version_ == SPDY3) {
- return 16 * 1024 * 1024;
- }
- // Absolute maximum size of HTTP2 frame payload (section 4.2 "Frame size").
- return (1<<14) - 1;
- }
-
- // TODO(jgraettinger): For h2-13 interop testing coverage,
- // fragment at smaller payload boundaries.
- size_t GetHeaderFragmentMaxSize() const {
- return GetControlFrameBufferMaxSize() >> 4; // 1023 bytes.
- }
-
// The size of the control frame buffer.
// Since this is only used for control frame headers, the maximum control
// frame header size (SYN_STREAM) is sufficient; all remaining control
// frame data is streamed to the visitor.
static const size_t kControlFrameBufferSize;
+ // The maximum size of the control frames that we support.
+ // This limit is arbitrary. We can enforce it here or at the application
+ // layer. We chose the framing layer, but this can be changed (or removed)
+ // if necessary later down the line.
+ static const size_t kMaxControlFrameSize;
+
SpdyState state_;
SpdyState previous_state_;
SpdyError error_code_;