diff options
| author | Javier <dev.git@javispedro.com> | 2014-11-30 18:49:07 +0100 |
|---|---|---|
| committer | Javier <dev.git@javispedro.com> | 2014-11-30 18:49:07 +0100 |
| commit | 4527ab9a4147a8f15bf8ca5613341df9d0029d0c (patch) | |
| tree | a6c45dd81e6c8389ba66aeb5d2e0444127b5d867 /daemon/watchconnector.cpp | |
| parent | 49f1261bf9d635d5e3d881e87a93ed4e76abfe90 (diff) | |
add stub datalogmanager
Diffstat (limited to 'daemon/watchconnector.cpp')
| -rw-r--r-- | daemon/watchconnector.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/daemon/watchconnector.cpp b/daemon/watchconnector.cpp index 61eeb67..a3ea181 100644 --- a/daemon/watchconnector.cpp +++ b/daemon/watchconnector.cpp @@ -160,6 +160,13 @@ void WatchConnector::onReadSocket() message_length = qFromBigEndian<quint16>(&header[0]); endpoint = qFromBigEndian<quint16>(&header[sizeof(quint16)]); + if (message_length > 8 * 1024) { + // Protocol does not allow messages more than 8K long, seemingly. + logger()->warn() << "received message size too long: " << message_length; + socket->readAll(); // drop input buffer + return; + } + // Now wait for the entire message if (socket->bytesAvailable() < header_length + message_length) { logger()->debug() << "incomplete msg body in read buffer"; |
