From c01d1ed38c46c4fe524af15b53ea2df6beb4af12 Mon Sep 17 00:00:00 2001 From: mmd-osm Date: Sun, 14 Jul 2024 12:00:27 +0200 Subject: [PATCH 1/2] Don't keep read only txn around for longer than needed --- src/process_request.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/process_request.cpp b/src/process_request.cpp index d549b938..f6176994 100644 --- a/src/process_request.cpp +++ b/src/process_request.cpp @@ -501,6 +501,9 @@ void process_request(request &req, rate_limiter &limiter, case http::method::POST: case http::method::PUT: { validate_user_db_update_permission(req_ctx, *selection); + // data_selection based read only transaction no longer needed + selection.reset(nullptr); + default_transaction.reset(nullptr); if (update_factory == nullptr) throw http::bad_request("Backend does not support given HTTP method"); From f9788e2a8a7c12d4c9d472951b1f43a1dad925d5 Mon Sep 17 00:00:00 2001 From: mmd-osm Date: Sun, 14 Jul 2024 12:00:53 +0200 Subject: [PATCH 2/2] Fix g++ 14 compilation error --- test/staticxml.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/staticxml.cpp b/test/staticxml.cpp index ba8e5e3a..ec8a2d26 100644 --- a/test/staticxml.cpp +++ b/test/staticxml.cpp @@ -284,7 +284,7 @@ std::unique_ptr parse_xml(const char *filename) { xml_parser parser(db.get()); int status = xmlSAXUserParseFile(&handler, &parser, filename); if (status != 0) { - xmlErrorPtr err = xmlGetLastError(); + const auto err = xmlGetLastError(); throw std::runtime_error( fmt::format("XML ERROR: {}.", err->message)); }