On 20 April 2016 at 05:17, Sylvain BERTRAND <sylvain.bertr...@gmail.com> wrote: > For my personnal use, I needed a small http server. All "mini" http servers > out > there I had a look were, IMHO, bloaty (SDK included).
Did you also look at http://git.suckless.org/quark/tree/quark.c ? quark is fork() based (and POSIX compliant in that sense) though, not epoll_wait() based. So quark will perform accordingly, but it supports a bit more HTTP features (incl. cgi execution), but its SLOC is considerable equal to lnanohttpd. > lnanohttp is really small (including dependencies and SDK), straight on linux > kernel > syscalls with a thin layer. Tested only on x86 and with a gcc/binutils > toolchain for the moment (planing to buy an armv8 raspberry board). > > Can be use easily as a base for a beefier http server. Some quick remarks: it uses a lot of #define's (all over the place) which I consider very weird. Also for type declarations it uses #define's of types which seem to be very weird as well. (e.g. #define sl ulinux_sl). Also is relying on -errno checks all over the place really secure? I would rather check for -1 and compare with errno directly. Or is it a linux pattern I wasn't aware of? BR, -Anselm