mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-10 09:07:02 +02:00
BUG/MINOR: quic: Possible unexpected counter incrementation on send*() errors
Some counters could potentially be incremented even if send*() syscall returned no error when ret >= 0 and ret != sz. This could be the case for instance if a first call to send*() returned -1 with errno set to EINTR (or any previous syscall which set errno to a non-null value) and if the next call to send*() returned something positive and smaller than <sz>. Must be backported to 2.7 and 2.6.
This commit is contained in:
parent
14037bf26f
commit
9fc10aff05
@ -609,7 +609,7 @@ int qc_snd_buf(struct quic_conn *qc, const struct buffer *buf, size_t sz,
|
|||||||
}
|
}
|
||||||
} while (ret < 0 && errno == EINTR);
|
} while (ret < 0 && errno == EINTR);
|
||||||
|
|
||||||
if (ret < 0 || ret != sz) {
|
if (ret < 0) {
|
||||||
struct proxy *prx = qc->li->bind_conf->frontend;
|
struct proxy *prx = qc->li->bind_conf->frontend;
|
||||||
struct quic_counters *prx_counters =
|
struct quic_counters *prx_counters =
|
||||||
EXTRA_COUNTERS_GET(prx->extra_counters_fe,
|
EXTRA_COUNTERS_GET(prx->extra_counters_fe,
|
||||||
@ -633,6 +633,9 @@ int qc_snd_buf(struct quic_conn *qc, const struct buffer *buf, size_t sz,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ret != sz)
|
||||||
|
return 1;
|
||||||
|
|
||||||
/* we count the total bytes sent, and the send rate for 32-byte blocks.
|
/* we count the total bytes sent, and the send rate for 32-byte blocks.
|
||||||
* The reason for the latter is that freq_ctr are limited to 4GB and
|
* The reason for the latter is that freq_ctr are limited to 4GB and
|
||||||
* that it's not enough per second.
|
* that it's not enough per second.
|
||||||
|
Loading…
Reference in New Issue
Block a user