]> git.sesse.net Git - cubemap/blobdiff - server.cpp
Create $(libdir) on make install.
[cubemap] / server.cpp
index 35cb9d6bce869b354f73b96f1824e004cf1835ec..8025fd1b4cb257ee71aa6a280a98c1913e007e73 100644 (file)
@@ -60,7 +60,7 @@ inline bool is_earlier(timespec a, timespec b)
 
 Server::Server()
 {
-       epoll_fd = epoll_create(1024);  // Size argument is ignored.
+       epoll_fd = epoll_create1(EPOLL_CLOEXEC);
        if (epoll_fd == -1) {
                log_perror("epoll_fd");
                exit(1);
@@ -70,6 +70,11 @@ Server::Server()
 Server::~Server()
 {
        safe_close(epoll_fd);
+
+       // We're going to die soon anyway, but clean this up to keep leak checking happy.
+       for (const auto &acceptor_and_context : tls_server_contexts) {
+               tls_destroy_context(acceptor_and_context.second);
+       }
 }
 
 vector<ClientStats> Server::get_client_stats() const