mirror of https://github.com/SeanOMik/libki.git
net: Fix some observed problems
It seems the client sends application messages before the session has been established.
This commit is contained in:
parent
d1118a937b
commit
1927426034
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue