0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-28 00:14:07 +01:00

ircd: Disregard repeat attempts to close client socket; return proper future.

This commit is contained in:
Jason Volk 2018-03-11 11:29:31 -07:00
parent ee48df71a8
commit edd03e58af

View file

@ -725,16 +725,22 @@ ircd::client::discard_unconsumed(const http::request::head &head)
ircd::ctx::future<void>
ircd::client::close(const net::close_opts &opts)
{
if(likely(sock))
if(likely(sock) && !sock->fini)
return net::close(*sock, opts);
else
return {};
return ctx::future<void>::already;
}
void
ircd::client::close(const net::close_opts &opts,
net::close_callback callback)
{
if(!sock)
return;
if(sock->fini)
return callback({});
net::close(*sock, opts, std::move(callback));
}