Skip to content

Commit 2efebfd

Browse files
committed
Merge #2762 into 1.1.6
2 parents 95a8f47 + 53a3663 commit 2efebfd

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

.github/workflows/check_netty_snapshots.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ jobs:
2929
distribution: 'temurin'
3030
java-version: '8'
3131
- name: Build with Gradle
32-
run: ./gradlew clean check --no-daemon -PforceTransport=${{ matrix.transport }} -PforceNettyVersion='4.1.91.Final-SNAPSHOT'
32+
run: ./gradlew clean check --no-daemon -PforceTransport=${{ matrix.transport }} -PforceNettyVersion='4.1.92.Final-SNAPSHOT'

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ ext {
100100
logbackVersion = '1.2.12'
101101

102102
// Netty
103-
nettyDefaultVersion = '4.1.90.Final'
103+
nettyDefaultVersion = '4.1.91.Final'
104104
if (!project.hasProperty("forceNettyVersion")) {
105105
nettyVersion = nettyDefaultVersion
106106
}

reactor-netty-http/src/main/java/reactor/netty/http/client/HttpTrafficHandler.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020-2021 VMware, Inc. or its affiliates, All Rights Reserved.
2+
* Copyright (c) 2020-2023 VMware, Inc. or its affiliates, All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -35,6 +35,10 @@
3535
* {@link ChannelInboundHandlerAdapter} prior {@link reactor.netty.channel.ChannelOperationsHandler}
3636
* for handling H2/H2C use cases. HTTP/1.x use cases are delegated to
3737
* {@link reactor.netty.channel.ChannelOperationsHandler} without any interference.
38+
* <p>
39+
* Once the channel is activated, the upgrade is decided (H2C or HTTP/1.1) and in case H2/H2C the first SETTINGS frame
40+
* is received, this handler is not needed any more. Thus said {@link #channelInactive(ChannelHandlerContext)}
41+
* is invoked only in case there are issues with the connection itself.
3842
*
3943
* @author Violeta Georgieva
4044
* @since 1.0.0
@@ -79,6 +83,11 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) {
7983
ctx.fireChannelRead(msg);
8084
}
8185

86+
@Override
87+
public void channelInactive(ChannelHandlerContext ctx) {
88+
ctx.fireExceptionCaught(new PrematureCloseException("Connection prematurely closed BEFORE response"));
89+
}
90+
8291
@Override
8392
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) {
8493
Channel channel = ctx.channel();
@@ -99,6 +108,7 @@ else if (evt == UPGRADE_REJECTED) {
99108
log.debug(format(channel, "The upgrade to H2C protocol was rejected, continue using HTTP/1.x protocol."));
100109
}
101110
sendNewState(Connection.from(channel), HttpClientState.UPGRADE_REJECTED);
111+
ctx.pipeline().remove(this);
102112
}
103113
ctx.fireUserEventTriggered(evt);
104114
}

0 commit comments

Comments
 (0)