It is accessed by at least two threads:

* `[shutoff]` in `UnregisterHTTPHandler`
* `[http]` in `http_request_cb`
#include <sys/stat.h>
#include <event2/buffer.h>
#include <event2/bufferevent.h>
#include <event2/http.h>
#include <event2/keyvalq_struct.h>
#include <event2/thread.h>
#include <event2/util.h>
#include <support/events.h>
static const size_t MAX_HEADERS_SIZE = 8192;
class HTTPWorkItem final : public HTTPClosure
{
public:
    HTTPWorkItem(std::unique_ptr<HTTPRequest> _req, const std::string &_path, const HTTPRequestHandler& _func):
        req(std::move(_req)), path(_path), func(_func)
    {
    }
    void operator()() override
    {
        func(req.get(), path);
    }
    std::unique_ptr<HTTPRequest> req;
private:
    std::string path;
    HTTPRequestHandler func;
};
/** Simple work queue for distributing work over multiple threads.
 * Work items are simply callable objects.
 */
template <typename WorkItem>
class WorkQueue