# HG changeset patch # User Roman Arutyunyan # Date 1691476997 -14400 # Node ID f3412ec3b6d146f091acee2c8cf44e39ed0fbe26 # Parent 93aee926d27f24cab575ecfbe014d5aa07b4d623 QUIC: allowed ngx_quic_frame_sendto() to return NGX_AGAIN. Previously, NGX_AGAIN returned by ngx_quic_send() was treated by ngx_quic_frame_sendto() as error, which triggered errors in its callers. However, a blocked socket is not an error. Now NGX_AGAIN is passed as is to the ngx_quic_frame_sendto() callers, which can safely ignore it. diff -r 93aee926d27f -r f3412ec3b6d1 src/event/quic/ngx_event_quic_migration.c --- a/src/event/quic/ngx_event_quic_migration.c Thu Jul 06 11:30:47 2023 +0400 +++ b/src/event/quic/ngx_event_quic_migration.c Tue Aug 08 10:43:17 2023 +0400 @@ -46,7 +46,7 @@ * An endpoint MUST expand datagrams that contain a PATH_RESPONSE frame * to at least the smallest allowed maximum datagram size of 1200 bytes. */ - if (ngx_quic_frame_sendto(c, &frame, 1200, pkt->path) != NGX_OK) { + if (ngx_quic_frame_sendto(c, &frame, 1200, pkt->path) == NGX_ERROR) { return NGX_ERROR; } @@ -544,13 +544,13 @@ */ /* same applies to PATH_RESPONSE frames */ - if (ngx_quic_frame_sendto(c, &frame, 1200, path) != NGX_OK) { + if (ngx_quic_frame_sendto(c, &frame, 1200, path) == NGX_ERROR) { return NGX_ERROR; } ngx_memcpy(frame.u.path_challenge.data, path->challenge2, 8); - if (ngx_quic_frame_sendto(c, &frame, 1200, path) != NGX_OK) { + if (ngx_quic_frame_sendto(c, &frame, 1200, path) == NGX_ERROR) { return NGX_ERROR; } diff -r 93aee926d27f -r f3412ec3b6d1 src/event/quic/ngx_event_quic_output.c --- a/src/event/quic/ngx_event_quic_output.c Thu Jul 06 11:30:47 2023 +0400 +++ b/src/event/quic/ngx_event_quic_output.c Tue Aug 08 10:43:17 2023 +0400 @@ -1233,7 +1233,7 @@ sent = ngx_quic_send(c, res.data, res.len, path->sockaddr, path->socklen); if (sent < 0) { - return NGX_ERROR; + return sent; } path->sent += sent;