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:
Joris Vink 2013-06-05 11:27:03 +02:00
parent a74fffe40c
commit b4deea82b4
2 changed files with 11 additions and 0 deletions

View File

@ -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);

View File

@ -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)
{