X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=serverpool.cpp;h=3e79b45ba41d065aa19021efe549eb1b65c08be6;hp=a598ecd68ee27b3966141025c08baa52c320cac2;hb=513af50c3e3454aafc25e97a7d20c206006e4d4c;hpb=b757a4a2ce9d24835b52a185134835762af2f50c diff --git a/serverpool.cpp b/serverpool.cpp index a598ecd..3e79b45 100644 --- a/serverpool.cpp +++ b/serverpool.cpp @@ -73,14 +73,14 @@ int ServerPool::lookup_stream_by_url(const string &url) const return servers[0].lookup_stream_by_url(url); } -int ServerPool::add_stream(const string &url, size_t backlog_size, size_t prebuffering_bytes, Stream::Encoding encoding) +int ServerPool::add_stream(const string &url, size_t backlog_size, size_t prebuffering_bytes, Stream::Encoding encoding, Stream::Encoding src_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, prebuffering_bytes, encoding); + int stream_index = servers[i].add_stream(url, backlog_size, prebuffering_bytes, encoding, src_encoding); assert(stream_index == num_http_streams); } return num_http_streams++; @@ -147,7 +147,7 @@ void ServerPool::set_header(int stream_index, const string &http_header, const s } } -void ServerPool::add_data(int stream_index, const char *data, size_t bytes, StreamStartSuitability suitable_for_stream_start) +void ServerPool::add_data(int stream_index, const char *data, size_t bytes, uint16_t metacube_flags) { assert(stream_index >= 0 && stream_index < ssize_t(num_http_streams + udp_streams.size())); @@ -159,7 +159,14 @@ void ServerPool::add_data(int stream_index, const char *data, size_t bytes, Stre // HTTP stream. for (int i = 0; i < num_servers; ++i) { - servers[i].add_data_deferred(stream_index, data, bytes, suitable_for_stream_start); + servers[i].add_data_deferred(stream_index, data, bytes, metacube_flags); + } +} + +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); } } @@ -214,3 +221,10 @@ void ServerPool::set_encoding(int stream_index, Stream::Encoding encoding) servers[i].set_encoding(stream_index, encoding); } } + +void ServerPool::set_src_encoding(int stream_index, Stream::Encoding encoding) +{ + for (int i = 0; i < num_servers; ++i) { + servers[i].set_src_encoding(stream_index, encoding); + } +}