summaryrefslogtreecommitdiffhomepage
path: root/src/conf.h
AgeCommit message (Collapse)Author
2020-09-16remove vector remainsrofl0r
2020-09-16listen_addrs: use sblistrofl0r
2020-09-16basicauth: use sblistrofl0r
2020-09-16connect_ports: use sblistrofl0r
2020-09-16add_header: use sblistrofl0r
note that the old code inserted added headers at the beginning of the list, reasoning unknown. this seems counter-intuitive as the headers would end up in the request in the reverse order they were added, but this was irrelevant, as the headers were originally first put into the hashmap hashofheaders before sending it to the client. since the hashmap didn't preserve ordering, the headers would appear in random order anyway.
2020-09-15replace leftover users of hashmap with htabrofl0r
also fixes a bug where the ErrorFile directive would create a new hashmap on every added item, effectively allowing only the use of the last specified errornumber, and producing memory leaks on each config reload.
2020-09-15fix free()ing of config itemsrofl0r
- we need to free the config after it has been succesfully loaded, not unconditionally before reloading. - we also need to free them before exiting from the main program to have clean valgrind output.
2020-09-07acl: typedef access_list to acl_list_trofl0r
this allows to switch the underlying implementation easily.
2020-01-15conf: fix loading of default valuesrofl0r
previously, default values were stored once into a static struct, then on each reload item by item copied manually into a "new" config struct. this has proven to be errorprone, as additions in one of the 2 locations were not propagated to the second one, apart from being simply a lot of gratuitous code. we now simply load the default values directly into the config struct to be used on each reload. closes #283
2020-01-15remove config file name item from conf structrofl0r
since this is set via command line, we can deal with it easily from where it is actually needed.
2020-01-15remove godaemon member from config structurerofl0r
since this option can't be set via config file, it makes sense to factor it out and use it only where strictly needed, e.g. in startup code.
2020-01-15move initialize_config_defaults to conf.crofl0r
2019-12-21simplify codebase by using one thread/conn, instead of preforked procsrofl0r
the existing codebase used an elaborate and complex approach for its parallelism: 5 different config file options, namely - MaxClients - MinSpareServers - MaxSpareServers - StartServers - MaxRequestsPerChild were used to steer how (and how many) parallel processes tinyproxy would spin up at start, how many processes at each point needed to be idle, etc. it seems all preforked processes would listen on the server port and compete with each other about who would get assigned the new incoming connections. since some data needs to be shared across those processes, a half- baked "shared memory" implementation was provided for this purpose. that implementation used to use files in the filesystem, and since it had a big FIXME comment, the author was well aware of how hackish that approach was. this entire complexity is now removed. the main thread enters a loop which polls on the listening fds, then spins up a new thread per connection, until the maximum number of connections (MaxClients) is hit. this is the only of the 5 config options left after this cleanup. since threads share the same address space, the code necessary for shared memory access has been removed. this means that the other 4 mentioned config option will now produce a parse error, when encountered. currently each thread uses a hardcoded default of 256KB per thread for the thread stack size, which is quite lavish and should be sufficient for even the worst C libraries, but people may want to tweak this value to the bare minimum, thus we may provide a new config option for this purpose in the future. i suspect that on heavily optimized C libraries such a musl, a stack size of 8-16 KB per thread could be sufficient. since the existing list implementation in vector.c did not provide a way to remove a single item from an existing list, i added my own list implementation from my libulz library which offers this functionality, rather than trying to add an ad-hoc, and perhaps buggy implementation to the vector_t list code. the sblist code is contained in an 80 line C file and as simple as it can get, while offering good performance and is proven bugfree due to years of use in other projects.
2018-02-06add support for basic HTTP authenticationrofl0r
using the "BasicAuth" keyword in tinyproxy.conf. base64 code was written by myself and taken from my own library "libulz". for this purpose it is relicensed under the usual terms of the tinyproxy license.
2013-11-09[BB#63] conf: Allow multiple Listen statements in the config.Michael Adam
This introduces a list (vector) of addresses instead of having just one address string. Signed-off-by: Michael Adam <obnox@samba.org>
2010-06-01[BB#89] Don't recompile regular expressionsJohn van der Kamp
This is a modification of a patch originally written by John van der Kamp <john@kirika.demon.nl> at <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=579427#12> The modification was done by the committer.
2010-01-25Fix compiler warning about dereferencing type-punned pointersMukund Sivaraman
2010-01-08[BB#17] Add custom HTTP request headers to outgoing HTTP requestsMukund Sivaraman
2009-12-23conf: confess - add my (C) after substantial changes.Michael Adam
Michael
2009-12-22conf.h: add "extern" to prototype of reload_config_fileMichael Adam
Michael
2009-12-22conf: make free_config staticMichael Adam
Michael
2009-12-22conf: make load_config_file static.Michael Adam
Michael
2009-12-22conf: rename reload_config --> reload_config_fileMichael Adam
Michael
2009-12-07Move definition of "struct config_s" from main.h to conf.hMichael Adam
Michael
2009-12-07Add reload_config() - (re-)load the config file, keeping defaults.Michael Adam
This allows for later reloading the config at SIGHUP (e.g.). First the old config data is freed, then the defaults that are given as a parameter are copied over in a rather clumsy manual fashion (maybe something more clever can be done here) and finally, the actual config file is loaded. Michael
2009-12-07Add free_config() - free all config data.Michael Adam
Michael
2009-11-14conf: refactor loading of config file out into load_config_file()Michael Adam
and make config_compile and config_parse static to conf.c Michael
2009-09-21Rename conffile.[ch] to conf.[ch]Mukund Sivaraman