// Process each client where its stream has new data,
// even if there was no socket activity.
// Process each client where its stream has new data,
// even if there was no socket activity.
vector<Client *> to_process;
swap(stream->to_process, to_process);
for (Client *client : to_process) {
vector<Client *> to_process;
swap(stream->to_process, to_process);
for (Client *client : to_process) {
for (const auto &fd_and_client : clients) {
serialized.add_clients()->MergeFrom(fd_and_client.second.serialize());
}
for (const auto &fd_and_client : clients) {
serialized.add_clients()->MergeFrom(fd_and_client.second.serialize());
}
}
auto inserted = clients.insert(make_pair(client.sock(), Client(client, stream)));
assert(inserted.second == true); // Should not already exist.
}
auto inserted = clients.insert(make_pair(client.sock(), Client(client, stream)));
assert(inserted.second == true); // Should not already exist.
- streams.push_back(new Stream(url, backlog_size, prebuffering_bytes, encoding, src_encoding));
+ streams.emplace_back(new Stream(url, backlog_size, prebuffering_bytes, encoding, src_encoding));