Package dev.relism.flash.http2
Class Http2StreamException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
dev.relism.flash.http2.Http2StreamException
- All Implemented Interfaces:
Serializable
A stream-level HTTP/2 error, scoped to one stream id. Results in an Why this allocates, unlike
Every instance carries a distinct
RST_STREAM
frame for streamId() with errorCode(); the connection and every other
stream on it are unaffected. Compare Http2Exception, whose scope is the whole
connection.
Deliberately does not extend IOException, for the same reason as
Http2Exception: the connection loop must be able to distinguish "we decided to reject
this stream" from "the socket failed" by catching unrelated exception types.
Why this allocates, unlike Http2Exception's singletons
Every instance carries a distinct streamId(), so it cannot be a shared singleton the
exempts error paths. The scenario where this matters most — a peer opening and resetting
thousands of streams per second (the Rapid Reset pattern, CVE-2023-44487) — is bounded by
that can force RST_STREAM generation fast enough for GC pressure to matter has already
tripped Http2Limits.MAX_RESET_STREAMS_PER_INTERVAL and the connection is being torn
down anyway.
Stack trace capture is disabled for the same cost reason as Http2Exception.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionHttp2StreamException(int streamId, Http2ErrorCode errorCode, String message) -
Method Summary
Modifier and TypeMethodDescriptionThe RFC 9113 §7 error code to send in theRST_STREAMframe.intstreamId()The id of the stream this error terminates.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
Http2StreamException
-
-
Method Details
-
streamId
public int streamId()The id of the stream this error terminates. -
errorCode
The RFC 9113 §7 error code to send in theRST_STREAMframe.
-