receive_encrypted_request(): Use the socket-timeout when waiting for new data
authorFabian Keil <fk@fabiankeil.de>
Sat, 18 Jul 2020 12:04:11 +0000 (14:04 +0200)
committerFabian Keil <fk@fabiankeil.de>
Sat, 18 Jul 2020 13:37:24 +0000 (15:37 +0200)
Previously the keep-alive-timeout was being used which
was inappropriate as we are waiting for data that belongs
to the same request.

Sponsored by: Robert Klemme

jcc.c

diff --git a/jcc.c b/jcc.c
index 511b36b..69c0180 100644 (file)
--- a/jcc.c
+++ b/jcc.c
@@ -2221,7 +2221,7 @@ static jb_err receive_encrypted_request(struct client_state *csp)
    {
       log_error(LOG_LEVEL_HEADER, "Reading encrypted headers");
       if (!is_ssl_pending(&(csp->mbedtls_client_attr.ssl)) &&
    {
       log_error(LOG_LEVEL_HEADER, "Reading encrypted headers");
       if (!is_ssl_pending(&(csp->mbedtls_client_attr.ssl)) &&
-          !data_is_available(csp->cfd, (int)csp->config->keep_alive_timeout))
+          !data_is_available(csp->cfd, csp->config->socket_timeout))
       {
          log_error(LOG_LEVEL_CONNECT,
             "Socket %d timed out while waiting for client headers", csp->cfd);
       {
          log_error(LOG_LEVEL_CONNECT,
             "Socket %d timed out while waiting for client headers", csp->cfd);