summaryrefslogtreecommitdiffstats
path: root/contrib/serf/buckets/simple_buckets.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/serf/buckets/simple_buckets.c')
-rw-r--r--contrib/serf/buckets/simple_buckets.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/contrib/serf/buckets/simple_buckets.c b/contrib/serf/buckets/simple_buckets.c
index f36239b..7ce7aeb 100644
--- a/contrib/serf/buckets/simple_buckets.c
+++ b/contrib/serf/buckets/simple_buckets.c
@@ -71,6 +71,23 @@ serf_bucket_t *serf_bucket_simple_copy_create(
return serf_bucket_create(&serf_bucket_type_simple, allocator, ctx);
}
+serf_bucket_t *serf_bucket_simple_own_create(
+ const char *data, apr_size_t len,
+ serf_bucket_alloc_t *allocator)
+{
+ simple_context_t *ctx;
+
+ ctx = serf_bucket_mem_alloc(allocator, sizeof(*ctx));
+
+ ctx->original = ctx->current = data;
+
+ ctx->remaining = len;
+ ctx->freefunc = free_copied_data;
+ ctx->baton = allocator;
+
+ return serf_bucket_create(&serf_bucket_type_simple, allocator, ctx);
+}
+
static apr_status_t serf_simple_read(serf_bucket_t *bucket,
apr_size_t requested,
const char **data, apr_size_t *len)
OpenPOWER on IntegriCloud