mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 15:17:01 +02:00
MEDIUM: dynbuf: generalize the use of b_dequeue() to detach buffer_wait
Now thanks to this the bufq_map field is expected to remain accurate.
This commit is contained in:
parent
f70bd5fad1
commit
f5566afec6
@ -121,8 +121,7 @@ static inline void __appctx_free(struct appctx *appctx)
|
|||||||
appctx_release_buf(appctx, &appctx->outbuf);
|
appctx_release_buf(appctx, &appctx->outbuf);
|
||||||
|
|
||||||
task_destroy(appctx->t);
|
task_destroy(appctx->t);
|
||||||
if (LIST_INLIST(&appctx->buffer_wait.list))
|
b_dequeue(&appctx->buffer_wait);
|
||||||
LIST_DEL_INIT(&appctx->buffer_wait.list);
|
|
||||||
if (appctx->sess)
|
if (appctx->sess)
|
||||||
session_free(appctx->sess);
|
session_free(appctx->sess);
|
||||||
BUG_ON(appctx->sedesc && !se_fl_test(appctx->sedesc, SE_FL_ORPHAN));
|
BUG_ON(appctx->sedesc && !se_fl_test(appctx->sedesc, SE_FL_ORPHAN));
|
||||||
|
@ -405,8 +405,7 @@ void appctx_shut(struct appctx *appctx)
|
|||||||
appctx->applet->release(appctx);
|
appctx->applet->release(appctx);
|
||||||
applet_fl_set(appctx, APPCTX_FL_SHUTDOWN);
|
applet_fl_set(appctx, APPCTX_FL_SHUTDOWN);
|
||||||
|
|
||||||
if (LIST_INLIST(&appctx->buffer_wait.list))
|
b_dequeue(&appctx->buffer_wait);
|
||||||
LIST_DEL_INIT(&appctx->buffer_wait.list);
|
|
||||||
|
|
||||||
TRACE_LEAVE(APPLET_EV_RELEASE, appctx);
|
TRACE_LEAVE(APPLET_EV_RELEASE, appctx);
|
||||||
}
|
}
|
||||||
|
@ -1415,8 +1415,7 @@ struct task *process_chk_conn(struct task *t, void *context, unsigned int state)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LIST_INLIST(&check->buf_wait.list))
|
b_dequeue(&check->buf_wait);
|
||||||
LIST_DEL_INIT(&check->buf_wait.list);
|
|
||||||
|
|
||||||
check_release_buf(check, &check->bi);
|
check_release_buf(check, &check->bi);
|
||||||
check_release_buf(check, &check->bo);
|
check_release_buf(check, &check->bo);
|
||||||
|
@ -2852,8 +2852,7 @@ spoe_acquire_buffer(struct buffer *buf, struct buffer_wait *buffer_wait)
|
|||||||
if (buf->size)
|
if (buf->size)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (LIST_INLIST(&buffer_wait->list))
|
b_dequeue(buffer_wait);
|
||||||
LIST_DEL_INIT(&buffer_wait->list);
|
|
||||||
|
|
||||||
if (b_alloc(buf, DB_CHANNEL))
|
if (b_alloc(buf, DB_CHANNEL))
|
||||||
return 1;
|
return 1;
|
||||||
@ -2865,8 +2864,7 @@ spoe_acquire_buffer(struct buffer *buf, struct buffer_wait *buffer_wait)
|
|||||||
static void
|
static void
|
||||||
spoe_release_buffer(struct buffer *buf, struct buffer_wait *buffer_wait)
|
spoe_release_buffer(struct buffer *buf, struct buffer_wait *buffer_wait)
|
||||||
{
|
{
|
||||||
if (LIST_INLIST(&buffer_wait->list))
|
b_dequeue(buffer_wait);
|
||||||
LIST_DEL_INIT(&buffer_wait->list);
|
|
||||||
|
|
||||||
/* Release the buffer if needed */
|
/* Release the buffer if needed */
|
||||||
if (buf->size) {
|
if (buf->size) {
|
||||||
|
@ -753,8 +753,7 @@ static void fcgi_release(struct fcgi_conn *fconn)
|
|||||||
|
|
||||||
TRACE_POINT(FCGI_EV_FCONN_END);
|
TRACE_POINT(FCGI_EV_FCONN_END);
|
||||||
|
|
||||||
if (LIST_INLIST(&fconn->buf_wait.list))
|
b_dequeue(&fconn->buf_wait);
|
||||||
LIST_DEL_INIT(&fconn->buf_wait.list);
|
|
||||||
|
|
||||||
fcgi_release_buf(fconn, &fconn->dbuf);
|
fcgi_release_buf(fconn, &fconn->dbuf);
|
||||||
fcgi_release_mbuf(fconn);
|
fcgi_release_mbuf(fconn);
|
||||||
|
@ -1238,9 +1238,7 @@ static void h1_release(struct h1c *h1c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (LIST_INLIST(&h1c->buf_wait.list))
|
b_dequeue(&h1c->buf_wait);
|
||||||
LIST_DEL_INIT(&h1c->buf_wait.list);
|
|
||||||
|
|
||||||
h1_release_buf(h1c, &h1c->ibuf);
|
h1_release_buf(h1c, &h1c->ibuf);
|
||||||
h1_release_buf(h1c, &h1c->obuf);
|
h1_release_buf(h1c, &h1c->obuf);
|
||||||
|
|
||||||
|
@ -1193,8 +1193,7 @@ static void h2_release(struct h2c *h2c)
|
|||||||
|
|
||||||
hpack_dht_free(h2c->ddht);
|
hpack_dht_free(h2c->ddht);
|
||||||
|
|
||||||
if (LIST_INLIST(&h2c->buf_wait.list))
|
b_dequeue(&h2c->buf_wait);
|
||||||
LIST_DEL_INIT(&h2c->buf_wait.list);
|
|
||||||
|
|
||||||
h2_release_buf(h2c, &h2c->dbuf);
|
h2_release_buf(h2c, &h2c->dbuf);
|
||||||
h2_release_mbuf(h2c);
|
h2_release_mbuf(h2c);
|
||||||
|
@ -632,8 +632,7 @@ void stream_free(struct stream *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* We may still be present in the buffer wait queue */
|
/* We may still be present in the buffer wait queue */
|
||||||
if (LIST_INLIST(&s->buffer_wait.list))
|
b_dequeue(&s->buffer_wait);
|
||||||
LIST_DEL_INIT(&s->buffer_wait.list);
|
|
||||||
|
|
||||||
if (s->req.buf.size || s->res.buf.size) {
|
if (s->req.buf.size || s->res.buf.size) {
|
||||||
int count = !!s->req.buf.size + !!s->res.buf.size;
|
int count = !!s->req.buf.size + !!s->res.buf.size;
|
||||||
|
Loading…
Reference in New Issue
Block a user