mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 22:01:31 +02:00
BUG/MEDIUM: stats: Require more room if buffer is almost full
This was lost with commit f4258bdf3 ("MINOR: stats: Use the applet API to write data"). When the buffer is almost full, the stats applet gives up. When this happens, the applet must require more room. Otherwise, data in the channel buffer are sent to the client but the applet is not woken up in return. It is a 2.8-specific bug, no backport needed.
This commit is contained in:
parent
557146ccc8
commit
a236c58223
16
src/stats.c
16
src/stats.c
@ -3228,13 +3228,17 @@ more:
|
|||||||
/* obj2 points to listeners list as initialized above */
|
/* obj2 points to listeners list as initialized above */
|
||||||
for (; ctx->obj2 != &px->conf.listeners; ctx->obj2 = l->by_fe.n) {
|
for (; ctx->obj2 != &px->conf.listeners; ctx->obj2 = l->by_fe.n) {
|
||||||
if (htx) {
|
if (htx) {
|
||||||
if (htx_almost_full(htx))
|
if (htx_almost_full(htx)) {
|
||||||
|
sc_need_room(sc, htx->size / 2);
|
||||||
goto full;
|
goto full;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
if (buffer_almost_full(&rep->buf))
|
if (buffer_almost_full(&rep->buf)) {
|
||||||
|
sc_need_room(sc, b_size(&rep->buf) / 2);
|
||||||
goto full;
|
goto full;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
l = LIST_ELEM(ctx->obj2, struct listener *, by_fe);
|
l = LIST_ELEM(ctx->obj2, struct listener *, by_fe);
|
||||||
if (!l->counters)
|
if (!l->counters)
|
||||||
@ -3294,13 +3298,17 @@ more:
|
|||||||
srv_take(sv);
|
srv_take(sv);
|
||||||
|
|
||||||
if (htx) {
|
if (htx) {
|
||||||
if (htx_almost_full(htx))
|
if (htx_almost_full(htx)) {
|
||||||
|
sc_need_room(sc, htx->size / 2);
|
||||||
goto full;
|
goto full;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
if (buffer_almost_full(&rep->buf))
|
if (buffer_almost_full(&rep->buf)) {
|
||||||
|
sc_need_room(sc, b_size(&rep->buf) / 2);
|
||||||
goto full;
|
goto full;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (ctx->flags & STAT_BOUND) {
|
if (ctx->flags & STAT_BOUND) {
|
||||||
if (!(ctx->type & (1 << STATS_TYPE_SV))) {
|
if (!(ctx->type & (1 << STATS_TYPE_SV))) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user