22
33#include < odr/exceptions.hpp>
44#include < odr/file.hpp>
5- #include < odr/filesystem.hpp>
65#include < odr/html.hpp>
7- #include < odr/internal/pdf_poppler/poppler_pdf_file.hpp>
86
97#include < httplib/httplib.h>
108
119#include < atomic>
12- #include < memory >
10+ #include < filesystem >
1311#include < sstream>
1412
1513namespace odr {
@@ -23,9 +21,9 @@ class HttpServer::Impl {
2321 // This prevents crashes when exceptions occur during request processing.
2422 m_server->set_exception_handler ([this ](const httplib::Request & /* req*/ ,
2523 httplib::Response &res,
26- std::exception_ptr ep) {
24+ const std::exception_ptr & ep) {
2725 try {
28- if (ep) {
26+ if (ep != nullptr ) {
2927 std::rethrow_exception (ep);
3028 }
3129 } catch (const std::exception &e) {
@@ -73,7 +71,7 @@ class HttpServer::Impl {
7371 // here (via unique_ptr::reset), we ensure all threads are joined
7472 // before any other members are destroyed.
7573 m_stopping.store (true , std::memory_order_release);
76- if (m_server) {
74+ if (m_server != nullptr ) {
7775 m_server->stop ();
7876 m_server.reset (); // Destroy server, join all thread pool threads
7977 }
@@ -160,7 +158,7 @@ class HttpServer::Impl {
160158 m_content.emplace (prefix, Content{prefix, std::move (service)});
161159 }
162160
163- void listen (const std::string &host, const std::uint32_t port) {
161+ void listen (const std::string &host, const std::uint32_t port) const {
164162 ODR_VERBOSE (*m_logger, " Listening on " << host << " :" << port);
165163
166164 m_server->listen (host, static_cast <int >(port));
@@ -186,7 +184,7 @@ class HttpServer::Impl {
186184 // This prevents new requests from starting while we're shutting down.
187185 m_stopping.store (true , std::memory_order_release);
188186
189- if (m_server) {
187+ if (m_server != nullptr ) {
190188 // Stop the server to prevent new connections.
191189 // Note: httplib::Server::stop() signals shutdown but thread pool
192190 // threads may still be running. They only fully stop when the
0 commit comments