summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorrofl0r <rofl0r@users.noreply.github.com>2020-09-07 20:49:07 +0100
committerrofl0r <rofl0r@users.noreply.github.com>2020-09-07 20:49:07 +0100
commit88153e944f7d28f57cccc77f3228a3f54f78ce4e (patch)
tree706b460a75a7ccfdcfaca5393de294b1654c2a29
parentf720244baa0f92c5e8c9500d2cc41415775196fd (diff)
get_request_entity: respect user-set timeout
get_request_entity() is only called on error, for example if a client doesn't pass a check_acl() check. in such a case it's possible that the client fd isn't yet ready to read from. using select() with a timeout timeval of {0,0} causes it to return immediately and return 0 if there's no data ready to be read. this resulted in immediate connection termination rather than returning the 403 access denied error page to the client and a confusing "no entity" message displayed in the proxy log.
-rw-r--r--src/reqs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/reqs.c b/src/reqs.c
index 365b27d..87a1a82 100644
--- a/src/reqs.c
+++ b/src/reqs.c
@@ -1490,7 +1490,7 @@ get_request_entity(struct conn_s *connptr)
FD_ZERO (&rset);
FD_SET (connptr->client_fd, &rset);
- tv.tv_sec = 0;
+ tv.tv_sec = config->idletimeout;
tv.tv_usec = 0;
ret = select (connptr->client_fd + 1, &rset, NULL, NULL, &tv);