]> git.sesse.net Git - cubemap/blobdiff - client.h
Store multiple suitable starting points for each stream.
[cubemap] / client.h
index d23b860767e16ecc372ab5726c6df8f2044ae7e3..954ad41967878b123ea388fe9110f7d6b4069603 100644 (file)
--- a/client.h
+++ b/client.h
@@ -11,11 +11,14 @@ class ClientProto;
 struct Stream;
 
 // Digested statistics for writing to logs etc.
+// Note that "referer" and "user_agent" here are already escaped for scary characters.
 struct ClientStats {
        std::string url;
        int sock;
        std::string remote_addr;
-       time_t connect_time;
+       std::string referer;
+       std::string user_agent;
+       timespec connect_time;
        size_t bytes_sent;
        size_t bytes_lost;
        size_t num_loss_events;
@@ -33,9 +36,13 @@ struct Client {
        // The file descriptor associated with this socket.
        int sock;
 
+       // When the client connected, in terms of CLOCK_MONOTONIC_COARSE.
+       timespec connect_time;
+
        // Some information only used for logging.
        std::string remote_addr;
-       time_t connect_time;
+       std::string referer;
+       std::string user_agent;
 
        enum State { READING_REQUEST, SENDING_HEADER, SENDING_DATA, SENDING_ERROR, WAITING_FOR_KEYFRAME, PREBUFFERING };
        State state;