[Libreoffice-commits] online.git: net/WebSocketHandler.hpp wsd/LOOLWSD.cpp
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Mon Apr 17 04:49:53 UTC 2017
net/WebSocketHandler.hpp | 2 +-
wsd/LOOLWSD.cpp | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
New commits:
commit 1262378301011fe799d06869b62814d89992a538
Author: Ashod Nakashian <ashod.nakashian at 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 <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at 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;
}
More information about the Libreoffice-commits
mailing list