]> git.kaiwu.me - haproxy.git/commitdiff
MINOR: quic: detect EBADF on sendto()
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 19 May 2022 09:53:56 +0000 (11:53 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 19 May 2022 09:58:32 +0000 (11:58 +0200)
EBADF can be encountered during process termination after fd listener
has been reset to -1.

src/quic_sock.c

index e56372ed60facce709f23baba806d3e6488507aa..164993006ef86826dc36f8586d049325fe2063d2 100644 (file)
@@ -343,7 +343,7 @@ size_t qc_snd_buf(struct quic_conn *qc, const struct buffer *buf, size_t count,
                        /* try again */
                        continue;
                }
-               else if (ret == 0 || errno == EAGAIN || errno == EWOULDBLOCK || errno == ENOTCONN || errno == EINPROGRESS) {
+               else if (ret == 0 || errno == EAGAIN || errno == EWOULDBLOCK || errno == ENOTCONN || errno == EINPROGRESS || errno == EBADF) {
                        /* TODO must be handle properly. It is justified for UDP ? */
                        qc->sendto_err++;
                        break;