diff options
Diffstat (limited to 'src/c/libunit-wasm.c')
-rw-r--r-- | src/c/libunit-wasm.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/c/libunit-wasm.c b/src/c/libunit-wasm.c index 28d5906..fdf9499 100644 --- a/src/c/libunit-wasm.c +++ b/src/c/libunit-wasm.c @@ -304,6 +304,17 @@ void luw_req_buf_append(luw_ctx_t *ctx, const u8 *src) ctx->req->total_content_sent = req->total_content_sent; } +/* Copy data from the request to the previously setup request_buffer. */ +void luw_req_buf_copy(luw_ctx_t *ctx, const u8 *src) +{ + struct luw_req *req = (struct luw_req *)src; + + memcpy(ctx->reqp + ctx->req->content_off, src + req->content_off, + req->request_size); + ctx->req->content_sent = req->content_sent; + ctx->req->total_content_sent = req->total_content_sent; +} + /* * Convenience function to fill the response buffer with data from * the request buffer. |