[Libreoffice-commits] online.git: wsd/DocumentBroker.cpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Mon Dec 12 05:29:12 UTC 2016


 wsd/DocumentBroker.cpp |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

New commits:
commit 3ac620fc4f2a1b8e28d4ddc275d089cfcd7735f6
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Sun Dec 11 19:01:00 2016 -0500

    loolwsd: alert all users via SenderQueue
    
    Change-Id: Ib5f4e456109a2a48f29fb6b7b75950315490c352
    Reviewed-on: https://gerrit.libreoffice.org/31890
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 73de6b1..bb8b9f6 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -626,14 +626,10 @@ void DocumentBroker::alertAllUsers(const std::string& msg)
     LOG_DBG("Alerting all users of [" << _docKey << "]: " << msg);
     for (auto& it : _sessions)
     {
-        try
-        {
-            it.second->sendTextFrame(msg);
-        }
-        catch (const std::exception& ex)
-        {
-            LOG_ERR("Error while alerting all users [" << msg << "]: " << ex.what());
-        }
+        auto payload = std::make_shared<MessagePayload>(msg.size(), MessagePayload::Type::Text);
+        auto& output = payload->data();
+        std::memcpy(output.data(), msg.data(), msg.size());
+        SenderQueue::instance().enqueue(it.second, payload);
     }
 }
 


More information about the Libreoffice-commits mailing list