# HG changeset patch # User Vladimir Khomutov # Date 1695396237 -14400 # Node ID 3db945fda515014d220151046d02f3960bcfca0a # Parent 32b5aaebcca51854de6e1f8a40798edb13662edb QUIC: handle callback errors in compat. The error may be triggered in add_handhshake_data() by incorrect transport parameter sent by client. The expected behaviour in this case is to close connection complaining about incorrect parameter. Currently the connection just times out. diff -r 32b5aaebcca5 -r 3db945fda515 src/event/quic/ngx_event_quic_openssl_compat.c --- a/src/event/quic/ngx_event_quic_openssl_compat.c Wed Sep 13 17:48:15 2023 +0400 +++ b/src/event/quic/ngx_event_quic_openssl_compat.c Fri Sep 22 19:23:57 2023 +0400 @@ -408,7 +408,9 @@ "quic compat tx %s len:%uz ", ngx_quic_level_name(level), len); - (void) com->method->add_handshake_data(ssl, level, buf, len); + if (com->method->add_handshake_data(ssl, level, buf, len) != 1) { + goto failed; + } break; @@ -420,11 +422,19 @@ "quic compat %s alert:%ui len:%uz ", ngx_quic_level_name(level), alert, len); - (void) com->method->send_alert(ssl, level, alert); + if (com->method->send_alert(ssl, level, alert) != 1) { + goto failed; + } } break; } + + return; + +failed: + + ngx_post_event(&qc->close, &ngx_posted_events); }