@@ -1559,7 +1559,7 @@ void HPackParser::QueueBufferToParse(const grpc_slice& slice) {
15591559 queued_slices_.push_back (grpc_slice_ref_internal (slice));
15601560}
15611561
1562- grpc_error_handle HPackParser::FinishFrame () {
1562+ grpc_error_handle HPackParser::Parse () {
15631563 grpc_error_handle error = GRPC_ERROR_NONE;
15641564 for (const auto & slice : queued_slices_) {
15651565 error = Parse (slice);
@@ -1569,11 +1569,12 @@ grpc_error_handle HPackParser::FinishFrame() {
15691569 grpc_slice_unref_internal (slice);
15701570 }
15711571 queued_slices_.clear ();
1572+ return error;
1573+ }
15721574
1575+ void HPackParser::FinishFrame () {
15731576 sink_ = Sink ();
15741577 dynamic_table_updates_allowed_ = 2 ;
1575-
1576- return error;
15771578}
15781579
15791580grpc_error_handle HPackParser::Parse (const grpc_slice& slice) {
@@ -1645,12 +1646,14 @@ grpc_error_handle grpc_chttp2_header_parser_parse(void* hpack_parser,
16451646 s->stats .incoming .header_bytes += GRPC_SLICE_LENGTH (slice);
16461647 }
16471648 parser->QueueBufferToParse (slice);
1648- if (!is_last || !parser-> is_boundary () ) {
1649+ if (!is_last) {
16491650 return GRPC_ERROR_NONE;
16501651 }
1651- grpc_error_handle error = parser->FinishFrame ();
1652- if (error != GRPC_ERROR_NONE) {
1653- return error;
1652+ if (parser->is_boundary ()) {
1653+ grpc_error_handle error = parser->Parse ();
1654+ if (error != GRPC_ERROR_NONE) {
1655+ return error;
1656+ }
16541657 }
16551658 /* need to check for null stream: this can occur if we receive an invalid
16561659 stream id on a header */
@@ -1682,5 +1685,6 @@ grpc_error_handle grpc_chttp2_header_parser_parse(void* hpack_parser,
16821685 grpc_chttp2_mark_stream_closed (t, s, true , false , GRPC_ERROR_NONE);
16831686 }
16841687 }
1688+ parser->FinishFrame ();
16851689 return GRPC_ERROR_NONE;
16861690}
0 commit comments