diff options
| author | Garrett D'Amore <garrett@damore.org> | 2020-01-21 07:32:59 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2020-01-21 07:32:59 -0800 |
| commit | f7800d315d657d7a702c040d8e3b295d0584b59c (patch) | |
| tree | 941b246eeebee033b0ff29ececfe06d282baf746 | |
| parent | 38c005e7c07b5ccaab3345dc8c66cbc27b95692a (diff) | |
| download | nng-f7800d315d657d7a702c040d8e3b295d0584b59c.tar.gz nng-f7800d315d657d7a702c040d8e3b295d0584b59c.tar.bz2 nng-f7800d315d657d7a702c040d8e3b295d0584b59c.zip | |
fixes #1141 nng_http_client_transact(), chunked encoding
| -rw-r--r-- | docs/man/nng_http_client_transact.3http.adoc | 7 | ||||
| -rw-r--r-- | include/nng/supplemental/http/http.h | 12 |
2 files changed, 6 insertions, 13 deletions
diff --git a/docs/man/nng_http_client_transact.3http.adoc b/docs/man/nng_http_client_transact.3http.adoc index be65c2c0..0585fa7e 100644 --- a/docs/man/nng_http_client_transact.3http.adoc +++ b/docs/man/nng_http_client_transact.3http.adoc @@ -1,6 +1,6 @@ = nng_http_client_transact(3http) // -// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2020 Staysail Systems, Inc. <info@staysail.tech> // Copyright 2018 Capitar IT Group BV <info@capitar.com> // // This document is supplied under the terms of the MIT License, a @@ -46,11 +46,6 @@ exists. That function behaves similarily, but uses an existing connection, which can be reused. -NOTE: This function does not support reading data sent using chunked -transfer encoding, and if the server attempts to do so, the underlying -connection will be closed and an `NNG_ENOTSUP` error will be returned. -This limitation is considered a bug, and a fix is planned for the future. - WARNING: If the remote server tries to send an extremely large buffer, then a corresponding allocation will be made, which can lead to denial of service attacks. diff --git a/include/nng/supplemental/http/http.h b/include/nng/supplemental/http/http.h index e0cbd501..cdd9b25f 100644 --- a/include/nng/supplemental/http/http.h +++ b/include/nng/supplemental/http/http.h @@ -1,5 +1,5 @@ // -// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2020 Staysail Systems, Inc. <info@staysail.tech> // Copyright 2018 Capitar IT Group BV <info@capitar.com> // // This software is supplied under the terms of the MIT License, a @@ -182,7 +182,7 @@ NNG_DECL int nng_http_res_set_status(nng_http_res *, uint16_t); // that the server responds (or responded) with. NNG_DECL const char *nng_http_res_get_reason(nng_http_res *); -// nng_http_res_set_rason sets the human readable status message. +// nng_http_res_set_reason sets the human readable status message. // NULL means that a default reason is used based on the status code. NNG_DECL int nng_http_res_set_reason(nng_http_res *, const char *); @@ -367,15 +367,15 @@ NNG_DECL int nng_http_handler_set_host(nng_http_handler *, const char *); NNG_DECL int nng_http_handler_collect_body(nng_http_handler *, bool, size_t); // nng_http_handler_set_tree indicates that the handler is being registered -// for a heirarchical tree, rather than just a single path, so it will be +// for a hierarchical tree, rather than just a single path, so it will be // called for all child paths supplied. By default the handler is only // called for an exact path match. NNG_DECL int nng_http_handler_set_tree(nng_http_handler *); // nng_http_handler_set_data is used to store additional data, along with -// a possible clean up routine. (The clean up is a custom deallocator and +// a possible clean up routine. (The clean up is a custom de-allocator and // will be called with the supplied data as an argument, when the handler -// is being deallocated.) +// is being de-allocated.) NNG_DECL int nng_http_handler_set_data( nng_http_handler *, void *, void (*)(void *)); @@ -514,8 +514,6 @@ NNG_DECL void nng_http_client_connect(nng_http_client *, nng_aio *); // single HTTP transaction). It will not automatically close the connection, // unless some kind of significant error occurs. The caller should close // the connection if the aio does not complete successfully. -// Note that this will fail with NNG_ENOTSUP if the server attempts to reply -// with a chunked transfer encoding. NNG_DECL void nng_http_conn_transact( nng_http_conn *, nng_http_req *, nng_http_res *, nng_aio *); |
