Socket activation
This allows using with systemd socket units. It works like the old inetd style activation.
The socket(s) to open are described in systemd socket units, and when a connection is made, systemd starts webdavd and passes the sockets to it on some file descriptors.
This way webdavd doesn't need to be running until it's used. Systemd also supports a lot more options for how it can listen on a socket. E.g., sockets can be bound to a specific interface and UNIX domain sockets can be used. See man:systemd.socket(5).
Multiple sockets can be used, e.g. http and https. Systemd will pass all of them to webdavd.
libminihttpd supports this already and can take an existing fd as the socket.
I use a systemd function that does some handy stuff, so this requires systemd's libraries. So that this isn't a hard dependency, it's protected in the build system by requiring HAVE_SYSTEMD to be set at build time, e.g. make HAVE_SYSTEMD=1.
One could add support for the old inetd server, but I didn't since it's not been included with with Fedora for years.
WebDAVd doesn't support shutting down after being idle for a period of time, but it could. Most of the logic is already there to do that. Without socket activation it wasn't useful since it wouldn't start up again, but with socket activation it should be possible to webdavd to exit when all the workers have shutdown.
I used this to put webdavd behind an nginx reverse proxy. I only wanted it to be on a certain vhost. Originally I had it on localhost:30000 and nginx would proxy dav.mydomain.com to localhost:30000.
But a UNIX domain socket would be better. It is more efficient than TCP/IP over loopback and the UNIX socket has better access control. Only processes in the nginx group are allowed to open it, unlike anything on localhost for the AF_INET socket.
I added UNIX sockets to webdavd, but this was a pain. You need to add the socket path to the xml, the group needs to be set so nginx can open it, the socket permissions to 0660, and then creating leading directories, and those directories' permissions, and how many listening connections are allowed, and so on. It was going to be a huge pain to add all this code to webdavd and put everything into the xml file.
So instead I added socket based activation. systemd already supports all this stuff for UNIX domain sockets, and a lot more besides, so one basically gets full UNIX socket support for free. In additional to the not running until used feature.