summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_h1proto.c
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2020-09-29 22:57:46 +0300
committerMax Romanov <max.romanov@nginx.com>2020-09-29 22:57:46 +0300
commitc4b000f9cc377b6a13777eb10e858c90de6264fe (patch)
tree2ffad6218419d5c8931048261b24941bded93610 /src/nxt_h1proto.c
parent4de6ffa63fb11bc37d47dcddc305bbf6f5768a84 (diff)
downloadunit-c4b000f9cc377b6a13777eb10e858c90de6264fe.tar.gz
unit-c4b000f9cc377b6a13777eb10e858c90de6264fe.tar.bz2
Supporting HTTP/1.0 keep-alive.
The Apache HTTP server benchmarking tool, ab, issues HTTP/1.0 requests with the 'Connection: Keep-Alive' header and expects a 'Connection: Keep-Alive' header in the response.
Diffstat (limited to 'src/nxt_h1proto.c')
-rw-r--r--src/nxt_h1proto.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nxt_h1proto.c b/src/nxt_h1proto.c
index 17046187..7c695549 100644
--- a/src/nxt_h1proto.c
+++ b/src/nxt_h1proto.c
@@ -734,9 +734,16 @@ nxt_h1p_connection(void *ctx, nxt_http_field_t *field, uintptr_t data)
r = ctx;
field->hopbyhop = 1;
- if (field->value_length == 5 && nxt_memcmp(field->value, "close", 5) == 0) {
+ if (field->value_length == 5
+ && nxt_memcasecmp(field->value, "close", 5) == 0)
+ {
r->proto.h1->keepalive = 0;
+ } else if (field->value_length == 10
+ && nxt_memcasecmp(field->value, "keep-alive", 10) == 0)
+ {
+ r->proto.h1->keepalive = 1;
+
} else if (field->value_length == 7
&& nxt_memcasecmp(field->value, "upgrade", 7) == 0)
{