From 7b0f08d4e99e42f0fa01a9155c20775da0d40679 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Sun, 21 Oct 2012 12:51:57 +0000 Subject: [PATCH] Let serve() wait for keep-alive-timeout seconds for new requests The server connection timeout is no longer relevant. --- jcc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/jcc.c b/jcc.c index 550b00bb..059e9e60 100644 --- a/jcc.c +++ b/jcc.c @@ -1,4 +1,4 @@ -const char jcc_rcs[] = "$Id: jcc.c,v 1.396 2012/10/21 12:50:46 fabiankeil Exp $"; +const char jcc_rcs[] = "$Id: jcc.c,v 1.397 2012/10/21 12:51:07 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jcc.c,v $ @@ -2579,13 +2579,10 @@ static void serve(struct client_state *csp) if (continue_chatting) { - unsigned int client_timeout = 1; /* XXX: Use something else here? */ - if (0 != (csp->flags & CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE)) { if (csp->server_connection.sfd != JB_INVALID_SOCKET) { - client_timeout = (unsigned)csp->server_connection.keep_alive_timeout - latency; log_error(LOG_LEVEL_CONNECT, "Waiting for the next client request on socket %d. " "Keeping the server socket %d to %s open.", @@ -2599,7 +2596,7 @@ static void serve(struct client_state *csp) } } if ((csp->flags & CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE) - && data_is_available(csp->cfd, (int)client_timeout) + && data_is_available(csp->cfd, (int)csp->config->keep_alive_timeout) && socket_is_still_alive(csp->cfd)) { log_error(LOG_LEVEL_CONNECT, -- 2.39.2