X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=httpd.h;h=9901814586cb913ca06c7f6afc4f39364561f5ac;hb=3795723be95f2fe82f3c8b8b45b1a905b2c811fd;hp=57c649b61158c6f73b498aeca6556b97bc52f179;hpb=0d0e637698dc347c2fec4746affbcf02d51a31f8;p=nageru diff --git a/httpd.h b/httpd.h index 57c649b..9901814 100644 --- a/httpd.h +++ b/httpd.h @@ -3,16 +3,16 @@ // A class dealing with stream output to HTTP. -#include -#include -#include #include #include #include #include #include #include +#include +#include #include +#include #include #include @@ -32,7 +32,8 @@ public: ~HTTPD(); // Should be called before start(). - void set_header(const std::string &data) { + void set_header(const std::string &data) + { header = data; } @@ -41,14 +42,16 @@ public: NO_CORS_POLICY, ALLOW_ALL_ORIGINS }; - void add_endpoint(const std::string &url, const EndpointCallback &callback, CORSPolicy cors_policy) { + void add_endpoint(const std::string &url, const EndpointCallback &callback, CORSPolicy cors_policy) + { endpoints[url] = Endpoint{ callback, cors_policy }; } void start(int port); void stop(); void add_data(const char *buf, size_t size, bool keyframe, int64_t time, AVRational timebase); - int64_t get_num_connected_clients() const { + int64_t get_num_connected_clients() const + { return metric_num_connected_clients.load(); }