diff options
Diffstat (limited to 'common/listener.cpp')
-rw-r--r-- | common/listener.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/common/listener.cpp b/common/listener.cpp index d2cab72..b9426db 100644 --- a/common/listener.cpp +++ b/common/listener.cpp | |||
@@ -109,10 +109,10 @@ void Listener::emergencyAbortAllConnections() | |||
109 | SinkWarning() << "Sending panic"; | 109 | SinkWarning() << "Sending panic"; |
110 | client.socket->write("PANIC"); | 110 | client.socket->write("PANIC"); |
111 | client.socket->waitForBytesWritten(); | 111 | client.socket->waitForBytesWritten(); |
112 | disconnect(client.socket, 0, this, 0); | 112 | disconnect(client.socket, nullptr, this, nullptr); |
113 | client.socket->abort(); | 113 | client.socket->abort(); |
114 | delete client.socket; | 114 | delete client.socket; |
115 | client.socket = 0; | 115 | client.socket = nullptr; |
116 | } | 116 | } |
117 | } | 117 | } |
118 | 118 | ||
@@ -123,10 +123,10 @@ void Listener::closeAllConnections() | |||
123 | { | 123 | { |
124 | for (Client &client : m_connections) { | 124 | for (Client &client : m_connections) { |
125 | if (client.socket) { | 125 | if (client.socket) { |
126 | disconnect(client.socket, 0, this, 0); | 126 | disconnect(client.socket, nullptr, this, nullptr); |
127 | client.socket->close(); | 127 | client.socket->close(); |
128 | delete client.socket; | 128 | delete client.socket; |
129 | client.socket = 0; | 129 | client.socket = nullptr; |
130 | } | 130 | } |
131 | } | 131 | } |
132 | 132 | ||
@@ -363,9 +363,9 @@ bool Listener::processClientBuffer(Client &client) | |||
363 | return false; | 363 | return false; |
364 | } | 364 | } |
365 | 365 | ||
366 | const uint messageId = *(uint *)client.commandBuffer.constData(); | 366 | const uint messageId = *(const uint *)client.commandBuffer.constData(); |
367 | const int commandId = *(int *)(client.commandBuffer.constData() + sizeof(uint)); | 367 | const int commandId = *(const int *)(client.commandBuffer.constData() + sizeof(uint)); |
368 | const uint size = *(uint *)(client.commandBuffer.constData() + sizeof(int) + sizeof(uint)); | 368 | const uint size = *(const uint *)(client.commandBuffer.constData() + sizeof(int) + sizeof(uint)); |
369 | SinkTrace() << "Received message. Id:" << messageId << " CommandId: " << commandId << " Size: " << size; | 369 | SinkTrace() << "Received message. Id:" << messageId << " CommandId: " << commandId << " Size: " << size; |
370 | 370 | ||
371 | // TODO: reject messages above a certain size? | 371 | // TODO: reject messages above a certain size? |