Tolerate empty first lines.

Change-Id: Ib9aaf82560fc3f5adaa97f40a3de5f3946c6f65d
This commit is contained in:
Michael Meeks 2019-05-17 14:26:07 +01:00
parent 8d359cedbe
commit 8be093ed67

View file

@ -87,6 +87,12 @@ bool ClientSession::_handleInput(const char *buffer, int length)
return false;
}
if (tokens.size() < 1)
{
sendTextFrame("error: cmd=empty kind=unknown");
return false;
}
LOOLWSD::dumpIncomingTrace(docBroker->getJailId(), getId(), firstLine);
if (LOOLProtocol::tokenIndicatesUserInteraction(tokens[0]))
@ -97,7 +103,7 @@ bool ClientSession::_handleInput(const char *buffer, int length)
}
if (tokens[0] == "loolclient")
{
if (tokens.size() < 1)
if (tokens.size() < 2)
{
sendTextFrame("error: cmd=loolclient kind=badprotocolversion");
return false;