#
# Makefile for the Squid Object Cache server
#
-# $Id: Makefile.in,v 1.63 1997/02/20 21:09:04 wessels Exp $
+# $Id: Makefile.in,v 1.64 1997/02/20 22:22:54 wessels Exp $
#
# Uncomment and customize the following to suit your needs:
#
USERAGENT_OPT = # -DUSE_USERAGENT_LOG=1
KILL_PARENT_OPT = # -DKILL_PARENT_OPT
USE_POLL_OPT = # -DUSE_POLL
-ANON_OPT = # -DUSE_ANONYMIZER
#
# do NOT define both USE_SPLAY_TREE and USE_BIN_TREE, only 1 at a time!
#
USE_BIN_TREE = # -DUSE_BIN_TREE
DEFINES = $(HOST_OPT) $(AUTH_OPT) $(LOG_HDRS_OPT) \
$(ICMP_OPT) $(DELAY_HACK) $(USERAGENT_OPT) \
- $(KILL_PARENT_OPT) $(USE_POLL_OPT) $(ANON_OPT) \
+ $(KILL_PARENT_OPT) $(USE_POLL_OPT) \
$(USE_SPLAY_TREE) $(USE_BIN_TREE)
prefix = @prefix@
gopher.o \
hash.o \
http.o \
+ http-anon.o \
icmp.o \
icp.o \
ident.o \
/*
- * $Id: cache_cf.cc,v 1.172 1997/02/19 17:05:21 wessels Exp $
+ * $Id: cache_cf.cc,v 1.173 1997/02/20 22:22:55 wessels Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
static void parseCachemgrPasswd _PARAMS((void));
static void parsePathname _PARAMS((char **));
static void parseProxyLine _PARAMS((peer **));
+static void parseHttpAnonymizer _PARAMS((int *));
static void
self_destruct(void)
wordlistDestroy(&actions);
}
+static void
+parseHttpAnonymizer(int *iptr)
+{
+ char *token;
+ token = strtok(NULL, w_space);
+ if (token == NULL)
+ self_destruct();
+ if (!strcasecmp(token, "off"))
+ *iptr = ANONYMIZER_NONE;
+ else if (!strcasecmp(token, "paranoid"))
+ *iptr = ANONYMIZER_PARANOID;
+ else
+ *iptr = ANONYMIZER_STANDARD;
+}
+
int
parseConfigFile(const char *file_name)
{
parseOnOff(&opt_forwarded_for);
else if (!strcmp(token, "log_icp_queries"))
parseOnOff(&Config.Options.log_udp);
+ else if (!strcmp(token, "http_anonymizer"))
+ parseHttpAnonymizer(&Config.Options.anonymizer);
else if (!strcmp(token, "minimum_direct_hops"))
parseIntegerValue(&Config.minDirectHops);
/*
- * $Id: http.cc,v 1.147 1997/01/31 23:44:10 wessels Exp $
+ * $Id: http.cc,v 1.148 1997/02/20 22:23:02 wessels Exp $
*
* DEBUG: section 11 Hypertext Transfer Protocol (HTTP)
* AUTHOR: Harvest Derived
}
}
-#ifdef USE_ANONYMIZER
-#include "http-anon.c"
-#endif
-
static void
httpAppendRequestHeader(char *hdr, const char *line, size_t * sz, size_t max)
{
size_t n = *sz + strlen(line) + 2;
if (n >= max)
return;
-#ifdef USE_ANONYMIZER
-#ifdef USE_PARANOID_ANONYMIZER
- if (httpAnonSearchHeaderField(http_anon_allowed_header, line) == NULL) {
-#else
- if (httpAnonSearchHeaderField(http_anon_denied_header, line) == NULL) {
-#endif
- debug(11, 5, "httpAppendRequestHeader: removed for anonymity: <%s>\n",
- line);
- return;
+ if (Config.Options.anonymizer == ANONYMIZER_PARANOID) {
+ if (!httpAnonAllowed(line))
+ return;
+ } else if (Config.Options.anonymizer == ANONYMIZER_STANDARD) {
+ if (httpAnonDenied(line))
+ return;
}
-#endif
/* allowed header, explicitly known to be not dangerous */
debug(11, 5, "httpAppendRequestHeader: %s\n", line);
strcpy(hdr + (*sz), line);
/*
- * $Id: squid.h,v 1.93 1997/01/31 22:30:36 wessels Exp $
+ * $Id: squid.h,v 1.94 1997/02/20 22:23:08 wessels Exp $
*
* AUTHOR: Duane Wessels
*
int *size_ptr));
extern void identStart _PARAMS((int, icpStateData *,
void (*callback) _PARAMS((void *))));
+extern int httpAnonAllowed _PARAMS((const char *line));
+extern int httpAnonDenied _PARAMS((const char *line));
extern const char *const dash_str;
extern const char *const null_string;