this is literally two lines

This commit is contained in:
malloc 2018-04-06 07:43:40 -05:00
parent 00f1bb953b
commit 4b0fbf2793
2 changed files with 3 additions and 9 deletions

View file

@ -91,15 +91,9 @@ int sosc::ScapeConnection::Receive(Packet* packet, bool block) {
} }
// TODO optimize // TODO optimize
this->frameQueue.push(frame); this->multiframe_buffer += frame.GetBody();
if(frame.IsFinal()) { if(frame.IsFinal()) {
std::string pck; if(packet->Parse(this->multiframe_buffer) == PCK_OK)
while(!this->frameQueue.empty()) {
pck += this->frameQueue.front().GetBody();
this->frameQueue.pop();
}
if(packet->Parse(pck) == PCK_OK)
return PCK_OK; return PCK_OK;
else else
return PCK_ERR; return PCK_ERR;

View file

@ -41,7 +41,7 @@ private:
TcpClient client; TcpClient client;
std::string buffer; std::string buffer;
std::queue<ws::Frame> frameQueue; std::string multiframe_buffer;
friend class ScapeServer; friend class ScapeServer;
}; };