From 0cc96c69b3fce09a9c4a8d467d17cfbda76bc02f Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Thu, 30 Aug 2018 14:23:39 -0700 Subject: fixes #681 HTTP convenience GET method desired... This adds a couple of new methods, and related documentation and test cases. --- src/supplemental/http/http_msg.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/supplemental/http/http_msg.c') diff --git a/src/supplemental/http/http_msg.c b/src/supplemental/http/http_msg.c index d6ab862e..dcd842c5 100644 --- a/src/supplemental/http/http_msg.c +++ b/src/supplemental/http/http_msg.c @@ -399,6 +399,20 @@ nni_http_res_copy_data(nni_http_res *res, const void *data, size_t size) return (0); } +// nni_http_res_alloc_data allocates the data region, but does not update any +// headers. The intended use is for client implementations that want to +// allocate a buffer to receive the entity into. +int +nni_http_res_alloc_data(nni_http_res *res, size_t size) +{ + int rv; + + if ((rv = http_entity_alloc_data(&res->data, size)) != 0) { + return (rv); + } + return (0); +} + bool nni_http_res_is_error(nni_http_res *res) { -- cgit v1.2.3-70-g09d2