mirror of https://github.com/grpc/grpc-java.git
coalesce pending flushes in OkHttpClientStream.start().
This commit is contained in:
parent
036af15b66
commit
097e3a8c65
|
|
@ -125,9 +125,16 @@ class OkHttpClientStream extends Http2ClientStream {
|
|||
requestHeaders = null;
|
||||
|
||||
if (pendingData != null) {
|
||||
boolean flush = false;
|
||||
while (!pendingData.isEmpty()) {
|
||||
PendingData data = pendingData.poll();
|
||||
outboundFlow.data(data.endOfStream, id, data.buffer, data.flush);
|
||||
outboundFlow.data(data.endOfStream, id, data.buffer, false);
|
||||
if (data.flush) {
|
||||
flush = true;
|
||||
}
|
||||
}
|
||||
if (flush) {
|
||||
outboundFlow.flush();
|
||||
}
|
||||
pendingData = null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ class OutboundFlowController {
|
|||
}
|
||||
}
|
||||
|
||||
private void flush() {
|
||||
void flush() {
|
||||
try {
|
||||
frameWriter.flush();
|
||||
} catch (IOException e) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue