projects
/
privoxy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Explicitly mention that Privoxy binaries are built by individuals on their own systems
[privoxy.git]
/
filters.c
diff --git
a/filters.c
b/filters.c
index
8a83bbc
..
0450f5a
100644
(file)
--- a/
filters.c
+++ b/
filters.c
@@
-1,4
+1,4
@@
-const char filters_rcs[] = "$Id: filters.c,v 1.
199 2016/01/16 12:33:3
5 fabiankeil Exp $";
+const char filters_rcs[] = "$Id: filters.c,v 1.
202 2016/05/25 10:50:5
5 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/filters.c,v $
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/filters.c,v $
@@
-70,6
+70,9
@@
const char filters_rcs[] = "$Id: filters.c,v 1.199 2016/01/16 12:33:35 fabiankei
#include "deanimate.h"
#include "urlmatch.h"
#include "loaders.h"
#include "deanimate.h"
#include "urlmatch.h"
#include "loaders.h"
+#ifdef FEATURE_CLIENT_TAGS
+#include "client-tags.h"
+#endif
#ifdef _WIN32
#include "win32.h"
#ifdef _WIN32
#include "win32.h"
@@
-79,8
+82,13
@@
const char filters_h_rcs[] = FILTERS_H_VERSION;
typedef char *(*filter_function_ptr)();
static filter_function_ptr get_filter_function(const struct client_state *csp);
typedef char *(*filter_function_ptr)();
static filter_function_ptr get_filter_function(const struct client_state *csp);
-static jb_err remove_chunked_transfer_coding(char *buffer, size_t *size);
static jb_err prepare_for_filtering(struct client_state *csp);
static jb_err prepare_for_filtering(struct client_state *csp);
+static void apply_url_actions(struct current_action_spec *action,
+ struct http_request *http,
+#ifdef FEATURE_CLIENT_TAGS
+ const struct list *client_tags,
+#endif
+ struct url_actions *b);
#ifdef FEATURE_ACL
#ifdef HAVE_RFC2553
#ifdef FEATURE_ACL
#ifdef HAVE_RFC2553
@@
-926,6
+934,7
@@
pcrs_job *compile_dynamic_pcrs_job_list(const struct client_state *csp, const st
{"path", csp->http->path, 1},
{"host", csp->http->host, 1},
{"origin", csp->ip_addr_str, 1},
{"path", csp->http->path, 1},
{"host", csp->http->host, 1},
{"origin", csp->ip_addr_str, 1},
+ {"listen-address", csp->listen_addr_str, 1},
{NULL, NULL, 1}
};
{NULL, NULL, 1}
};
@@
-1762,6
+1771,7
@@
static void set_privoxy_variables(const struct client_state *csp)
{ "PRIVOXY_PATH", csp->http->path },
{ "PRIVOXY_HOST", csp->http->host },
{ "PRIVOXY_ORIGIN", csp->ip_addr_str },
{ "PRIVOXY_PATH", csp->http->path },
{ "PRIVOXY_HOST", csp->http->host },
{ "PRIVOXY_ORIGIN", csp->ip_addr_str },
+ { "PRIVOXY_LISTEN_ADDRESS", csp->listen_addr_str },
};
for (i = 0; i < SZ(env); i++)
};
for (i = 0; i < SZ(env); i++)
@@
-1946,7
+1956,11
@@
static char *execute_external_filter(const struct client_state *csp,
* or NULL in case something went wrong.
*
*********************************************************************/
* or NULL in case something went wrong.
*
*********************************************************************/
+#ifdef FUZZ
+char *gif_deanimate_response(struct client_state *csp)
+#else
static char *gif_deanimate_response(struct client_state *csp)
static char *gif_deanimate_response(struct client_state *csp)
+#endif
{
struct binbuffer *in, *out;
char *p;
{
struct binbuffer *in, *out;
char *p;
@@
-2044,13
+2058,23
@@
static filter_function_ptr get_filter_function(const struct client_state *csp)
* JB_ERR_PARSE otherwise
*
*********************************************************************/
* JB_ERR_PARSE otherwise
*
*********************************************************************/
+#ifdef FUZZ
+extern jb_err remove_chunked_transfer_coding(char *buffer, size_t *size)
+#else
static jb_err remove_chunked_transfer_coding(char *buffer, size_t *size)
static jb_err remove_chunked_transfer_coding(char *buffer, size_t *size)
+#endif
{
size_t newsize = 0;
unsigned int chunksize = 0;
char *from_p, *to_p;
const char *end_of_buffer = buffer + *size;
{
size_t newsize = 0;
unsigned int chunksize = 0;
char *from_p, *to_p;
const char *end_of_buffer = buffer + *size;
+ if (*size == 0)
+ {
+ log_error(LOG_LEVEL_FATAL, "Invalid chunked input. Buffer is empty.");
+ return JB_ERR_PARSE;
+ }
+
assert(buffer);
from_p = to_p = buffer;
assert(buffer);
from_p = to_p = buffer;
@@
-2322,13
+2346,16
@@
void get_url_actions(struct client_state *csp, struct http_request *http)
return;
}
return;
}
+#ifdef FEATURE_CLIENT_TAGS
+ apply_url_actions(csp->action, http, csp->client_tags, b);
+#else
apply_url_actions(csp->action, http, b);
apply_url_actions(csp->action, http, b);
+#endif
}
return;
}
}
return;
}
-
/*********************************************************************
*
* Function : apply_url_actions
/*********************************************************************
*
* Function : apply_url_actions
@@
-2338,14
+2365,18
@@
void get_url_actions(struct client_state *csp, struct http_request *http)
* Parameters :
* 1 : action = Destination.
* 2 : http = Current URL
* Parameters :
* 1 : action = Destination.
* 2 : http = Current URL
- * 3 : b = list of URL actions to apply
+ * 3 : client_tags = list of client tags
+ * 4 : b = list of URL actions to apply
*
* Returns : N/A
*
*********************************************************************/
*
* Returns : N/A
*
*********************************************************************/
-void apply_url_actions(struct current_action_spec *action,
- struct http_request *http,
- struct url_actions *b)
+static void apply_url_actions(struct current_action_spec *action,
+ struct http_request *http,
+#ifdef FEATURE_CLIENT_TAGS
+ const struct list *client_tags,
+#endif
+ struct url_actions *b)
{
if (b == NULL)
{
{
if (b == NULL)
{
@@
-2359,6
+2390,12
@@
void apply_url_actions(struct current_action_spec *action,
{
merge_current_action(action, b->action);
}
{
merge_current_action(action, b->action);
}
+#ifdef FEATURE_CLIENT_TAGS
+ if (client_tag_match(b->url, client_tags))
+ {
+ merge_current_action(action, b->action);
+ }
+#endif
}
}
}
}