When logging was enabled via the config file, standard output was left
fully buffered. Logs should never be fully buffered.
Thanks to Chang-Li for pointing this out.
* Don't dynamically allocate the struct since that's not necessary.
* Use a more concise log message.
* Include current clients when counting the time.
* Print final statistics message *after* closing all clients.
* Don't include total connections in ACCEPT.
* Mention SIGUSR1 in the new man page, too.
Adjusts #24.
As *BSD defaults to use IPv6 only sockets and Linux to IPv4 mapped IPv6
sockets, switches to support explicit binding address families are required.
Now set explicitly if you want IPv6 only, IPv4 only or mapped IPv4.
Caveat:
OpenBSD explicitly states to not support IPv4 mapped IPv6 via setsock-API
It seems this is required to get all the IPv6 definitions, though most
systems aren't very picky. NetBSD seems to be one of those picky
systems, though.
1. If sockets are non-blocking, no need to use poll() on them. Just try
to write regardless and ignore the outcome. This means we don't need the
pollvec stuff anymore.
2. getline(3) is apparently still too new to POSIX that it's hard to use
portably. We don't really need it that badly anyway.
3. Don't use MSG_DONTWAIT. It's non-standard and apparently still hard
to use portably. Set sockets to non-blocking instead.
4. Since we're not polling on client sockets, the queue is a whole lot
simpler.
Requires extensions to be enabled due to incomplete support for
POSIX.1-2008. However one of the now-exposed extensions is tragically
named "struct queue". This struct was been renamed to "struct fifo".
Thanks to @yvoinov for reporting this issue and collaborating on a
solution.
Closes#14, #17.
This is necessary for supporting OmniOS (Solaris), which doesn't
actually document how to actually define this flag. This platform also
requires LDLIBS='-lsocket -lnsl' when compiling.