From c46a247d5fe70c0d1198180dc7b1ca7f627b88a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rg=20Prante?= Date: Sat, 3 Jun 2017 15:23:04 +0200 Subject: [PATCH] minor change --- .../netty/http/client/HttpClientBuilder.java | 4 ++-- .../client/handler/Http2NegotiationHandler.java | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/xbib/netty/http/client/HttpClientBuilder.java b/src/main/java/org/xbib/netty/http/client/HttpClientBuilder.java index 2f74b52..fb58bc1 100644 --- a/src/main/java/org/xbib/netty/http/client/HttpClientBuilder.java +++ b/src/main/java/org/xbib/netty/http/client/HttpClientBuilder.java @@ -61,12 +61,12 @@ public class HttpClientBuilder implements HttpClientChannelContextDefaults { private int tcpReceiveBufferSize = DEFAULT_TCP_RECEIVE_BUFFER_SIZE; - private int maxChunkSize = DEFAULT_MAX_CHUNK_SIZE; - private int maxInitialLineLength = DEFAULT_MAX_INITIAL_LINE_LENGTH; private int maxHeadersSize = DEFAULT_MAX_HEADERS_SIZE; + private int maxChunkSize = DEFAULT_MAX_CHUNK_SIZE; + private int maxConnections = DEFAULT_MAX_CONNECTIONS; private int maxContentLength = DEFAULT_MAX_CONTENT_LENGTH; diff --git a/src/main/java/org/xbib/netty/http/client/handler/Http2NegotiationHandler.java b/src/main/java/org/xbib/netty/http/client/handler/Http2NegotiationHandler.java index 7361c8e..2e2c446 100644 --- a/src/main/java/org/xbib/netty/http/client/handler/Http2NegotiationHandler.java +++ b/src/main/java/org/xbib/netty/http/client/handler/Http2NegotiationHandler.java @@ -16,6 +16,7 @@ package org.xbib.netty.http.client.handler; import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelPipeline; import io.netty.handler.codec.http.HttpClientCodec; import io.netty.handler.codec.http2.HttpToHttp2ConnectionHandler; import io.netty.handler.ssl.ApplicationProtocolNames; @@ -45,18 +46,17 @@ class Http2NegotiationHandler extends ApplicationProtocolNegotiationHandler { @Override protected void configurePipeline(ChannelHandlerContext ctx, String protocol) throws Exception { + ChannelPipeline pipeline = ctx.pipeline(); if (ApplicationProtocolNames.HTTP_2.equals(protocol)) { - HttpToHttp2ConnectionHandler http2connectionHandler = createHttp2ConnectionHandler(initializer.getContext()); - ctx.pipeline().addLast(http2connectionHandler); - configureHttp2Pipeline(ctx.pipeline(), initializer.getHttp2ResponseHandler()); - logger.log(Level.FINE, () -> "negotiated HTTP/2: handler = " + ctx.pipeline().names()); + pipeline.addLast(createHttp2ConnectionHandler(initializer.getContext())); + configureHttp2Pipeline(pipeline, initializer.getHttp2ResponseHandler()); + logger.log(Level.FINE, () -> "negotiated HTTP/2: handler = " + pipeline.names()); return; } if (ApplicationProtocolNames.HTTP_1_1.equals(protocol)) { - HttpClientCodec http1connectionHandler = createHttp1ConnectionHandler(initializer.getContext()); - ctx.pipeline().addLast(http1connectionHandler); - configureHttp1Pipeline(ctx.pipeline(), initializer.getContext(), initializer.getHttpHandler()); - logger.log(Level.FINE, () -> "negotiated HTTP/1.1: handler = " + ctx.pipeline().names()); + pipeline.addLast(createHttp1ConnectionHandler(initializer.getContext())); + configureHttp1Pipeline(pipeline, initializer.getContext(), initializer.getHttpHandler()); + logger.log(Level.FINE, () -> "negotiated HTTP/1.1: handler = " + pipeline.names()); return; } ctx.close();