diff options
| author | 2018-10-11 09:52:22 +0000 | |
|---|---|---|
| committer | 2018-10-11 09:52:22 +0000 | |
| commit | 833d1df9c059cb7e42fa8c29ed39fd8ac73f9927 (patch) | |
| tree | 766725c964fd3053e22f5230533385f7a6a78d9f /usr.sbin/httpd/server.c | |
| parent | don't send new-style rsa-sha2-*-cert-v01@openssh.com names to older (diff) | |
| download | wireguard-openbsd-833d1df9c059cb7e42fa8c29ed39fd8ac73f9927.tar.xz wireguard-openbsd-833d1df9c059cb7e42fa8c29ed39fd8ac73f9927.zip | |
Backout my previous commit:
date: 2018/10/01 19:24:09; author: benno; state: Exp; lines: +7 -1;
commitid: 0O8fyHPNvPd8rvYU;
Only send 408 Timeout responses when we have seen at least part of a
request. Without a request, just close the connection when we hit
request timeout.
Prompted by a bug report from Nikola Kolev, thanks.
ok reyk@ and some suggestions from claudio@ and bluhm@
Mark Patruck (mark AT wrapped DOT cx) found a problem with it, thanks
for the report.
ok reyk@ bluhm@ sthen@ deraadt@
Diffstat (limited to 'usr.sbin/httpd/server.c')
| -rw-r--r-- | usr.sbin/httpd/server.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.sbin/httpd/server.c b/usr.sbin/httpd/server.c index ef4aa6a2a93..63536a060e2 100644 --- a/usr.sbin/httpd/server.c +++ b/usr.sbin/httpd/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.115 2018/10/01 19:24:09 benno Exp $ */ +/* $OpenBSD: server.c,v 1.116 2018/10/11 09:52:22 benno Exp $ */ /* * Copyright (c) 2006 - 2015 Reyk Floeter <reyk@openbsd.org> @@ -901,6 +901,7 @@ server_input(struct client *clt) return; } + clt->clt_toread = TOREAD_HTTP_HEADER; inrd = server_read_http; slen = sizeof(clt->clt_sndbufsiz); @@ -1018,10 +1019,7 @@ server_error(struct bufferevent *bev, short error, void *arg) struct evbuffer *dst; if (error & EVBUFFER_TIMEOUT) { - if (clt->clt_toread != TOREAD_HTTP_INIT) - server_abort_http(clt, 408, "timeout"); - else - server_abort_http(clt, 0, "timeout"); + server_abort_http(clt, 408, "timeout"); return; } if (error & EVBUFFER_ERROR) { |
