campaignd: close socket on read error

This commit is contained in:
loonycyborg 2022-10-02 04:40:52 +03:00
parent eadba482d2
commit 491c6464f9
No known key found for this signature in database
GPG key ID: 6E8233FAB8F26D61

View file

@ -497,7 +497,10 @@ void server::serve_requests(Socket socket, boost::asio::yield_context yield)
while(true) {
boost::system::error_code ec;
auto doc { coro_receive_doc(socket, yield[ec]) };
if(check_error(ec, socket) || !doc) return;
if(check_error(ec, socket) || !doc) {
socket->lowest_layer().close();
return;
}
config data;
read(data, doc->output());