Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import io.netty.handler.codec.http.DefaultFullHttpResponse;
import io.netty.handler.codec.http.FullHttpResponse;
import io.netty.handler.codec.http.HttpContent;
import io.netty.handler.codec.http.HttpExpectationFailedEvent;
import io.netty.handler.codec.http.HttpHeaderValues;
import io.netty.handler.codec.http.HttpMessage;
import io.netty.handler.codec.http.HttpObject;
Expand Down Expand Up @@ -409,6 +410,10 @@ private void write413(ChannelHandlerContext ctx, boolean keepalive, FullHttpResp
ctx.channel().close();
}
});
// fix https://github.com/esastack/esa-httpserver/issues/22
// we must trigger this event to make sure HttpObjectDecoder#reset() is invoked.
// see more details from HttpObjectDecoder#userEventTriggered()
ctx.pipeline().fireUserEventTriggered(HttpExpectationFailedEvent.INSTANCE);
}

private void write417(ChannelHandlerContext ctx, boolean keepalive) {
Expand All @@ -421,6 +426,10 @@ private void write417(ChannelHandlerContext ctx, boolean keepalive) {
ctx.channel().close();
}
});
// fix https://github.com/esastack/esa-httpserver/issues/22
// we must trigger this event to make sure HttpObjectDecoder#reset() is invoked.
// see more details from HttpObjectDecoder#userEventTriggered()
ctx.pipeline().fireUserEventTriggered(HttpExpectationFailedEvent.INSTANCE);
}

private void write400(ChannelHandlerContext ctx, DecoderResult msg) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,8 @@ private void write413(ChannelHandlerContext ctx,
stream.close();
} else if (isShutdown() && ctx.channel().isActive()) {
ctx.channel().close();
} else {
stream.close();
}
});
}
Expand All @@ -445,6 +447,8 @@ private void write417(ChannelHandlerContext ctx,
stream.close();
} else if (isShutdown() && ctx.channel().isActive()) {
ctx.channel().close();
} else {
stream.close();
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,4 @@ final class Http2HeadersImpl extends Http2HeadersAdaptor {
Http2HeadersImpl(Http2Headers headers) {
super(headers);
}

Http2Headers unwrap() {
return underlying;
}
}