Nokotan -- not very complicated Spartan daemon.

Supported command line parameters:
-d <absolute-path>
	A directory to serve. Default is /var/spartan/
-p <port>
	A port to listen on. Default is 300
-u <user name>
-g <group name>
	The user and group to which privilleges are dropped. Default -
	do not switch user and group.
-f
	Do not daemonize, work in foreground.
-c
	Try to chroot to the served directory.
-V
	Enable basic virtual hosts support (see below).
-v
	Be more verbose. Use twice to enable debug messages.
-e
	Also send log messages to stderr.
-E
	Send log messages to stderr only.
-h
	This list of options and the program version.

Nokotan remains single-process, but uses select(2) (which is my favourite
Unix system call) to serve multiple clients at a single time.

When requested file is a directory, then it sends a directory listing. If
a requested directory contains a file named .message, this file is written
before the listing, much like in many FTP daemons.

Directory listing items are sorted in this manner: all directories are put
before other files, and everything is sorted alphabetically, ignoring case.

In this version files' MIME types and charater encodings are
hard-coded:
"text/gemini" is for .gmi, .gem, .gemini and .message files;
"text/plain" is used by .txt, .sh, .c and files with no suffix
"video/mp4" for .mp4
"audio/mpeg" for .mp3
"application/octet-stream" for other suffixes;

charset parameter is always US-ASCII.

I promise I will fix MIME types in future versions. May be something like
.htaccess will be a good solution. Maybe not.

With -V flag, the daemon uses each directory in a Spartan root as a
separate virtual host. Directories are named as a virtual host they are
used by.

V-hosts support is basic and I didn't test it yet, so it might be buggy.

If you experience troubles with Nokotan daemon (and the real Nokotan too!),
write me to <arbo@sh.pp.ru>
