]> git.sesse.net Git - cubemap/blobdiff - serverpool.cpp
Fix handling of streams with no data.
[cubemap] / serverpool.cpp
index be47aa99139c17e4048cc82a9b6becac369e8348..1c99d4065ef50a39fe808ebcb72331a81d8e0856 100644 (file)
@@ -121,9 +121,9 @@ int ServerPool::add_stream_from_serialized(const StreamProto &stream, const vect
        return num_http_streams++;
 }
        
-int ServerPool::add_udpstream(const sockaddr_in6 &dst, MarkPool *mark_pool)
+int ServerPool::add_udpstream(const sockaddr_in6 &dst, MarkPool *mark_pool, int pacing_rate)
 {
-       udp_streams.push_back(new UDPStream(dst, mark_pool));
+       udp_streams.push_back(new UDPStream(dst, mark_pool, pacing_rate));
        return num_http_streams + udp_streams.size() - 1;
 }
 
@@ -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)
+void ServerPool::add_data(int stream_index, const char *data, size_t bytes, StreamStartSuitability suitable_for_stream_start)
 {
        assert(stream_index >= 0 && stream_index < ssize_t(num_http_streams + udp_streams.size()));
 
@@ -159,7 +159,7 @@ void ServerPool::add_data(int stream_index, const char *data, size_t bytes)
 
        // HTTP stream.
        for (int i = 0; i < num_servers; ++i) {
-               servers[i].add_data_deferred(stream_index, data, bytes);
+               servers[i].add_data_deferred(stream_index, data, bytes, suitable_for_stream_start);
        }
 }
 
@@ -191,6 +191,13 @@ void ServerPool::set_mark_pool(int stream_index, MarkPool *mark_pool)
 {
        for (int i = 0; i < num_servers; ++i) {
                servers[i].set_mark_pool(stream_index, mark_pool);
+       }
+}
+
+void ServerPool::set_pacing_rate(int stream_index, uint32_t pacing_rate)
+{
+       for (int i = 0; i < num_servers; ++i) {
+               servers[i].set_pacing_rate(stream_index, pacing_rate);
        }       
 }