-const char jcc_rcs[] = "$Id: jcc.c,v 1.335 2010/12/26 16:20:08 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.338 2011/01/02 12:17:03 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
if (FD_ISSET(csp->server_connection.sfd, &rfds))
{
#ifdef FEATURE_CONNECTION_KEEP_ALIVE
- if (!socket_is_still_alive(csp->cfd))
+ /*
+ * If we are buffering content, we don't want to eat up to
+ * buffer-limit bytes if the client no longer cares about them.
+ * If we aren't buffering, however, a dead client socket will be
+ * noticed pretty much right away anyway, so we can reduce the
+ * overhead by skipping the check.
+ */
+ if (buffer_and_filter_content && !socket_is_still_alive(csp->cfd))
{
#ifdef _WIN32
log_error(LOG_LEVEL_CONNECT,
&& data_is_available(csp->cfd, (int)client_timeout)
&& socket_is_still_alive(csp->cfd))
{
- log_error(LOG_LEVEL_CONNECT, "Client request arrived in "
- "time or the client closed the connection on socket %d.",
- csp->cfd);
+ log_error(LOG_LEVEL_CONNECT,
+ "Client request arrived in time on socket %d.", csp->cfd);
prepare_csp_for_next_request(csp);
}
else
}
csp = &csp_list->csp;
+ log_error(LOG_LEVEL_CONNECT, "Listening for new connections ... ");
+
+ if (!accept_connection(csp, bfd))
+ {
+ log_error(LOG_LEVEL_CONNECT, "accept failed: %E");
+
+#ifdef AMIGA
+ if(!childs)
+ {
+ exit(1);
+ }
+#endif
+ freez(csp_list);
+ continue;
+ }
+ else
+ {
+ log_error(LOG_LEVEL_CONNECT,
+ "accepted connection from %s on socket %d",
+ csp->ip_addr_str, csp->cfd);
+ }
+
csp->flags |= CSP_FLAG_ACTIVE;
csp->server_connection.sfd = JB_INVALID_SOCKET;
bfd = bind_port_helper(config);
}
- log_error(LOG_LEVEL_CONNECT, "Listening for new connections ... ");
-
- if (!accept_connection(csp, bfd))
- {
- log_error(LOG_LEVEL_CONNECT, "accept failed: %E");
-
-#ifdef AMIGA
- if(!childs)
- {
- exit(1);
- }
-#endif
- freez(csp_list);
- continue;
- }
- else
- {
- log_error(LOG_LEVEL_CONNECT,
- "accepted connection from %s on socket %d",
- csp->ip_addr_str, csp->cfd);
- }
-
#ifdef FEATURE_TOGGLE
if (global_toggle_state)
#endif /* def FEATURE_TOGGLE */