mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-02 11:33:21 +00:00
CLEANUP: buffers: remove unused function buffer_contig_space_with_res()
This function is now unused and was dangerous. Its cousin buffer_contig_space_res() was removed as well since it was the only one to use it.
This commit is contained in:
parent
285ff0f25a
commit
5a8ba60fe1
@ -228,29 +228,6 @@ static inline int buffer_contig_space(const struct buffer *buf)
|
||||
return right - left;
|
||||
}
|
||||
|
||||
/* Return the amount of bytes that can be written into the buffer at once,
|
||||
* excluding the amount of reserved space passed in <res>, which is
|
||||
* preserved.
|
||||
*/
|
||||
static inline int buffer_contig_space_with_res(const struct buffer *buf, int res)
|
||||
{
|
||||
/* Proceed differently if the buffer is full, partially used or empty.
|
||||
* The hard situation is when it's partially used and either data or
|
||||
* reserved space wraps at the end.
|
||||
*/
|
||||
int spare = buf->size - res;
|
||||
|
||||
if (buffer_len(buf) >= spare)
|
||||
spare = 0;
|
||||
else if (buffer_len(buf)) {
|
||||
spare = buffer_contig_space(buf) - res;
|
||||
if (spare < 0)
|
||||
spare = 0;
|
||||
}
|
||||
return spare;
|
||||
}
|
||||
|
||||
|
||||
/* Normalizes a pointer which is supposed to be relative to the beginning of a
|
||||
* buffer, so that wrapping is correctly handled. The intent is to use this
|
||||
* when increasing a pointer. Note that the wrapping test is only performed
|
||||
|
@ -280,14 +280,6 @@ static inline int buffer_max_len(const struct channel *chn)
|
||||
return chn->buf->size - buffer_reserved(chn);
|
||||
}
|
||||
|
||||
/* Return the amount of bytes that can be written into the buffer at once,
|
||||
* excluding reserved space, which is preserved.
|
||||
*/
|
||||
static inline int buffer_contig_space_res(const struct channel *chn)
|
||||
{
|
||||
return buffer_contig_space_with_res(chn->buf, buffer_reserved(chn));
|
||||
}
|
||||
|
||||
/* Returns the amount of space available at the input of the buffer, taking the
|
||||
* reserved space into account if ->to_forward indicates that an end of transfer
|
||||
* is close to happen. The test is optimized to avoid as many operations as
|
||||
|
Loading…
Reference in New Issue
Block a user