From 793d7954eff81190843f9f1196a6b1e319730b23 Mon Sep 17 00:00:00 2001 From: evoskuil Date: Sat, 16 May 2026 15:46:54 -0400 Subject: [PATCH] Socket body writer requires non-empty buffer to write empty. --- src/messages/http_body.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/messages/http_body.cpp b/src/messages/http_body.cpp index 1385587ca..90bd64c2c 100644 --- a/src/messages/http_body.cpp +++ b/src/messages/http_body.cpp @@ -111,6 +111,7 @@ void body::writer::init(boost_code& ec) NOEXCEPT { [&] (std::monostate&) NOEXCEPT { + ec = {}; }, [&](auto& write) NOEXCEPT { @@ -132,8 +133,16 @@ body::writer::out_buffer body::writer::get(boost_code& ec) NOEXCEPT { [&] (std::monostate&) NOEXCEPT { + ec = {}; return out_buffer{}; }, + [&](empty_writer&) NOEXCEPT + { + ec = {}; + + // Socket body writer requires non-empty buffer to write empty. + return out_buffer{ std::make_pair(asio::const_buffer{}, false) }; + }, [&](auto& write) NOEXCEPT { try