mirror of
https://github.com/matrix-construct/construct
synced 2024-12-29 08:54:02 +01:00
ircd: Disregard repeat attempts to close client socket; return proper future.
This commit is contained in:
parent
ee48df71a8
commit
edd03e58af
1 changed files with 8 additions and 2 deletions
|
@ -725,16 +725,22 @@ ircd::client::discard_unconsumed(const http::request::head &head)
|
||||||
ircd::ctx::future<void>
|
ircd::ctx::future<void>
|
||||||
ircd::client::close(const net::close_opts &opts)
|
ircd::client::close(const net::close_opts &opts)
|
||||||
{
|
{
|
||||||
if(likely(sock))
|
if(likely(sock) && !sock->fini)
|
||||||
return net::close(*sock, opts);
|
return net::close(*sock, opts);
|
||||||
else
|
else
|
||||||
return {};
|
return ctx::future<void>::already;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ircd::client::close(const net::close_opts &opts,
|
ircd::client::close(const net::close_opts &opts,
|
||||||
net::close_callback callback)
|
net::close_callback callback)
|
||||||
{
|
{
|
||||||
|
if(!sock)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(sock->fini)
|
||||||
|
return callback({});
|
||||||
|
|
||||||
net::close(*sock, opts, std::move(callback));
|
net::close(*sock, opts, std::move(callback));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue