From c93f50e13f43a529ce17d2f5df1b8837a3a84a92 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Tue, 30 Dec 2025 00:02:49 -0800 Subject: [PATCH 1/4] Fix use-after-destroy bug in spawn --- src/server/route_handler.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/route_handler.cpp b/src/server/route_handler.cpp index 7e4f92ac..9e60beed 100644 --- a/src/server/route_handler.cpp +++ b/src/server/route_handler.cpp @@ -73,8 +73,9 @@ spawn( return; } auto rv = std::move(std::get<1>(r)); + auto resume_ = resume; // would be destroyed h.destroy(); - resume(rv); + resume_(rv); }; ex.post([h]() { h.resume(); }); From b087110fc7986ec4b6d40d36e61a2321c08db563 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Tue, 30 Dec 2025 04:57:38 -0800 Subject: [PATCH 2/4] Add Boost.JSON as public dependency --- CMakeLists.txt | 3 ++- build/Jamfile | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ae6a2365..0544fbf4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,6 +59,7 @@ set(BOOST_HTTP_PROTO_DEPENDENCIES Boost::capy Boost::config Boost::core + Boost::json Boost::mp11 Boost::static_assert Boost::system @@ -122,7 +123,7 @@ if (BOOST_HTTP_PROTO_IS_ROOT) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${BOOST_SRC_DIR}/tools/cmake/include") else () # From Boost Package - find_package(Boost REQUIRED COMPONENTS buffers filesystem url) + find_package(Boost REQUIRED COMPONENTS buffers filesystem json url) foreach (BOOST_INCLUDE_LIBRARY ${BOOST_INCLUDE_LIBRARIES}) if (NOT TARGET Boost::${BOOST_INCLUDE_LIBRARY}) add_library(Boost::${BOOST_INCLUDE_LIBRARY} ALIAS Boost::headers) diff --git a/build/Jamfile b/build/Jamfile index b4898e96..7d51b10b 100644 --- a/build/Jamfile +++ b/build/Jamfile @@ -41,12 +41,14 @@ lib boost_http_proto : requirements /boost//buffers /boost//capy + /boost//json /boost//url ../ BOOST_HTTP_PROTO_SOURCE : usage-requirements /boost//buffers /boost//capy + /boost//json /boost//url ; From 668e6283905902444adab55417faa493b29993fd Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Tue, 30 Dec 2025 05:07:27 -0800 Subject: [PATCH 3/4] Fix Boost.JSON reference for modular library --- build/Jamfile | 4 ++-- include/boost/http_proto/json.hpp | 22 ++++++++++++++++++++++ test/unit/json.cpp | 11 +++++++++++ 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 include/boost/http_proto/json.hpp create mode 100644 test/unit/json.cpp diff --git a/build/Jamfile b/build/Jamfile index 7d51b10b..21adba08 100644 --- a/build/Jamfile +++ b/build/Jamfile @@ -41,14 +41,14 @@ lib boost_http_proto : requirements /boost//buffers /boost//capy - /boost//json + /boost/json//boost_json /boost//url ../ BOOST_HTTP_PROTO_SOURCE : usage-requirements /boost//buffers /boost//capy - /boost//json + /boost/json//boost_json /boost//url ; diff --git a/include/boost/http_proto/json.hpp b/include/boost/http_proto/json.hpp new file mode 100644 index 00000000..50399c89 --- /dev/null +++ b/include/boost/http_proto/json.hpp @@ -0,0 +1,22 @@ +// +// Copyright (c) 2025 Vinnie Falco (vinnie.falco@gmail.com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +// Official repository: https://github.com/cppalliance/http_proto +// + +#ifndef BOOST_HTTP_PROTO_JSON_HPP +#define BOOST_HTTP_PROTO_JSON_HPP + +#include +#include + +namespace boost { +namespace http_proto { + +} // http_proto +} // boost + +#endif diff --git a/test/unit/json.cpp b/test/unit/json.cpp new file mode 100644 index 00000000..1c87c680 --- /dev/null +++ b/test/unit/json.cpp @@ -0,0 +1,11 @@ +// +// Copyright (c) 2025 Vinnie Falco (vinnie dot falco at gmail dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +// Official repository: https://github.com/cppalliance/http_proto +// + +// Test that header file is self-contained. +#include From 3309e07882c5a0a86e64e16372ed4f93ddea2302 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Tue, 30 Dec 2025 12:53:47 -0800 Subject: [PATCH 4/4] Disable warnings-as-errors for Boost.JSON (GCC 15 false positive) --- build/Jamfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/Jamfile b/build/Jamfile index 21adba08..8e688b72 100644 --- a/build/Jamfile +++ b/build/Jamfile @@ -41,14 +41,14 @@ lib boost_http_proto : requirements /boost//buffers /boost//capy - /boost/json//boost_json + /boost/json//boost_json/off /boost//url ../ BOOST_HTTP_PROTO_SOURCE : usage-requirements /boost//buffers /boost//capy - /boost/json//boost_json + /boost/json//boost_json/off /boost//url ;