|
45 | 45 | import io.servicetalk.transport.api.ConnectionObserver.StreamObserver;
|
46 | 46 | import io.servicetalk.transport.api.IoThreadFactory;
|
47 | 47 | import io.servicetalk.transport.api.SslConfig;
|
| 48 | +import io.servicetalk.transport.netty.internal.ChannelCloseUtils; |
48 | 49 | import io.servicetalk.transport.netty.internal.ChannelInitializer;
|
49 | 50 | import io.servicetalk.transport.netty.internal.CloseHandler;
|
50 | 51 | import io.servicetalk.transport.netty.internal.DefaultNettyConnection;
|
|
86 | 87 | import static io.servicetalk.http.netty.AbstractStreamingHttpConnection.ZERO_MAX_CONCURRENCY_EVENT;
|
87 | 88 | import static io.servicetalk.http.netty.HeaderUtils.OBJ_EXPECT_CONTINUE;
|
88 | 89 | import static io.servicetalk.http.netty.HttpDebugUtils.showPipeline;
|
89 |
| -import static io.servicetalk.transport.netty.internal.ChannelCloseUtils.close; |
90 | 90 | import static io.servicetalk.transport.netty.internal.ChannelSet.CHANNEL_CLOSEABLE_KEY;
|
91 | 91 | import static io.servicetalk.transport.netty.internal.CloseHandler.forNonPipelined;
|
92 | 92 | import static io.servicetalk.transport.netty.internal.NettyPipelineSslUtils.extractSslSession;
|
@@ -145,14 +145,14 @@ protected void handleSubscribe(final Subscriber<? super H2ClientParentConnection
|
145 | 145 | delayedCancellable, shouldWaitForSslHandshake(sslSession, sslConfig),
|
146 | 146 | allowDropTrailersReadFromTransport, config.headersFactory(), reqRespFactory, observer);
|
147 | 147 | } catch (Throwable cause) {
|
148 |
| - close(channel, cause); |
| 148 | + ChannelCloseUtils.close(channel, cause); |
149 | 149 | deliverErrorFromSource(subscriber, cause);
|
150 | 150 | return;
|
151 | 151 | }
|
152 | 152 | try {
|
153 | 153 | subscriber.onSubscribe(delayedCancellable);
|
154 | 154 | } catch (Throwable cause) {
|
155 |
| - close(channel, cause); |
| 155 | + ChannelCloseUtils.close(channel, cause); |
156 | 156 | handleExceptionFromOnSubscribe(subscriber, cause);
|
157 | 157 | return;
|
158 | 158 | }
|
@@ -215,7 +215,7 @@ void tryCompleteSubscriber() {
|
215 | 215 | @Override
|
216 | 216 | boolean tryFailSubscriber(Throwable cause) {
|
217 | 217 | if (subscriber != null) {
|
218 |
| - close(parentContext.nettyChannel(), cause); |
| 218 | + ChannelCloseUtils.close(parentContext.nettyChannel(), cause); |
219 | 219 | Subscriber<? super H2ClientParentConnection> subscriberCopy = subscriber;
|
220 | 220 | subscriber = null;
|
221 | 221 | subscriberCopy.onError(cause);
|
@@ -391,7 +391,7 @@ private void childChannelActive(Future<Http2StreamChannel> future,
|
391 | 391 | } catch (Throwable cause) {
|
392 | 392 | if (streamChannel != null) {
|
393 | 393 | try {
|
394 |
| - close(streamChannel, cause); |
| 394 | + ChannelCloseUtils.close(streamChannel, cause); |
395 | 395 | } catch (Throwable unexpected) {
|
396 | 396 | addSuppressed(unexpected, cause);
|
397 | 397 | LOGGER.warn("Unexpected exception while handling the original cause", unexpected);
|
|
0 commit comments