A minimal but flexible directory listing server
cb7a1f6390
While off_t might be better suited for file-offsets and -sizes, the IEEE Computer Society was unable to mandate limits (min, max) for it in the POSIX specification in the last 32 years. Because it's impossible to portably determine these numbers for signed integers, I decided to switch to size_t for the offsets to be able to pass proper values to strtonum(), because C99 is sane and has defined limits for size_t (i.e. SIZE_MIN and SIZE_MAX). On my system, long long and off_t have the same size, so it didn't trigger any bugs, but strtonum() could pass a bigger number to lower and upper than they can handle and make them overflow. The rationale for switching to size_t is actually given by the fact that functions like mmap() blur the border between memory and filesystem. Another point is that glibc has a horrible define _FILE_OFFSET_BITS you need to set to 64 to actually get decent values for off_t, which was a huge headache in sbase until we found that out. Signed-off-by: Laslo Hunhold <dev@frign.de> |
||
---|---|---|
arg.h | ||
config.def.h | ||
config.mk | ||
http.c | ||
http.h | ||
LICENSE | ||
main.c | ||
Makefile | ||
quark.1 | ||
resp.c | ||
resp.h | ||
sock.c | ||
sock.h | ||
util.c | ||
util.h |