Skip to content

Commit

Permalink
Remove the custom frame logger implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
violetagg committed Apr 22, 2024
1 parent 05b5afd commit 4283829
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 164 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ protected void initChannel(Channel channel) {

if (loggingHandler != null) {
channel.pipeline().addLast(NettyPipeline.LoggingHandler, loggingHandler);
quicServerCodecBuilder.streamHandler(loggingHandler);
}
channel.pipeline().addLast(quicServerCodecBuilder.build());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@

final class Http3Codec extends ChannelInitializer<QuicStreamChannel> {

static final ChannelHandler FRAME_LOGGING_HANDLER = new Http3FrameLoggingHandler();

static final Logger log = Loggers.getLogger(Http3Codec.class);

final BiPredicate<HttpServerRequest, HttpServerResponse> compressPredicate;
Expand All @@ -53,7 +51,6 @@ final class Http3Codec extends ChannelInitializer<QuicStreamChannel> {
final BiFunction<ConnectionInfo, HttpRequest, ConnectionInfo> forwardedHeaderHandler;
final HttpMessageLogFactory httpMessageLogFactory;
final ConnectionObserver listener;
final ChannelHandler loggingHandler;
final BiFunction<? super Mono<Void>, ? super Connection, ? extends Mono<Void>>
mapHandle;
final ChannelOperations.OnSetup opsFactory;
Expand All @@ -69,7 +66,6 @@ final class Http3Codec extends ChannelInitializer<QuicStreamChannel> {
@Nullable BiFunction<ConnectionInfo, HttpRequest, ConnectionInfo> forwardedHeaderHandler,
HttpMessageLogFactory httpMessageLogFactory,
ConnectionObserver listener,
@Nullable ChannelHandler loggingHandler,
@Nullable BiFunction<? super Mono<Void>, ? super Connection, ? extends Mono<Void>> mapHandle,
ChannelOperations.OnSetup opsFactory,
@Nullable Duration readTimeout,
Expand All @@ -82,7 +78,6 @@ final class Http3Codec extends ChannelInitializer<QuicStreamChannel> {
this.forwardedHeaderHandler = forwardedHeaderHandler;
this.httpMessageLogFactory = httpMessageLogFactory;
this.listener = listener;
this.loggingHandler = loggingHandler;
this.mapHandle = mapHandle;
this.opsFactory = opsFactory;
this.readTimeout = readTimeout;
Expand All @@ -93,9 +88,6 @@ final class Http3Codec extends ChannelInitializer<QuicStreamChannel> {
@Override
protected void initChannel(QuicStreamChannel channel) {
ChannelPipeline p = channel.pipeline();
if (loggingHandler != null && p.context("Http3FrameCodec#0") != null) {
p.addAfter(channel.pipeline().context("Http3FrameCodec#0").name(), NettyPipeline.LoggingHandler, loggingHandler);
}
p.addLast(new Http3FrameToHttpObjectCodec(true, validate))
.addLast(NettyPipeline.HttpTrafficHandler,
new Http3StreamBridgeServerHandler(compressPredicate, cookieDecoder, cookieEncoder, formDecoderProvider,
Expand All @@ -114,7 +106,6 @@ static ChannelHandler newHttp3ServerConnectionHandler(
@Nullable BiPredicate<HttpServerRequest, HttpServerResponse> compressPredicate,
ServerCookieDecoder decoder,
ServerCookieEncoder encoder,
boolean enableLogging,
HttpServerFormDecoderProvider formDecoderProvider,
@Nullable BiFunction<ConnectionInfo, HttpRequest, ConnectionInfo> forwardedHeaderHandler,
HttpMessageLogFactory httpMessageLogFactory,
Expand All @@ -124,10 +115,8 @@ static ChannelHandler newHttp3ServerConnectionHandler(
@Nullable Duration readTimeout,
@Nullable Duration requestTimeout,
boolean validate) {
ChannelHandler loggingHandler = enableLogging ? FRAME_LOGGING_HANDLER : null;
return new Http3ServerConnectionHandler(
new Http3Codec(compressPredicate, decoder, encoder, formDecoderProvider, forwardedHeaderHandler,
httpMessageLogFactory, listener, loggingHandler, mapHandle, opsFactory, readTimeout, requestTimeout, validate),
loggingHandler, null, null, true);
httpMessageLogFactory, listener, mapHandle, opsFactory, readTimeout, requestTimeout, validate));
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,8 @@ static void configureHttp3Pipeline(
p.remove(NettyPipeline.ReactiveBridge);

p.addFirst(NettyPipeline.HttpCodec, newHttp3ServerConnectionHandler(compressPredicate, cookieDecoder, cookieEncoder,
p.get(NettyPipeline.LoggingHandler) != null, formDecoderProvider, forwardedHeaderHandler, httpMessageLogFactory,
listener, mapHandle, opsFactory, readTimeout, requestTimeout, validate));
formDecoderProvider, forwardedHeaderHandler, httpMessageLogFactory, listener, mapHandle, opsFactory,
readTimeout, requestTimeout, validate));
}

static void configureH2Pipeline(ChannelPipeline p,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,6 @@
"name": "reactor.netty.http.server.Http3Codec",
"queryAllPublicMethods": true
},
{
"condition": {
"typeReachable": "reactor.netty.http.server.Http3FrameLoggingHandler"
},
"name": "reactor.netty.http.server.Http3FrameLoggingHandler",
"queryAllPublicMethods": true
},
{
"condition": {
"typeReachable": "reactor.netty.http.server.Http3StreamBridgeServerHandler"
Expand Down

0 comments on commit 4283829

Please sign in to comment.