minor change
This commit is contained in:
parent
7af00b6869
commit
c46a247d5f
2 changed files with 10 additions and 10 deletions
|
@ -61,12 +61,12 @@ public class HttpClientBuilder implements HttpClientChannelContextDefaults {
|
||||||
|
|
||||||
private int tcpReceiveBufferSize = DEFAULT_TCP_RECEIVE_BUFFER_SIZE;
|
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 maxInitialLineLength = DEFAULT_MAX_INITIAL_LINE_LENGTH;
|
||||||
|
|
||||||
private int maxHeadersSize = DEFAULT_MAX_HEADERS_SIZE;
|
private int maxHeadersSize = DEFAULT_MAX_HEADERS_SIZE;
|
||||||
|
|
||||||
|
private int maxChunkSize = DEFAULT_MAX_CHUNK_SIZE;
|
||||||
|
|
||||||
private int maxConnections = DEFAULT_MAX_CONNECTIONS;
|
private int maxConnections = DEFAULT_MAX_CONNECTIONS;
|
||||||
|
|
||||||
private int maxContentLength = DEFAULT_MAX_CONTENT_LENGTH;
|
private int maxContentLength = DEFAULT_MAX_CONTENT_LENGTH;
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
package org.xbib.netty.http.client.handler;
|
package org.xbib.netty.http.client.handler;
|
||||||
|
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
|
import io.netty.channel.ChannelPipeline;
|
||||||
import io.netty.handler.codec.http.HttpClientCodec;
|
import io.netty.handler.codec.http.HttpClientCodec;
|
||||||
import io.netty.handler.codec.http2.HttpToHttp2ConnectionHandler;
|
import io.netty.handler.codec.http2.HttpToHttp2ConnectionHandler;
|
||||||
import io.netty.handler.ssl.ApplicationProtocolNames;
|
import io.netty.handler.ssl.ApplicationProtocolNames;
|
||||||
|
@ -45,18 +46,17 @@ class Http2NegotiationHandler extends ApplicationProtocolNegotiationHandler {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void configurePipeline(ChannelHandlerContext ctx, String protocol) throws Exception {
|
protected void configurePipeline(ChannelHandlerContext ctx, String protocol) throws Exception {
|
||||||
|
ChannelPipeline pipeline = ctx.pipeline();
|
||||||
if (ApplicationProtocolNames.HTTP_2.equals(protocol)) {
|
if (ApplicationProtocolNames.HTTP_2.equals(protocol)) {
|
||||||
HttpToHttp2ConnectionHandler http2connectionHandler = createHttp2ConnectionHandler(initializer.getContext());
|
pipeline.addLast(createHttp2ConnectionHandler(initializer.getContext()));
|
||||||
ctx.pipeline().addLast(http2connectionHandler);
|
configureHttp2Pipeline(pipeline, initializer.getHttp2ResponseHandler());
|
||||||
configureHttp2Pipeline(ctx.pipeline(), initializer.getHttp2ResponseHandler());
|
logger.log(Level.FINE, () -> "negotiated HTTP/2: handler = " + pipeline.names());
|
||||||
logger.log(Level.FINE, () -> "negotiated HTTP/2: handler = " + ctx.pipeline().names());
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (ApplicationProtocolNames.HTTP_1_1.equals(protocol)) {
|
if (ApplicationProtocolNames.HTTP_1_1.equals(protocol)) {
|
||||||
HttpClientCodec http1connectionHandler = createHttp1ConnectionHandler(initializer.getContext());
|
pipeline.addLast(createHttp1ConnectionHandler(initializer.getContext()));
|
||||||
ctx.pipeline().addLast(http1connectionHandler);
|
configureHttp1Pipeline(pipeline, initializer.getContext(), initializer.getHttpHandler());
|
||||||
configureHttp1Pipeline(ctx.pipeline(), initializer.getContext(), initializer.getHttpHandler());
|
logger.log(Level.FINE, () -> "negotiated HTTP/1.1: handler = " + pipeline.names());
|
||||||
logger.log(Level.FINE, () -> "negotiated HTTP/1.1: handler = " + ctx.pipeline().names());
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ctx.close();
|
ctx.close();
|
||||||
|
|
Loading…
Reference in a new issue