summaryrefslogtreecommitdiffstats
path: root/usr.sbin/httpd
diff options
context:
space:
mode:
authorbenno <benno@openbsd.org>2020-01-14 20:48:57 +0000
committerbenno <benno@openbsd.org>2020-01-14 20:48:57 +0000
commitca8e2b3ead2b67ac8037a952ecd828778a0d313f (patch)
tree81ee83c8f376965e7bcea04b6c844576c298048d /usr.sbin/httpd
parentAdd amlsm(4), a driver for the "secure monitor" firmware interface. (diff)
downloadwireguard-openbsd-ca8e2b3ead2b67ac8037a952ecd828778a0d313f.tar.xz
wireguard-openbsd-ca8e2b3ead2b67ac8037a952ecd828778a0d313f.zip
Pick the value for "max requests number" from the correct server {}
section in the config, by moving the code down where the Host: header has been read and the correct server configuration selected. Note that it may not be that useful to have this option per server, because it is valid to send requests with different Host: headers over the same tcp connection. problem noted and diff from Tracey Emery, thanks! ok florian@
Diffstat (limited to 'usr.sbin/httpd')
-rw-r--r--usr.sbin/httpd/server_http.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/usr.sbin/httpd/server_http.c b/usr.sbin/httpd/server_http.c
index 326daa6a687..4a46f6b44ba 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.135 2019/11/04 14:58:37 benno Exp $ */
+/* $OpenBSD: server_http.c,v 1.136 2020/01/14 20:48:57 benno Exp $ */
/*
* Copyright (c) 2006 - 2018 Reyk Floeter <reyk@openbsd.org>
@@ -1232,13 +1232,6 @@ server_response(struct httpd *httpd, struct client *clt)
clt->clt_persist = 0;
}
- if (clt->clt_persist >= srv_conf->maxrequests)
- clt->clt_persist = 0;
-
- /* pipelining should end after the first "idempotent" method */
- if (clt->clt_pipelining && clt->clt_toread > 0)
- clt->clt_persist = 0;
-
/*
* Do we have a Host header and matching configuration?
* XXX the Host can also appear in the URL path.
@@ -1292,6 +1285,13 @@ server_response(struct httpd *httpd, struct client *clt)
srv_conf = clt->clt_srv_conf;
}
+ if (clt->clt_persist >= srv_conf->maxrequests)
+ clt->clt_persist = 0;
+
+ /* pipelining should end after the first "idempotent" method */
+ if (clt->clt_pipelining && clt->clt_toread > 0)
+ clt->clt_persist = 0;
+
if ((desc->http_host = strdup(hostname)) == NULL)
goto fail;