diff options
author | David Garcia Quintas <dgq@google.com> | 2015-07-06 23:01:39 -0700 |
---|---|---|
committer | David Garcia Quintas <dgq@google.com> | 2015-07-06 23:01:39 -0700 |
commit | 20afd46db876d5b2e68a6ef0ad007565c7d16217 (patch) | |
tree | 78401943a03d28921528f8533a1927e6f41d0277 /src/core/transport/chttp2 | |
parent | 4e4033650911582617049643fb02942a114be220 (diff) |
PR comments
Diffstat (limited to 'src/core/transport/chttp2')
-rw-r--r-- | src/core/transport/chttp2/stream_encoder.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/transport/chttp2/stream_encoder.c b/src/core/transport/chttp2/stream_encoder.c index 5788236ffb..d0a17af5da 100644 --- a/src/core/transport/chttp2/stream_encoder.c +++ b/src/core/transport/chttp2/stream_encoder.c @@ -476,6 +476,7 @@ gpr_uint32 grpc_chttp2_preencode(grpc_stream_op *inops, size_t *inops_count, gpr_uint32 flow_controlled_bytes_taken = 0; gpr_uint32 curop = 0; gpr_uint8 *p; + int compressed_flag_set = 0; while (curop < *inops_count) { GPR_ASSERT(flow_controlled_bytes_taken <= max_flow_controlled_bytes); @@ -495,9 +496,12 @@ gpr_uint32 grpc_chttp2_preencode(grpc_stream_op *inops, size_t *inops_count, case GRPC_OP_BEGIN_MESSAGE: /* begin op: for now we just convert the op to a slice and fall through - this lets us reuse the slice framing code below */ + compressed_flag_set = + !!(op->data.begin_message.flags & GRPC_WRITE_INTERNAL_COMPRESS); slice = gpr_slice_malloc(5); + p = GPR_SLICE_START_PTR(slice); - p[0] = !!(op->data.begin_message.flags & GRPC_WRITE_INTERNAL_COMPRESS); + p[0] = compressed_flag_set; p[1] = op->data.begin_message.length >> 24; p[2] = op->data.begin_message.length >> 16; p[3] = op->data.begin_message.length >> 8; |