diff options
Diffstat (limited to 'indra/llmessage')
-rw-r--r-- | indra/llmessage/llcachename.cpp | 8 | ||||
-rw-r--r-- | indra/llmessage/llcoproceduremanager.cpp | 8 | ||||
-rw-r--r-- | indra/llmessage/llcorehttputil.h | 8 | ||||
-rw-r--r-- | indra/llmessage/lldatapacker.cpp | 7 | ||||
-rw-r--r-- | indra/llmessage/llexperiencecache.h | 2 | ||||
-rw-r--r-- | indra/llmessage/lliohttpserver.cpp | 2 | ||||
-rw-r--r-- | indra/llmessage/lliopipe.h | 2 | ||||
-rw-r--r-- | indra/llmessage/lliosocket.h | 4 | ||||
-rw-r--r-- | indra/llmessage/llpumpio.cpp | 34 | ||||
-rw-r--r-- | indra/llmessage/llregionflags.h | 9 | ||||
-rw-r--r-- | indra/llmessage/llservice.h | 2 | ||||
-rw-r--r-- | indra/llmessage/llstoredmessage.h | 2 | ||||
-rw-r--r-- | indra/llmessage/lluseroperation.cpp | 2 | ||||
-rw-r--r-- | indra/llmessage/message.cpp | 2 | ||||
-rw-r--r-- | indra/llmessage/tests/llcurl_stub.cpp | 2 |
15 files changed, 55 insertions, 39 deletions
diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index c90b6d86ad..5b4f9aded7 100644 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -87,19 +87,19 @@ public: LLUUID mID; LLCacheNameSignal mSignal; LLHost mHost; - + PendingReply(const LLUUID& id, const LLHost& host) : mID(id), mHost(host) { } - + boost::signals2::connection setCallback(const LLCacheNameCallback& cb) { return mSignal.connect(cb); } - + void done() { mID.setNull(); } - bool isDone() const { return mID.isNull() != false; } + bool isDone() const { return mID.isNull(); } }; class ReplySender diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp index ebbaea9b12..c0a5e361b1 100644 --- a/indra/llmessage/llcoproceduremanager.cpp +++ b/indra/llmessage/llcoproceduremanager.cpp @@ -95,7 +95,7 @@ public: private: struct QueuedCoproc { - typedef boost::shared_ptr<QueuedCoproc> ptr_t; + typedef std::shared_ptr<QueuedCoproc> ptr_t; QueuedCoproc(const std::string &name, const LLUUID &id, CoProcedure_t proc) : mName(name), @@ -115,7 +115,7 @@ private: // Use shared_ptr to control the lifespan of our CoprocQueue_t instance // because the consuming coroutine might outlive this LLCoprocedurePool // instance. - typedef boost::shared_ptr<CoprocQueue_t> CoprocQueuePtr; + typedef std::shared_ptr<CoprocQueue_t> CoprocQueuePtr; std::string mPoolName; size_t mPoolSize, mActiveCoprocsCount, mPending; @@ -301,7 +301,7 @@ LLCoprocedurePool::LLCoprocedurePool(const std::string &poolName, size_t size): mPoolSize(size), mActiveCoprocsCount(0), mPending(0), - mPendingCoprocs(boost::make_shared<CoprocQueue_t>(LLCoprocedureManager::DEFAULT_QUEUE_SIZE)), + mPendingCoprocs(std::make_shared<CoprocQueue_t>(LLCoprocedureManager::DEFAULT_QUEUE_SIZE)), mHTTPPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID), mCoroMapping() { @@ -384,7 +384,7 @@ LLUUID LLCoprocedurePool::enqueueCoprocedure(const std::string &name, LLCoproced LL_INFOS("CoProcMgr") << "Coprocedure(" << name << ") enqueuing with id=" << id.asString() << " in pool \"" << mPoolName << "\" at " << mPending << LL_ENDL; } - auto pushed = mPendingCoprocs->try_push(boost::make_shared<QueuedCoproc>(name, id, proc)); + auto pushed = mPendingCoprocs->try_push(std::make_shared<QueuedCoproc>(name, id, proc)); if (pushed == boost::fibers::channel_op_status::success) { ++mPending; diff --git a/indra/llmessage/llcorehttputil.h b/indra/llmessage/llcorehttputil.h index 6d0d68cf24..fc561c6b0f 100644 --- a/indra/llmessage/llcorehttputil.h +++ b/indra/llmessage/llcorehttputil.h @@ -263,8 +263,8 @@ class HttpCoroHandler : public LLCore::HttpHandler { public: - typedef boost::shared_ptr<HttpCoroHandler> ptr_t; - typedef boost::weak_ptr<HttpCoroHandler> wptr_t; + typedef std::shared_ptr<HttpCoroHandler> ptr_t; + typedef std::weak_ptr<HttpCoroHandler> wptr_t; HttpCoroHandler(LLEventStream &reply); @@ -317,8 +317,8 @@ public: static const std::string HTTP_RESULTS_CONTENT; static const std::string HTTP_RESULTS_RAW; - typedef boost::shared_ptr<HttpCoroutineAdapter> ptr_t; - typedef boost::weak_ptr<HttpCoroutineAdapter> wptr_t; + typedef std::shared_ptr<HttpCoroutineAdapter> ptr_t; + typedef std::weak_ptr<HttpCoroutineAdapter> wptr_t; HttpCoroutineAdapter(const std::string &name, LLCore::HttpRequest::policy_t policyId); ~HttpCoroutineAdapter(); diff --git a/indra/llmessage/lldatapacker.cpp b/indra/llmessage/lldatapacker.cpp index b3113cd5d8..1545443798 100644 --- a/indra/llmessage/lldatapacker.cpp +++ b/indra/llmessage/lldatapacker.cpp @@ -298,6 +298,13 @@ bool LLDataPackerBinaryBuffer::unpackBinaryData(U8 *value, S32 &size, const char } htolememcpy(&size, mCurBufferp, MVT_S32, 4); + + if (size < 0) + { + LL_WARNS() << "LLDataPackerBinaryBuffer::unpackBinaryData unpacked invalid size, aborting!" << LL_ENDL; + return false; + } + mCurBufferp += 4; if (!verifyLength(size, name)) diff --git a/indra/llmessage/llexperiencecache.h b/indra/llmessage/llexperiencecache.h index 8be4c64dfc..3ee45da2e7 100644 --- a/indra/llmessage/llexperiencecache.h +++ b/indra/llmessage/llexperiencecache.h @@ -112,7 +112,7 @@ private: // Callback types for get() typedef boost::signals2::signal < void(const LLSD &) > callback_signal_t; - typedef boost::shared_ptr<callback_signal_t> signal_ptr; + typedef std::shared_ptr<callback_signal_t> signal_ptr; // May have multiple callbacks for a single ID, which are // represented as multiple slots bound to the signal. // Avoid copying signals via pointers. diff --git a/indra/llmessage/lliohttpserver.cpp b/indra/llmessage/lliohttpserver.cpp index c707c7ad09..e302dd2b5e 100644 --- a/indra/llmessage/lliohttpserver.cpp +++ b/indra/llmessage/lliohttpserver.cpp @@ -982,7 +982,7 @@ LLHTTPNode& LLIOHTTPServer::create( } LLHTTPResponseFactory* factory = new LLHTTPResponseFactory; - boost::shared_ptr<LLChainIOFactory> factory_ptr(factory); + std::shared_ptr<LLChainIOFactory> factory_ptr(factory); LLIOServerSocket* server = new LLIOServerSocket(pool, socket, factory_ptr); diff --git a/indra/llmessage/lliopipe.h b/indra/llmessage/lliopipe.h index 7fd4cee8ba..e6ac8ebfc2 100644 --- a/indra/llmessage/lliopipe.h +++ b/indra/llmessage/lliopipe.h @@ -89,7 +89,7 @@ public: /** * @brief Scattered memory container. */ - typedef boost::shared_ptr<LLBufferArray> buffer_ptr_t; + typedef std::shared_ptr<LLBufferArray> buffer_ptr_t; /** * @brief Enumeration for IO return codes diff --git a/indra/llmessage/lliosocket.h b/indra/llmessage/lliosocket.h index 303d80eb14..a62b3c0204 100644 --- a/indra/llmessage/lliosocket.h +++ b/indra/llmessage/lliosocket.h @@ -65,7 +65,7 @@ public: /** * @brief Reference counted shared pointers to sockets. */ - typedef boost::shared_ptr<LLSocket> ptr_t; + typedef std::shared_ptr<LLSocket> ptr_t; /** * @brief Type of socket to create. @@ -305,7 +305,7 @@ class LLIOServerSocket : public LLIOPipe { public: typedef LLSocket::ptr_t socket_t; - typedef boost::shared_ptr<LLChainIOFactory> factory_t; + typedef std::shared_ptr<LLChainIOFactory> factory_t; LLIOServerSocket(apr_pool_t* pool, socket_t listener, factory_t reactor); virtual ~LLIOServerSocket(); diff --git a/indra/llmessage/llpumpio.cpp b/indra/llmessage/llpumpio.cpp index 44720f0015..52e6be6f98 100644 --- a/indra/llmessage/llpumpio.cpp +++ b/indra/llmessage/llpumpio.cpp @@ -113,7 +113,7 @@ void ll_debug_poll_fd(const char* msg, const apr_pollfd_t* poll) { LL_DEBUGS() << "Poll -- " << (msg?msg:"") << ": no descriptor." << LL_ENDL; } -#endif +#endif } /** @@ -181,12 +181,13 @@ bool LLPumpIO::prime(apr_pool_t* pool) { cleanup(); initialize(pool); - return ((pool == NULL) ? false : true); + return pool != nullptr; } bool LLPumpIO::addChain(const chain_t& chain, F32 timeout, bool has_curl_request) { - if(chain.empty()) return false; + if (chain.empty()) + return false; LLChainInfo info; info.mHasCurlRequest = has_curl_request; @@ -218,12 +219,13 @@ bool LLPumpIO::addChain( LLSD context, F32 timeout) { - // remember that if the caller is providing a full link // description, we need to have that description matched to a // particular buffer. - if(!data) return false; - if(links.empty()) return false; + if (!data) + return false; + if (links.empty()) + return false; #if LL_DEBUG_PIPE_TYPE_IN_PUMP LL_DEBUGS() << "LLPumpIO::addChain() " << links[0].mPipe << " '" @@ -243,10 +245,11 @@ bool LLPumpIO::addChain( bool LLPumpIO::setTimeoutSeconds(F32 timeout) { // If no chain is running, return failure. - if(mRunningChains.end() == mCurrentChain) + if (mRunningChains.end() == mCurrentChain) { return false; } + (*mCurrentChain).setTimeoutSeconds(timeout); return true; } @@ -254,7 +257,7 @@ bool LLPumpIO::setTimeoutSeconds(F32 timeout) void LLPumpIO::adjustTimeoutSeconds(F32 delta) { // Ensure a chain is running - if(mRunningChains.end() != mCurrentChain) + if (mRunningChains.end() != mCurrentChain) { (*mCurrentChain).adjustTimeoutSeconds(delta); } @@ -263,27 +266,27 @@ void LLPumpIO::adjustTimeoutSeconds(F32 delta) static std::string events_2_string(apr_int16_t events) { std::ostringstream ostr; - if(events & APR_POLLIN) + if (events & APR_POLLIN) { ostr << "read,"; } - if(events & APR_POLLPRI) + if (events & APR_POLLPRI) { ostr << "priority,"; } - if(events & APR_POLLOUT) + if (events & APR_POLLOUT) { ostr << "write,"; } - if(events & APR_POLLERR) + if (events & APR_POLLERR) { ostr << "error,"; } - if(events & APR_POLLHUP) + if (events & APR_POLLHUP) { ostr << "hangup,"; } - if(events & APR_POLLNVAL) + if (events & APR_POLLNVAL) { ostr << "invalid,"; } @@ -292,7 +295,8 @@ static std::string events_2_string(apr_int16_t events) bool LLPumpIO::setConditional(LLIOPipe* pipe, const apr_pollfd_t* poll) { - if(!pipe) return false; + if (!pipe) + return false; ll_debug_poll_fd("Set conditional", poll); LL_DEBUGS() << "Setting conditionals (" << (poll ? events_2_string(poll->reqevents) :"null") diff --git a/indra/llmessage/llregionflags.h b/indra/llmessage/llregionflags.h index 489765e0ac..ab2d127f6e 100644 --- a/indra/llmessage/llregionflags.h +++ b/indra/llmessage/llregionflags.h @@ -106,11 +106,16 @@ const U64 REGION_FLAGS_ESTATE_MASK = REGION_FLAGS_EXTERNALLY_VISIBLE | REGION_FLAGS_DENY_ANONYMOUS | REGION_FLAGS_DENY_AGEUNVERIFIED; +inline bool is_flag_set(U64 flags, U64 flag) +{ + return (flags & flag) != 0; +} + inline bool is_prelude( U64 flags ) { // definition of prelude does not depend on fixed-sun - return 0 == (flags & REGION_FLAGS_PRELUDE_UNSET) - && 0 != (flags & REGION_FLAGS_PRELUDE_SET); + return !is_flag_set(flags, REGION_FLAGS_PRELUDE_UNSET) && + is_flag_set(flags, REGION_FLAGS_PRELUDE_SET); } inline U64 set_prelude_flags(U64 flags) diff --git a/indra/llmessage/llservice.h b/indra/llmessage/llservice.h index 9c09aeb44c..f215acab56 100644 --- a/indra/llmessage/llservice.h +++ b/indra/llmessage/llservice.h @@ -116,7 +116,7 @@ class LLService : public LLIOPipe public: //typedef boost::intrusive_ptr<LLServiceCreator> creator_t; //typedef boost::intrusive_ptr<LLService> service_t; - typedef boost::shared_ptr<LLChainIOFactory> creator_t; + typedef std::shared_ptr<LLChainIOFactory> creator_t; /** * @brief This method is used to register a protocol name with a diff --git a/indra/llmessage/llstoredmessage.h b/indra/llmessage/llstoredmessage.h index 9c98e2c558..6ea150fda3 100644 --- a/indra/llmessage/llstoredmessage.h +++ b/indra/llmessage/llstoredmessage.h @@ -46,7 +46,7 @@ private: std::string mName; }; -typedef boost::shared_ptr<LLStoredMessage> LLStoredMessagePtr; +typedef std::shared_ptr<LLStoredMessage> LLStoredMessagePtr; #endif // LL_STOREDMESSAGE_H diff --git a/indra/llmessage/lluseroperation.cpp b/indra/llmessage/lluseroperation.cpp index 3e387d3d5e..6b0cc63686 100644 --- a/indra/llmessage/lluseroperation.cpp +++ b/indra/llmessage/lluseroperation.cpp @@ -138,7 +138,7 @@ bool LLUserOperationMgr::deleteOperation(LLUserOperation* op) delete op; op = NULL; } - return rv ? true : false; + return rv != 0; } void LLUserOperationMgr::deleteExpiredOperations() diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp index 0d7810a659..272bf9b672 100644 --- a/indra/llmessage/message.cpp +++ b/indra/llmessage/message.cpp @@ -1947,7 +1947,7 @@ 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 != nullptr; msg->enableCircuit(msg->getSender(), false); cdp = msg->mCircuitInfo.findCircuit(msg->getSender()); diff --git a/indra/llmessage/tests/llcurl_stub.cpp b/indra/llmessage/tests/llcurl_stub.cpp index b7fdf4f437..1c571a74da 100644 --- a/indra/llmessage/tests/llcurl_stub.cpp +++ b/indra/llmessage/tests/llcurl_stub.cpp @@ -49,7 +49,7 @@ void LLCurl::Responder::httpCompleted() } void LLCurl::Responder::completedRaw(LLChannelDescriptors const&, - boost::shared_ptr<LLBufferArray> const&) + std::shared_ptr<LLBufferArray> const&) { } |