Skip to content

Commit

Permalink
Merge #2762 into 1.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
violetagg committed Apr 5, 2023
2 parents 95a8f47 + 53a3663 commit 2efebfd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check_netty_snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
distribution: 'temurin'
java-version: '8'
- name: Build with Gradle
run: ./gradlew clean check --no-daemon -PforceTransport=${{ matrix.transport }} -PforceNettyVersion='4.1.91.Final-SNAPSHOT'
run: ./gradlew clean check --no-daemon -PforceTransport=${{ matrix.transport }} -PforceNettyVersion='4.1.92.Final-SNAPSHOT'
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ ext {
logbackVersion = '1.2.12'

// Netty
nettyDefaultVersion = '4.1.90.Final'
nettyDefaultVersion = '4.1.91.Final'
if (!project.hasProperty("forceNettyVersion")) {
nettyVersion = nettyDefaultVersion
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2021 VMware, Inc. or its affiliates, All Rights Reserved.
* Copyright (c) 2020-2023 VMware, Inc. or its affiliates, All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -35,6 +35,10 @@
* {@link ChannelInboundHandlerAdapter} prior {@link reactor.netty.channel.ChannelOperationsHandler}
* for handling H2/H2C use cases. HTTP/1.x use cases are delegated to
* {@link reactor.netty.channel.ChannelOperationsHandler} without any interference.
* <p>
* Once the channel is activated, the upgrade is decided (H2C or HTTP/1.1) and in case H2/H2C the first SETTINGS frame
* is received, this handler is not needed any more. Thus said {@link #channelInactive(ChannelHandlerContext)}
* is invoked only in case there are issues with the connection itself.
*
* @author Violeta Georgieva
* @since 1.0.0
Expand Down Expand Up @@ -79,6 +83,11 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) {
ctx.fireChannelRead(msg);
}

@Override
public void channelInactive(ChannelHandlerContext ctx) {
ctx.fireExceptionCaught(new PrematureCloseException("Connection prematurely closed BEFORE response"));
}

@Override
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) {
Channel channel = ctx.channel();
Expand All @@ -99,6 +108,7 @@ else if (evt == UPGRADE_REJECTED) {
log.debug(format(channel, "The upgrade to H2C protocol was rejected, continue using HTTP/1.x protocol."));
}
sendNewState(Connection.from(channel), HttpClientState.UPGRADE_REJECTED);
ctx.pipeline().remove(this);
}
ctx.fireUserEventTriggered(evt);
}
Expand Down

0 comments on commit 2efebfd

Please sign in to comment.