]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: fix fc_rtt/srtt values
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 1 Aug 2024 09:25:15 +0000 (11:25 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 1 Aug 2024 09:35:27 +0000 (11:35 +0200)
QUIC has recently implement get_info callback to return RTT/sRTT values.
However, it uses milliseconds, contrary to TCP which uses microseconds.
This cause smp fetch functions to return invalid values. Fix this by
converting QUIC values to microseconds.

This does not need to be backported.

src/proto_quic.c

index d16cbbb8a7745e38e83d74fe932adb3128f186be..f9f4930399e71757a5e7498d4059d937fd5d20d3 100644 (file)
@@ -702,8 +702,8 @@ static int quic_get_info(struct connection *conn, long long int *info, int info_
        struct quic_conn *qc = conn->handle.qc;
 
        switch (info_num) {
-       case 0:  *info = qc->path->loss.srtt;             break;
-       case 1:  *info = qc->path->loss.rtt_var;          break;
+       case 0:  *info = qc->path->loss.srtt * 1000;      break;
+       case 1:  *info = qc->path->loss.rtt_var * 1000;   break;
        case 3:  *info = qc->path->loss.nb_lost_pkt;      break;
        case 7:  *info = qc->path->loss.nb_reordered_pkt; break;
        default: return 0;