Skip to content

Commit

Permalink
increasing max http header size from 8192 to 32768
Browse files Browse the repository at this point in the history
  • Loading branch information
Owen Williams committed Mar 29, 2018
1 parent fa0ea34 commit 099efa8
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,15 @@
import io.reactivex.netty.channel.SingleNioLoopProvider;
import io.reactivex.netty.client.RxClient;
import io.reactivex.netty.pipeline.ssl.SSLEngineFactory;
import io.reactivex.netty.pipeline.PipelineConfigurator;
import io.reactivex.netty.pipeline.PipelineConfiguratorComposite;
import io.reactivex.netty.protocol.http.HttpObjectAggregationConfigurator;
import io.reactivex.netty.protocol.http.client.CompositeHttpClient;
import io.reactivex.netty.protocol.http.client.CompositeHttpClientBuilder;
import io.reactivex.netty.protocol.http.client.HttpClientPipelineConfigurator;
import io.reactivex.netty.protocol.http.client.HttpClientRequest;
import io.reactivex.netty.protocol.http.client.HttpClientResponse;

import rx.Observable;
import rx.Single;
import rx.functions.Func1;
Expand Down Expand Up @@ -231,13 +238,22 @@ public SSLEngine createSSLEngine(ByteBufAllocator allocator) {
CompositeHttpClientBuilder<ByteBuf, ByteBuf> builder = new CompositeHttpClientBuilder<ByteBuf, ByteBuf>()
.withSslEngineFactory(new DefaultSSLEngineFactory())
.withMaxConnections(connectionPolicy.getMaxPoolSize())
.withIdleConnectionsTimeoutMillis(this.connectionPolicy.getIdleConnectionTimeoutInMillis());
.withIdleConnectionsTimeoutMillis(this.connectionPolicy.getIdleConnectionTimeoutInMillis())
.pipelineConfigurator(createClientPipelineConfigurator());

RxClient.ClientConfig config = new RxClient.ClientConfig.Builder()
.readTimeout(connectionPolicy.getRequestTimeoutInMillis(), TimeUnit.MILLISECONDS).build();
return builder.config(config);
}

private PipelineConfigurator createClientPipelineConfigurator() {
PipelineConfigurator clientPipelineConfigurator = new PipelineConfiguratorComposite<HttpClientResponse<ByteBuf>,
HttpClientRequest<ByteBuf>>(new HttpClientPipelineConfigurator<ByteBuf, ByteBuf>
(8192, 32768, 8182, true ),
new HttpObjectAggregationConfigurator());
return clientPipelineConfigurator;
}

@Override
public URI getServiceEndpoint() {
return this.serviceEndpoint;
Expand Down

0 comments on commit 099efa8

Please sign in to comment.