projects
/
privoxy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add changes made in the last days.
[privoxy.git]
/
jcc.c
diff --git
a/jcc.c
b/jcc.c
index
713fa54
..
e115818
100644
(file)
--- a/
jcc.c
+++ b/
jcc.c
@@
-1,4
+1,4
@@
-const char jcc_rcs[] = "$Id: jcc.c,v 1.3
25 2010/07/21 14:39:20
fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.3
30 2010/09/14 07:16:07
fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
@@
-1521,9
+1521,7
@@
static void chat(struct client_state *csp)
const struct forward_spec *fwd;
struct http_request *http;
long len = 0; /* for buffer sizes (and negative error codes) */
const struct forward_spec *fwd;
struct http_request *http;
long len = 0; /* for buffer sizes (and negative error codes) */
-
- /* Function that does the content filtering for the current request */
- filter_function_ptr content_filter = NULL;
+ int buffer_and_filter_content = 0;
/* Skeleton for HTTP response, if we should intercept the request */
struct http_response *rsp;
/* Skeleton for HTTP response, if we should intercept the request */
struct http_response *rsp;
@@
-2049,11
+2047,11
@@
static void chat(struct client_state *csp)
* now is the time to apply content modification
* and send the result to the client.
*/
* now is the time to apply content modification
* and send the result to the client.
*/
- if (
content_filter
)
+ if (
buffer_and_filter_content
)
{
{
- p = execute_content_filter
(csp, content_filter
);
+ p = execute_content_filter
s(csp
);
/*
/*
- * If
the content filter
fails, use the original
+ * If
content filtering
fails, use the original
* buffer and length.
* (see p != NULL ? p : csp->iob->cur below)
*/
* buffer and length.
* (see p != NULL ? p : csp->iob->cur below)
*/
@@
-2115,7
+2113,7
@@
static void chat(struct client_state *csp)
*/
if (server_body || http->ssl)
{
*/
if (server_body || http->ssl)
{
- if (
content_filter
)
+ if (
buffer_and_filter_content
)
{
/*
* If there is no memory left for buffering the content, or the buffer limit
{
/*
* If there is no memory left for buffering the content, or the buffer limit
@@
-2163,7
+2161,7
@@
static void chat(struct client_state *csp)
*/
byte_count = (unsigned long long)flushed;
freez(hdr);
*/
byte_count = (unsigned long long)flushed;
freez(hdr);
-
content_filter = NULL
;
+
buffer_and_filter_content = 0
;
server_body = 1;
}
}
server_body = 1;
}
}
@@
-2330,12
+2328,12
@@
static void chat(struct client_state *csp)
if (!http->ssl) /* We talk plaintext */
{
if (!http->ssl) /* We talk plaintext */
{
-
content_filter = get_filter_function
(csp);
+
buffer_and_filter_content = content_requires_filtering
(csp);
}
/*
* Only write if we're not buffering for content modification
*/
}
/*
* Only write if we're not buffering for content modification
*/
- if (!
content_filter
)
+ if (!
buffer_and_filter_content
)
{
/*
* Write the server's (modified) header to
{
/*
* Write the server's (modified) header to
@@
-2556,7
+2554,7
@@
static void serve(struct client_state *csp)
{
time_t time_open = time(NULL) - csp->server_connection.timestamp;
{
time_t time_open = time(NULL) - csp->server_connection.timestamp;
- if (csp->server_connection.keep_alive_timeout < time_open
+
latency)
+ if (csp->server_connection.keep_alive_timeout < time_open
- (time_t)
latency)
{
break;
}
{
break;
}
@@
-3460,7
+3458,9
@@
static void listen_loop(void)
}
else
{
}
else
{
- log_error(LOG_LEVEL_CONNECT, "accepted connection from %s", csp->ip_addr_str);
+ log_error(LOG_LEVEL_CONNECT,
+ "accepted connection from %s on socket %d",
+ csp->ip_addr_str, csp->cfd);
}
#ifdef FEATURE_TOGGLE
}
#ifdef FEATURE_TOGGLE