Merge pull request #1710 from ctiller/lets-fix-the-state-machine

Handle priority frames in any header
pull/1725/head
Yang Gao 10 years ago
commit 23c870c805
  1. 4
      src/core/transport/chttp2/hpack_parser.c
  2. 2
      src/core/transport/chttp2/hpack_parser.h

@ -654,7 +654,7 @@ static int parse_stream_weight(grpc_chttp2_hpack_parser *p,
return 1; return 1;
} }
return parse_begin(p, cur + 1, end); return p->after_prioritization(p, cur + 1, end);
} }
static int parse_stream_dep3(grpc_chttp2_hpack_parser *p, const gpr_uint8 *cur, static int parse_stream_dep3(grpc_chttp2_hpack_parser *p, const gpr_uint8 *cur,
@ -1349,7 +1349,7 @@ void grpc_chttp2_hpack_parser_init(grpc_chttp2_hpack_parser *p,
} }
void grpc_chttp2_hpack_parser_set_has_priority(grpc_chttp2_hpack_parser *p) { void grpc_chttp2_hpack_parser_set_has_priority(grpc_chttp2_hpack_parser *p) {
GPR_ASSERT(p->state == parse_begin); p->after_prioritization = p->state;
p->state = parse_stream_dep0; p->state = parse_stream_dep0;
} }

@ -62,6 +62,8 @@ struct grpc_chttp2_hpack_parser {
grpc_chttp2_hpack_parser_state state; grpc_chttp2_hpack_parser_state state;
/* future states dependent on the opening op code */ /* future states dependent on the opening op code */
const grpc_chttp2_hpack_parser_state *next_state; const grpc_chttp2_hpack_parser_state *next_state;
/* what to do after skipping prioritization data */
grpc_chttp2_hpack_parser_state after_prioritization;
/* the value we're currently parsing */ /* the value we're currently parsing */
union { union {
gpr_uint32 *value; gpr_uint32 *value;

Loading…
Cancel
Save