diff options
| author | Garrett D'Amore <garrett@damore.org> | 2025-01-12 08:07:20 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2025-01-12 08:07:20 -0800 |
| commit | d87b873ea5bbdae1352b2a61f5110f20b65928cc (patch) | |
| tree | bea488ee888710a7c99705d6de18ed49e9efebb7 /src/supplemental/http/http_msg.c | |
| parent | b16e6ebf05429cb4ac29b3a5a5c9758fa362c78a (diff) | |
| download | nng-d87b873ea5bbdae1352b2a61f5110f20b65928cc.tar.gz nng-d87b873ea5bbdae1352b2a61f5110f20b65928cc.tar.bz2 nng-d87b873ea5bbdae1352b2a61f5110f20b65928cc.zip | |
http: status and reason fixes (make it match docs)
Diffstat (limited to 'src/supplemental/http/http_msg.c')
| -rw-r--r-- | src/supplemental/http/http_msg.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/supplemental/http/http_msg.c b/src/supplemental/http/http_msg.c index 5cc71b7d..009c8ab4 100644 --- a/src/supplemental/http/http_msg.c +++ b/src/supplemental/http/http_msg.c @@ -72,9 +72,6 @@ void nni_http_res_reset(nni_http_res *res) { http_entity_reset(&res->data); - nni_strfree(res->rsn); - res->rsn = NULL; - res->code = 0; } // http_entity_set_data sets the entity, but does not update the @@ -183,8 +180,6 @@ nni_http_res_init(nni_http_res *res) res->data.data = NULL; res->data.size = 0; res->data.own = false; - res->rsn = NULL; - res->code = 0; } static int @@ -252,7 +247,6 @@ http_req_parse_line(nng_http *conn, void *line) static int http_res_parse_line(nng_http *conn, uint8_t *line) { - int rv; char *reason; char *codestr; char *version; @@ -276,14 +270,9 @@ http_res_parse_line(nng_http *conn, uint8_t *line) return (NNG_EPROTO); } - if ((rv = nni_http_set_status(conn, (uint16_t) status, reason)) != 0) { - return (rv); - } + nni_http_set_status(conn, (uint16_t) status, reason); - if ((rv = nni_http_set_version(conn, version)) != 0) { - return (rv); - } - return (0); + return (nni_http_set_version(conn, version)); } // nni_http_req_parse parses a request (but not any attached entity data). |
