projects
/
privoxy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ssl_send_certificate_error(): Remove a 'dead nested assignment'
[privoxy.git]
/
loaders.c
diff --git
a/loaders.c
b/loaders.c
index
1edf427
..
a9820df
100644
(file)
--- a/
loaders.c
+++ b/
loaders.c
@@
-8,7
+8,7
@@
* unload files that are no longer in use.
*
* Copyright : Written by and Copyright (C) 2001-2014 the
* unload files that are no longer in use.
*
* Copyright : Written by and Copyright (C) 2001-2014 the
- * Privoxy team. http://www.privoxy.org/
+ * Privoxy team. http
s
://www.privoxy.org/
*
* Based on the Internet Junkbuster originally written
* by and Copyright (C) 1997 Anonymous Coders and
*
* Based on the Internet Junkbuster originally written
* by and Copyright (C) 1997 Anonymous Coders and
@@
-46,7
+46,7
@@
#include <ctype.h>
#include <assert.h>
#include <ctype.h>
#include <assert.h>
-#if !defined(_WIN32)
&& !defined(__OS2__)
+#if !defined(_WIN32)
#include <unistd.h>
#endif
#include <unistd.h>
#endif
@@
-112,7
+112,13
@@
void free_csp_resources(struct client_state *csp)
free_http_request(csp->http);
destroy_list(csp->headers);
free_http_request(csp->http);
destroy_list(csp->headers);
+#ifdef FEATURE_HTTPS_INSPECTION
+ destroy_list(csp->https_headers);
+#endif
destroy_list(csp->tags);
destroy_list(csp->tags);
+#ifdef FEATURE_CLIENT_TAGS
+ destroy_list(csp->client_tags);
+#endif
free_current_action(csp->action);
}
free_current_action(csp->action);
}
@@
-216,13
+222,13
@@
unsigned int sweep(void)
{
last_active->next = client_list->next;
{
last_active->next = client_list->next;
-#if
def FEATURE_STATISTICS
+#if
defined(FEATURE_STATISTICS) && !defined(MUTEX_LOCKS_AVAILABLE)
urls_read++;
if (csp->flags & CSP_FLAG_REJECTED)
{
urls_rejected++;
}
urls_read++;
if (csp->flags & CSP_FLAG_REJECTED)
{
urls_rejected++;
}
-#endif /* def
FEATURE_STATISTICS
*/
+#endif /* def
ined(FEATURE_STATISTICS) && !defined(MUTEX_LOCKS_AVAILABLE)
*/
freez(client_list);
freez(client_list);
@@
-1158,6
+1164,14
@@
int load_one_re_filterfile(struct client_state *csp, int fileid)
new_filter = FT_EXTERNAL_CONTENT_FILTER;
}
#endif
new_filter = FT_EXTERNAL_CONTENT_FILTER;
}
#endif
+ else if (strncmp(buf, "CLIENT-BODY-FILTER:", 19) == 0)
+ {
+ new_filter = FT_CLIENT_BODY_FILTER;
+ }
+ else if (strncmp(buf, "CLIENT-BODY-TAGGER:", 19) == 0)
+ {
+ new_filter = FT_CLIENT_BODY_TAGGER;
+ }
/*
* If this is the head of a new filter block, make it a
/*
* If this is the head of a new filter block, make it a
@@
-1176,6
+1190,14
@@
int load_one_re_filterfile(struct client_state *csp, int fileid)
new_bl->name = chomp(buf + 16);
}
#endif
new_bl->name = chomp(buf + 16);
}
#endif
+ else if (new_filter == FT_CLIENT_BODY_FILTER)
+ {
+ new_bl->name = chomp(buf + 19);
+ }
+ else if (new_filter == FT_CLIENT_BODY_TAGGER)
+ {
+ new_bl->name = chomp(buf + 19);
+ }
else
{
new_bl->name = chomp(buf + 21);
else
{
new_bl->name = chomp(buf + 21);
@@
-1205,7
+1227,7
@@
int load_one_re_filterfile(struct client_state *csp, int fileid)
/*
* If this is the first filter block, chain it
/*
* If this is the first filter block, chain it
- * to the file_list rather than its (nonexist
a
nt)
+ * to the file_list rather than its (nonexist
e
nt)
* predecessor
*/
if (fs->f == NULL)
* predecessor
*/
if (fs->f == NULL)
@@
-1220,7
+1242,9
@@
int load_one_re_filterfile(struct client_state *csp, int fileid)
bl = new_bl;
log_error(LOG_LEVEL_RE_FILTER, "Reading in filter \"%s\" (\"%s\")", bl->name, bl->description);
bl = new_bl;
log_error(LOG_LEVEL_RE_FILTER, "Reading in filter \"%s\" (\"%s\")", bl->name, bl->description);
-
+#ifdef FEATURE_EXTENDED_STATISTICS
+ register_filter_for_statistics(bl->name);
+#endif
freez(buf);
continue;
}
freez(buf);
continue;
}
@@
-1232,7
+1256,7
@@
int load_one_re_filterfile(struct client_state *csp, int fileid)
/* Save the code as "pattern", but do not compile anything. */
if (bl->patterns->first != NULL)
{
/* Save the code as "pattern", but do not compile anything. */
if (bl->patterns->first != NULL)
{
- log_error(LOG_LEVEL_FATAL, "External filter '%s' contains several jobs
s
. "
+ log_error(LOG_LEVEL_FATAL, "External filter '%s' contains several jobs. "
"Did you forget to escape a line break?",
bl->name);
}
"Did you forget to escape a line break?",
bl->name);
}
@@
-1317,7
+1341,8
@@
int load_one_re_filterfile(struct client_state *csp, int fileid)
}
else
{
}
else
{
- log_error(LOG_LEVEL_ERROR, "Ignoring job %s outside filter block in %s, line %d",
+ log_error(LOG_LEVEL_ERROR,
+ "Ignoring job %s outside filter block in %s, line %lu",
buf, csp->config->re_filterfile[fileid], linenum);
}
freez(buf);
buf, csp->config->re_filterfile[fileid], linenum);
}
freez(buf);