libwebserver shutdown patch

For the impatient:
Patch for libwebserver 0.5.3
Tracker item on SourceForge
Libwebserver page

Libwebserver is a fully functional web server in a tiny little library. It serves HTTP 1.0 and 1.1, and even supports SSL and cookies. You can use it to expose files and directories for download, but you can also write custom handlers whose output is sent directly to the client.

Granted, if you just want a web server, libwebserver isn’t for you. However, if you want to embed a web server in another program, it’s perfect. We’re using it in our quest for synchronizing mp3 playback, and we love it…

…except for one thing. Libwebserver lets you start a server, but doesn’t provide a way to stop it. This might be reasonable for most programs, but not ours; we start and stop the server fairly often. This patch adds a web_server_shutdown() call that stops the server, closes its socket, and deallocates its memory.

Leave a Reply

Your email address will not be published. Required fields are marked *