projects
/
privoxy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Let server_set_cookie() stay silent when the cookie isn't modified
[privoxy.git]
/
jcc.c
diff --git
a/jcc.c
b/jcc.c
index
f29dea1
..
7d3b723
100644
(file)
--- a/
jcc.c
+++ b/
jcc.c
@@
-1,4
+1,4
@@
-const char jcc_rcs[] = "$Id: jcc.c,v 1.41
0 2012/10/29 12:00:1
5 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.41
6 2012/11/24 14:01:2
5 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
@@
-951,6
+951,7
@@
static int server_response_is_complete(struct client_state *csp,
*/
csp->expected_content_length = 0;
content_length_known = TRUE;
*/
csp->expected_content_length = 0;
content_length_known = TRUE;
+ csp->flags |= CSP_FLAG_SERVER_CONTENT_LENGTH_SET;
}
if (csp->http->status == 204 || csp->http->status == 304)
}
if (csp->http->status == 204 || csp->http->status == 304)
@@
-960,6
+961,7
@@
static int server_response_is_complete(struct client_state *csp,
*/
csp->expected_content_length = 0;
content_length_known = TRUE;
*/
csp->expected_content_length = 0;
content_length_known = TRUE;
+ csp->flags |= CSP_FLAG_SERVER_CONTENT_LENGTH_SET;
}
return (content_length_known && ((0 == csp->expected_content_length)
}
return (content_length_known && ((0 == csp->expected_content_length)
@@
-1118,9
+1120,7
@@
static void verify_request_length(struct client_state *csp)
{
/* XXX: this is an incomplete hack */
csp->flags &= ~CSP_FLAG_CLIENT_REQUEST_COMPLETELY_READ;
{
/* XXX: this is an incomplete hack */
csp->flags &= ~CSP_FLAG_CLIENT_REQUEST_COMPLETELY_READ;
- csp->flags |= CSP_FLAG_SERVER_SOCKET_TAINTED;
- log_error(LOG_LEVEL_CONNECT,
- "There might be a request body. The connection will not be kept alive.");
+ log_error(LOG_LEVEL_CONNECT, "There better be a request body.");
}
else
{
}
else
{
@@
-1181,7
+1181,7
@@
static void mark_server_socket_tainted(struct client_state *csp)
* actually been reused.
*/
if ((csp->flags & CSP_FLAG_SERVER_CONNECTION_KEEP_ALIVE)
* actually been reused.
*/
if ((csp->flags & CSP_FLAG_SERVER_CONNECTION_KEEP_ALIVE)
- && !(csp->flags
|=
CSP_FLAG_SERVER_SOCKET_TAINTED))
+ && !(csp->flags
&
CSP_FLAG_SERVER_SOCKET_TAINTED))
{
log_error(LOG_LEVEL_CONNECT,
"Marking the server socket %d tainted.",
{
log_error(LOG_LEVEL_CONNECT,
"Marking the server socket %d tainted.",
@@
-2631,7
+2631,9
@@
static void serve(struct client_state *csp)
& RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE)
&& !(csp->flags & CSP_FLAG_SERVER_SOCKET_TAINTED)
&& (csp->cfd != JB_INVALID_SOCKET)
& RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE)
&& !(csp->flags & CSP_FLAG_SERVER_SOCKET_TAINTED)
&& (csp->cfd != JB_INVALID_SOCKET)
- && (csp->flags & CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE);
+ && (csp->flags & CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE)
+ && ((csp->flags & CSP_FLAG_SERVER_CONTENT_LENGTH_SET)
+ || (csp->flags & CSP_FLAG_CHUNKED));
if (!(csp->flags & CSP_FLAG_CRUNCHED)
&& (csp->server_connection.sfd != JB_INVALID_SOCKET))
if (!(csp->flags & CSP_FLAG_CRUNCHED)
&& (csp->server_connection.sfd != JB_INVALID_SOCKET))
@@
-2828,7
+2830,7
@@
static int32 server_thread(void *data)
static void usage(const char *myname)
{
printf("Privoxy version " VERSION " (" HOME_PAGE_URL ")\n"
static void usage(const char *myname)
{
printf("Privoxy version " VERSION " (" HOME_PAGE_URL ")\n"
- "Usage: %s "
+ "Usage: %s
[--config-test]
"
#if defined(unix)
"[--chroot] "
#endif /* defined(unix) */
#if defined(unix)
"[--chroot] "
#endif /* defined(unix) */
@@
-3018,6
+3020,7
@@
int main(int argc, char **argv)
#endif
{
int argc_pos = 0;
#endif
{
int argc_pos = 0;
+ int do_config_test = 0;
unsigned int random_seed;
#ifdef unix
struct passwd *pw = NULL;
unsigned int random_seed;
#ifdef unix
struct passwd *pw = NULL;
@@
-3148,6
+3151,11
@@
int main(int argc, char **argv)
}
#endif /* defined(unix) */
}
#endif /* defined(unix) */
+ else if (strcmp(argv[argc_pos], "--config-test") == 0)
+ {
+ do_config_test = 1;
+ }
+
else if (argc_pos + 1 != argc)
{
/*
else if (argc_pos + 1 != argc)
{
/*
@@
-3251,6
+3259,10
@@
int main(int argc, char **argv)
# endif /* def _WIN_CONSOLE */
#endif /* def _WIN32 */
# endif /* def _WIN_CONSOLE */
#endif /* def _WIN32 */
+ if (do_config_test)
+ {
+ exit(NULL == load_config());
+ }
/* Initialize the CGI subsystem */
cgi_init_error_messages();
/* Initialize the CGI subsystem */
cgi_init_error_messages();