X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=stream.h;h=33fb55eeeab9180589d57275b182f806dcb3b9a3;hp=97451f0c8afe7fe08dc57b7c44c18e64de4a0615;hb=1e15bf9054e65adfce268578f4e474c980ef6443;hpb=e0b47eba2f5ec1aca1d02adc9fb4ffc7293d5c0f diff --git a/stream.h b/stream.h index 97451f0..33fb55e 100644 --- a/stream.h +++ b/stream.h @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -70,7 +71,8 @@ struct Stream { MarkPool *mark_pool; // Queued data, if any. Protected by the owning Server's . - std::string queued_data; + // The data pointers in the iovec are owned by us. + std::vector queued_data; // Put client to sleep, since there is no more data for it; we will on // longer listen on POLLOUT until we get more data. Also, it will be put @@ -78,6 +80,7 @@ struct Stream { void put_client_to_sleep(Client *client); // Add more data to , adding Metacube headers if needed. + // Does not take ownership of . // You should hold the owning Server's . void add_data_deferred(const char *data, size_t bytes); @@ -89,9 +92,9 @@ private: Stream(const Stream& other); // Adds data directly to the stream file descriptor, without adding headers or - // going through . You should hold the owning Server's - // . - void add_data_raw(const char *data, ssize_t bytes); + // going through . + // You should hold the owning Server's . + void add_data_raw(const std::vector &data); }; #endif // !defined(_STREAM_H)