aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-12-22 09:32:10 -0800
committerGarrett D'Amore <garrett@damore.org>2024-12-22 09:32:10 -0800
commit9ac2c5a0bb545a5dc48c7e0531346e40e426cf9b (patch)
treecedb57c29328b1e7e627e4979fac88bd5e37b7a5 /include
parentf0e0801f557abad86f4542243a5efa04fe9ecd85 (diff)
downloadnng-2.0.0-alpha.1.tar.gz
nng-2.0.0-alpha.1.tar.bz2
nng-2.0.0-alpha.1.zip
HTTP: intern the version and avoid allocationv2.0.0-alpha.1
There are only a few possible reasonable values, and we can intern them to avoid any allocations for it. (We will probably do the same for the HTTP method shortly as well.)
Diffstat (limited to 'include')
-rw-r--r--include/nng/supplemental/http/http.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/nng/supplemental/http/http.h b/include/nng/supplemental/http/http.h
index fa81f984..bb163949 100644
--- a/include/nng/supplemental/http/http.h
+++ b/include/nng/supplemental/http/http.h
@@ -87,6 +87,11 @@ enum nng_http_status {
NNG_HTTP_STATUS_NETWORK_AUTH_REQUIRED = 511,
};
+#define NNG_HTTP_VERSION_1_0 "HTTP/1.0"
+#define NNG_HTTP_VERSION_1_1 "HTTP/1.1"
+#define NNG_HTTP_VERSION_2 "HTTP/2"
+#define NNG_HTTP_VERSION_3 "HTTP/3"
+
// nng_http_req represents an HTTP request.
typedef struct nng_http_req nng_http_req;