Skip to content

Commit

Permalink
Minor cleanup of http proxy/handshake code (#2717)
Browse files Browse the repository at this point in the history
Motivation:
Remove some unused arguments and member variables.
  • Loading branch information
Scottmitch authored Oct 2, 2023
1 parent 2aa6a04 commit 61b65b8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
import io.servicetalk.transport.api.TransportObserver;
import io.servicetalk.transport.netty.internal.NoopTransportObserver;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.function.Function;
import javax.annotation.Nullable;

Expand All @@ -49,7 +46,6 @@

abstract class AbstractLBHttpConnectionFactory<ResolvedAddress>
implements ConnectionFactory<ResolvedAddress, FilterableStreamingHttpLoadBalancedConnection> {
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractLBHttpConnectionFactory.class);
@Nullable
private final StreamingHttpConnectionFilterFactory connectionFilterFunction;
final ReadOnlyHttpClientConfig config;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import io.servicetalk.concurrent.api.Single;
import io.servicetalk.http.api.FilterableStreamingHttpConnection;
import io.servicetalk.http.api.HttpExecutionContext;
import io.servicetalk.http.api.HttpExecutionStrategy;
import io.servicetalk.http.api.StreamingHttpConnectionFilterFactory;
import io.servicetalk.http.api.StreamingHttpRequestResponseFactory;
import io.servicetalk.http.netty.AlpnChannelSingle.NoopChannelInitializer;
Expand Down Expand Up @@ -47,7 +46,6 @@

import static io.netty.channel.ChannelOption.ALLOW_HALF_CLOSURE;
import static io.servicetalk.buffer.netty.BufferUtils.getByteBufAllocator;
import static io.servicetalk.http.api.HttpExecutionStrategies.customStrategyBuilder;
import static io.servicetalk.http.api.HttpProtocolVersion.HTTP_1_1;
import static io.servicetalk.http.api.HttpProtocolVersion.HTTP_2_0;
import static io.servicetalk.http.netty.AlpnLBHttpConnectionFactory.unknownAlpnProtocol;
Expand All @@ -67,9 +65,6 @@
*/
final class ProxyConnectLBHttpConnectionFactory<ResolvedAddress>
extends AbstractLBHttpConnectionFactory<ResolvedAddress> {

private static final HttpExecutionStrategy OFFLOAD_SEND_STRATEGY = customStrategyBuilder().offloadSend().build();

private final String connectAddress;

ProxyConnectLBHttpConnectionFactory(
Expand Down Expand Up @@ -107,12 +102,12 @@ private Single<? extends FilterableStreamingHttpConnection> createConnection(
.andThen(new HttpClientChannelInitializer(
getByteBufAllocator(executionContext.bufferAllocator()), h1Config, closeHandler)),
observer, h1Config.headersFactory(), connectAddress)
.flatMap(ch -> handshake(ch, observer))
.flatMap(ProxyConnectLBHttpConnectionFactory::handshake)
.flatMap(protocol -> finishConnectionInitialization(protocol, channel, closeHandler, observer))
.onErrorMap(cause -> handleException(cause, channel));
}

private static Single<String> handshake(final Channel channel, final ConnectionObserver connectionObserver) {
private static Single<String> handshake(final Channel channel) {
assert channel.eventLoop().inEventLoop();

final Single<String> result;
Expand Down

0 comments on commit 61b65b8

Please sign in to comment.