RST_STREAM frame in HTTP2

user1968030

I read about new feature in http2 RST_STREAM :

HTTP/2 adds the RST_STREAM frame to allow a client to change its mind; if the browser navigates away from a page, or the user cancels a download, it can avoid having to open a new connection without wasting all of that bandwidth.

How can do this?How Browser can do this?Is there any change in code?

sbordet

The browser initiates a request and then changes its mind, either with the user navigating away or by cancelling.

In HTTP/1.1, the only choice to avoid the download of the response content was to close the connection, since there is no way for the client to communicate this intention of aborting the request to the server. Closing the connection is the way.

In HTTP/2, if the client wants to abort the request, it sends a RST_STREAM. When the server receives a RST_STREAM, it will stop sending DATA frames to the client, thereby stopping the response (or the download). The connection is still usable for other requests, and requests/responses that were concurrent with the one that has been aborted may continue to progress.

Typically, applications do not need to do anything and are not aware of RST_STREAM, it is all done by the browser and by the server implementation.

It is possible that by the time the RST_STREAM travels from the client to the server, the whole content of the request is in transit and will arrive to the client, which will discard it. However, for large response contents, sending a RST_STREAM may have a good chance to arrive to the server before the whole response content is sent, and therefore will save bandwidth.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

gRPC: Rendezvous terminated with (StatusCode.INTERNAL, Received RST_STREAM with error code 2)

Decoding http2 frame header/data in Go

What is a GoAway Frame in Http2 and how is it linked to Redirects?

http2: header block logical equivalence to a single frame

Envoy GRPC Reverse Bridge - Received RST_STREAM with code 0

why http2 use prioritization over stream instead of requests?

HTTP2: Is it possible to send subsequent or additional HEADER blocks on a stream?

Can lightweight client implementation of HTTP2 ignore Stream Priority?

What the half close does in http2? What the diff between local and remote in stream state in http2?

How do you retrieve HTTP2 frame settings in a Spring Cloud Zuul filter with Jetty embed server?

http2: PUSH_PROMISE client-side stream state

Node HTTP2: is multiple messages between client and server using the same stream possible?

How to get number of Max_concurrent_streams and stream id in http2 clients like okhttp or java 11 httpclient

HTTP2 protocol with playframewok

Http2 not working with express

HTTP/2 (HTTP2 or SPDY) on .NET

java: how to read RTSP stream frame by frame

How to stream opencv frame with django frame in realtime?

Am I serving http or http2?

HTTP/3 : frame analysis

Stream OpenCV frame to HTML in Python

Trying to implement HTTP2 push

http2: order of push promise data

ExperimentalWarning: The http2 module is an experimental API

How to keep long connection in HTTP2?

Enable http2 with Tomcat in Spring Boot

Spring Boot HTTP2 Server Push

Connection header disapper when HTTP2

okhttp support for connection pooling in http2