diff options
Diffstat (limited to 'indra/llmessage/message.cpp')
-rw-r--r-- | indra/llmessage/message.cpp | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp index d11efab7ab..91a1250857 100644 --- a/indra/llmessage/message.cpp +++ b/indra/llmessage/message.cpp @@ -148,11 +148,11 @@ static const char* nullToEmpty(const char* s) void LLMessageSystem::init() { // initialize member variables - mVerboseLog = FALSE; + mVerboseLog = false; - mbError = FALSE; + mbError = false; mErrorCode = 0; - mSendReliable = FALSE; + mSendReliable = false; mUnackedListDepth = 0; mUnackedListSize = 0; @@ -214,7 +214,7 @@ LLMessageSystem::LLMessageSystem(const std::string& filename, U32 port, mVersionFlags = 0x0; // default to not accepting packets from not alive circuits - mbProtected = TRUE; + mbProtected = true; // default to blocking trusted connections on a public interface if one is specified mBlockUntrustedInterface = true; @@ -239,7 +239,7 @@ LLMessageSystem::LLMessageSystem(const std::string& filename, U32 port, S32 error = start_net(mSocket, mPort); if (error != 0) { - mbError = TRUE; + mbError = true; mErrorCode = error; } // LL_DEBUGS("Messaging") << << "*** port: " << mPort << LL_ENDL; @@ -288,7 +288,7 @@ void LLMessageSystem::loadTemplateFile(const std::string& filename, bool failure if(filename.empty()) { LL_ERRS("Messaging") << "No template filename specified" << LL_ENDL; - mbError = TRUE; + mbError = true; return; } @@ -300,7 +300,7 @@ void LLMessageSystem::loadTemplateFile(const std::string& filename, bool failure } else { LL_WARNS("Messaging") << "Failed to open template: " << filename << LL_ENDL; } - mbError = TRUE; + mbError = true; return; } @@ -506,8 +506,8 @@ bool LLMessageSystem::checkMessages(LockMessageChecker&, S64 frame_count ) { clearReceiveState(); - BOOL recv_reliable = false; - BOOL recv_resent = false; + bool recv_reliable = false; + bool recv_resent = false; S32 acks = 0; S32 true_rcv_size = 0; @@ -768,7 +768,7 @@ void LLMessageSystem::processAcks(LockMessageChecker&, F32 collect_time) } } - BOOL dump = FALSE; + bool dump = false; { // Check the status of circuits mCircuitInfo.updateWatchDogTimers(this); @@ -793,17 +793,17 @@ void LLMessageSystem::processAcks(LockMessageChecker&, F32 collect_time) { if (mNumMessageCounts >= mMaxMessageCounts) { - dump = TRUE; + dump = true; } } if (mMaxMessageTime >= F32Seconds(0.f)) { // This is one of the only places where we're required to get REAL message system time. - mReceiveTime = getMessageTimeSeconds(TRUE) - mMessageCountTime; + mReceiveTime = getMessageTimeSeconds(true) - mMessageCountTime; if (mReceiveTime > mMaxMessageTime) { - dump = TRUE; + dump = true; } } } @@ -833,7 +833,7 @@ void LLMessageSystem::copyMessageReceivedToSend() { mMessageBuilder = mLLSDMessageBuilder; } - mSendReliable = FALSE; + mSendReliable = false; mMessageBuilder->newMessage(mMessageReader->getMessageName()); mMessageReader->copyToBuilder(*mMessageBuilder); } @@ -928,7 +928,7 @@ S32 LLMessageSystem::sendMessage(const LLHost &host, LLStoredMessagePtr message) void LLMessageSystem::clearMessage() { - mSendReliable = FALSE; + mSendReliable = false; mMessageBuilder->clearMessage(); } @@ -968,7 +968,7 @@ bool LLMessageSystem::removeLastBlock() S32 LLMessageSystem::sendReliable(const LLHost &host) { - return sendReliable(host, LL_DEFAULT_RELIABLE_RETRIES, TRUE, LL_PING_BASED_TIMEOUT_DUMMY, NULL, NULL); + return sendReliable(host, LL_DEFAULT_RELIABLE_RETRIES, true, LL_PING_BASED_TIMEOUT_DUMMY, NULL, NULL); } @@ -987,15 +987,15 @@ S32 LLMessageSystem::sendSemiReliable(const LLHost &host, void (*callback)(void timeout = LL_SEMIRELIABLE_TIMEOUT_FACTOR * LL_AVERAGED_PING_MAX; } - const S32 retries = 0; - const BOOL ping_based_timeout = FALSE; + constexpr S32 retries = 0; + constexpr bool ping_based_timeout = false; return sendReliable(host, retries, ping_based_timeout, timeout, callback, callback_data); } // send the message via a UDP packet S32 LLMessageSystem::sendReliable( const LLHost &host, S32 retries, - BOOL ping_based_timeout, + bool ping_based_timeout, F32Seconds timeout, void (*callback)(void **,S32), void ** callback_data) @@ -1013,7 +1013,7 @@ S32 LLMessageSystem::sendReliable( const LLHost &host, } } - mSendReliable = TRUE; + mSendReliable = true; mReliablePacketParams.set(host, retries, ping_based_timeout, timeout, callback, callback_data, const_cast<char*>(mMessageBuilder->getMessageName())); @@ -1040,7 +1040,7 @@ void LLMessageSystem::forwardReliable(const U32 circuit_code) S32 LLMessageSystem::forwardReliable( const LLHost &host, S32 retries, - BOOL ping_based_timeout, + bool ping_based_timeout, F32Seconds timeout, void (*callback)(void **,S32), void ** callback_data) @@ -1067,9 +1067,9 @@ S32 LLMessageSystem::flushSemiReliable(const LLHost &host, void (*callback)(void S32 send_bytes = 0; if (mMessageBuilder->getMessageSize()) { - mSendReliable = TRUE; + mSendReliable = true; // No need for ping-based retry as not going to retry - mReliablePacketParams.set(host, 0, FALSE, timeout, callback, + mReliablePacketParams.set(host, 0, false, timeout, callback, callback_data, const_cast<char*>(mMessageBuilder->getMessageName())); send_bytes = sendMessage(host); @@ -1169,7 +1169,7 @@ S32 LLMessageSystem::sendMessage(const LLHost &host) host.getUntrustedSimulatorCap(), mLLSDMessageBuilder->getMessageName(), message, cb)); - mSendReliable = FALSE; + mSendReliable = false; mReliablePacketParams.clear(); return 1; } @@ -1218,7 +1218,7 @@ S32 LLMessageSystem::sendMessage(const LLHost &host) // tack packet acks onto the end of this message S32 space_left = (MTUBYTES - buffer_length) / sizeof(TPACKETID); // space left for packet ids S32 ack_count = (S32)cdp->mAcks.size(); - BOOL is_ack_appended = FALSE; + bool is_ack_appended = false; std::vector<TPACKETID> acks; if((space_left > 0) && (ack_count > 0) && (mMessageBuilder->getMessageName() != _PREHASH_PacketAck)) @@ -1269,10 +1269,10 @@ S32 LLMessageSystem::sendMessage(const LLHost &host) // tack the count in the final byte U8 count = (U8)append_ack_count; buf_ptr[buffer_length++] = count; - is_ack_appended = TRUE; + is_ack_appended = true; } - BOOL success; + bool success; success = mPacketRing.sendPacket(mSocket, (char *)buf_ptr, buffer_length, host); if (!success) @@ -1307,12 +1307,12 @@ S32 LLMessageSystem::sendMessage(const LLHost &host) mPacketsOut++; mTotalBytesOut += buffer_length; - mSendReliable = FALSE; + mSendReliable = false; mReliablePacketParams.clear(); return buffer_length; } -void LLMessageSystem::logMsgFromInvalidCircuit( const LLHost& host, BOOL recv_reliable ) +void LLMessageSystem::logMsgFromInvalidCircuit( const LLHost& host, bool recv_reliable ) { if(mVerboseLog) { @@ -1339,7 +1339,7 @@ void LLMessageSystem::logMsgFromInvalidCircuit( const LLHost& host, BOOL recv_re // TODO: babbage: work out if we need these // mMessageCountList[mNumMessageCounts].mMessageNum = mCurrentRMessageTemplate->mMessageNumber; mMessageCountList[mNumMessageCounts].mMessageBytes = mMessageReader->getMessageSize(); - mMessageCountList[mNumMessageCounts].mInvalid = TRUE; + mMessageCountList[mNumMessageCounts].mInvalid = true; mNumMessageCounts++; } } @@ -1392,12 +1392,12 @@ void LLMessageSystem::logTrustedMsgFromUntrustedCircuit( const LLHost& host ) // = mCurrentRMessageTemplate->mMessageNumber; mMessageCountList[mNumMessageCounts].mMessageBytes = mMessageReader->getMessageSize(); - mMessageCountList[mNumMessageCounts].mInvalid = TRUE; + mMessageCountList[mNumMessageCounts].mInvalid = true; mNumMessageCounts++; } } -void LLMessageSystem::logValidMsg(LLCircuitData *cdp, const LLHost& host, BOOL recv_reliable, BOOL recv_resent, BOOL recv_acks ) +void LLMessageSystem::logValidMsg(LLCircuitData *cdp, const LLHost& host, bool recv_reliable, bool recv_resent, bool recv_acks ) { if (mNumMessageCounts >= MAX_MESSAGE_COUNT_NUM) { @@ -1408,7 +1408,7 @@ void LLMessageSystem::logValidMsg(LLCircuitData *cdp, const LLHost& host, BOOL r // TODO: babbage: work out if we need these //mMessageCountList[mNumMessageCounts].mMessageNum = mCurrentRMessageTemplate->mMessageNumber; mMessageCountList[mNumMessageCounts].mMessageBytes = mMessageReader->getMessageSize(); - mMessageCountList[mNumMessageCounts].mInvalid = FALSE; + mMessageCountList[mNumMessageCounts].mInvalid = false; mNumMessageCounts++; } @@ -1502,7 +1502,7 @@ void LLMessageSystem::getCircuitInfo(LLSD& info) const } // returns whether the given host is on a trusted circuit -BOOL LLMessageSystem::getCircuitTrust(const LLHost &host) +bool LLMessageSystem::getCircuitTrust(const LLHost &host) { LLCircuitData *cdp = mCircuitInfo.findCircuit(host); if (cdp) @@ -1510,12 +1510,12 @@ BOOL LLMessageSystem::getCircuitTrust(const LLHost &host) return cdp->getTrusted(); } - return FALSE; + return false; } // Activate a circuit, and set its trust level (TRUE if trusted, // FALSE if not). -void LLMessageSystem::enableCircuit(const LLHost &host, BOOL trusted) +void LLMessageSystem::enableCircuit(const LLHost &host, bool trusted) { LLCircuitData *cdp = mCircuitInfo.findCircuit(host); if (!cdp) @@ -1576,7 +1576,7 @@ void LLMessageSystem::disableCircuit(const LLHost &host) } -void LLMessageSystem::setCircuitAllowTimeout(const LLHost &host, BOOL allow) +void LLMessageSystem::setCircuitAllowTimeout(const LLHost &host, bool allow) { LLCircuitData *cdp = mCircuitInfo.findCircuit(host); if (cdp) @@ -1654,7 +1654,7 @@ bool LLMessageSystem::checkCircuitAlive(const LLHost &host) } -void LLMessageSystem::setCircuitProtection(BOOL b_protect) +void LLMessageSystem::setCircuitProtection(bool b_protect) { mbProtected = b_protect; } @@ -1782,7 +1782,7 @@ void open_circuit(LLMessageSystem *msgsystem, void** /*user_data*/) msgsystem->getIPPortFast(_PREHASH_CircuitInfo, _PREHASH_Port, port); // By default, OpenCircuit's are untrusted - msgsystem->enableCircuit(LLHost(ip, port), FALSE); + msgsystem->enableCircuit(LLHost(ip, port), false); } void close_circuit(LLMessageSystem *msgsystem, void** /*user_data*/) @@ -1947,9 +1947,9 @@ void LLMessageSystem::processUseCircuitCode(LLMessageSystem* msg, // passed the circuit code and session id check, so we will go // ahead and persist the ID associated. LLCircuitData *cdp = msg->mCircuitInfo.findCircuit(msg->getSender()); - BOOL had_circuit_already = cdp ? TRUE : FALSE; + bool had_circuit_already = cdp ? true : false; - msg->enableCircuit(msg->getSender(), FALSE); + msg->enableCircuit(msg->getSender(), false); cdp = msg->mCircuitInfo.findCircuit(msg->getSender()); if(cdp) { @@ -1973,7 +1973,7 @@ void LLMessageSystem::processUseCircuitCode(LLMessageSystem* msg, // doesn't get properly duplicate suppressed. Not a BIG deal, but it's somewhat confusing // (and bad from a state point of view). DJS 9/23/04 // - cdp->checkPacketInID(gMessageSystem->mCurrentRecvPacketID, FALSE ); // Since this is the first message on the circuit, by definition it's not resent. + cdp->checkPacketInID(gMessageSystem->mCurrentRecvPacketID, false ); // Since this is the first message on the circuit, by definition it's not resent. } msg->mIPPortToCircuitCode[ip_port_in] = circuit_code_in; @@ -2460,13 +2460,13 @@ bool start_messaging_system( if (!gMessageSystem) { LL_ERRS("AppInit") << "Messaging system initialization failed." << LL_ENDL; - return FALSE; + return false; } // bail if system encountered an error. if(!gMessageSystem->isOK()) { - return FALSE; + return false; } if (b_dump_prehash_file) @@ -2517,12 +2517,12 @@ bool start_messaging_system( // Initialize the transfer manager gTransferManager.init(); - return TRUE; + return true; } void LLMessageSystem::startLogging() { - mVerboseLog = TRUE; + mVerboseLog = true; std::ostringstream str; str << "START MESSAGE LOG" << std::endl; str << "Legend:" << std::endl; @@ -2536,7 +2536,7 @@ void LLMessageSystem::stopLogging() { if(mVerboseLog) { - mVerboseLog = FALSE; + mVerboseLog = false; LL_INFOS("Messaging") << "END MESSAGE LOG" << LL_ENDL; } } @@ -2757,7 +2757,7 @@ S32 LLMessageSystem::zeroCodeAdjustCurrentSendTotal() 0); } // TODO: babbage: remove this horror - mMessageBuilder->setBuilt(FALSE); + mMessageBuilder->setBuilt(false); S32 count = mSendSize; @@ -3357,7 +3357,7 @@ void LLMessageSystem::dumpPacketToLog() //static -U64Microseconds LLMessageSystem::getMessageTimeUsecs(const BOOL update) +U64Microseconds LLMessageSystem::getMessageTimeUsecs(const bool update) { if (gMessageSystem) { @@ -3374,7 +3374,7 @@ U64Microseconds LLMessageSystem::getMessageTimeUsecs(const BOOL update) } //static -F64Seconds LLMessageSystem::getMessageTimeSeconds(const BOOL update) +F64Seconds LLMessageSystem::getMessageTimeSeconds(const bool update) { if (gMessageSystem) { @@ -3432,7 +3432,7 @@ void LLMessageSystem::newMessageFast(const char *name) mMessageBuilder = mTemplateMessageBuilder; } } - mSendReliable = FALSE; + mSendReliable = false; mMessageBuilder->newMessage(name); } @@ -3923,7 +3923,7 @@ void LLMessageSystem::getString(const char *block, const char *var, blocknum); } -BOOL LLMessageSystem::has(const char *blockname) const +bool LLMessageSystem::has(const char *blockname) const { return getNumberOfBlocks(blockname) > 0; } |