X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=client.h;h=954ad41967878b123ea388fe9110f7d6b4069603;hp=d23b860767e16ecc372ab5726c6df8f2044ae7e3;hb=2fbbdf3c4a4ffd2d90c102a37c7a02b5b6f80216;hpb=6889a665614e926437484a556124a5ff60363568 diff --git a/client.h b/client.h index d23b860..954ad41 100644 --- 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;