mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 15:47:01 +02:00
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.
This commit is contained in:
parent
40909dfec5
commit
dc0dcb394b
@ -495,9 +495,16 @@ int qc_snd_buf(struct quic_conn *qc, const struct buffer *buf, size_t sz,
|
|||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
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,
|
ret = sendto(qc->li->rx.fd, b_peek(buf, b_head_ofs(buf)), sz,
|
||||||
MSG_DONTWAIT|MSG_NOSIGNAL,
|
MSG_DONTWAIT|MSG_NOSIGNAL,
|
||||||
(struct sockaddr *)&qc->peer_addr, get_addr_len(&qc->peer_addr));
|
(struct sockaddr *)&qc->peer_addr,
|
||||||
|
get_addr_len(&qc->peer_addr));
|
||||||
|
}
|
||||||
} while (ret < 0 && errno == EINTR);
|
} while (ret < 0 && errno == EINTR);
|
||||||
|
|
||||||
if (ret < 0 || ret != sz) {
|
if (ret < 0 || ret != sz) {
|
||||||
@ -515,7 +522,9 @@ int qc_snd_buf(struct quic_conn *qc, const struct buffer *buf, size_t sz,
|
|||||||
HA_ATOMIC_INC(&prx_counters->sendto_err);
|
HA_ATOMIC_INC(&prx_counters->sendto_err);
|
||||||
}
|
}
|
||||||
else if (errno) {
|
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);
|
HA_ATOMIC_INC(&prx_counters->sendto_err_unknown);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user