fixed previous commit

This commit is contained in:
john30
2015-03-07 16:25:40 +01:00
parent 291c4b939e
commit 2faab3f3b4
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -265,7 +265,7 @@ string MainLoop::executeRead(vector<string> &args)
if (!hasCache || (message != NULL && message->getLastUpdateTime() > cacheMessage->getLastUpdateTime()))
cacheMessage = message; // message is newer/better
if (cacheMessage != NULL && (cacheMessage->getLastUpdateTime() + maxAge > now || cacheMessage->isPassive())) {
if (cacheMessage != NULL && (cacheMessage->getLastUpdateTime() + maxAge > now || (cacheMessage->isPassive() && cacheMessage->getLastUpdateTime() != 0))) {
result_t ret = cacheMessage->decodeLastData(result, verbose, fieldIndex==-2 ? NULL : fieldName.c_str(), fieldIndex);
if (ret != RESULT_OK)
return getResultCode(ret);
+3 -1
View File
@@ -395,9 +395,11 @@ result_t Message::decodeLastData(ostringstream& output,
offset = 0;
leadingSeparator = output.str().length() > startPos;
result = m_data->read(pt_slaveData, m_lastSlaveData, offset, output, leadingSeparator, verbose, fieldName, fieldIndex, separator);
if (result < RESULT_OK)
return result;
if (empty && result == RESULT_EMPTY)
return RESULT_ERR_NOTFOUND;
return result;
return RESULT_OK;
}
bool Message::isLessPollWeight(const Message* other)