Skip to content

Commit

Permalink
Explicitly deny new server-initiated bidirectional stream
Browse files Browse the repository at this point in the history
Vanilla HTTP/3 does not allow server to create bidirectional stream.
libnghttp3 expects that application configures the QUIC stack like so.
Still it would be nice to explicitly deny new server-initiated
bidirectional stream for clarity.
  • Loading branch information
tatsuhiro-t committed Dec 29, 2024
1 parent 444f491 commit d35c8f8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/nghttp3_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,10 @@ nghttp3_ssize nghttp3_conn_read_stream(nghttp3_conn *conn, int64_t stream_id,
return rv;
}
}
} else if(!nghttp3_stream_uni(stream_id)) {
/* server does not expect to receive new server initiated
bidirectional stream from client. */
return NGHTTP3_ERR_H3_STREAM_CREATION_ERROR;
} else {
/* unidirectional stream */
if (srclen == 0 && fin) {
Expand Down

0 comments on commit d35c8f8

Please sign in to comment.