wsd/LOOLWSD.cpp | 1 + wsd/LOOLWebSocket.hpp | 10 ++++++++++ 2 files changed, 11 insertions(+)
New commits: commit b497fcfac54d10ca67c0906f59a6b69f0940310e Author: Ashod Nakashian <[email protected]> Date: Fri Jan 20 16:34:10 2017 -0500 wsd: close the socket when shutting down fails Change-Id: Iea5c6a259272b6af881a5bfb27ffc31d2ad27793 Reviewed-on: https://gerrit.libreoffice.org/33424 Reviewed-by: Ashod Nakashian <[email protected]> Tested-by: Ashod Nakashian <[email protected]> diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp index f41cb70..10bc54d 100644 --- a/wsd/LOOLWSD.cpp +++ b/wsd/LOOLWSD.cpp @@ -194,6 +194,7 @@ namespace inline void shutdownLimitReached(LOOLWebSocket& ws) { const std::string error = Poco::format(PAYLOAD_UNAVAILABLE_LIMIT_REACHED, MAX_DOCUMENTS, MAX_CONNECTIONS); + LOG_INF("Sending client limit-reached message: " << error); /* loleaflet sends loolclient, load and partrectangles message immediately after web socket handshake, so closing web socket fails loading page in diff --git a/wsd/LOOLWebSocket.hpp b/wsd/LOOLWebSocket.hpp index dc2c805..b1acd35 100644 --- a/wsd/LOOLWebSocket.hpp +++ b/wsd/LOOLWebSocket.hpp @@ -223,6 +223,16 @@ public: { LOG_WRN("LOOLWebSocket::shutdown: Exception: " << exc.displayText() << (exc.nested() ? " (" + exc.nested()->displayText() + ")" : "")); + + // Just close it. + try + { + Poco::Net::WebSocket::close(); + } + catch (const std::exception&) + { + // Nothing we can do. + } } } }; _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
