|
@@ -322,10 +322,7 @@ grpc_chttp2_begin_write_result grpc_chttp2_begin_write(
|
|
|
(send_bytes == s->compressed_data_buffer->length &&
|
|
(send_bytes == s->compressed_data_buffer->length &&
|
|
|
s->flow_controlled_buffer.length == 0 &&
|
|
s->flow_controlled_buffer.length == 0 &&
|
|
|
s->fetching_send_message == NULL);
|
|
s->fetching_send_message == NULL);
|
|
|
- is_last_frame =
|
|
|
|
|
- is_last_data_frame && s->send_trailing_metadata != NULL &&
|
|
|
|
|
- grpc_metadata_batch_is_empty(s->send_trailing_metadata);
|
|
|
|
|
- if (is_last_frame && s->stream_compression_ctx) {
|
|
|
|
|
|
|
+ if (is_last_data_frame && s->stream_compression_ctx) {
|
|
|
GPR_ASSERT(grpc_stream_compress(
|
|
GPR_ASSERT(grpc_stream_compress(
|
|
|
s->stream_compression_ctx, &s->flow_controlled_buffer,
|
|
s->stream_compression_ctx, &s->flow_controlled_buffer,
|
|
|
s->compressed_data_buffer, NULL, MAX_SIZE_T,
|
|
s->compressed_data_buffer, NULL, MAX_SIZE_T,
|
|
@@ -335,10 +332,13 @@ grpc_chttp2_begin_write_result grpc_chttp2_begin_write(
|
|
|
s->stream_compression_ctx = NULL;
|
|
s->stream_compression_ctx = NULL;
|
|
|
/* After finish, bytes in s->compressed_data_buffer may be
|
|
/* After finish, bytes in s->compressed_data_buffer may be
|
|
|
* more than max_outgoing. Start another round of the current
|
|
* more than max_outgoing. Start another round of the current
|
|
|
- * while loop so that send_bytes, is_last_data_frame and
|
|
|
|
|
- * is_last_frame are recalculated. */
|
|
|
|
|
|
|
+ * while loop so that send_bytes and is_last_data_frame are
|
|
|
|
|
+ * recalculated. */
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
|
|
+ is_last_frame =
|
|
|
|
|
+ is_last_data_frame && s->send_trailing_metadata != NULL &&
|
|
|
|
|
+ grpc_metadata_batch_is_empty(s->send_trailing_metadata);
|
|
|
grpc_chttp2_encode_data(s->id, s->compressed_data_buffer,
|
|
grpc_chttp2_encode_data(s->id, s->compressed_data_buffer,
|
|
|
send_bytes, is_last_frame,
|
|
send_bytes, is_last_frame,
|
|
|
&s->stats.outgoing, &t->outbuf);
|
|
&s->stats.outgoing, &t->outbuf);
|