diff --git a/includes/kore.h b/includes/kore.h index 484727e..41e6180 100644 --- a/includes/kore.h +++ b/includes/kore.h @@ -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); diff --git a/src/buf.c b/src/buf.c index d6e2c3c..fa1547b 100644 --- a/src/buf.c +++ b/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) {