http2:PUSH_PROMISE客户端流状态 [英] http2: PUSH_PROMISE client-side stream state

查看:277
本文介绍了http2:PUSH_PROMISE客户端流状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

http2规范说:

接收方必须在以下流上对待PUSH_PROMISE的接收: 既不是打开"也不是半封闭(本地)"作为连接错误 (第5.4.1节)类型为PROTOCOL_ERROR.但是,具有 在相关流上发送的RST_STREAM必须处理PUSH_PROMISE 可能是在RST_STREAM框架之前创建的框架 接收并处理.

A receiver MUST treat the receipt of a PUSH_PROMISE on a stream that is neither "open" nor "half-closed (local)" as a connection error (Section 5.4.1) of type PROTOCOL_ERROR. However, an endpoint that has sent RST_STREAM on the associated stream MUST handle PUSH_PROMISE frames that might have been created before the RST_STREAM frame is received and processed.

该规范还具有此生命周期图.

我的理解是,为了使客户端在流上收到PUSH_PROMISE,客户端必须在该流上具有全部

My understanding is that in order for a client to receive a PUSH_PROMISE on a stream, the client must have all of these on that stream:

  • HEADERS帧(+任何CONTINUATION)发送到服务器
  • 未从服务器收到END_STREAM标志
  • 未从服务器收到RST_STREAM
  • sent HEADERS frame (+ any CONTINUATIONs) to the server
  • not received END_STREAM flag from the server
  • not received RST_STREAM frame from the server

(此处明显丢失的是未将RST_STREAM帧发送到服务器",这将导致流被关闭";上面的引用说,这不是连接错误的依据.)

(Notably missing here is "not sent RST_STREAM frame to the server", which would lead to the stream being "closed"; the quote above says this is not grounds for connection error.)

在任何不满足这些条件的情况下,客户端都必须将接收PUSH_PROMISE视为连接错误.

In any case where these criteria are not met, then the client must treat receiving a PUSH_PROMISE as a connection error.

这是正确的理解吗?

推荐答案

您的理解是正确的.

HTTP/2协议将PUSH_PROMISE流关联到称为关联流的现有流.

The HTTP/2 protocol associates PUSH_PROMISE streams to an existing stream, called the associated stream.

关联的流必须满足问题中引用的规范部分中定义的条件;问题中的项目符号列表是与规范部分说相同的话的另一种方式.

The associated stream must meet the conditions defined in the section of the specification quoted in the question; the bullet list in the question is another way of saying the same thing that the specification section says.

这篇关于http2:PUSH_PROMISE客户端流状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆