diff options
author | Merov Linden <merov@lindenlab.com> | 2015-03-16 09:49:57 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2015-03-16 09:49:57 -0700 |
commit | 9ba10bf1f2ee16eb082f4cb29b0b9f7172e7ce8e (patch) | |
tree | 9548ff32e0a1dc5b3f8a70b2a386827f72bf5284 /indra/llmessage | |
parent | 184bf6a76fd3b52efa83c93f56164d2adce7ed3e (diff) | |
parent | d4a2e9fd9a0e7001a6c824ddd6cf37039a632b9d (diff) |
Merge lindenlab/viewer-tools-update
Diffstat (limited to 'indra/llmessage')
-rwxr-xr-x | indra/llmessage/llcachename.cpp | 3 | ||||
-rwxr-xr-x | indra/llmessage/llcircuit.cpp | 2 | ||||
-rwxr-xr-x | indra/llmessage/llhttpassetstorage.cpp | 3 | ||||
-rwxr-xr-x | indra/llmessage/lliopipe.h | 72 | ||||
-rwxr-xr-x | indra/llmessage/llpartdata.cpp | 5 | ||||
-rwxr-xr-x | indra/llmessage/llregionhandle.h | 4 | ||||
-rwxr-xr-x | indra/llmessage/llthrottle.cpp | 2 | ||||
-rwxr-xr-x | indra/llmessage/llxfermanager.cpp | 2 | ||||
-rwxr-xr-x | indra/llmessage/message.cpp | 2 | ||||
-rwxr-xr-x | indra/llmessage/tests/llhost_test.cpp | 30 |
10 files changed, 43 insertions, 82 deletions
diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index 4dd8d04656..daf3e0b4de 100755 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -51,9 +51,6 @@ static const std::string NAME("name"); // We won't re-request a name during this time const U32 PENDING_TIMEOUT_SECS = 5 * 60; -// File version number -const S32 CN_FILE_VERSION = 2; - // Globals LLCacheName* gCacheName = NULL; std::map<std::string, std::string> LLCacheName::sCacheName; diff --git a/indra/llmessage/llcircuit.cpp b/indra/llmessage/llcircuit.cpp index 5aaada63b1..3eb0e0d057 100755 --- a/indra/llmessage/llcircuit.cpp +++ b/indra/llmessage/llcircuit.cpp @@ -688,7 +688,7 @@ void LLCircuitData::checkPacketInID(TPACKETID id, BOOL receive_resent) // now, check to see if we've got a gap U32 gap = 0; - if ((mPacketsInID == id)) + if (mPacketsInID == id) { // nope! bump and wrap the counter, then return mPacketsInID++; diff --git a/indra/llmessage/llhttpassetstorage.cpp b/indra/llmessage/llhttpassetstorage.cpp index a30140e8f3..e202154445 100755 --- a/indra/llmessage/llhttpassetstorage.cpp +++ b/indra/llmessage/llhttpassetstorage.cpp @@ -47,8 +47,7 @@ const char* const LOCAL_ASSET_URL_FORMAT = "http://%s:12041/asset"; const U32 MAX_RUNNING_REQUESTS = 1; -const F32 MAX_PROCESSING_TIME = 0.005f; -const S32 CURL_XFER_BUFFER_SIZE = 65536; + // Try for 30 minutes for now. const F32 GET_URL_TO_FILE_TIMEOUT = 1800.0f; diff --git a/indra/llmessage/lliopipe.h b/indra/llmessage/lliopipe.h index 9a0a427efd..7fd4cee8ba 100755 --- a/indra/llmessage/lliopipe.h +++ b/indra/llmessage/lliopipe.h @@ -56,11 +56,8 @@ void pump_debug(const char *file, S32 line); /** * intrusive pointer support */ -namespace boost -{ - void intrusive_ptr_add_ref(LLIOPipe* p); - void intrusive_ptr_release(LLIOPipe* p); -}; +void intrusive_ptr_add_ref(LLIOPipe* p); +void intrusive_ptr_release(LLIOPipe* p); /** * @class LLIOPipe @@ -251,68 +248,21 @@ protected: LLPumpIO* pump) = 0; private: - friend void boost::intrusive_ptr_add_ref(LLIOPipe* p); - friend void boost::intrusive_ptr_release(LLIOPipe* p); + friend void intrusive_ptr_add_ref(LLIOPipe* p); + friend void intrusive_ptr_release(LLIOPipe* p); U32 mReferenceCount; }; -namespace boost +inline void intrusive_ptr_add_ref(LLIOPipe* p) { - inline void intrusive_ptr_add_ref(LLIOPipe* p) - { - ++p->mReferenceCount; - } - inline void intrusive_ptr_release(LLIOPipe* p) + ++p->mReferenceCount; +} +inline void intrusive_ptr_release(LLIOPipe* p) +{ + if(p && 0 == --p->mReferenceCount) { - if(p && 0 == --p->mReferenceCount) - { - delete p; - } + delete p; } -}; - - -#if 0 -/** - * @class LLIOBoiler - * @brief This class helps construct new LLIOPipe specializations - * @see LLIOPipe - * - * THOROUGH_DESCRIPTION - */ -class LLIOBoiler : public LLIOPipe -{ -public: - LLIOBoiler(); - virtual ~LLIOBoiler(); - -protected: - /* @name LLIOPipe virtual implementations - */ - //@{ - /** - * @brief Process the data in buffer - */ - virtual EStatus process_impl( - const LLChannelDescriptors& channels, - buffer_ptr_t& buffer, - bool& eos, - LLSD& context, - LLPumpIO* pump); - //@} -}; - -// virtual -LLIOPipe::EStatus process_impl( - const LLChannelDescriptors& channels, - buffer_ptr_t& buffer, - bool& eos, - LLSD& context, - LLPumpIO* pump) -{ - return STATUS_NOT_IMPLEMENTED; } -#endif // #if 0 - use this block as a boilerplate - #endif // LL_LLIOPIPE_H diff --git a/indra/llmessage/llpartdata.cpp b/indra/llmessage/llpartdata.cpp index 41a0310ce0..53aa35c0f9 100755 --- a/indra/llmessage/llpartdata.cpp +++ b/indra/llmessage/llpartdata.cpp @@ -49,11 +49,6 @@ const S32 PS_MAX_DATA_BLOCK_SIZE = PS_SYS_DATA_BLOCK_SIZE+ const S32 PS_LEGACY_DATA_BLOCK_SIZE = PS_SYS_DATA_BLOCK_SIZE + PS_LEGACY_PART_DATA_BLOCK_SIZE; - -const U32 PART_DATA_MASK = LLPartData::LL_PART_DATA_GLOW | LLPartData::LL_PART_DATA_BLEND; - - - const F32 MAX_PART_SCALE = 4.f; bool LLPartData::hasGlow() const diff --git a/indra/llmessage/llregionhandle.h b/indra/llmessage/llregionhandle.h index e3ddd46acd..085757dcbc 100755 --- a/indra/llmessage/llregionhandle.h +++ b/indra/llmessage/llregionhandle.h @@ -73,7 +73,7 @@ inline BOOL to_region_handle(const F32 x_pos, const F32 y_pos, U64 *region_handl } else { - x_int = (U32)llround(x_pos); + x_int = (U32)ll_round(x_pos); } if (y_pos < 0.f) { @@ -82,7 +82,7 @@ inline BOOL to_region_handle(const F32 x_pos, const F32 y_pos, U64 *region_handl } else { - y_int = (U32)llround(y_pos); + y_int = (U32)ll_round(y_pos); } *region_handle = to_region_handle(x_int, y_int); return TRUE; diff --git a/indra/llmessage/llthrottle.cpp b/indra/llmessage/llthrottle.cpp index e484bd258d..7605da4d3f 100755 --- a/indra/llmessage/llthrottle.cpp +++ b/indra/llmessage/llthrottle.cpp @@ -391,7 +391,7 @@ BOOL LLThrottleGroup::dynamicAdjust() } mBitsSentThisPeriod[i] = 0; - total += llround(mBitsSentHistory[i]); + total += ll_round(mBitsSentHistory[i]); } // Look for busy channels diff --git a/indra/llmessage/llxfermanager.cpp b/indra/llmessage/llxfermanager.cpp index b518dd1b72..0ab67b8dda 100755 --- a/indra/llmessage/llxfermanager.cpp +++ b/indra/llmessage/llxfermanager.cpp @@ -261,7 +261,7 @@ U32 LLXferManager::numActiveListEntries(LLXfer *list_head) while (list_head) { - if ((list_head->mStatus == e_LL_XFER_IN_PROGRESS)) + if (list_head->mStatus == e_LL_XFER_IN_PROGRESS) { num_entries++; } diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp index cc2d5d66ad..0c3c14969b 100755 --- a/indra/llmessage/message.cpp +++ b/indra/llmessage/message.cpp @@ -2752,7 +2752,7 @@ void LLMessageSystem::dumpReceiveCounts() if (mt->mReceiveCount > 0) { LL_INFOS("Messaging") << "Num: " << std::setw(3) << mt->mReceiveCount << " Bytes: " << std::setw(6) << mt->mReceiveBytes - << " Invalid: " << std::setw(3) << mt->mReceiveInvalid << " " << mt->mName << " " << llround(100 * mt->mDecodeTimeThisFrame / mReceiveTime.value()) << "%" << LL_ENDL; + << " Invalid: " << std::setw(3) << mt->mReceiveInvalid << " " << mt->mName << " " << ll_round(100 * mt->mDecodeTimeThisFrame / mReceiveTime.value()) << "%" << LL_ENDL; } } } diff --git a/indra/llmessage/tests/llhost_test.cpp b/indra/llmessage/tests/llhost_test.cpp index eadf83c428..efca1bbfca 100755 --- a/indra/llmessage/tests/llhost_test.cpp +++ b/indra/llmessage/tests/llhost_test.cpp @@ -151,11 +151,31 @@ namespace tut template<> template<> void host_object::test<9>() { - skip("this test is flaky, but we should figure out why..."); + skip("this test is irreparably flaky"); // skip("setHostByName(\"google.com\"); getHostName() -> (e.g.) \"yx-in-f100.1e100.net\""); - std::string hostStr = "lindenlab.com"; + // nat: is it reasonable to expect LLHost::getHostName() to echo + // back something resembling the string passed to setHostByName()? + // + // If that's not even reasonable, would a round trip in the /other/ + // direction make more sense? (Call getHostName() for something with + // known IP address; call setHostByName(); verify IP address) + // + // Failing that... is there a plausible way to test getHostName() and + // setHostByName()? Hopefully without putting up a dummy local DNS + // server? + + // monty: If you don't control the DNS server or the DNS configuration + // for the test point then, no, none of these will necessarily be + // reliable and may start to fail at any time. Forward translation + // is subject to CNAME records and round-robin address assignment. + // Reverse lookup is 1-to-many and is more and more likely to have + // nothing to do with the forward translation. + // + // So the test is increasingly meaningless on a real network. + + std::string hostStr = "lindenlab.com"; LLHost host; - host.setHostByName(hostStr); + host.setHostByName(hostStr); // reverse DNS will likely result in appending of some // sub-domain to the main hostname. so look for @@ -177,9 +197,9 @@ namespace tut template<> template<> void host_object::test<10>() { - std::string hostStr = "64.233.167.99"; + std::string hostStr = "64.233.167.99"; LLHost host; - host.setHostByName(hostStr); + host.setHostByName(hostStr); ensure("SetHostByName for dotted IP Address failed", host.getAddress() == ip_string_to_u32(hostStr.c_str())); } |