Add new line at the end of the message
This commit is contained in:
parent
6399c95d4e
commit
8ff9a00677
@ -67,7 +67,7 @@ void WebSocketServer::sendData(const QUuid &clientId, const QByteArray &data)
|
|||||||
client = m_clientList.value(clientId);
|
client = m_clientList.value(clientId);
|
||||||
if (client) {
|
if (client) {
|
||||||
qCDebug(dcWebSocketServerTraffic()) << "--> Sending data to client:" << data;
|
qCDebug(dcWebSocketServerTraffic()) << "--> Sending data to client:" << data;
|
||||||
client->sendTextMessage(data);
|
client->sendTextMessage(data + '\n');
|
||||||
} else {
|
} else {
|
||||||
qCWarning(dcWebSocketServer()) << "Client" << clientId << "unknown to this transport";
|
qCWarning(dcWebSocketServer()) << "Client" << clientId << "unknown to this transport";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,7 +50,7 @@ QUrl WebSocketConnection::serverUrl() const
|
|||||||
|
|
||||||
void WebSocketConnection::sendData(const QByteArray &data)
|
void WebSocketConnection::sendData(const QByteArray &data)
|
||||||
{
|
{
|
||||||
m_webSocket->sendTextMessage(QString::fromUtf8(data));
|
m_webSocket->sendTextMessage(QString::fromUtf8(data + '\n'));
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebSocketConnection::ignoreSslErrors()
|
void WebSocketConnection::ignoreSslErrors()
|
||||||
|
|||||||
@ -459,12 +459,12 @@ void RemoteProxyOfflineTests::remoteConnection()
|
|||||||
connectionOne->sendData(dataOne);
|
connectionOne->sendData(dataOne);
|
||||||
remoteConnectionDataTwo.wait(500);
|
remoteConnectionDataTwo.wait(500);
|
||||||
QVERIFY(remoteConnectionDataTwo.count() == 1);
|
QVERIFY(remoteConnectionDataTwo.count() == 1);
|
||||||
QCOMPARE(remoteConnectionDataTwo.at(0).at(0).toByteArray(), dataOne);
|
QCOMPARE(remoteConnectionDataTwo.at(0).at(0).toByteArray().trimmed(), dataOne);
|
||||||
|
|
||||||
connectionTwo->sendData(dataTwo);
|
connectionTwo->sendData(dataTwo);
|
||||||
remoteConnectionDataOne.wait(500);
|
remoteConnectionDataOne.wait(500);
|
||||||
QVERIFY(remoteConnectionDataOne.count() == 1);
|
QVERIFY(remoteConnectionDataOne.count() == 1);
|
||||||
QCOMPARE(remoteConnectionDataOne.at(0).at(0).toByteArray(), dataTwo);
|
QCOMPARE(remoteConnectionDataOne.at(0).at(0).toByteArray().trimmed(), dataTwo);
|
||||||
|
|
||||||
connectionOne->deleteLater();
|
connectionOne->deleteLater();
|
||||||
connectionTwo->deleteLater();
|
connectionTwo->deleteLater();
|
||||||
|
|||||||
Reference in New Issue
Block a user