]> git.sesse.net Git - cubemap/blobdiff - server.h
Stop doing find_stream() every time we send out data; it takes some CPU.
[cubemap] / server.h
index 24e2fcbac3a737a91211bed9eea590d9d1c1a86a..fd309f41e34e1b97434f5af0071f9a47e4ad6690 100644 (file)
--- a/server.h
+++ b/server.h
@@ -15,6 +15,7 @@
 
 class ClientProto;
 class CubemapStateProto;
+class Stream;
 class StreamProto;
 
 struct Client {
@@ -22,7 +23,7 @@ struct Client {
        Client(int sock);
 
        // Serialization/deserialization.
-       Client(const ClientProto &serialized);
+       Client(const ClientProto &serialized, Stream *stream);
        ClientProto serialize() const;
 
        // The file descriptor associated with this socket.
@@ -38,6 +39,7 @@ struct Client {
        // What stream we're connecting to; parsed from <request>.
        // Not relevant for READING_REQUEST.
        std::string stream_id;
+       Stream *stream;
 
        // The header we want to send. This is nominally a copy of Stream::header,
        // but since that might change on reconnects etc., we keep a local copy here.