diff options
author | 2015-08-20 10:34:37 -0700 | |
---|---|---|
committer | 2015-08-20 10:34:37 -0700 | |
commit | 5bb30c764b91e54da27f4de0fcf258b320486c8c (patch) | |
tree | a376e339e683aa0469a4372c01f609ba5a4764c8 /src/core/transport/chttp2 | |
parent | 2670086806aace424d954be11123f3a5f9ef2115 (diff) |
if to assert
Diffstat (limited to 'src/core/transport/chttp2')
-rw-r--r-- | src/core/transport/chttp2/stream_encoder.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/core/transport/chttp2/stream_encoder.c b/src/core/transport/chttp2/stream_encoder.c index e9acf2b916..c6780e6156 100644 --- a/src/core/transport/chttp2/stream_encoder.c +++ b/src/core/transport/chttp2/stream_encoder.c @@ -362,14 +362,13 @@ static grpc_mdelem *hpack_enc(grpc_chttp2_hpack_compressor *c, gpr_uint32 indices_key; int should_add_elem; - if (GPR_SLICE_LENGTH(elem->key->slice) > 0) { - if (GPR_SLICE_START_PTR(elem->key->slice)[0] != ':') { /* regular header */ - st->seen_regular_header = 1; - } else if (st->seen_regular_header != 0) { /* reserved header */ - gpr_log(GPR_ERROR, - "Reserved header (colon-prefixed) happening after regular ones."); - abort(); - } + GPR_ASSERT (GPR_SLICE_LENGTH(elem->key->slice) > 0); + if (GPR_SLICE_START_PTR(elem->key->slice)[0] != ':') { /* regular header */ + st->seen_regular_header = 1; + } else if (st->seen_regular_header != 0) { /* reserved header */ + gpr_log(GPR_ERROR, + "Reserved header (colon-prefixed) happening after regular ones."); + abort(); } inc_filter(HASH_FRAGMENT_1(elem_hash), &c->filter_elems_sum, c->filter_elems); |