close client before returning

This commit is contained in:
Theis Pieter Hollebeek 2024-12-12 10:43:37 +01:00
parent 2d4879b69f
commit cf84770d90

View File

@ -126,7 +126,6 @@ public:
if (err < 0) { if (err < 0) {
return Err { .msg = std::format("could not bind ({})", err) }; return Err { .msg = std::format("could not bind ({})", err) };
}; };
return Unit {};
} }
{ {
auto err = ::listen(socket, 0); auto err = ::listen(socket, 0);
@ -168,6 +167,7 @@ public:
auto msg = std::format( auto msg = std::format(
"error parsing rpc message: '{}' @ {}:{}\n", "error parsing rpc message: '{}' @ {}:{}\n",
err.msg, err.pos.line, err.pos.col); err.msg, err.pos.line, err.pos.col);
close(client);
return Err { return Err {
.msg = msg, .msg = msg,
}; };