X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=serverpool.cpp;h=c77c30ef85c262084a0d92ad862da38a4717ceb5;hp=4684d8c63267d4af225f55eeab61b401829f00b1;hb=364cb4e07ae1dcb65e8492e8e66494d6c8098b3a;hpb=0eac9253f23925734e256c63081e157c68c70704 diff --git a/serverpool.cpp b/serverpool.cpp index 4684d8c..c77c30e 100644 --- a/serverpool.cpp +++ b/serverpool.cpp @@ -67,20 +67,20 @@ void ServerPool::add_client_from_serialized(const ClientProto &client) servers[clients_added++ % num_servers].add_client_from_serialized(client); } -int ServerPool::lookup_stream_by_url(const std::string &url) const +int ServerPool::lookup_stream_by_url(const string &url) const { assert(servers != NULL); return servers[0].lookup_stream_by_url(url); } -int ServerPool::add_stream(const string &url, size_t backlog_size, Stream::Encoding encoding) +int ServerPool::add_stream(const string &url, size_t backlog_size, size_t prebuffering_bytes, Stream::Encoding encoding) { // Adding more HTTP streams after UDP streams would cause the UDP stream // indices to move around, which is obviously not good. assert(udp_streams.empty()); for (int i = 0; i < num_servers; ++i) { - int stream_index = servers[i].add_stream(url, backlog_size, encoding); + int stream_index = servers[i].add_stream(url, backlog_size, prebuffering_bytes, encoding); assert(stream_index == num_http_streams); } return num_http_streams++; @@ -163,6 +163,13 @@ void ServerPool::add_data(int stream_index, const char *data, size_t bytes, Stre } } +void ServerPool::add_gen204(const std::string &url, const std::string &allow_origin) +{ + for (int i = 0; i < num_servers; ++i) { + servers[i].add_gen204(url, allow_origin); + } +} + void ServerPool::run() { for (int i = 0; i < num_servers; ++i) { @@ -201,6 +208,13 @@ void ServerPool::set_backlog_size(int stream_index, size_t new_size) } } +void ServerPool::set_prebuffering_bytes(int stream_index, size_t new_amount) +{ + for (int i = 0; i < num_servers; ++i) { + servers[i].set_prebuffering_bytes(stream_index, new_amount); + } +} + void ServerPool::set_encoding(int stream_index, Stream::Encoding encoding) { for (int i = 0; i < num_servers; ++i) {