Skip to content

Commit

Permalink
Stop the quicserver if the handshake or receiving the request fails
Browse files Browse the repository at this point in the history
Previously we entered an infinite loop if these things failed.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #22557)

(cherry picked from commit ddf84fc)
  • Loading branch information
mattcaswell authored and t8m committed Nov 1, 2023
1 parent 7a78528 commit bb8ecea
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions util/quicserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,11 @@ int main(int argc, char *argv[])
while(!ossl_quic_tserver_is_handshake_confirmed(qtserv)) {
wait_for_activity(qtserv);
ossl_quic_tserver_tick(qtserv);
if (ossl_quic_tserver_is_terminated(qtserv)) {
BIO_printf(bio_err, "Failed waiting for handshake completion\n");
ret = EXIT_FAILURE;
goto end;
}
}

for (;; respnum++) {
Expand All @@ -257,6 +262,11 @@ int main(int argc, char *argv[])
wait_for_activity(qtserv);

ossl_quic_tserver_tick(qtserv);
if (ossl_quic_tserver_is_terminated(qtserv)) {
BIO_printf(bio_err, "Failed reading request\n");
ret = EXIT_FAILURE;
goto end;
}

if (ossl_quic_tserver_read(qtserv, streamid, reqbuf + reqbytes,
sizeof(reqbuf) - reqbytes,
Expand Down

0 comments on commit bb8ecea

Please sign in to comment.