Lines Matching refs:frame

159   // additional frame padding to apply to DATA and HEADERS frames. Currently
235 // The Http2Settings class is used to configure a SETTINGS frame that is
258 // frame. This can be used, for instance, to create the Base64-encoded
693 // frame. There is no guarantee that this GOAWAY will be received by
775 // that the total frame size, including header bytes, are 8-byte aligned.
786 // use the max instead, even tho this means the frame will not be
789 Debug(this, "using frame size padding: %d", pad);
794 // of padding allowed for the current frame.
797 Debug(this, "using max frame size padding: %d", maxPayloadLen);
876 int32_t GetFrameID(const nghttp2_frame* frame) {
878 return (frame->hd.type == NGHTTP2_PUSH_PROMISE) ?
879 frame->push_promise.promised_stream_id :
880 frame->hd.stream_id;
884 // Called by nghttp2 at the start of receiving a HEADERS frame. We use this
889 const nghttp2_frame* frame,
892 int32_t id = GetFrameID(frame);
900 Http2Stream::New(session, id, frame->headers.cat) ==
916 stream->StartHeaders(frame->headers.cat);
925 const nghttp2_frame* frame,
931 int32_t id = GetFrameID(frame);
950 // Called by nghttp2 when a complete HTTP2 frame has been received. There are
951 // only a handful of frame types that we care about handling here.
953 const nghttp2_frame* frame,
957 Debug(session, "complete frame received: type: %d",
958 frame->hd.type);
959 switch (frame->hd.type) {
961 return session->HandleDataFrame(frame);
965 session->HandleHeadersFrame(frame);
968 session->HandleSettingsFrame(frame);
971 session->HandlePriorityFrame(frame);
974 session->HandleGoawayFrame(frame);
977 session->HandlePingFrame(frame);
980 session->HandleAltSvcFrame(frame);
983 session->HandleOriginFrame(frame);
992 const nghttp2_frame* frame,
999 "invalid frame received (%u/%u), code: %d",
1024 void Http2Session::DecrefHeaders(const nghttp2_frame* frame) {
1025 int32_t id = GetFrameID(frame);
1058 // If nghttp2 is unable to send a queued up frame, it will call this callback
1065 const nghttp2_frame* frame,
1070 Debug(session, "frame type %d was not sent, code: %d",
1071 frame->hd.type, error_code);
1073 // Do not report if the frame was not sent due to the session closing
1081 session->DecrefHeaders(frame);
1091 Integer::New(isolate, frame->hd.stream_id),
1092 Integer::New(isolate, frame->hd.type),
1102 const nghttp2_frame* frame,
1149 const nghttp2_frame* frame,
1158 // When nghttp2 receives a DATA frame, it will deliver the data payload to
1180 // so that it can send a WINDOW_UPDATE frame. This is a critical part of
1243 // a DATA or HEADERS frame.
1245 const nghttp2_frame* frame,
1249 ssize_t padding = frame->hd.length;
1330 // HEADERS frame has been received and processed. This method converts the
1332 void Http2Session::HandleHeadersFrame(const nghttp2_frame* frame) {
1338 int32_t id = GetFrameID(frame);
1339 Debug(this, "handle headers frame for stream %d", id);
1373 Integer::New(isolate, frame->hd.flags),
1382 // Called by OnFrameReceived when a complete PRIORITY frame has been
1386 void Http2Session::HandlePriorityFrame(const nghttp2_frame* frame) {
1393 nghttp2_priority priority_frame = frame->priority;
1394 int32_t id = GetFrameID(frame);
1395 Debug(this, "handle priority frame for stream %d", id);
1396 // Priority frame stream ID should never be <= 0. nghttp2 handles this for us
1410 // Called by OnFrameReceived when a complete DATA frame has been received.
1411 // If we know that this was the last DATA frame (because the END_STREAM flag
1413 int Http2Session::HandleDataFrame(const nghttp2_frame* frame) {
1414 int32_t id = GetFrameID(frame);
1415 Debug(this, "handling data frame for stream %d", id);
1420 frame->hd.flags & NGHTTP2_FLAG_END_STREAM) {
1422 } else if (frame->hd.length == 0) {
1425 Debug(this, "rejecting empty-frame-without-END_STREAM flood\n");
1434 // Called by OnFrameReceived when a complete GOAWAY frame has been received.
1435 void Http2Session::HandleGoawayFrame(const nghttp2_frame* frame) {
1441 nghttp2_goaway goaway_frame = frame->goaway;
1442 Debug(this, "handling goaway frame");
1464 // Called by OnFrameReceived when a complete ALTSVC frame has been received.
1465 void Http2Session::HandleAltSvcFrame(const nghttp2_frame* frame) {
1472 int32_t id = GetFrameID(frame);
1474 nghttp2_extension ext = frame->ext;
1476 Debug(this, "handling altsvc frame");
1488 void Http2Session::HandleOriginFrame(const nghttp2_frame* frame) {
1494 Debug(this, "handling origin frame");
1496 nghttp2_extension ext = frame->ext;
1510 // Called by OnFrameReceived when a complete PING frame has been received.
1511 void Http2Session::HandlePingFrame(const nghttp2_frame* frame) {
1517 bool ack = frame->hd.flags & NGHTTP2_FLAG_ACK;
1532 ping->Done(true, frame->ping.opaque_data);
1540 reinterpret_cast<const char*>(frame->ping.opaque_data),
1545 // Called by OnFrameReceived when a complete SETTINGS frame has been received.
1546 void Http2Session::HandleSettingsFrame(const nghttp2_frame* frame) {
1547 bool ack = frame->hd.flags & NGHTTP2_FLAG_ACK;
1819 nghttp2_frame* frame,
1825 BaseObjectPtr<Http2Stream> stream = session->FindStream(frame->hd.stream_id);
1828 // Send the frame header + a byte that indicates padding length.
1830 if (frame->data.padlen > 0) {
1831 uint8_t padding_byte = frame->data.padlen - 1;
1832 CHECK_EQ(padding_byte, frame->data.padlen - 1);
1860 if (frame->data.padlen > 0) {
1863 uv_buf_init(const_cast<char*>(zero_bytes_256), frame->data.padlen - 1)
1953 // offset of a DATA frame's data into the socket read buffer.
2235 // Sending an empty trailers frame poses problems in Safari, Edge & IE.
2236 // Instead we can just send an empty data frame with NGHTTP2_FLAG_END_STREAM
2256 // Submit a PRIORITY frame to the connected peer.
2275 // Closes the Http2Stream by submitting an RST_STREAM frame to the connected
2285 // If RST_STREAM frame is received with error code NGHTTP2_CANCEL,
2380 // when nghttp2 is ready to serialize the data frame.
2446 // A Provider is the thing that provides outbound DATA frame data.
2489 size_t amount = 0; // amount of data being sent in this data frame.
2506 Debug(session, "sending %d bytes for data frame on stream %d", amount, id);
2719 // Submits a GOAWAY frame to signal that the Http2Session is in the process
2738 // Submits a GOAWAY frame to signal that the Http2Session is in the process
2776 // Submits an RST_STREAM frame effectively closing the Http2Stream. Note that
2871 // Send a PRIORITY frame
2941 // Submits an AltSvc frame to be sent to the connected peer.
2984 // Submits a PING frame to be sent to the connected peer.
2989 // A PING frame may have exactly 8 bytes of payload data. If not provided,
3002 // Submits a SETTINGS frame for the Http2Session