summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-10-11 01:13:15 +0200
committerMichael Adam <obnox@samba.org>2009-10-11 01:13:15 +0200
commitf208b1222b968d9701662daea7dc260f4ca62d95 (patch)
treebd7b6c61347aa9208c6ea9365338e0b5fe02b784
parentf46aeca9a583821d34e0cd9925a03475fe8e345d (diff)
downloadtinyproxy-f208b1222b968d9701662daea7dc260f4ca62d95.tar.gz
tinyproxy-f208b1222b968d9701662daea7dc260f4ca62d95.zip
Add a boolean config option "DisableViaHeader".
Diffstat (limited to '')
-rw-r--r--src/conf.c15
-rw-r--r--src/main.h2
2 files changed, 17 insertions, 0 deletions
diff --git a/src/conf.c b/src/conf.c
index 70ba939..ca2172f 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -131,6 +131,7 @@ static HANDLE_FUNC (handle_timeout);
static HANDLE_FUNC (handle_user);
static HANDLE_FUNC (handle_viaproxyname);
+static HANDLE_FUNC (handle_disableviaheader);
static HANDLE_FUNC (handle_xtinyproxy);
#ifdef UPSTREAM_SUPPORT
@@ -182,6 +183,7 @@ struct {
/* boolean arguments */
STDCONF ("syslog", BOOL, handle_syslog),
STDCONF ("bindsame", BOOL, handle_bindsame),
+ STDCONF ("disableviaheader", BOOL, handle_disableviaheader),
/* integer arguments */
STDCONF ("port", INT, handle_port),
STDCONF ("maxclients", INT, handle_maxclients),
@@ -435,6 +437,19 @@ static HANDLE_FUNC (handle_viaproxyname)
return 0;
}
+static HANDLE_FUNC (handle_disableviaheader)
+{
+ int r = set_bool_arg (&conf->disable_viaheader, line, &match[2]);
+
+ if (r) {
+ return r;
+ }
+
+ log_message (LOG_INFO,
+ "Disabling transmission of the \"Via\" header.");
+ return 0;
+}
+
static HANDLE_FUNC (handle_defaulterrorfile)
{
return set_string_arg (&conf->errorpage_undef, line, &match[2]);
diff --git a/src/main.h b/src/main.h
index 50e4cab..16c3352 100644
--- a/src/main.h
+++ b/src/main.h
@@ -83,6 +83,8 @@ struct config_s {
*/
char *via_proxy_name;
+ unsigned int disable_viaheader; /* boolean */
+
/*
* Error page support. Map error numbers to file paths.
*/