diff --git a/src/protocol/net/DMLSession.cpp b/src/protocol/net/DMLSession.cpp index a0e4b85..54fc9a4 100644 --- a/src/protocol/net/DMLSession.cpp +++ b/src/protocol/net/DMLSession.cpp @@ -23,7 +23,11 @@ namespace net return; } - on_message(*message); + // Are we sufficiently authenticated to handle this message? + if (get_access_level() >= message->get_access_level()) + on_message(*message); + else + on_invalid_message(); delete message; } } diff --git a/src/protocol/net/Session.cpp b/src/protocol/net/Session.cpp index f5467c3..6a995c8 100644 --- a/src/protocol/net/Session.cpp +++ b/src/protocol/net/Session.cpp @@ -182,10 +182,8 @@ namespace net // whether this is a control packet or not if (header.is_control()) on_control_message(header); - else if (m_established) - on_application_message(header); else - close(); + on_application_message(header); } } }