Skip to content

Commit b98c7f3

Browse files
committed
TcpInterface: properly handle multiple lines in a single packet
1 parent 904db0e commit b98c7f3

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/tcpinterface.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,8 @@ void RemoteControlSocket::addClient() {
1010
auto *client = server.nextPendingConnection();
1111
clients.push_back(client);
1212
connect(client, &QTcpSocket::readyRead, this, [this, client]() {
13-
if (!client->canReadLine()) return;
14-
QString line(client->readLine());
15-
qInfo() << line;
16-
line = line.trimmed();
17-
this->handleLine(line, client);
13+
while(client->canReadLine())
14+
this->handleLine(client->readLine().trimmed(), client);
1815
});
1916
}
2017

0 commit comments

Comments
 (0)