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.
This commit is contained in:
rofl0r 2020-09-07 20:49:07 +01:00
parent f720244baa
commit 88153e944f

View File

@ -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);