[Libreoffice-commits] online.git: wsd/ClientSession.cpp wsd/LOOLWSD.cpp
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Fri Mar 17 04:05:04 UTC 2017
wsd/ClientSession.cpp | 8 +++-----
wsd/LOOLWSD.cpp | 29 -----------------------------
2 files changed, 3 insertions(+), 34 deletions(-)
New commits:
commit f9664bb36981e34bf2e9f270bfc2bee7d65df36b
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Wed Mar 15 10:45:42 2017 -0400
wsd: send recylcing message to clients on shutdown
Change-Id: Ibeb37b801e388fa33671a3c7df564c8ed86d9b71
Reviewed-on: https://gerrit.libreoffice.org/35306
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 64212a48..1f179ed4 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -736,11 +736,9 @@ void ClientSession::onDisconnect()
}
else
{
-#if 0 // loolnb
- std::lock_guard<std::mutex> lock(ClientWebSocketsMutex);
- LOG_TRC("Capturing Client WS for [" << _id << "]");
- // ClientWebSockets.push_back(ws); //FIXME
-#endif
+ static const std::string msg("close: recycling");
+ sendFrame(msg);
+ shutdown(WebSocketHandler::StatusCodes::ENDPOINT_GOING_AWAY);
}
}
catch (const std::exception& exc)
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index c12d7e60..fac23b22 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -179,12 +179,6 @@ static std::atomic<int> OutstandingForks(0);
static std::map<std::string, std::shared_ptr<DocumentBroker> > DocBrokers;
static std::mutex DocBrokersMutex;
-#if 0 // loolnb
-/// Used when shutting down to notify them all that the server is recycling.
-static std::vector<std::shared_ptr<LOOLWebSocket> > ClientWebSockets;
-static std::mutex ClientWebSocketsMutex;
-#endif
-
extern "C" { void dump_state(void); /* easy for gdb */ }
#if ENABLE_DEBUG
@@ -2589,29 +2583,6 @@ int LOOLWSD::main(const std::vector<std::string>& /*args*/)
FileUtil::removeFile(path, true);
}
- if (isShuttingDown())
- {
-#if 0 // loolnb
- // At this point there should be no other thread, but...
- std::lock_guard<std::mutex> lock(ClientWebSocketsMutex);
-
- LOG_INF("Notifying clients that we are recycling.");
- static const std::string msg("close: recycling");
- for (auto& ws : ClientWebSockets)
- {
- try
- {
- ws->sendFrame(msg.data(), msg.size());
- ws->shutdown(WebSocket::WS_ENDPOINT_GOING_AWAY);
- }
- catch (const std::exception& ex)
- {
- LOG_ERR("Error while notifying client of recycle: " << ex.what());
- }
- }
-#endif
- }
-
// Finally, we no longer need SSL.
if (LOOLWSD::isSSLEnabled())
{
More information about the Libreoffice-commits
mailing list