]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mux-quic: update session's idle delay before stream creation
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 17 May 2022 16:03:37 +0000 (18:03 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 18 May 2022 13:30:13 +0000 (15:30 +0200)
This commit is an adaptation from the following patch :
  commit d0de6776826ee18da74e6949752e2f44cba8fdf2
  Author: Willy Tarreau <w@1wt.eu>
  Date:   Fri Feb 4 09:05:37 2022 +0100
  BUG/MINOR: mux-h2: update the session's idle delay before creating the stream

This should fix the incorrect timeouts present in httplog format for
QUIC requests.

include/haproxy/mux_quic.h

index 72e52f318733f39bdd5990ac6422932f9750751d..dc14277ce78f44f3315482e0608076f095cc5fd9 100644 (file)
@@ -92,10 +92,22 @@ static inline int qcc_install_app_ops(struct qcc *qcc,
 
 static inline struct conn_stream *qc_attach_cs(struct qcs *qcs, struct buffer *buf)
 {
-       if (!cs_new_from_endp(qcs->endp, qcs->qcc->conn->owner, buf))
+       struct session *sess = qcs->qcc->conn->owner;
+
+       /* TODO duplicated from mux_h2 */
+       sess->t_idle = tv_ms_elapsed(&sess->tv_accept, &now) - sess->t_handshake;
+
+       if (!cs_new_from_endp(qcs->endp, sess, buf))
                return NULL;
 
        ++qcs->qcc->nb_cs;
+
+       /* TODO duplicated from mux_h2 */
+       sess->accept_date = date;
+       sess->tv_accept   = now;
+       sess->t_handshake = 0;
+       sess->t_idle = 0;
+
        return qcs->endp->cs;
 }