net: Fix some observed problems

It seems the client sends application messages before the session has been established.
This commit is contained in:
Joshua Scott 2018-04-20 01:35:43 +01:00
parent d1118a937b
commit 1927426034
2 changed files with 6 additions and 4 deletions

View File

@ -23,7 +23,11 @@ namespace net
return; return;
} }
// Are we sufficiently authenticated to handle this message?
if (get_access_level() >= message->get_access_level())
on_message(*message); on_message(*message);
else
on_invalid_message();
delete message; delete message;
} }
} }

View File

@ -182,10 +182,8 @@ namespace net
// whether this is a control packet or not // whether this is a control packet or not
if (header.is_control()) if (header.is_control())
on_control_message(header); on_control_message(header);
else if (m_established)
on_application_message(header);
else else
close(); on_application_message(header);
} }
} }
} }