-const char jcc_rcs[] = "$Id: jcc.c,v 1.384 2012/07/27 17:31:10 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.389 2012/10/12 11:19:35 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
* Purpose : Main file. Contains main() method, main loop, and
* the main connection-handling function.
*
- * Copyright : Written by and Copyright (C) 2001-2010 the
+ * Copyright : Written by and Copyright (C) 2001-2012 the
* Privoxy team. http://www.privoxy.org/
*
* Based on the Internet Junkbuster originally written
/* Assume persistence until further notice */
csp->flags |= CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE;
}
+
+ if (csp->http->ssl == 0)
+ {
+ csp->expected_client_content_length = get_expected_content_length(csp->headers);
+ verify_request_length(csp);
+ }
#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */
err = sed(csp, FILTER_CLIENT_HEADERS);
return JB_ERR_PARSE;
}
-#ifdef FEATURE_CONNECTION_KEEP_ALIVE
- if (csp->http->ssl == 0)
- {
- verify_request_length(csp);
- }
-#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */
-
return JB_ERR_OK;
}
* we can parse the headers we just continue here.
*/
log_error(LOG_LEVEL_CONNECT,
- "Continuing buffering headers. Bytes most recently read: %d.",
- len);
+ "Continuing buffering server headers from socket %d. "
+ "Bytes most recently read: %d.", csp->cfd, len);
continue;
}
}
#endif /* def FEATURE_CONNECTION_SHARING */
int continue_chatting = 0;
+ log_error(LOG_LEVEL_CONNECT, "Accepted connection from %s on socket %d",
+ csp->ip_addr_str, csp->cfd);
+
do
{
unsigned int latency;
remember_connection(&csp->server_connection);
csp->server_connection.sfd = JB_INVALID_SOCKET;
- close_socket(csp->cfd);
+ drain_and_close_socket(csp->cfd);
csp->cfd = JB_INVALID_SOCKET;
privoxy_mutex_lock(&connection_reuse_mutex);
if (!monitor_thread_running)
"Keep-alive: %u, Socket alive: %u. Data available: %u.",
csp->cfd, 0 != (csp->flags & CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE),
socket_is_still_alive(csp->cfd), data_is_available(csp->cfd, 0));
- close_socket(csp->cfd);
+ drain_and_close_socket(csp->cfd);
}
csp->flags &= ~CSP_FLAG_ACTIVE;
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;