Skip to content

Commit

Permalink
Directly close the http request instead of using Resource.dispose
Browse files Browse the repository at this point in the history
  • Loading branch information
pderop committed Sep 7, 2022
1 parent 5100b0c commit 7b44ace
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@
import io.netty5.handler.codec.http.EmptyLastHttpContent;
import io.netty5.handler.codec.http.HttpHeaderNames;
import io.netty5.handler.codec.http.HttpHeaders;
import io.netty5.handler.codec.http.HttpRequest;
import io.netty5.handler.codec.http.FullHttpRequest;
import io.netty5.handler.codec.http.websocketx.CloseWebSocketFrame;
import io.netty5.handler.codec.http.websocketx.PingWebSocketFrame;
import io.netty5.handler.codec.http.websocketx.PongWebSocketFrame;
import io.netty5.handler.codec.http.websocketx.WebSocketCloseStatus;
import io.netty5.handler.codec.http.websocketx.WebSocketServerHandshaker;
import io.netty5.handler.codec.http.websocketx.WebSocketServerHandshakerFactory;
import io.netty5.handler.codec.http.websocketx.extensions.compression.WebSocketServerCompressionHandler;
import io.netty5.util.Resource;
import io.netty5.util.concurrent.Future;
import io.netty5.util.concurrent.FutureListener;
import org.reactivestreams.Publisher;
Expand Down Expand Up @@ -86,7 +85,7 @@ final class WebsocketServerOperations extends HttpServerOperations
removeHandler(NettyPipeline.AccessLogHandler);
removeHandler(NettyPipeline.HttpMetricsHandler);

HttpRequest request = new DefaultFullHttpRequest(replaced.version(), replaced.method(), replaced.uri(),
FullHttpRequest request = new DefaultFullHttpRequest(replaced.version(), replaced.method(), replaced.uri(),
channel.bufferAllocator().allocate(0));

request.headers()
Expand Down Expand Up @@ -115,7 +114,7 @@ final class WebsocketServerOperations extends HttpServerOperations
replaced.responseHeaders
.remove(HttpHeaderNames.TRANSFER_ENCODING))
.addListener(f -> {
Resource.dispose(request);
request.close();
if (replaced.rebind(this)) {
markPersistent(false);
// This change is needed after the Netty change https://github.com/netty/netty/pull/11966
Expand Down

0 comments on commit 7b44ace

Please sign in to comment.