-const char jcc_rcs[] = "$Id: jcc.c,v 1.338 2011/01/02 12:17:03 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.346 2011/04/26 16:48:04 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
{
/*
* We were able to read a complete
- * header and can finaly enlist it.
+ * header and can finally enlist it.
*/
enlist(headers, p);
freez(p);
* this function is called (via serve()) to handle the
* main business of the communication. This function
* returns after dealing with a single request. It can
- * be called multiple times witht the same client socket
+ * be called multiple times with the same client socket
* if the client is keeping the connection alive.
*
* The decision whether or not a client connection will
int server_body;
int ms_iis5_hack = 0;
unsigned long long byte_count = 0;
- int forwarded_connect_retries = 0;
- int max_forwarded_connect_retries = csp->config->forwarded_connect_retries;
const struct forward_spec *fwd;
struct http_request *http;
long len = 0; /* for buffer sizes (and negative error codes) */
}
#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */
- while ((csp->server_connection.sfd = forwarded_connect(fwd, http, csp))
- && (errno == EINVAL)
- && (forwarded_connect_retries++ < max_forwarded_connect_retries))
- {
- log_error(LOG_LEVEL_ERROR,
- "failed request #%u to connect to %s. Trying again.",
- forwarded_connect_retries, http->hostport);
- }
+ csp->server_connection.sfd = forwarded_connect(fwd, http, csp);
if (csp->server_connection.sfd == JB_INVALID_SOCKET)
{
else
{
rsp = error_response(csp, "connect-failed");
- log_error(LOG_LEVEL_CONNECT, "connect to: %s failed: %E",
- http->hostport);
}
/* Write the answer to the client */
if (csp->content_length == 0)
{
/*
- * If Privoxy didn't recalculate the Content-Lenght,
+ * If Privoxy didn't recalculate the Content-Length,
* byte_count is still correct.
*/
csp->content_length = byte_count;
&& (((csp->flags & CSP_FLAG_SERVER_CONNECTION_KEEP_ALIVE)
&& !(csp->flags & CSP_FLAG_SERVER_SOCKET_TAINTED))
|| (csp->flags & CSP_FLAG_CRUNCHED))
- && (csp->cfd != JB_INVALID_SOCKET);
+ && (csp->cfd != JB_INVALID_SOCKET)
+ && (csp->flags & CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE);
if (continue_chatting && !(csp->flags & CSP_FLAG_CRUNCHED))
{
{
if (++argc_pos == argc) usage(argv[argc_pos]);
- if ((NULL != (p = strchr(argv[argc_pos], '.'))) && *(p + 1) != '0')
+ if (NULL != (p = strchr(argv[argc_pos], '.')))
{
*p++ = '\0';
if (NULL == (grp = getgrnam(p)))
{
- log_error(LOG_LEVEL_FATAL, "Group %s not found.", p);
+ log_error(LOG_LEVEL_FATAL, "Group '%s' not found.", p);
}
}
if (NULL == (pw = getpwnam(argv[argc_pos])))
{
- log_error(LOG_LEVEL_FATAL, "User %s not found.", argv[argc_pos]);
+ log_error(LOG_LEVEL_FATAL, "User '%s' not found.", argv[argc_pos]);
}
if (p != NULL) *--p = '\0';
{
int child_id;
-/* this is a switch () statment in the C preprocessor - ugh */
+/* this is a switch () statement in the C preprocessor - ugh */
#undef SELECTED_ONE_OPTION
/* Use Pthreads in preference to native code */
#if defined(unix)
freez(basedir);
#endif
- freez(configfile);
#if defined(_WIN32) && !defined(_WIN_CONSOLE)
/* Cleanup - remove taskbar icon etc. */