Make backlog_size changeable across HUPs.
[cubemap] / server.cpp
index 266d418..2c8661a 100644 (file)
@@ -194,6 +194,13 @@ void Server::add_stream_from_serialized(const StreamProto &stream)
        streams.insert(make_pair(stream.stream_id(), new Stream(stream)));
 }
        
+void Server::set_backlog_size(const std::string &stream_id, size_t new_size)
+{
+       MutexLock lock(&mutex);
+       assert(streams.count(stream_id) != 0);
+       streams[stream_id]->set_backlog_size(new_size);
+}
+       
 void Server::set_header(const string &stream_id, const string &header)
 {
        MutexLock lock(&mutex);
@@ -527,6 +534,7 @@ void Server::process_queued_data()
             ++queued_it) {
                Stream *stream = find_stream(queued_it->first);
                stream->add_data(queued_it->second.data(), queued_it->second.size());
+               stream->wake_up_all_clients();
        }
        queued_data.clear();
 }