mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
adds state check to connection::close
This commit is contained in:
@@ -214,6 +214,10 @@ void connection<config>::close(const close::status::value code,
|
||||
{
|
||||
m_alog.write(log::alevel::devel,"connection close");
|
||||
// check state
|
||||
if (m_state != session::state::OPEN) {
|
||||
ec = error::make_error_code(error::invalid_state);
|
||||
return;
|
||||
}
|
||||
|
||||
// check reason length
|
||||
if (reason.size() > frame::limits::close_reason_size) {
|
||||
|
||||
Reference in New Issue
Block a user