Skip to content

Commit 4fffb2f

Browse files
authored
Merge pull request #342 from ngtcp2/initial-rx-http-state
Set initial rx http state on stream creation
2 parents 55e85ab + 4484ca7 commit 4fffb2f

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

lib/nghttp3_conn.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -460,14 +460,8 @@ nghttp3_ssize nghttp3_conn_read_stream(nghttp3_conn *conn, int64_t stream_id,
460460
return NGHTTP3_ERR_H3_STREAM_CREATION_ERROR;
461461
}
462462
} else if (conn->server) {
463-
if (nghttp3_client_stream_bidi(stream_id)) {
464-
if (stream->rx.hstate == NGHTTP3_HTTP_STATE_NONE) {
465-
stream->rx.hstate = NGHTTP3_HTTP_STATE_REQ_INITIAL;
466-
stream->tx.hstate = NGHTTP3_HTTP_STATE_REQ_INITIAL;
467-
}
468-
} else {
469-
assert(nghttp3_client_stream_uni(stream_id));
470-
}
463+
assert(nghttp3_client_stream_bidi(stream_id) ||
464+
nghttp3_client_stream_uni(stream_id));
471465
} else {
472466
assert(nghttp3_client_stream_bidi(stream_id) ||
473467
nghttp3_server_stream_uni(stream_id));
@@ -1794,6 +1788,8 @@ conn_on_priority_update_stream(nghttp3_conn *conn,
17941788

17951789
stream->node.pri = fr->pri;
17961790
stream->flags |= NGHTTP3_STREAM_FLAG_PRIORITY_UPDATE_RECVED;
1791+
stream->rx.hstate = NGHTTP3_HTTP_STATE_REQ_INITIAL;
1792+
stream->tx.hstate = NGHTTP3_HTTP_STATE_REQ_INITIAL;
17971793

17981794
return 0;
17991795
}

0 commit comments

Comments
 (0)