summaryrefslogtreecommitdiffstats
path: root/src/check.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 05:11:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 05:11:10 +0000
commitcff6d757e3ba609c08ef2aaa00f07e53551e5bf6 (patch)
tree08c4fc3255483ad397d712edb4214ded49149fd9 /src/check.c
parentAdding upstream version 2.9.7. (diff)
downloadhaproxy-cff6d757e3ba609c08ef2aaa00f07e53551e5bf6.tar.xz
haproxy-cff6d757e3ba609c08ef2aaa00f07e53551e5bf6.zip
Adding upstream version 3.0.0.upstream/3.0.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/check.c')
-rw-r--r--src/check.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/check.c b/src/check.c
index 2753c93..64464c4 100644
--- a/src/check.c
+++ b/src/check.c
@@ -1031,9 +1031,9 @@ int httpchk_build_status_header(struct server *s, struct buffer *buf)
s->queue.length);
if ((s->cur_state == SRV_ST_STARTING) &&
- ns_to_sec(now_ns) < s->last_change + s->slowstart &&
- ns_to_sec(now_ns) >= s->last_change) {
- ratio = MAX(1, 100 * (ns_to_sec(now_ns) - s->last_change) / s->slowstart);
+ ns_to_sec(now_ns) < s->counters.last_change + s->slowstart &&
+ ns_to_sec(now_ns) >= s->counters.last_change) {
+ ratio = MAX(1, 100 * (ns_to_sec(now_ns) - s->counters.last_change) / s->slowstart);
chunk_appendf(buf, "; throttle=%d%%", ratio);
}
@@ -1382,7 +1382,7 @@ struct task *process_chk_conn(struct task *t, void *context, unsigned int state)
* as a failed response coupled with "observe layer7" caused the
* server state to be suddenly changed.
*/
- sc_conn_drain_and_shut(sc);
+ se_shutdown(sc->sedesc, SE_SHR_DRAIN|SE_SHW_SILENT);
}
if (sc) {
@@ -1415,8 +1415,7 @@ struct task *process_chk_conn(struct task *t, void *context, unsigned int state)
}
}
- if (LIST_INLIST(&check->buf_wait.list))
- LIST_DEL_INIT(&check->buf_wait.list);
+ b_dequeue(&check->buf_wait);
check_release_buf(check, &check->bi);
check_release_buf(check, &check->bo);
@@ -1505,13 +1504,13 @@ int check_buf_available(void *target)
BUG_ON(!check->sc);
- if ((check->state & CHK_ST_IN_ALLOC) && b_alloc(&check->bi)) {
+ if ((check->state & CHK_ST_IN_ALLOC) && b_alloc(&check->bi, DB_CHANNEL)) {
TRACE_STATE("unblocking check, input buffer allocated", CHK_EV_TCPCHK_EXP|CHK_EV_RX_BLK, check);
check->state &= ~CHK_ST_IN_ALLOC;
tasklet_wakeup(check->sc->wait_event.tasklet);
return 1;
}
- if ((check->state & CHK_ST_OUT_ALLOC) && b_alloc(&check->bo)) {
+ if ((check->state & CHK_ST_OUT_ALLOC) && b_alloc(&check->bo, DB_CHANNEL)) {
TRACE_STATE("unblocking check, output buffer allocated", CHK_EV_TCPCHK_SND|CHK_EV_TX_BLK, check);
check->state &= ~CHK_ST_OUT_ALLOC;
tasklet_wakeup(check->sc->wait_event.tasklet);
@@ -1529,10 +1528,8 @@ struct buffer *check_get_buf(struct check *check, struct buffer *bptr)
struct buffer *buf = NULL;
if (likely(!LIST_INLIST(&check->buf_wait.list)) &&
- unlikely((buf = b_alloc(bptr)) == NULL)) {
- check->buf_wait.target = check;
- check->buf_wait.wakeup_cb = check_buf_available;
- LIST_APPEND(&th_ctx->buffer_wq, &check->buf_wait.list);
+ unlikely((buf = b_alloc(bptr, DB_CHANNEL)) == NULL)) {
+ b_queue(DB_CHANNEL, &check->buf_wait, check, check_buf_available);
}
return buf;
}