From d87b873ea5bbdae1352b2a61f5110f20b65928cc Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 12 Jan 2025 08:07:20 -0800 Subject: http: status and reason fixes (make it match docs) --- src/supplemental/http/http_msg.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (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 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). -- cgit v1.2.3-70-g09d2