The more traditional approach is to fork for every new connection. That yields the advantage of having complete seperation of the connections as well as a much simpler program structure. A big disadvantage is that the server is more susceptible for things like Slow-Lorris attacks. Also the resource consumption is higher.
This webserver handles all connection (for a given bind) in the same thread. All sockets are set as non-blocking and asynchronous meaning that new data on a socket creates a SIGIO signal that causes the data handler to check every active connection for new data. If the HTTP header for a connection is complete the handler for the site is started in a new thread.
The consequence is a very slim memory footprint.
## Feature-Set
- The server can bind to multible addresses at once.
- It can be compiled with full SSL support (OpenSSL) on a per-bind basis.
- Virtual host ("site") support including hostname wildcards
- Basic file handling with optional indexes
- CGI/1.1 support
- Dynamic logging (+ additional access log)
- All settings can be specified via a config file.
Features yet to implement:
- Full SSL-certificate-chain
- Dynamic mods (handlers, ...)
## Modability
I designed the webserver to be as flexible as possible. If the config module is not in use every aspect of the server can be controlled in a fine-grained manner.
New handlers can be added using the `handlerGetter_t` type.