]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: abort on unlisted errno on sendto()
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 18 May 2022 16:26:13 +0000 (18:26 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 19 May 2022 08:18:18 +0000 (10:18 +0200)
If an unlisted errno is reported, abort the process. If a crash is
reported on this condition, we must determine if the error code is a
bug, should interrupt emission on the fd or if we can retry the syscall.

src/quic_sock.c

index 71fe0b7f5928e5b3bc5526cd1af7ec23ba421d4e..e56372ed60facce709f23baba806d3e6488507aa 100644 (file)
@@ -339,14 +339,18 @@ size_t qc_snd_buf(struct quic_conn *qc, const struct buffer *buf, size_t count,
                        if (ret < try)
                                break;
                }
+               else if (errno == EINTR) {
+                       /* try again */
+                       continue;
+               }
                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 ? */
-                       qc->sendto_err++;
+               else if (errno) {
+                       /* TODO unlisted errno : handle it explicitely. */
+                       ABORT_NOW();
                }
        }