Small fixes

pull/4097/head
Craig Tiller 9 years ago
parent e58d817818
commit 575b4200a7
  1. 3
      src/core/transport/chttp2/hpack_table.c
  2. 2
      src/core/transport/chttp2/hpack_table.h
  3. 2
      test/core/end2end/fixtures/proxy.c
  4. 3
      test/core/transport/chttp2/hpack_parser_test.c

@ -324,10 +324,9 @@ int grpc_chttp2_hptbl_add(grpc_chttp2_hptbl *tbl, grpc_mdelem *md) {
}
/* copy the finalized entry in */
tbl->ents[tbl->last_ent] = GRPC_MDELEM_REF(md);
tbl->ents[(tbl->first_ent + tbl->num_ents) % tbl->cap_entries] = GRPC_MDELEM_REF(md);
/* update accounting values */
tbl->last_ent = ((tbl->last_ent + 1) % tbl->cap_entries);
tbl->num_ents++;
tbl->mem_used += (gpr_uint32)elem_bytes;
return 1;

@ -62,8 +62,6 @@ typedef struct {
grpc_mdctx *mdctx;
/* the first used entry in ents */
gpr_uint32 first_ent;
/* the last used entry in ents */
gpr_uint32 last_ent;
/* how many entries are in the table */
gpr_uint32 num_ents;
/* the amount of memory used by the table, according to the hpack algorithm */

@ -146,7 +146,6 @@ void grpc_end2end_proxy_destroy(grpc_end2end_proxy *proxy) {
}
static void unrefpc(proxy_call *pc, const char *reason) {
gpr_log(GPR_DEBUG, "PROXY UNREF %s", reason);
if (gpr_unref(&pc->refs)) {
grpc_call_destroy(pc->c2p);
grpc_call_destroy(pc->p2s);
@ -159,7 +158,6 @@ static void unrefpc(proxy_call *pc, const char *reason) {
}
static void refpc(proxy_call *pc, const char *reason) {
gpr_log(GPR_DEBUG, "PROXY REF %s", reason);
gpr_ref(&pc->refs);
}

@ -151,7 +151,8 @@ static void test_vectors(grpc_slice_split_mode mode) {
grpc_chttp2_hpack_parser_destroy(&parser);
grpc_chttp2_hpack_parser_init(&parser, mdctx);
parser.table.max_bytes = 256;
grpc_chttp2_hptbl_set_max_bytes(&parser.table, 256);
grpc_chttp2_hptbl_set_current_table_size(&parser.table, 256);
/* D.5.1 */
test_vector(&parser, mode,
"4803 3330 3258 0770 7269 7661 7465 611d"

Loading…
Cancel
Save