MINOR: quic: use connection socket for emission
If quic-conn has a dedicated socket, use it for sending over the
listener socket. This should improve performance by reducing contention
over the shared listener socket.
This change is part of quic-conn owned socket implementation.
It may be backported to 2.7 after a period of observation.
diff --git a/src/quic_sock.c b/src/quic_sock.c
index bce8a1b..7de9613 100644
--- a/src/quic_sock.c
+++ b/src/quic_sock.c
@@ -495,9 +495,16 @@
ssize_t ret;
do {
- ret = sendto(qc->li->rx.fd, b_peek(buf, b_head_ofs(buf)), sz,
- MSG_DONTWAIT | MSG_NOSIGNAL,
- (struct sockaddr *)&qc->peer_addr, get_addr_len(&qc->peer_addr));
+ if (qc_test_fd(qc)) {
+ ret = send(qc->fd, b_peek(buf, b_head_ofs(buf)), sz,
+ MSG_DONTWAIT | MSG_NOSIGNAL);
+ }
+ else {
+ ret = sendto(qc->li->rx.fd, b_peek(buf, b_head_ofs(buf)), sz,
+ MSG_DONTWAIT|MSG_NOSIGNAL,
+ (struct sockaddr *)&qc->peer_addr,
+ get_addr_len(&qc->peer_addr));
+ }
} while (ret < 0 && errno == EINTR);
if (ret < 0 || ret != sz) {
@@ -515,7 +522,9 @@
HA_ATOMIC_INC(&prx_counters->sendto_err);
}
else if (errno) {
- /* TODO unlisted errno : handle it explicitly. */
+ /* TODO unlisted errno : handle it explicitly.
+ * ECONNRESET may be encounter on quic-conn socket.
+ */
HA_ATOMIC_INC(&prx_counters->sendto_err_unknown);
}