summaryrefslogtreecommitdiff
path: root/indra/llcommon/llevents.cpp
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2015-12-17 14:09:51 -0800
committerRider Linden <rider@lindenlab.com>2015-12-17 14:09:51 -0800
commit2c9097aa28d65eeddcfb60b9ac93495723ed6419 (patch)
tree1e6ddd635bf2eee516628a563af200384c0b36ae /indra/llcommon/llevents.cpp
parentdb70768def60016daabaf25f38d516d6b72f77ce (diff)
MAINT-5977: Finish implementation of MailBox event pump type for guaranteed delivery
Diffstat (limited to 'indra/llcommon/llevents.cpp')
-rwxr-xr-xindra/llcommon/llevents.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/indra/llcommon/llevents.cpp b/indra/llcommon/llevents.cpp
index 080830a134..fc2d8d5e23 100755
--- a/indra/llcommon/llevents.cpp
+++ b/indra/llcommon/llevents.cpp
@@ -512,10 +512,11 @@ bool LLEventStream::post(const LLSD& event)
*****************************************************************************/
bool LLEventMailDrop::post(const LLSD& event)
{
- bool posted = LLEventPump::post(event);
+ bool posted = LLEventStream::post(event);
if (!posted)
- {
+ { // if the event was not handled we will save it for later so that it can
+ // be posted to any future listeners when they attach.
mEventHistory.push_back(event);
}
@@ -527,15 +528,17 @@ LLBoundListener LLEventMailDrop::listen_impl(const std::string& name,
const NameList& after,
const NameList& before)
{
- LLBoundListener bndlistener = LLEventPump::listen_impl(name, listener, after, before);
-
- return bndlistener;
-}
-
-// typedef std::list<LLSD> EventList;
-// EventList mEventHistory;
+ if (!mEventHistory.empty())
+ {
+ if (listener(mEventHistory.front()))
+ {
+ mEventHistory.pop_front();
+ }
+ }
+ return LLEventStream::listen_impl(name, listener, after, before);
+}
/*****************************************************************************