forked from mirrors/kore
add kore_buf_appendb() which allows us to append a kore_buf to another one.
(releases the kore_buf that is being appended while at it).
This commit is contained in:
parent
a74fffe40c
commit
b4deea82b4
|
@ -181,6 +181,7 @@ void kore_buf_append(struct kore_buf *, u_int8_t *, u_int32_t);
|
|||
u_int8_t *kore_buf_release(struct kore_buf *, u_int32_t *);
|
||||
void kore_buf_appendf(struct kore_buf *, const char *, ...);
|
||||
void kore_buf_appendv(struct kore_buf *, struct buf_vec *, u_int16_t);
|
||||
void kore_buf_appendb(struct kore_buf *, struct kore_buf *);
|
||||
|
||||
struct spdy_header_block *spdy_header_block_create(int);
|
||||
struct spdy_stream *spdy_stream_lookup(struct connection *, u_int32_t);
|
||||
|
|
10
src/buf.c
10
src/buf.c
|
@ -62,6 +62,16 @@ kore_buf_append(struct kore_buf *buf, u_int8_t *d, u_int32_t len)
|
|||
buf->offset += len;
|
||||
}
|
||||
|
||||
void
|
||||
kore_buf_appendb(struct kore_buf *buf, struct kore_buf *src)
|
||||
{
|
||||
u_int8_t *d;
|
||||
u_int32_t len;
|
||||
|
||||
d = kore_buf_release(src, &len);
|
||||
kore_buf_append(buf, d, len);
|
||||
}
|
||||
|
||||
void
|
||||
kore_buf_appendv(struct kore_buf *buf, struct buf_vec *v, u_int16_t count)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue