[Libreoffice-commits] online.git: wsd/ClientSession.cpp wsd/DocumentBroker.cpp
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Mon Apr 10 04:09:17 UTC 2017
wsd/ClientSession.cpp | 4 ++--
wsd/DocumentBroker.cpp | 9 +++++++++
2 files changed, 11 insertions(+), 2 deletions(-)
New commits:
commit 679a39eb0b2272c56173ef2febd5281b152b1e45
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Sun Apr 9 19:41:29 2017 -0400
wsd: send recycling message to clients before going down
Change-Id: I388ca55524983d554fabf247bb3baee23010657d
Reviewed-on: https://gerrit.libreoffice.org/36329
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 7ad8df31..883b30b1 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -769,8 +769,8 @@ void ClientSession::onDisconnect()
}
else
{
- static const std::string msg("close: recycling");
- sendMessage(msg);
+ LOG_TRC("Server recycling.");
+ closeFrame();
shutdown(WebSocketHandler::StatusCodes::ENDPOINT_GOING_AWAY);
}
}
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index f7bbd9f1..6f827175 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -254,6 +254,15 @@ void DocumentBroker::pollThread()
_poll->continuePolling() << ", TerminationFlag: " << TerminationFlag <<
", ShutdownRequestFlag: " << ShutdownRequestFlag << ".");
+ if (ShutdownRequestFlag)
+ {
+ static const std::string msg("close: recycling");
+ for (const auto& pair : _sessions)
+ {
+ pair.second->sendMessage(msg);
+ }
+ }
+
// Terminate properly while we can.
//TODO: pass some sensible reason.
terminateChild("", false);
More information about the Libreoffice-commits
mailing list