mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 17:53:32 +02:00
Merge pull request #1763 from birarda/master
use a proper string list in DataServer for values
This commit is contained in:
commit
51d994d8ca
1 changed files with 5 additions and 9 deletions
|
@ -152,7 +152,7 @@ void DataServer::readPendingDatagrams() {
|
|||
sendPacketStream << keyListString;
|
||||
|
||||
QStringList keyList = keyListString.split(MULTI_KEY_VALUE_SEPARATOR);
|
||||
QString valueList;
|
||||
QStringList valueList;
|
||||
|
||||
foreach (const QString& dataKey, keyList) {
|
||||
qDebug("Sending command to redis: GET uuid:%s:%s",
|
||||
|
@ -164,21 +164,17 @@ void DataServer::readPendingDatagrams() {
|
|||
|
||||
if (reply->len) {
|
||||
// copy the value that redis returned
|
||||
valueList.append(reply->str);
|
||||
valueList << QString(reply->str);
|
||||
} else {
|
||||
// didn't find a value - insert a space
|
||||
valueList.append(' ');
|
||||
valueList << QChar(' ');
|
||||
}
|
||||
|
||||
// add the multi-value separator
|
||||
valueList.append(MULTI_KEY_VALUE_SEPARATOR);
|
||||
|
||||
freeReplyObject(reply);
|
||||
}
|
||||
|
||||
// null terminate the packet we're sending back (erases the trailing separator)
|
||||
valueList[valueList.size() - 1] = '\0';
|
||||
sendPacketStream << valueList;
|
||||
// append the value QStringList using the right separator
|
||||
sendPacketStream << valueList.join(MULTI_KEY_VALUE_SEPARATOR);
|
||||
} else {
|
||||
// user was asking for their UUID
|
||||
sendPacketStream << userString;
|
||||
|
|
Loading…
Reference in a new issue