diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-12-27 16:32:33 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-12-27 16:32:33 -0800 |
| commit | 5ff3d3d3ab82be4b2171e06f1def9cdddaef4115 (patch) | |
| tree | 028fff3d0dbcbec741406541931029c106bae465 /src/supplemental/http/http_msg.c | |
| parent | eb1f8db4ed87867f0f08afba79253e3981db9c88 (diff) | |
| download | nng-5ff3d3d3ab82be4b2171e06f1def9cdddaef4115.tar.gz nng-5ff3d3d3ab82be4b2171e06f1def9cdddaef4115.tar.bz2 nng-5ff3d3d3ab82be4b2171e06f1def9cdddaef4115.zip | |
fixes #180 add websocket header properties
Diffstat (limited to 'src/supplemental/http/http_msg.c')
| -rw-r--r-- | src/supplemental/http/http_msg.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/supplemental/http/http_msg.c b/src/supplemental/http/http_msg.c index 2e245868..8b3c6a7c 100644 --- a/src/supplemental/http/http_msg.c +++ b/src/supplemental/http/http_msg.c @@ -520,6 +520,32 @@ http_res_prepare(nni_http_res *res) return (rv); } +char * +nni_http_req_headers(nni_http_req *req) +{ + char * s; + size_t len; + + len = http_sprintf_headers(NULL, 0, &req->hdrs) + 1; + if ((s = nni_alloc(len)) != NULL) { + http_sprintf_headers(s, len, &req->hdrs); + } + return (s); +} + +char * +nni_http_res_headers(nni_http_res *res) +{ + char * s; + size_t len; + + len = http_sprintf_headers(NULL, 0, &res->hdrs) + 1; + if ((s = nni_alloc(len)) != NULL) { + http_sprintf_headers(s, len, &res->hdrs); + } + return (s); +} + int nni_http_req_get_buf(nni_http_req *req, void **data, size_t *szp) { |
