diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2015-08-18 17:05:29 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2015-08-18 17:05:29 -0400 |
commit | 62527e6f18f0a035a234cf584e31f7eea93fd4a7 (patch) | |
tree | 29f532cde7b0cf0fbf96cd4def3c89c77717b8fb /indra/llmessage | |
parent | 02b7e7ce07948a25bc1f58fdbfe3499dc917340f (diff) |
MAINT-5506: Fix ugly timing bug in llurlentry static initialization.
The problem was that class-static LLUrlEntryParcel::sRegionHost was being
initialized by copying class-static LLHost::invalid. Naturally, these two
statics are initialized in different source files. Since C++ makes no promises
about the relative order in which objects in different object files are
initialized, it seems we hit a case in which we were trying to initialize
sRegionHost by copying a completely uninitialized LLHost::invalid.
In general we might attempt to address such cross-translation-unit issues by
introducing an LLSingleton. But in this particular case, the punch line is
that LLHost::invalid is explicitly constructed identically to a
default-constructed LLHost! In other words, LLHost::invalid provides nothing
we couldn't get from LLHost(). All it gives us is an opportunity for glitches
such as the above.
Remove LLHost::invalid and all references, replacing with LLHost().
Diffstat (limited to 'indra/llmessage')
-rwxr-xr-x | indra/llmessage/llassetstorage.cpp | 2 | ||||
-rwxr-xr-x | indra/llmessage/llcachename.cpp | 2 | ||||
-rwxr-xr-x | indra/llmessage/llhost.cpp | 2 | ||||
-rwxr-xr-x | indra/llmessage/llhost.h | 2 | ||||
-rwxr-xr-x | indra/llmessage/message.cpp | 2 |
5 files changed, 3 insertions, 7 deletions
diff --git a/indra/llmessage/llassetstorage.cpp b/indra/llmessage/llassetstorage.cpp index 8ba2535531..a6edafecf8 100755 --- a/indra/llmessage/llassetstorage.cpp +++ b/indra/llmessage/llassetstorage.cpp @@ -290,7 +290,7 @@ LLAssetStorage::LLAssetStorage(LLMessageSystem *msg, LLXferManager *xfer, LLVFS LLAssetStorage::LLAssetStorage(LLMessageSystem *msg, LLXferManager *xfer, LLVFS *vfs, LLVFS *static_vfs) { - _init(msg, xfer, vfs, static_vfs, LLHost::invalid); + _init(msg, xfer, vfs, static_vfs, LLHost()); } diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index daf3e0b4de..66bd85f4e6 100755 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -259,7 +259,7 @@ LLCacheName::~LLCacheName() } LLCacheName::Impl::Impl(LLMessageSystem* msg) - : mMsg(msg), mUpstreamHost(LLHost::invalid) + : mMsg(msg), mUpstreamHost(LLHost()) { mMsg->setHandlerFuncFast( _PREHASH_UUIDNameRequest, handleUUIDNameRequest, (void**)this); diff --git a/indra/llmessage/llhost.cpp b/indra/llmessage/llhost.cpp index 63c15f0d5e..ae5c2ecf69 100755 --- a/indra/llmessage/llhost.cpp +++ b/indra/llmessage/llhost.cpp @@ -41,8 +41,6 @@ #include <arpa/inet.h> #endif -LLHost LLHost::invalid(INVALID_PORT,INVALID_HOST_IP_ADDRESS); - LLHost::LLHost(const std::string& ip_and_port) { std::string::size_type colon_index = ip_and_port.find(":"); diff --git a/indra/llmessage/llhost.h b/indra/llmessage/llhost.h index 9a221e2a6e..376371cffd 100755 --- a/indra/llmessage/llhost.h +++ b/indra/llmessage/llhost.h @@ -42,8 +42,6 @@ protected: U32 mIP; std::string mUntrustedSimCap; public: - - static LLHost invalid; // CREATORS LLHost() diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp index feb756a0c7..6712171418 100755 --- a/indra/llmessage/message.cpp +++ b/indra/llmessage/message.cpp @@ -1675,7 +1675,7 @@ LLHost LLMessageSystem::findHost(const U32 circuit_code) } else { - return LLHost::invalid; + return LLHost(); } } |