#include <haproxy/quic_frame-t.h>
#include <haproxy/quic_stream-t.h>
#include <haproxy/stconn-t.h>
+#include <haproxy/time-t.h>
/* Stream types */
enum qcs_type {
uint64_t err; /* error code to transmit via RESET_STREAM */
int start; /* base timestamp for http-request timeout */
+
+ struct {
+ struct tot_time base; /* total QCS lifetime */
+ struct tot_time buf; /* stream to QCS send blocked on buffer */
+ struct tot_time fctl; /* stream to QCS send blocked on flow-control */
+ } timer;
};
/* Used as qcc_app_ops.close callback argument. */
qcs->err = 0;
+ /* Reset all timers and start base one. */
+ tot_time_reset(&qcs->timer.base);
+ tot_time_reset(&qcs->timer.buf);
+ tot_time_reset(&qcs->timer.fctl);
+ tot_time_start(&qcs->timer.base);
+
qcs->sd = sedesc_new();
if (!qcs->sd)
goto err;
if (!LIST_ISEMPTY(&qcc->buf_wait_list)) {
qcs = LIST_ELEM(qcc->buf_wait_list.n, struct qcs *, el_buf);
LIST_DEL_INIT(&qcs->el_buf);
+ tot_time_stop(&qcs->timer.buf);
qcs_notify_send(qcs);
ret = 1;
}
if (!out) {
if (qcc->flags & QC_CF_CONN_FULL) {
LIST_APPEND(&qcc->buf_wait_list, &qcs->el_buf);
+ tot_time_start(&qcs->timer.buf);
goto out;
}
TRACE_STATE("hitting stream desc buffer limit", QMUX_EV_QCS_SEND, qcc->conn, qcs);
LIST_APPEND(&qcc->buf_wait_list, &qcs->el_buf);
+ tot_time_start(&qcs->timer.buf);
qcc->flags |= QC_CF_CONN_FULL;
goto out;
}
while (!LIST_ISEMPTY(&qcc->fctl_list)) {
qcs = LIST_ELEM(qcc->fctl_list.n, struct qcs *, el_fctl);
LIST_DEL_INIT(&qcs->el_fctl);
+ tot_time_stop(&qcs->timer.fctl);
qcs_notify_send(qcs);
}
}
tasklet_wakeup(qcc->wait_event.tasklet);
}
- if (unblock_soft)
+ if (unblock_soft) {
+ tot_time_stop(&qcs->timer.fctl);
qcs_notify_send(qcs);
+ }
}
}
TRACE_DEVEL("append to fctl-list",
QMUX_EV_STRM_SEND, qcs->qcc->conn, qcs);
LIST_APPEND(&qcs->qcc->fctl_list, &qcs->el_fctl);
+ tot_time_start(&qcs->timer.fctl);
}
goto end;
}
if (qfctl_sblocked(&qcs->tx.fc)) {
TRACE_DEVEL("leaving on flow-control reached",
QMUX_EV_STRM_SEND, qcs->qcc->conn, qcs);
+ tot_time_start(&qcs->timer.fctl);
goto end;
}
chunk_appendf(msg, " .tx=%llu %llu/%llu", (ullong)qcs->tx.fc.off_soft,
(ullong)qcs->tx.fc.off_real,
(ullong)qcs->tx.fc.limit);
+
+ chunk_appendf(msg, " .ti=%u/%u/%u",
+ tot_time_read(&qcs->timer.base),
+ tot_time_read(&qcs->timer.buf),
+ tot_time_read(&qcs->timer.fctl));
}