- 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.",
- csp->cfd, csp->server_connection.sfd, csp->server_connection.host);
+ 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.",
+ csp->cfd, csp->server_connection.sfd, csp->server_connection.host);
+ }
+ else
+ {
+ client_timeout = 1; /* XXX: Use something else here? */
+ log_error(LOG_LEVEL_CONNECT,
+ "Waiting for the next client request on socket %d. "
+ "No server socket to keep open.", csp->cfd);
+ }