Skip to content

Commit

Permalink
don't process headers/data/rst if res is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
jrhee17 committed Nov 4, 2021
1 parent fb719ef commit df43379
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -185,7 +185,7 @@ public void onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers
boolean endOfStream) throws Http2Exception {
keepAliveChannelRead();
final HttpResponseWrapper res = getResponse(streamIdToId(streamId), endOfStream);
if (res == null) {
if (res == null || !res.isOpen()) {
if (conn.streamMayHaveExisted(streamId)) {
if (logger.isDebugEnabled()) {
logger.debug("{} Received a late HEADERS frame for a closed stream: {}",
Expand Down Expand Up @@ -234,7 +234,7 @@ public int onDataRead(

final int dataLength = data.readableBytes();
final HttpResponseWrapper res = getResponse(streamIdToId(streamId), endOfStream);
if (res == null) {
if (res == null || !res.isOpen()) {
if (conn.streamMayHaveExisted(streamId)) {
if (logger.isDebugEnabled()) {
logger.debug("{} Received a late DATA frame for a closed stream: {}",
Expand Down Expand Up @@ -295,7 +295,7 @@ private boolean shouldSendGoAway() {
public void onRstStreamRead(ChannelHandlerContext ctx, int streamId, long errorCode) throws Http2Exception {
keepAliveChannelRead();
final HttpResponseWrapper res = removeResponse(streamIdToId(streamId));
if (res == null) {
if (res == null || !res.isOpen()) {
if (conn.streamMayHaveExisted(streamId)) {
if (logger.isDebugEnabled()) {
logger.debug("{} Received a late RST_STREAM frame for a closed stream: {}",
Expand Down

0 comments on commit df43379

Please sign in to comment.