diff options
author | Callum Prentice <callum@lindenlab.com> | 2014-05-07 09:31:20 -0700 |
---|---|---|
committer | Callum Prentice <callum@lindenlab.com> | 2014-05-07 09:31:20 -0700 |
commit | fbe10b8ee0537c71f2119142f4e0da1bd69d1a53 (patch) | |
tree | b5ac3f23c9fbd7dba299cd7aa2e8e4f812df98f6 /indra/llmessage/lltemplatemessagereader.cpp | |
parent | 1953c569a6acfd731af2c459da7a6928be4aaf5b (diff) | |
parent | d0ef02c23a7a37c8c9bfe3a86bae88bb811fc9fe (diff) |
Merge with viewer-release
Diffstat (limited to 'indra/llmessage/lltemplatemessagereader.cpp')
-rwxr-xr-x | indra/llmessage/lltemplatemessagereader.cpp | 120 |
1 files changed, 60 insertions, 60 deletions
diff --git a/indra/llmessage/lltemplatemessagereader.cpp b/indra/llmessage/lltemplatemessagereader.cpp index 94bc7cb045..406afadd2f 100755 --- a/indra/llmessage/lltemplatemessagereader.cpp +++ b/indra/llmessage/lltemplatemessagereader.cpp @@ -68,13 +68,13 @@ void LLTemplateMessageReader::getData(const char *blockname, const char *varname // is there a message ready to go? if (mReceiveSize == -1) { - llerrs << "No message waiting for decode 2!" << llendl; + LL_ERRS() << "No message waiting for decode 2!" << LL_ENDL; return; } if (!mCurrentRMessageData) { - llerrs << "Invalid mCurrentMessageData in getData!" << llendl; + LL_ERRS() << "Invalid mCurrentMessageData in getData!" << LL_ENDL; return; } @@ -85,8 +85,8 @@ void LLTemplateMessageReader::getData(const char *blockname, const char *varname if (iter == mCurrentRMessageData->mMemberBlocks.end()) { - llerrs << "Block " << blockname << " #" << blocknum - << " not in message " << mCurrentRMessageData->mName << llendl; + LL_ERRS() << "Block " << blockname << " #" << blocknum + << " not in message " << mCurrentRMessageData->mName << LL_ENDL; return; } @@ -95,8 +95,8 @@ void LLTemplateMessageReader::getData(const char *blockname, const char *varname if (var_data_map.find(vnamep) == var_data_map.end()) { - llerrs << "Variable "<< vnamep << " not in message " - << mCurrentRMessageData->mName<< " block " << bnamep << llendl; + LL_ERRS() << "Variable "<< vnamep << " not in message " + << mCurrentRMessageData->mName<< " block " << bnamep << LL_ENDL; return; } @@ -104,11 +104,11 @@ void LLTemplateMessageReader::getData(const char *blockname, const char *varname if (size && size != vardata.getSize()) { - llerrs << "Msg " << mCurrentRMessageData->mName + LL_ERRS() << "Msg " << mCurrentRMessageData->mName << " variable " << vnamep << " is size " << vardata.getSize() << " but copying into buffer of size " << size - << llendl; + << LL_ENDL; return; } @@ -138,11 +138,11 @@ void LLTemplateMessageReader::getData(const char *blockname, const char *varname } else { - llwarns << "Msg " << mCurrentRMessageData->mName + LL_WARNS() << "Msg " << mCurrentRMessageData->mName << " variable " << vnamep << " is size " << vardata.getSize() << " but truncated to max size of " << max_size - << llendl; + << LL_ENDL; memcpy(datap, vardata.getData(), max_size); } @@ -153,13 +153,13 @@ S32 LLTemplateMessageReader::getNumberOfBlocks(const char *blockname) // is there a message ready to go? if (mReceiveSize == -1) { - llerrs << "No message waiting for decode 3!" << llendl; + LL_ERRS() << "No message waiting for decode 3!" << LL_ENDL; return -1; } if (!mCurrentRMessageData) { - llerrs << "Invalid mCurrentRMessageData in getData!" << llendl; + LL_ERRS() << "Invalid mCurrentRMessageData in getData!" << LL_ENDL; return -1; } @@ -180,13 +180,13 @@ S32 LLTemplateMessageReader::getSize(const char *blockname, const char *varname) // is there a message ready to go? if (mReceiveSize == -1) { // This is a serious error - crash - llerrs << "No message waiting for decode 4!" << llendl; + LL_ERRS() << "No message waiting for decode 4!" << LL_ENDL; return LL_MESSAGE_ERROR; } if (!mCurrentRMessageData) { // This is a serious error - crash - llerrs << "Invalid mCurrentRMessageData in getData!" << llendl; + LL_ERRS() << "Invalid mCurrentRMessageData in getData!" << LL_ENDL; return LL_MESSAGE_ERROR; } @@ -196,8 +196,8 @@ S32 LLTemplateMessageReader::getSize(const char *blockname, const char *varname) if (iter == mCurrentRMessageData->mMemberBlocks.end()) { // don't crash - llinfos << "Block " << bnamep << " not in message " - << mCurrentRMessageData->mName << llendl; + LL_INFOS() << "Block " << bnamep << " not in message " + << mCurrentRMessageData->mName << LL_ENDL; return LL_BLOCK_NOT_IN_MESSAGE; } @@ -208,15 +208,15 @@ S32 LLTemplateMessageReader::getSize(const char *blockname, const char *varname) if (!vardata.getName()) { // don't crash - llinfos << "Variable " << varname << " not in message " - << mCurrentRMessageData->mName << " block " << bnamep << llendl; + LL_INFOS() << "Variable " << varname << " not in message " + << mCurrentRMessageData->mName << " block " << bnamep << LL_ENDL; return LL_VARIABLE_NOT_IN_BLOCK; } if (mCurrentRMessageTemplate->mMemberBlocks[bnamep]->mType != MBT_SINGLE) { // This is a serious error - crash - llerrs << "Block " << bnamep << " isn't type MBT_SINGLE," - " use getSize with blocknum argument!" << llendl; + LL_ERRS() << "Block " << bnamep << " isn't type MBT_SINGLE," + " use getSize with blocknum argument!" << LL_ENDL; return LL_MESSAGE_ERROR; } @@ -228,13 +228,13 @@ S32 LLTemplateMessageReader::getSize(const char *blockname, S32 blocknum, const // is there a message ready to go? if (mReceiveSize == -1) { // This is a serious error - crash - llerrs << "No message waiting for decode 5!" << llendl; + LL_ERRS() << "No message waiting for decode 5!" << LL_ENDL; return LL_MESSAGE_ERROR; } if (!mCurrentRMessageData) { // This is a serious error - crash - llerrs << "Invalid mCurrentRMessageData in getData!" << llendl; + LL_ERRS() << "Invalid mCurrentRMessageData in getData!" << LL_ENDL; return LL_MESSAGE_ERROR; } @@ -245,8 +245,8 @@ S32 LLTemplateMessageReader::getSize(const char *blockname, S32 blocknum, const if (iter == mCurrentRMessageData->mMemberBlocks.end()) { // don't crash - llinfos << "Block " << bnamep << " not in message " - << mCurrentRMessageData->mName << llendl; + LL_INFOS() << "Block " << bnamep << " not in message " + << mCurrentRMessageData->mName << LL_ENDL; return LL_BLOCK_NOT_IN_MESSAGE; } @@ -255,8 +255,8 @@ S32 LLTemplateMessageReader::getSize(const char *blockname, S32 blocknum, const if (!vardata.getName()) { // don't crash - llinfos << "Variable " << vnamep << " not in message " - << mCurrentRMessageData->mName << " block " << bnamep << llendl; + LL_INFOS() << "Variable " << vnamep << " not in message " + << mCurrentRMessageData->mName << " block " << bnamep << LL_ENDL; return LL_VARIABLE_NOT_IN_BLOCK; } @@ -328,8 +328,8 @@ void LLTemplateMessageReader::getF32(const char *block, const char *var, if( !llfinite( d ) ) { - llwarns << "non-finite in getF32Fast " << block << " " << var - << llendl; + LL_WARNS() << "non-finite in getF32Fast " << block << " " << var + << LL_ENDL; d = 0; } } @@ -341,8 +341,8 @@ void LLTemplateMessageReader::getF64(const char *block, const char *var, if( !llfinite( d ) ) { - llwarns << "non-finite in getF64Fast " << block << " " << var - << llendl; + LL_WARNS() << "non-finite in getF64Fast " << block << " " << var + << LL_ENDL; d = 0; } } @@ -354,8 +354,8 @@ void LLTemplateMessageReader::getVector3(const char *block, const char *var, if( !v.isFinite() ) { - llwarns << "non-finite in getVector3Fast " << block << " " - << var << llendl; + LL_WARNS() << "non-finite in getVector3Fast " << block << " " + << var << LL_ENDL; v.zeroVec(); } } @@ -367,8 +367,8 @@ void LLTemplateMessageReader::getVector4(const char *block, const char *var, if( !v.isFinite() ) { - llwarns << "non-finite in getVector4Fast " << block << " " - << var << llendl; + LL_WARNS() << "non-finite in getVector4Fast " << block << " " + << var << LL_ENDL; v.zeroVec(); } } @@ -380,8 +380,8 @@ void LLTemplateMessageReader::getVector3d(const char *block, const char *var, if( !v.isFinite() ) { - llwarns << "non-finite in getVector3dFast " << block << " " - << var << llendl; + LL_WARNS() << "non-finite in getVector3dFast " << block << " " + << var << LL_ENDL; v.zeroVec(); } @@ -398,8 +398,8 @@ void LLTemplateMessageReader::getQuat(const char *block, const char *var, } else { - llwarns << "non-finite in getQuatFast " << block << " " << var - << llendl; + LL_WARNS() << "non-finite in getQuatFast " << block << " " << var + << LL_ENDL; q.loadIdentity(); } } @@ -452,7 +452,7 @@ BOOL LLTemplateMessageReader::decodeTemplate( // is there a message ready to go? if (buffer_size <= 0) { - llwarns << "No message waiting for decode!" << llendl; + LL_WARNS() << "No message waiting for decode!" << LL_ENDL; return(FALSE); } @@ -487,8 +487,8 @@ BOOL LLTemplateMessageReader::decodeTemplate( } else // bogus packet received (too short) { - llwarns << "Packet with unusable length received (too short): " - << buffer_size << llendl; + LL_WARNS() << "Packet with unusable length received (too short): " + << buffer_size << LL_ENDL; return(FALSE); } @@ -499,8 +499,8 @@ BOOL LLTemplateMessageReader::decodeTemplate( } else { - llwarns << "Message #" << std::hex << num << std::dec - << " received but not registered!" << llendl; + LL_WARNS() << "Message #" << std::hex << num << std::dec + << " received but not registered!" << LL_ENDL; gMessageSystem->callExceptionFunc(MX_UNREGISTERED_MESSAGE); return(FALSE); } @@ -511,23 +511,23 @@ BOOL LLTemplateMessageReader::decodeTemplate( void LLTemplateMessageReader::logRanOffEndOfPacket( const LLHost& host, const S32 where, const S32 wanted ) { // we've run off the end of the packet! - llwarns << "Ran off end of packet " << mCurrentRMessageTemplate->mName + LL_WARNS() << "Ran off end of packet " << mCurrentRMessageTemplate->mName // << " with id " << mCurrentRecvPacketID << " from " << host << " trying to read " << wanted << " bytes at position " << where << " going past packet end at " << mReceiveSize - << llendl; + << LL_ENDL; if(gMessageSystem->mVerboseLog) { - llinfos << "MSG: -> " << host << "\tREAD PAST END:\t" + LL_INFOS() << "MSG: -> " << host << "\tREAD PAST END:\t" // << mCurrentRecvPacketID << " " - << getMessageName() << llendl; + << getMessageName() << LL_ENDL; } gMessageSystem->callExceptionFunc(MX_RAN_OFF_END_OF_PACKET); } -static LLFastTimer::DeclareTimer FTM_PROCESS_MESSAGES("Process Messages"); +static LLTrace::BlockTimerStatHandle FTM_PROCESS_MESSAGES("Process Messages"); // decode a given message BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender ) @@ -588,7 +588,7 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender } else { - llerrs << "Unknown block type" << llendl; + LL_ERRS() << "Unknown block type" << LL_ENDL; return FALSE; } @@ -655,7 +655,7 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender htonmemcpy(&tsize, &buffer[decode_pos], MVT_U32, 4); break; default: - llerrs << "Attempting to read variable field with unknown size of " << data_size << llendl; + LL_ERRS() << "Attempting to read variable field with unknown size of " << data_size << LL_ENDL; break; } } @@ -694,7 +694,7 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender if (mCurrentRMessageData->mMemberBlocks.empty() && !mCurrentRMessageTemplate->mMemberBlocks.empty()) { - lldebugs << "Empty message '" << mCurrentRMessageTemplate->mName << "' (no blocks)" << llendl; + LL_DEBUGS() << "Empty message '" << mCurrentRMessageTemplate->mName << "' (no blocks)" << LL_ENDL; return FALSE; } @@ -707,10 +707,10 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender } { - LLFastTimer t(FTM_PROCESS_MESSAGES); + LL_RECORD_BLOCK_TIME(FTM_PROCESS_MESSAGES); if( !mCurrentRMessageTemplate->callHandlerFunc(gMessageSystem) ) { - llwarns << "Message from " << sender << " with no handler function received: " << mCurrentRMessageTemplate->mName << llendl; + LL_WARNS() << "Message from " << sender << " with no handler function received: " << mCurrentRMessageTemplate->mName << LL_ENDL; } } @@ -740,9 +740,9 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender if(decode_time > LLMessageReader::getTimeDecodesSpamThreshold()) { - lldebugs << "--------- Message " << mCurrentRMessageTemplate->mName << " decode took " << decode_time << " seconds. (" << + LL_DEBUGS() << "--------- Message " << mCurrentRMessageTemplate->mName << " decode took " << decode_time << " seconds. (" << mCurrentRMessageTemplate->mMaxDecodeTimePerMsg << " max, " << - (mCurrentRMessageTemplate->mTotalDecodeTime / mCurrentRMessageTemplate->mTotalDecoded) << " avg)" << llendl; + (mCurrentRMessageTemplate->mTotalDecodeTime / mCurrentRMessageTemplate->mTotalDecoded) << " avg)" << LL_ENDL; } } } @@ -760,9 +760,9 @@ BOOL LLTemplateMessageReader::validateMessage(const U8* buffer, if(valid) { mCurrentRMessageTemplate->mReceiveCount++; - //lldebugs << "MessageRecvd:" + //LL_DEBUGS() << "MessageRecvd:" // << mCurrentRMessageTemplate->mName - // << " from " << sender << llendl; + // << " from " << sender << LL_ENDL; } if (valid && isBanned(trusted)) @@ -772,15 +772,15 @@ BOOL LLTemplateMessageReader::validateMessage(const U8* buffer, << getMessageName() << " from " << ((trusted) ? "trusted " : "untrusted ") - << sender << llendl; + << sender << LL_ENDL; valid = FALSE; } if(valid && isUdpBanned()) { - llwarns << "Received UDP black listed message " + LL_WARNS() << "Received UDP black listed message " << getMessageName() - << " from " << sender << llendl; + << " from " << sender << LL_ENDL; valid = FALSE; } return valid; |