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:
Willy Tarreau 2018-06-06 06:42:46 +02:00
parent 08d5ac8f27
commit d5b343bf9e
3 changed files with 2 additions and 11 deletions

View File

@ -394,15 +394,6 @@ static inline void bi_fast_delete(struct buffer *buf, int 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
* already covers those data. That permits doing a flush even after a forward,
* although not recommended.

View File

@ -91,7 +91,7 @@ int co_inject(struct channel *chn, const char *msg, int len)
return -2;
}
buffer_realign(chn->buf);
c_realign_if_empty(chn);
max = bo_contig_space(chn->buf);
if (len > max)
return max;

View File

@ -8318,7 +8318,7 @@ void http_reset_txn(struct stream *s)
s->res.buf->i = 0;
/* 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.wto = TICK_ETERNITY;