diff options
| author | 2014-07-14 09:03:08 +0000 | |
|---|---|---|
| committer | 2014-07-14 09:03:08 +0000 | |
| commit | 091144dbaf6d58cccd2a1fb664755381d0a334b6 (patch) | |
| tree | 2677dda5377d208447eef4ca0068a43e11430684 /usr.sbin/httpd/server_http.c | |
| parent | Write to the correct control module registers when configuring gpio pins. (diff) | |
| download | wireguard-openbsd-091144dbaf6d58cccd2a1fb664755381d0a334b6.tar.xz wireguard-openbsd-091144dbaf6d58cccd2a1fb664755381d0a334b6.zip | |
Track Connection: Keep-Alive
Diffstat (limited to 'usr.sbin/httpd/server_http.c')
| -rw-r--r-- | usr.sbin/httpd/server_http.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/usr.sbin/httpd/server_http.c b/usr.sbin/httpd/server_http.c index 16de7da9c64..42b2a2fb4ab 100644 --- a/usr.sbin/httpd/server_http.c +++ b/usr.sbin/httpd/server_http.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server_http.c,v 1.6 2014/07/14 00:19:48 reyk Exp $ */ +/* $OpenBSD: server_http.c,v 1.7 2014/07/14 09:03:08 reyk Exp $ */ /* * Copyright (c) 2006 - 2014 Reyk Floeter <reyk@openbsd.org> @@ -624,15 +624,21 @@ server_response(struct httpd *httpd, struct client *clt) if ((kv = kv_find(&desc->http_headers, &key)) == NULL) goto fail; - /* Is the connection persistent? */ + /* Is the connection persistent? */ + key.kv_key = "Connection"; if ((kv = kv_find(&desc->http_headers, &key)) != NULL && strcasecmp("close", kv->kv_value) == 0) clt->clt_persist = 0; else - clt->clt_persist = 1; + clt->clt_persist++; } else { - /* Keep-Alive with HTTP/1.0 not supported */ - clt->clt_persist = 0; + /* Is the connection persistent? */ + key.kv_key = "Connection"; + if ((kv = kv_find(&desc->http_headers, &key)) != NULL && + strcasecmp("keep-alive", kv->kv_value) == 0) + clt->clt_persist++; + else + clt->clt_persist = 0; } if ((ret = server_file(httpd, clt)) == -1) |
