mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 23:27:04 +02:00
MINOR: mux-quic: refactor timeout code
This commit is a small reorganization of condition used into qcc_refresh_timeout(). Its objective is to render the code more logical before the next patch which will ensure that timeout is properly set for backend connections.
This commit is contained in:
parent
558532fc57
commit
95cb763cd6
@ -316,8 +316,8 @@ static void qcc_refresh_timeout(struct qcc *qcc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Frontend timeout management
|
/* Frontend timeout management
|
||||||
* - shutdown done -> timeout client-fin
|
|
||||||
* - detached streams with data left to send -> default timeout
|
* - detached streams with data left to send -> default timeout
|
||||||
|
* - shutdown done -> timeout client-fin
|
||||||
* - stream waiting on incomplete request or no stream yet activated -> timeout http-request
|
* - stream waiting on incomplete request or no stream yet activated -> timeout http-request
|
||||||
* - idle after stream processing -> timeout http-keep-alive
|
* - idle after stream processing -> timeout http-keep-alive
|
||||||
*
|
*
|
||||||
@ -329,8 +329,12 @@ static void qcc_refresh_timeout(struct qcc *qcc)
|
|||||||
TRACE_DEVEL("pending output data", QMUX_EV_QCC_WAKE, qcc->conn);
|
TRACE_DEVEL("pending output data", QMUX_EV_QCC_WAKE, qcc->conn);
|
||||||
qcc->task->expire = tick_add_ifset(now_ms, qcc->timeout);
|
qcc->task->expire = tick_add_ifset(now_ms, qcc->timeout);
|
||||||
}
|
}
|
||||||
else if ((!LIST_ISEMPTY(&qcc->opening_list) || unlikely(!qcc->largest_bidi_r)) &&
|
else if (qcc->app_st >= QCC_APP_ST_SHUT) {
|
||||||
qcc->app_st < QCC_APP_ST_SHUT) {
|
TRACE_DEVEL("connection in closing", QMUX_EV_QCC_WAKE, qcc->conn);
|
||||||
|
qcc->task->expire = tick_add_ifset(now_ms,
|
||||||
|
qcc->shut_timeout);
|
||||||
|
}
|
||||||
|
else if (!LIST_ISEMPTY(&qcc->opening_list) || unlikely(!qcc->largest_bidi_r)) {
|
||||||
int timeout = px->timeout.httpreq;
|
int timeout = px->timeout.httpreq;
|
||||||
struct qcs *qcs = NULL;
|
struct qcs *qcs = NULL;
|
||||||
int base_time;
|
int base_time;
|
||||||
@ -346,18 +350,11 @@ static void qcc_refresh_timeout(struct qcc *qcc)
|
|||||||
qcc->task->expire = tick_add_ifset(base_time, timeout);
|
qcc->task->expire = tick_add_ifset(base_time, timeout);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (qcc->app_st >= QCC_APP_ST_SHUT) {
|
/* Use http-request timeout if keep-alive timeout not set */
|
||||||
TRACE_DEVEL("connection in closing", QMUX_EV_QCC_WAKE, qcc->conn);
|
int timeout = tick_isset(px->timeout.httpka) ?
|
||||||
qcc->task->expire = tick_add_ifset(now_ms,
|
px->timeout.httpka : px->timeout.httpreq;
|
||||||
qcc->shut_timeout);
|
TRACE_DEVEL("at least one request achieved but none currently in progress", QMUX_EV_QCC_WAKE, qcc->conn);
|
||||||
}
|
qcc->task->expire = tick_add_ifset(qcc->idle_start, timeout);
|
||||||
else {
|
|
||||||
/* Use http-request timeout if keep-alive timeout not set */
|
|
||||||
int timeout = tick_isset(px->timeout.httpka) ?
|
|
||||||
px->timeout.httpka : px->timeout.httpreq;
|
|
||||||
TRACE_DEVEL("at least one request achieved but none currently in progress", QMUX_EV_QCC_WAKE, qcc->conn);
|
|
||||||
qcc->task->expire = tick_add_ifset(qcc->idle_start, timeout);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user