Skip to content
Snippets Groups Projects
Commit 575b4200 authored by Craig Tiller's avatar Craig Tiller
Browse files

Small fixes

parent e58d8178
No related branches found
No related tags found
No related merge requests found
...@@ -324,10 +324,9 @@ int grpc_chttp2_hptbl_add(grpc_chttp2_hptbl *tbl, grpc_mdelem *md) { ...@@ -324,10 +324,9 @@ int grpc_chttp2_hptbl_add(grpc_chttp2_hptbl *tbl, grpc_mdelem *md) {
} }
/* copy the finalized entry in */ /* 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 */ /* update accounting values */
tbl->last_ent = ((tbl->last_ent + 1) % tbl->cap_entries);
tbl->num_ents++; tbl->num_ents++;
tbl->mem_used += (gpr_uint32)elem_bytes; tbl->mem_used += (gpr_uint32)elem_bytes;
return 1; return 1;
......
...@@ -62,8 +62,6 @@ typedef struct { ...@@ -62,8 +62,6 @@ typedef struct {
grpc_mdctx *mdctx; grpc_mdctx *mdctx;
/* the first used entry in ents */ /* the first used entry in ents */
gpr_uint32 first_ent; gpr_uint32 first_ent;
/* the last used entry in ents */
gpr_uint32 last_ent;
/* how many entries are in the table */ /* how many entries are in the table */
gpr_uint32 num_ents; gpr_uint32 num_ents;
/* the amount of memory used by the table, according to the hpack algorithm */ /* 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) { ...@@ -146,7 +146,6 @@ void grpc_end2end_proxy_destroy(grpc_end2end_proxy *proxy) {
} }
static void unrefpc(proxy_call *pc, const char *reason) { static void unrefpc(proxy_call *pc, const char *reason) {
gpr_log(GPR_DEBUG, "PROXY UNREF %s", reason);
if (gpr_unref(&pc->refs)) { if (gpr_unref(&pc->refs)) {
grpc_call_destroy(pc->c2p); grpc_call_destroy(pc->c2p);
grpc_call_destroy(pc->p2s); grpc_call_destroy(pc->p2s);
...@@ -159,7 +158,6 @@ static void unrefpc(proxy_call *pc, const char *reason) { ...@@ -159,7 +158,6 @@ static void unrefpc(proxy_call *pc, const char *reason) {
} }
static void refpc(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); gpr_ref(&pc->refs);
} }
......
...@@ -151,7 +151,8 @@ static void test_vectors(grpc_slice_split_mode mode) { ...@@ -151,7 +151,8 @@ static void test_vectors(grpc_slice_split_mode mode) {
grpc_chttp2_hpack_parser_destroy(&parser); grpc_chttp2_hpack_parser_destroy(&parser);
grpc_chttp2_hpack_parser_init(&parser, mdctx); 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 */ /* D.5.1 */
test_vector(&parser, mode, test_vector(&parser, mode,
"4803 3330 3258 0770 7269 7661 7465 611d" "4803 3330 3258 0770 7269 7661 7465 611d"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment