mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-09 16:47:18 +02:00
MINOR: channel/buffer: use c_realign_if_empty() instead of buffer_realign()
This patch removes buffer_realign() and replaces it with c_realign_if_empty() instead.
This commit is contained in:
parent
08d5ac8f27
commit
d5b343bf9e
@ -394,15 +394,6 @@ static inline void bi_fast_delete(struct buffer *buf, int n)
|
|||||||
buf->p += n;
|
buf->p += n;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Tries to realign the given buffer. */
|
|
||||||
static inline void buffer_realign(struct buffer *buf)
|
|
||||||
{
|
|
||||||
if (!(buf->i | buf->o)) {
|
|
||||||
/* let's realign the buffer to optimize I/O */
|
|
||||||
buf->p = buf->data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Schedule all remaining buffer data to be sent. ->o is not touched if it
|
/* Schedule all remaining buffer data to be sent. ->o is not touched if it
|
||||||
* already covers those data. That permits doing a flush even after a forward,
|
* already covers those data. That permits doing a flush even after a forward,
|
||||||
* although not recommended.
|
* although not recommended.
|
||||||
|
@ -91,7 +91,7 @@ int co_inject(struct channel *chn, const char *msg, int len)
|
|||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer_realign(chn->buf);
|
c_realign_if_empty(chn);
|
||||||
max = bo_contig_space(chn->buf);
|
max = bo_contig_space(chn->buf);
|
||||||
if (len > max)
|
if (len > max)
|
||||||
return max;
|
return max;
|
||||||
|
@ -8318,7 +8318,7 @@ void http_reset_txn(struct stream *s)
|
|||||||
s->res.buf->i = 0;
|
s->res.buf->i = 0;
|
||||||
|
|
||||||
/* Now we can realign the response buffer */
|
/* Now we can realign the response buffer */
|
||||||
buffer_realign(s->res.buf);
|
c_realign_if_empty(&s->res);
|
||||||
|
|
||||||
s->req.rto = strm_fe(s)->timeout.client;
|
s->req.rto = strm_fe(s)->timeout.client;
|
||||||
s->req.wto = TICK_ETERNITY;
|
s->req.wto = TICK_ETERNITY;
|
||||||
|
Loading…
Reference in New Issue
Block a user