summaryrefslogtreecommitdiff
path: root/loolwsd/LOOLSession.cpp
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2016-11-08 19:07:28 +0530
committerPranav Kant <pranavk@collabora.co.uk>2016-11-10 15:04:21 +0530
commitb0933b063e8b0e8e0de7eeeb9706fb291af72b5c (patch)
tree2464485bea4081378ff54751b6a9758539ae2185 /loolwsd/LOOLSession.cpp
parent410936b60012c5cbbd1032c2590582821ba22e62 (diff)
tdf#103640: Implement OwnerTermination; send application-level close frame
This implements a new feature 'OwnerTermination' for WOPI based hosts. WOPI hosts now have to enable this feature by mentioning 'EnableOwnerTermination' as 'true' in their CheckFileInfo response. If the OwnerId of the file matches that of the UserId of the session, this session would be able to terminate all other sessions currently editing the same document. The reason for this kind of document termination is sent to all sessions in a new application-level 'close:' message. This new message is similar to the CLOSE frame of WebSocket protocol which doesn't seem to work across all browsers as of now. Eg: Chrome - https://bugs.chromium.org/p/chromium/issues/detail?id=426798 After receiving this 'close: ' message, loleaflet acts accordingly and tells the WOPI host why the websocket was closed via post message API. Change-Id: I997aa2e7805157ed599a3946a877fd32477cee1b
Diffstat (limited to 'loolwsd/LOOLSession.cpp')
-rw-r--r--loolwsd/LOOLSession.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/loolwsd/LOOLSession.cpp b/loolwsd/LOOLSession.cpp
index 25bc40859..db091f5ca 100644
--- a/loolwsd/LOOLSession.cpp
+++ b/loolwsd/LOOLSession.cpp
@@ -202,14 +202,14 @@ bool LOOLSession::handleDisconnect()
return false;
}
-void LOOLSession::shutdown(Poco::UInt16 statusCode)
+void LOOLSession::shutdown(Poco::UInt16 statusCode, const std::string& statusMessage)
{
if (_ws)
{
try
{
- LOG_TRC("Shutting down WS [" << getName() << "].");
- _ws->shutdown(statusCode);
+ LOG_TRC("Shutting down WS [" << getName() << "] with statusCode [" << statusCode << "] and reason [" << statusMessage << "].");
+ _ws->shutdown(statusCode, statusMessage);
}
catch (const Poco::Exception &exc)
{