diff --git a/src/odr/html_service.cpp b/src/odr/html_service.cpp index 3f955875..97cac683 100644 --- a/src/odr/html_service.cpp +++ b/src/odr/html_service.cpp @@ -24,13 +24,7 @@ const HtmlResourceLocator &HtmlDocumentService::resource_locator() const { HtmlResources HtmlDocumentService::write_document(std::ostream &os) const { internal::html::HtmlWriter out(os, config()); - auto internal_resources = m_impl->write_document(out); - - HtmlResources resources; - for (const auto &[resource, location] : internal_resources) { - resources.emplace_back(HtmlResource(resource), location); - } - return resources; + return m_impl->write_document(out); } const std::shared_ptr & diff --git a/src/odr/http_server.cpp b/src/odr/http_server.cpp index 0a179599..30a5495b 100644 --- a/src/odr/http_server.cpp +++ b/src/odr/http_server.cpp @@ -155,6 +155,8 @@ class HttpServer::Impl { m_server.listen(host, static_cast(port)); } + void stop() { m_server.stop(); } + private: [[nodiscard]] static std::string get_id() { std::mt19937 rng(std::random_device{}()); @@ -192,4 +194,6 @@ void HttpServer::listen(const std::string &host, std::uint32_t port) { m_impl->listen(host, port); } +void HttpServer::stop() { m_impl->stop(); } + } // namespace odr diff --git a/src/odr/http_server.hpp b/src/odr/http_server.hpp index 86cef9ed..ac43c8ae 100644 --- a/src/odr/http_server.hpp +++ b/src/odr/http_server.hpp @@ -23,6 +23,8 @@ class HttpServer { void listen(const std::string &host, std::uint32_t port); + void stop(); + private: class Impl;