Skip to content

Commit ba42bd2

Browse files
authored
Merge pull request #356 from ngtcp2/add-read-control-tests
Add tests for reading a control stream
2 parents b5b95d1 + 32caf8c commit ba42bd2

File tree

2 files changed

+567
-2
lines changed

2 files changed

+567
-2
lines changed

lib/nghttp3_conn.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ nghttp3_ssize nghttp3_conn_read_control(nghttp3_conn *conn,
661661
nghttp3_varint_read_state_reset(rvint);
662662
rstate->state = NGHTTP3_CTRL_STREAM_STATE_FRAME_LENGTH;
663663
if (p == end) {
664-
break;
664+
return (nghttp3_ssize)nconsumed;
665665
}
666666
/* Fall through */
667667
case NGHTTP3_CTRL_STREAM_STATE_FRAME_LENGTH:
@@ -969,6 +969,10 @@ nghttp3_ssize nghttp3_conn_read_control(nghttp3_conn *conn,
969969

970970
rstate->state = NGHTTP3_CTRL_STREAM_STATE_PRIORITY_UPDATE;
971971

972+
if (p == end) {
973+
return (nghttp3_ssize)nconsumed;
974+
}
975+
972976
/* Fall through */
973977
case NGHTTP3_CTRL_STREAM_STATE_PRIORITY_UPDATE:
974978
/* We need to buffer Priority Field Value because it might be

0 commit comments

Comments
 (0)