-const char jcc_rcs[] = "$Id: jcc.c,v 1.294 2009/09/18 18:57:20 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.297 2009/10/03 10:37:49 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
/* Did we actually get anything? */
if (NULL == csp->headers->first)
{
- log_error(LOG_LEVEL_ERROR,
- "Empty server or forwarder response received on socket %d.", csp->sfd);
+ if ((csp->flags & CSP_FLAG_REUSED_CLIENT_CONNECTION))
+ {
+ log_error(LOG_LEVEL_ERROR,
+ "Empty server or forwarder response received on socket %d. "
+ "Closing client connection %d without sending data.",
+ csp->sfd, csp->cfd);
+ }
+ else
+ {
+ log_error(LOG_LEVEL_ERROR,
+ "Empty server or forwarder response received on socket %d.",
+ csp->sfd);
+ send_crunch_response(csp, error_response(csp, "no-server-data"));
+ }
log_error(LOG_LEVEL_CLF, "%s - - [%T] \"%s\" 502 0", csp->ip_addr_str, http->cmd);
- send_crunch_response(csp, error_response(csp, "no-server-data"));
free_http_request(http);
mark_server_socket_tainted(csp);
return;
chat(csp);
latency = (unsigned)(csp->server_connection.response_received -
- csp->server_connection.request_sent);
+ csp->server_connection.request_sent) / 2;
continue_chatting = (csp->config->feature_flags
& RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE)
}
/* XXX: Store per-connection flags someplace else. */
- csp->flags = CSP_FLAG_ACTIVE | (csp->flags & CSP_FLAG_TOGGLED_ON);
+ csp->flags = CSP_FLAG_ACTIVE |
+ (csp->flags & CSP_FLAG_TOGGLED_ON) | CSP_FLAG_REUSED_CLIENT_CONNECTION;
}
else
{
break;
}
- remember_connection(csp, forward_url(csp, csp->http));
+ remember_connection(&csp->server_connection);
csp->sfd = JB_INVALID_SOCKET;
close_socket(csp->cfd);
csp->cfd = JB_INVALID_SOCKET;