add mimetype and autoindex option + minor changes
* follow style(9) for prototypes * move first most used extension for more effeciciency when looking for mime * add opts.h to deal with options * remove lang=en by default * add option to set default mimetype * add option to autoindex if no index.gmi found * redirect if ending "/" is missing * send appropriate status code if request too long * edit manpage and README for new options
This commit is contained in:
parent
4a1b0c8ce2
commit
f60ea88c8d
11 changed files with 191 additions and 97 deletions
12
opts.h
Normal file
12
opts.h
Normal file
|
@ -0,0 +1,12 @@
|
|||
#include <limits.h> /* PATH_MAX */
|
||||
|
||||
#define DEFAULT_MIME "application/octet-stream"
|
||||
#define DEFAULT_LANG ""
|
||||
#define DEFAULT_CHROOT "/var/gemini"
|
||||
#define DEFAULT_AUTOIDX 0
|
||||
|
||||
/* longest is 56 so 64 should be enough */
|
||||
static char default_mime[64] = DEFAULT_MIME;
|
||||
static char chroot_dir[PATH_MAX] = DEFAULT_CHROOT;
|
||||
static char lang[16] = DEFAULT_LANG;
|
||||
static unsigned int doautoidx = DEFAULT_AUTOIDX;
|
Loading…
Add table
Add a link
Reference in a new issue