aboutsummaryrefslogtreecommitdiff
path: root/src/supplemental/http/http_msg.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2025-01-17 09:24:36 -0800
committerGarrett D'Amore <garrett@damore.org>2025-01-17 09:24:36 -0800
commitd203647145c7c3e5f0f4ae8288d2c4796f9e23d5 (patch)
tree9a908867ee286fba4bb774486c296b5adbd81dd2 /src/supplemental/http/http_msg.c
parent6d74a90b72c80edbd58d8b2b29105e749bdfc28e (diff)
downloadnng-http-handler-fini.tar.gz
nng-http-handler-fini.tar.bz2
nng-http-handler-fini.zip
http: start of clean up of public vs. private functionshttp-handler-fini
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.
Diffstat (limited to 'src/supplemental/http/http_msg.c')
-rw-r--r--src/supplemental/http/http_msg.c22
1 files changed, 11 insertions, 11 deletions
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).