]> git.sesse.net Git - cubemap/blobdiff - server.cpp
Use libsystemd to inform systemd accurately about when the service is up and running.
[cubemap] / server.cpp
index e99dbeaa89b311788a9c0fc4eb132a667db3f5b1..72664e33f665eda4bd09e49d22789e546b4ee81f 100644 (file)
@@ -140,7 +140,7 @@ void Server::do_work()
                }
                timeout_time.tv_sec -= REQUEST_READ_TIMEOUT_SEC;
                while (!clients_ordered_by_connect_time.empty()) {
-                       pair<timespec, int> &connect_time_and_fd = clients_ordered_by_connect_time.front();
+                       const pair<timespec, int> &connect_time_and_fd = clients_ordered_by_connect_time.front();
 
                        // See if we have reached the end of clients to process.
                        if (is_earlier(timeout_time, connect_time_and_fd.first)) {
@@ -149,7 +149,7 @@ void Server::do_work()
 
                        // If this client doesn't exist anymore, just ignore it
                        // (it was deleted earlier).
-                       std::map<int, Client>::iterator client_it = clients.find(connect_time_and_fd.second);
+                       map<int, Client>::iterator client_it = clients.find(connect_time_and_fd.second);
                        if (client_it == clients.end()) {
                                clients_ordered_by_connect_time.pop();
                                continue;
@@ -286,7 +286,7 @@ void Server::add_client_from_serialized(const ClientProto &client)
        }
 }
 
-int Server::lookup_stream_by_url(const std::string &url) const
+int Server::lookup_stream_by_url(const string &url) const
 {
        map<string, int>::const_iterator url_it = url_map.find(url);
        if (url_it == url_map.end()) {
@@ -472,7 +472,7 @@ sending_header_or_error_again:
                Stream *stream = client->stream;
                if (client->stream_pos == size_t(-2)) {
                        // Start sending from the beginning of the backlog.
-                       client->stream_pos = std::min<size_t>(
+                       client->stream_pos = min<size_t>(
                            stream->bytes_received - stream->backlog_size,
                            0);
                        client->state = Client::SENDING_DATA;