mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-30 07:11:04 +01:00
MEDIUM: channel: make buffer_reserved() use channel_in_transit()
This ensures that we rely on a sane computation for the buffer size.
This commit is contained in:
parent
1a4484dec8
commit
fe57834955
@ -287,16 +287,11 @@ static inline void channel_dont_read(struct channel *chn)
|
|||||||
*/
|
*/
|
||||||
static inline int buffer_reserved(const struct channel *chn)
|
static inline int buffer_reserved(const struct channel *chn)
|
||||||
{
|
{
|
||||||
unsigned int reserved = global.tune.maxrewrite;
|
int reserved;
|
||||||
|
|
||||||
if (chn->to_forward == CHN_INFINITE_FORWARD ||
|
reserved = global.tune.maxrewrite - channel_in_transit(chn);
|
||||||
chn->to_forward >= reserved ||
|
if (reserved < 0)
|
||||||
chn->buf->o >= reserved ||
|
|
||||||
chn->to_forward + chn->buf->o >= reserved)
|
|
||||||
reserved = 0;
|
reserved = 0;
|
||||||
else
|
|
||||||
reserved -= chn->to_forward + chn->buf->o;
|
|
||||||
|
|
||||||
return reserved;
|
return reserved;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user