Fix gQUIC connection close: there is no HEADERS stream without HTTP flag

This is a bit of an unexpected use case, as gQUIC usually means that
there is HEADERS stream, but the API allows one to turn HTTP off.

Fixes bug #220.
This commit is contained in:
Dmitri Tikhonov 2021-01-25 10:44:33 -05:00
parent 65c5d50287
commit 50c35e5b80
1 changed files with 3 additions and 1 deletions

View File

@ -2615,10 +2615,12 @@ maybe_close_conn (struct full_conn *conn)
struct lsquic_stream *stream;
struct lsquic_hash_elem *el;
#endif
const unsigned n_special_stream = N_SPECIAL_STREAMS
- !(conn->fc_flags & FC_HTTP);
if ((conn->fc_flags & (FC_CLOSING|FC_GOAWAY_SENT|FC_SERVER))
== (FC_GOAWAY_SENT|FC_SERVER)
&& lsquic_hash_count(conn->fc_pub.all_streams) == N_SPECIAL_STREAMS)
&& lsquic_hash_count(conn->fc_pub.all_streams) == n_special_streams)
{
#ifndef NDEBUG
for (el = lsquic_hash_first(conn->fc_pub.all_streams); el;