diff options
author | Robert James Kaes <rjkaes@users.sourceforge.net> | 2000-03-31 20:08:19 +0000 |
---|---|---|
committer | Robert James Kaes <rjkaes@users.sourceforge.net> | 2000-03-31 20:08:19 +0000 |
commit | 0edeabbd63b5524ee27a8123015f08a477e6929c (patch) | |
tree | 8fa8f481cfd3cf0d014db33858d1a7eb25b0acd8 | |
parent | b1e97bd24f5796d12f8afc3e1c28da2a7e68054e (diff) | |
download | tinyproxy-0edeabbd63b5524ee27a8123015f08a477e6929c.tar.gz tinyproxy-0edeabbd63b5524ee27a8123015f08a477e6929c.zip |
Removed the allowedhdr_s structure since it is now accessed through
anonymous.*
Diffstat (limited to '')
-rw-r--r-- | src/tinyproxy.c | 50 | ||||
-rw-r--r-- | src/tinyproxy.h | 8 |
2 files changed, 16 insertions, 42 deletions
diff --git a/src/tinyproxy.c b/src/tinyproxy.c index 22907ab..e41d95e 100644 --- a/src/tinyproxy.c +++ b/src/tinyproxy.c @@ -1,4 +1,4 @@ -/* $Id: tinyproxy.c,v 1.2 2000-03-11 20:37:44 rjkaes Exp $ +/* $Id: tinyproxy.c,v 1.3 2000-03-31 20:08:19 rjkaes Exp $ * * The initialize routine. Basically sets up all the initial stuff (logfile, * listening socket, config options, etc.) and then sits there and loops @@ -56,6 +56,7 @@ adns_state adns; #include "reqs.h" #include "buffer.h" #include "filter.h" +#include "anonymous.h" void takesig(int sig); @@ -89,7 +90,6 @@ struct config_s config = { struct stat_s stats; float load = 0.00; -struct allowedhdr_s *allowedhdrs = NULL; /* * Dump info to the logfile @@ -258,9 +258,6 @@ int main(int argc, char **argv) char *upstream_ptr; #endif /* UPSTREAM_PROXY */ - struct allowedhdr_s **rpallowedptr = &allowedhdrs; - struct allowedhdr_s *allowedptr = allowedhdrs, *newallowed; - while ((optch = getopt(argc, argv, "vh?dp:l:Sa:w:s:u:n:i:rx:f:t:")) != EOF) { switch (optch) { @@ -310,27 +307,7 @@ int main(int argc, char **argv) break; case 'a': config.anonymous = TRUE; - - while (allowedptr) { - rpallowedptr = &allowedptr->next; - allowedptr = allowedptr->next; - } - - if (! - (newallowed = - xmalloc(sizeof(struct allowedhdr_s)))) { - log("tinyproxy: cannot allocate headers"); - exit(EX_SOFTWARE); - } - - if (!(newallowed->hdrname = xstrdup(optarg))) { - log("tinyproxy: cannot duplicate string"); - exit(EX_SOFTWARE); - } - - *rpallowedptr = newallowed; - newallowed->next = allowedptr; - + anon_insert(optarg); break; case 'n': if (!(config.subnet = xstrdup(optarg))) { @@ -397,6 +374,18 @@ int main(int argc, char **argv) exit(EX_OK); } + /* + * If ANONYMOUS is turned on, make sure that Content-Length is + * in the list of allowed headers, since it is required in a + * HTTP/1.0 request. Also add the Content-Type header since it goes + * hand in hand with Content-Length. + * - rjkaes + */ + if (config.anonymous) { + anon_insert("Content-Length:"); + anon_insert("Content-Type:"); + } + /* chris - Initialise asynchronous DNS */ if (adns_init(&adns, 0, 0)) { log("tinyproxy: could not initialise ADNS"); @@ -499,15 +488,6 @@ int main(int argc, char **argv) else closelog(); - allowedptr = allowedhdrs; - while (allowedptr) { - struct allowedhdr_s *delptr = NULL; - delptr = allowedptr; - safefree(delptr->hdrname); - allowedptr = delptr->next; - safefree(delptr); - } - /* finsih up ADNS */ adns_finish(adns); diff --git a/src/tinyproxy.h b/src/tinyproxy.h index 22630a7..041c80f 100644 --- a/src/tinyproxy.h +++ b/src/tinyproxy.h @@ -1,4 +1,4 @@ -/* $Id: tinyproxy.h,v 1.2 2000-03-11 20:37:44 rjkaes Exp $ +/* $Id: tinyproxy.h,v 1.3 2000-03-31 20:08:19 rjkaes Exp $ * * See 'tinyproxy.c' for a detailed description. * @@ -77,15 +77,9 @@ struct stat_s { unsigned long int num_refused; }; -struct allowedhdr_s { - char *hdrname; - struct allowedhdr_s *next; -}; - /* Global Structures used in the program */ extern struct config_s config; extern struct stat_s stats; -extern struct allowedhdr_s *allowedhdrs; extern float load; #endif |