Commits


don't fprintf


improve logs management


handle also EAGAIN together with EWOULDBLOCK


add the ``entrypoint'' option


swap check in vhost_* fns it's faster (statistically speaking) to first compute if the option is set and then fnmatch than the inverse. This way we can avoid unnecessary fnmatch.


added ``block return'' and ``strip'' options


fix auto index precedence


reload configuration on SIGHUP


use upper bound given by poll it's a waste to loop through all fds. We know the *exact* number of clients that needs attention, so use that information to limit the looping.


revert commit 346f28eeaa205d268d1e63c7ffd86cf041f6d1e6 keep mark_nonblock in utils.c, as otherwise the build for the regress suite will fail (mark_nonblock needs fatal which is in gmid.c, and we can't link gmid.o with the regress suite...)


move mark_nonblock to utils.c


mark various functions as static By marking all those function as static, the compiler is free to do more optimizations. In addition, those functions are not used outside server.c


cgi now follows globbing rules


print the header in the directory listing


simplify handle_cgi Now that I got rid of the enum+switch, adding more state is easier. Before, we used an hack to remember if we had read the CGI reply or not (c->code = -1). This introduces a new state, handle_cgi_reply that reads the CGI script reply, logs it, and only then switches to handle_cgi. handle_cgi itself is cleaner, now it only reads into c->sbuf and send what it had red. We even get, almost for free, the 42 error. If read exists with -1 or 0 from in handle_cgi_reply, we return a proper error to the client. We can extend this further in the future and also try to validate the CGI reply (for now we're only looking for a \n).