Showing the changes to interface/src/DataServerClient.cpp (1 of 1 file). Show all
Unified · Split
| @@ -9,6 +9,7 @@ · 8 unmodified lines | ||
| 9 | 9 | #include <NodeList.h> |
| 10 | 10 | #include <PacketHeaders.h> |
| 11 | 11 | #include <UDPSocket.h> |
| 12 | +#include <UUID.h> | |
| 12 | 13 | |
| 13 | 14 | #include "DataServerClient.h" |
| 14 | 15 | |
| @@ -26,9 +27,9 @@ void DataServerClient::putValueForKey(const char* key, const char* value) { · 11 unmodified lines | ||
| 26 | 27 | int numPacketBytes = populateTypeAndVersion(putPacket, PACKET_TYPE_DATA_SERVER_PUT); |
| 27 | 28 | |
| 28 | 29 | // pack the client UUID |
| 29 | − QByteArray rfcUUID = _clientUUID.toRfc4122(); | |
| 30 | − memcpy(putPacket + numPacketBytes, rfcUUID.constData(), rfcUUID.size()); | |
| 31 | − numPacketBytes += rfcUUID.size(); | |
| 30 | + QString uuidString = uuidStringWithoutCurlyBraces(_clientUUID); | |
| 31 | + memcpy(putPacket + numPacketBytes, uuidString.toLocal8Bit().constData(), uuidString.toLocal8Bit().size()); | |
| 32 | + numPacketBytes += uuidString.toLocal8Bit().size(); | |
| 32 | 33 | |
| 33 | 34 | // pack the key, null terminated |
| 34 | 35 | strcpy((char*) putPacket + numPacketBytes, key); |
| @@ -54,9 +55,9 @@ void DataServerClient::getValueForKeyAndUUID(const char* key, QUuid &uuid) { · 19 unmodified lines | ||
| 54 | 55 | int numPacketBytes = populateTypeAndVersion(getPacket, PACKET_TYPE_DATA_SERVER_GET); |
| 55 | 56 | |
| 56 | 57 | // pack the UUID we're asking for data for |
| 57 | − QByteArray rfcUUID = uuid.toRfc4122(); | |
| 58 | − memcpy(getPacket + numPacketBytes, rfcUUID, rfcUUID.size()); | |
| 59 | − numPacketBytes += rfcUUID.size(); | |
| 58 | + QString uuidString = uuidStringWithoutCurlyBraces(uuid); | |
| 59 | + memcpy(getPacket + numPacketBytes, uuidString.toLocal8Bit().constData(), uuidString.toLocal8Bit().size()); | |
| 60 | + numPacketBytes += uuidString.toLocal8Bit().size(); | |
| 60 | 61 | |
| 61 | 62 | // pack the key, null terminated |
| 62 | 63 | strcpy((char*) getPacket + numPacketBytes, key); |