net/WebSocketHandler.hpp |    2 +-
 wsd/LOOLWSD.cpp          |    1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 1262378301011fe799d06869b62814d89992a538
Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk>
Date:   Sun Apr 16 19:45:54 2017 -0400

    wsd: send document unloading error as WS message
    
    Without an explicit WS message, the client
    does not get this message and the handler
    is not invoked at all.
    
    Change-Id: I71e210a9958965cff35dd4d0f1d99985429b82f4
    Reviewed-on: https://gerrit.libreoffice.org/36593
    Reviewed-by: Ashod Nakashian <ashnak...@gmail.com>
    Tested-by: Ashod Nakashian <ashnak...@gmail.com>

diff --git a/net/WebSocketHandler.hpp b/net/WebSocketHandler.hpp
index 85cad811..c6d69883 100644
--- a/net/WebSocketHandler.hpp
+++ b/net/WebSocketHandler.hpp
@@ -269,7 +269,7 @@ public:
     int getPollEvents(std::chrono::steady_clock::time_point now,
                       int & timeoutMaxMs) override
     {
-        int timeSincePingMs =
+        const int timeSincePingMs =
             std::chrono::duration_cast<std::chrono::milliseconds>(now - 
_pingSent).count();
         timeoutMaxMs = std::min(timeoutMaxMs, PingFrequencyMs - 
timeSincePingMs);
         return POLLIN;
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 5112e9ae..e3619b6e 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -1241,6 +1241,7 @@ static std::shared_ptr<DocumentBroker> 
findOrCreateDocBroker(WebSocketHandler& w
         if (docBroker->isMarkedToDestroy())
         {
             LOG_WRN("DocBroker with docKey [" << docKey << "] that is marked 
to be destroyed. Rejecting client request.");
+            ws.sendMessage("error: cmd=load kind=docunloading");
             ws.shutdown(WebSocketHandler::StatusCodes::ENDPOINT_GOING_AWAY, 
"error: cmd=load kind=docunloading");
             return nullptr;
         }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to