0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-25 08:12:37 +01:00

ircd::net: Return ENOTCONN from net::check(socket) in fini state.

This commit is contained in:
Jason Volk 2019-09-14 18:22:34 -07:00
parent 4ed000e6ab
commit 4c7f53fda9

View file

@ -3168,9 +3168,12 @@ noexcept
buf
};
if(unlikely(!sd.is_open()))
if(!sd.is_open())
return make_error_code(std::errc::bad_file_descriptor);
if(fini)
return make_error_code(std::errc::not_connected);
std::error_code ret;
if(SSL_peek(ssl.native_handle(), buf, sizeof(buf)) > 0)
return ret;
@ -3476,6 +3479,9 @@ noexcept try
if(unlikely(!ec && !sd.is_open()))
ec = make_error_code(errc::bad_file_descriptor);
if(unlikely(!ec && fini))
ec = make_error_code(errc::not_connected);
#ifdef IRCD_DEBUG_NET_SOCKET_READY
const auto has_pending
{