onPushPromiseRead() — netty Function Reference
Architecture documentation for the onPushPromiseRead() function in DefaultHttp2ConnectionDecoder.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 081ac2df_dd8d_01c3_d08e_00974bf739a2["onPushPromiseRead()"] 0189a990_8f54_63f5_92fb_f168c031db1e["FrameReadListener"] 081ac2df_dd8d_01c3_d08e_00974bf739a2 -->|defined in| 0189a990_8f54_63f5_92fb_f168c031db1e 1eaaf9ee_71d0_7014_1f1e_25d86629850c["onPushPromiseRead()"] 1eaaf9ee_71d0_7014_1f1e_25d86629850c -->|calls| 081ac2df_dd8d_01c3_d08e_00974bf739a2 1eaaf9ee_71d0_7014_1f1e_25d86629850c["onPushPromiseRead()"] 081ac2df_dd8d_01c3_d08e_00974bf739a2 -->|calls| 1eaaf9ee_71d0_7014_1f1e_25d86629850c ced1d4e9_b458_5358_c892_efa8534c4694["shouldIgnoreHeadersOrDataFrame()"] 081ac2df_dd8d_01c3_d08e_00974bf739a2 -->|calls| ced1d4e9_b458_5358_c892_efa8534c4694 style 081ac2df_dd8d_01c3_d08e_00974bf739a2 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2ConnectionDecoder.java lines 546–592
@Override
public void onPushPromiseRead(ChannelHandlerContext ctx, int streamId, int promisedStreamId,
Http2Headers headers, int padding) throws Http2Exception {
// A client cannot push.
if (connection().isServer()) {
throw connectionError(PROTOCOL_ERROR, "A client cannot push.");
}
Http2Stream parentStream = connection.stream(streamId);
if (shouldIgnoreHeadersOrDataFrame(ctx, streamId, parentStream, false, "PUSH_PROMISE")) {
return;
}
switch (parentStream.state()) {
case OPEN:
case HALF_CLOSED_LOCAL:
// Allowed to receive push promise in these states.
break;
default:
// Connection error.
throw connectionError(PROTOCOL_ERROR,
"Stream %d in unexpected state for receiving push promise: %s",
parentStream.id(), parentStream.state());
}
if (!requestVerifier.isAuthoritative(ctx, headers)) {
throw streamError(promisedStreamId, PROTOCOL_ERROR,
"Promised request on stream %d for promised stream %d is not authoritative",
streamId, promisedStreamId);
}
if (!requestVerifier.isCacheable(headers)) {
throw streamError(promisedStreamId, PROTOCOL_ERROR,
"Promised request on stream %d for promised stream %d is not known to be cacheable",
streamId, promisedStreamId);
}
if (!requestVerifier.isSafe(headers)) {
throw streamError(promisedStreamId, PROTOCOL_ERROR,
"Promised request on stream %d for promised stream %d is not known to be safe",
streamId, promisedStreamId);
}
// Reserve the push stream based with a priority based on the current stream's priority.
connection.remote().reservePushStream(promisedStreamId, parentStream);
listener.onPushPromiseRead(ctx, streamId, promisedStreamId, headers, padding);
}
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does onPushPromiseRead() do?
onPushPromiseRead() is a function in the netty codebase, defined in codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2ConnectionDecoder.java.
Where is onPushPromiseRead() defined?
onPushPromiseRead() is defined in codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2ConnectionDecoder.java at line 546.
What does onPushPromiseRead() call?
onPushPromiseRead() calls 2 function(s): onPushPromiseRead, shouldIgnoreHeadersOrDataFrame.
What calls onPushPromiseRead()?
onPushPromiseRead() is called by 1 function(s): onPushPromiseRead.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free