summaryrefslogtreecommitdiff
path: root/src/http_kv.c
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2020-01-21 20:41:39 -0500
committerGlenn Strauss <gstrauss@gluelogic.com>2020-07-08 19:54:29 -0400
commiteae84b6a697b71dbf0fd3d1c293f494e987313d4 (patch)
treecf11440a3eeeb38128de0bad6cd342679015d946 /src/http_kv.c
parent17e0b6fe308690bbf16446c2ba1fcbc0b4dc0487 (diff)
downloadlighttpd-git-eae84b6a697b71dbf0fd3d1c293f494e987313d4.tar.gz
[core] http_status_append() short-circuit 200 OK
Diffstat (limited to 'src/http_kv.c')
-rw-r--r--src/http_kv.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/http_kv.c b/src/http_kv.c
index b77ab6bf..5c4e89a2 100644
--- a/src/http_kv.c
+++ b/src/http_kv.c
@@ -154,6 +154,11 @@ http_method_t get_http_method_key(const char *s, size_t slen) {
void http_status_append(buffer * const b, const int status) {
+ if (200 == status) { /*(short-circuit common case)*/
+ buffer_append_string_len(b, CONST_STR_LEN("200 OK"));
+ return;
+ }
+
const keyvalue * const kv = http_status;
int i;
for (i = 0; kv[i].key != status && kv[i].vlen; ++i) ;