mirror of https://github.com/grpc/grpc-java.git
core: Call onSentBytes only if future is successfull. (#2339)
For example, if opening a stream failed after a DATA frame had already been queued.
This commit is contained in:
parent
46e46eb8bd
commit
10f4c90f4e
|
|
@ -150,9 +150,11 @@ class NettyClientStream extends AbstractClientStream2 {
|
|||
channel.newPromise().addListener(new ChannelFutureListener() {
|
||||
@Override
|
||||
public void operationComplete(ChannelFuture future) throws Exception {
|
||||
// Remove the bytes from outbound flow control, optionally notifying
|
||||
// the client that they can send more bytes.
|
||||
transportState().onSentBytes(numBytes);
|
||||
if (future.isSuccess()) {
|
||||
// Remove the bytes from outbound flow control, optionally notifying
|
||||
// the client that they can send more bytes.
|
||||
transportState().onSentBytes(numBytes);
|
||||
}
|
||||
}
|
||||
}), flush);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue