MINOR: buffer: add b_del() to delete a number of characters
This will be used by code which directly parses buffers with no channel in the middle (eg: h2, might be used by checks as well).
This commit is contained in:
parent
36eb3a3ac8
commit
4a6425d373
|
@ -79,6 +79,17 @@ void buffer_slow_realign(struct buffer *buf);
|
|||
__ret; \
|
||||
})
|
||||
|
||||
/* Skips <del> bytes in a one-way buffer <b> : <p> advances by <del>, <i>
|
||||
* shrinks by <del> as well, and <o> is left untouched (supposed to be zero).
|
||||
* The caller is responsible for ensuring that <del> is always smaller than or
|
||||
* equal to b->i.
|
||||
*/
|
||||
static inline void b_del(struct buffer *b, unsigned int del)
|
||||
{
|
||||
b->i -= del;
|
||||
b->p = b_ptr(b, del);
|
||||
}
|
||||
|
||||
/* Advances the buffer by <adv> bytes, which means that the buffer
|
||||
* pointer advances, and that as many bytes from in are transferred
|
||||
* to out. The caller is responsible for ensuring that adv is always
|
||||
|
|
Loading…
Reference in New Issue