Skip to content

Commit

Permalink
Unknown fix, maybe for grpc-web?
Browse files Browse the repository at this point in the history
  • Loading branch information
ulfjack committed Nov 21, 2023
1 parent 89e4254 commit ea7981c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions netty/src/main/java/io/grpc/netty/NettyServerHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -791,11 +791,13 @@ private void sendGrpcFrame(ChannelHandlerContext ctx, SendGrpcFrameCommand cmd,
PerfMark.startTask("NettyServerHandler.sendGrpcFrame", cmd.stream().tag());
PerfMark.linkIn(cmd.getLink());
try {
if (cmd.endStream()) {
closeStreamWhenDone(promise, cmd.stream().id());
int streamId = cmd.stream().id();
Http2Stream stream = connection().stream(streamId);
if (stream != null && cmd.endStream()) {
closeStreamWhenDone(promise, streamId);
}
// Call the base class to write the HTTP/2 DATA frame.
encoder().writeData(ctx, cmd.stream().id(), cmd.content(), 0, cmd.endStream(), promise);
encoder().writeData(ctx, streamId, cmd.content(), 0, cmd.endStream(), promise);
} finally {
PerfMark.stopTask("NettyServerHandler.sendGrpcFrame", cmd.stream().tag());
}
Expand Down

0 comments on commit ea7981c

Please sign in to comment.