Skip to content

Commit

Permalink
Revert "fix StreamBufferingEncoder"
Browse files Browse the repository at this point in the history
This reverts commit 95060b2.
  • Loading branch information
dapengzhang0 committed Apr 5, 2021
1 parent ab719bd commit 43324ef
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions netty/src/main/java/io/grpc/netty/StreamBufferingEncoder.java
Expand Up @@ -60,8 +60,6 @@
* <p>This implementation makes the buffering mostly transparent and is expected to be used as a
* drop-in decorator of {@link io.netty.handler.codec.http2.DefaultHttp2ConnectionEncoder}.
*/
// This is a temporary copy of {@link io.netty.handler.codec.http2.DecoratingHttp2ConnectionEncoder}
// with a bug fix that is not available yet in the latest netty release.
class StreamBufferingEncoder extends DecoratingHttp2ConnectionEncoder {

/**
Expand Down Expand Up @@ -155,7 +153,11 @@ public ChannelFuture writeHeaders(ChannelHandlerContext ctx, int streamId, Http2
if (closed) {
return promise.setFailure(new Http2ChannelClosedException());
}
if (isExistingStream(streamId) || canCreateStream()) {
if (isExistingStream(streamId) || connection().goAwayReceived()) {
return super.writeHeaders(ctx, streamId, headers, streamDependency, weight,
exclusive, padding, endOfStream, promise);
}
if (canCreateStream()) {
return super.writeHeaders(ctx, streamId, headers, streamDependency, weight,
exclusive, padding, endOfStream, promise);
}
Expand Down

0 comments on commit 43324ef

Please sign in to comment.