X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=server.h;h=cfb6b2e13680409314ba444f68dc023666d8de31;hp=da2076498f010785ae8d1a8954dc5d5920a7d83b;hb=f2e7dbf218365e3f47b942ea999796b2724ccc24;hpb=20e85bd6901355cc40a6cfb4c0deb7232d9aa63f diff --git a/server.h b/server.h index da20764..cfb6b2e 100644 --- a/server.h +++ b/server.h @@ -6,11 +6,11 @@ #include #include #include -#include #include #include #include #include +#include #include #include "tlse.h" @@ -106,13 +106,13 @@ private: std::vector> streams; // Map from URL to index into . - std::map stream_url_map, stream_hls_url_map; + std::unordered_map stream_url_map, stream_hls_url_map; // Map from URL to CORS Allow-Origin header (or empty string). - std::map ping_url_map; + std::unordered_map ping_url_map; // Map from file descriptor to client. - std::map clients; + std::unordered_map clients; // A list of all clients, ordered by the time they connected (first element), // and their file descriptor (second element). It is ordered by connection time @@ -132,7 +132,7 @@ private: epoll_event events[EPOLL_MAX_EVENTS]; // For each TLS-enabled acceptor, our private server context for its key pair. - std::map tls_server_contexts; + std::unordered_map tls_server_contexts; // The actual worker thread. virtual void do_work(); @@ -201,6 +201,10 @@ private: void skip_lost_data(Client *client); void add_client(int sock, Acceptor *acceptor); + + // Mark that a client just went into READING_REQUEST state, so we should + // note the current time of day and then put it into . + void start_client_timeout_timer(Client *client); }; #endif // !defined(_SERVER_H)