Skip to content

Commit

Permalink
network: clear buffer after a message is received
Browse files Browse the repository at this point in the history
This ensures that shorter payloads does not end with data from previous
(and longer) messages.
  • Loading branch information
Erik Botö committed Oct 1, 2013
1 parent 559ff28 commit c9c7c1f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions qmqtt_network.cpp
Expand Up @@ -154,6 +154,7 @@ void Network::sockReadReady()
{
_buffer->reset();
Frame frame(_header, _buffer->buffer());
_buffer->buffer().clear();
qDebug("network emit received(frame), header: %d", _header);
emit received(frame);
}
Expand Down

0 comments on commit c9c7c1f

Please sign in to comment.