From d203647145c7c3e5f0f4ae8288d2c4796f9e23d5 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Fri, 17 Jan 2025 09:24:36 -0800 Subject: http: start of clean up of public vs. private functions We have a lot of "private" wrappers around public functions, which doesn't really help at all, and just add needless extra stack frames and extra cruft in the linker tables. We should eliminate the trivially thin wrappers where possible, and this is a start. --- src/supplemental/http/http_msg.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 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 09470e31..17fb000a 100644 --- a/src/supplemental/http/http_msg.c +++ b/src/supplemental/http/http_msg.c @@ -142,7 +142,7 @@ http_parse_header(nng_http *conn, void *line) end--; } - return (nni_http_add_header(conn, key, val)); + return (nng_http_add_header(conn, key, val)); } void @@ -207,39 +207,39 @@ http_req_parse_line(nng_http *conn, void *line) char *uri; char *version; - if (nni_http_get_status(conn) >= NNG_HTTP_STATUS_BAD_REQUEST) { + if (nng_http_get_status(conn) >= NNG_HTTP_STATUS_BAD_REQUEST) { // we've already failed it, nothing else for us to do return (NNG_OK); } method = line; if ((uri = strchr(method, ' ')) == NULL) { - nni_http_set_status(conn, NNG_HTTP_STATUS_BAD_REQUEST, NULL); + nng_http_set_status(conn, NNG_HTTP_STATUS_BAD_REQUEST, NULL); return (NNG_OK); } *uri = '\0'; uri++; if ((version = strchr(uri, ' ')) == NULL) { - nni_http_set_status(conn, NNG_HTTP_STATUS_BAD_REQUEST, NULL); + nng_http_set_status(conn, NNG_HTTP_STATUS_BAD_REQUEST, NULL); return (NNG_OK); } *version = '\0'; version++; if (nni_url_canonify_uri(uri) != 0) { - nni_http_set_status(conn, NNG_HTTP_STATUS_BAD_REQUEST, NULL); + nng_http_set_status(conn, NNG_HTTP_STATUS_BAD_REQUEST, NULL); return (NNG_OK); } - if (nni_http_set_version(conn, version)) { - nni_http_set_status( + if (nng_http_set_version(conn, version)) { + nng_http_set_status( conn, NNG_HTTP_STATUS_HTTP_VERSION_NOT_SUPP, NULL); return (NNG_OK); } - nni_http_set_method(conn, method); + nng_http_set_method(conn, method); // this one only can fail due to ENOMEM - return (nni_http_set_uri(conn, uri, NULL)); + return (nng_http_set_uri(conn, uri, NULL)); } static nng_err @@ -268,9 +268,9 @@ http_res_parse_line(nng_http *conn, uint8_t *line) return (NNG_EPROTO); } - nni_http_set_status(conn, (uint16_t) status, reason); + nng_http_set_status(conn, (uint16_t) status, reason); - return (nni_http_set_version(conn, version)); + return (nng_http_set_version(conn, version)); } // nni_http_req_parse parses a request (but not any attached entity data). -- cgit v1.2.3-70-g09d2