简体   繁体   English

在 HTTP/2 中,数据帧后的预告片帧是否可能?

[英]Is trailers frame after data frame possible in HTTP/2?

Is it possible in HTTP/2 that a data frame is received with END_STREAM flag, and later a trailers frame will be received?在 HTTP/2 中是否有可能接收到带有 END_STREAM 标志的数据帧,然后再接收到预告片帧? In other words, will a frame with END_STREAM also indicate that no other frame will be sent?换句话说,带有END_STREAM的帧是否也表示不会发送其他帧? Also, must a trailers frame (Which is practically headers frame) set END_STREAM?另外,预告片框架(实际上是标题框架)必须设置 END_STREAM 吗?

Is it possible in HTTP/2 that a data frame is received with END_STREAM flag, and later a trailers frame will be received?在 HTTP/2 中是否有可能接收到带有 END_STREAM 标志的数据帧,然后再接收到预告片帧?

No. When a frame with END_STREAM is received, the stream enters the "half-closed (remote)" state. No. 当接收到带有 END_STREAM 的帧时,stream 进入“半关闭(远程)”state。

This is specified in section 5.1 of RFC 7540, where it says:这在 RFC 7540 的第 5.1 节中指定,其中说:

half-closed (remote): A stream that is "half-closed (remote)" is no longer being used by the peer to send frames.半关闭(远程):“半关闭(远程)”的 stream 不再被对等方用于发送帧。 In this state, an endpoint is no longer obligated to maintain a receiver flow-control window. If an endpoint receives additional frames, other than WINDOW_UPDATE, PRIORITY, or RST_STREAM, for a stream that is in this state, it MUST respond with a stream error (Section 5.4.2) of type STREAM_CLOSED.在这个 state 中,端点不再有义务维护接收器流量控制 window。如果端点接收到额外的帧,除了 WINDOW_UPDATE、PRIORITY 或 RST_STREAM,对于在这个 state 中的 stream,它必须用 88564411188 响应STREAM_CLOSED 类型的错误(第 5.4.2 节)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM