]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: break for error on sendto
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 18 May 2022 16:14:12 +0000 (18:14 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 19 May 2022 08:18:18 +0000 (10:18 +0200)
If sendto returns an error, we should not retry the call and break from
the sending loop. An exception is made for EINTR which allows to retry
immediately the syscall.

This bug caused an infinite loop reproduced when the process is in the
closing state by SIGUSR1 but there is still QUIC data emission left.

src/quic_sock.c

index 2cc5a7f0332a66643c662b58a6736a5d23305399..71fe0b7f5928e5b3bc5526cd1af7ec23ba421d4e 100644 (file)
@@ -342,6 +342,7 @@ size_t qc_snd_buf(struct quic_conn *qc, const struct buffer *buf, size_t count,
                else if (ret == 0 || errno == EAGAIN || errno == EWOULDBLOCK || errno == ENOTCONN || errno == EINPROGRESS) {
                        /* TODO must be handle properly. It is justified for UDP ? */
                        qc->sendto_err++;
+                       break;
                }
                else if (errno != EINTR) {
                        /* TODO must be handle properly. It is justified for UDP ? */