net/WebSocketHandler.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
New commits: commit c1ffb649048f6735a5804a8febc8689b52b28596 Author: Ashod Nakashian <[email protected]> Date: Sat Mar 25 21:51:25 2017 -0400 wsd: correct shutdown status code echoed back Change-Id: Ieb685135ab280ed76070af3392bfa69cf313f35a Reviewed-on: https://gerrit.libreoffice.org/35708 Reviewed-by: Ashod Nakashian <[email protected]> Tested-by: Ashod Nakashian <[email protected]> diff --git a/net/WebSocketHandler.hpp b/net/WebSocketHandler.hpp index 08500bf2..6983fbae 100644 --- a/net/WebSocketHandler.hpp +++ b/net/WebSocketHandler.hpp @@ -213,8 +213,10 @@ public: if (!_shuttingDown) { // Peer-initiated shutdown must be echoed. - // Otherwise, this is the echo to _out_ shutdown message. - const StatusCodes statusCode = static_cast<StatusCodes>((static_cast<unsigned>(_wsPayload[0]) << 8) | _wsPayload[1]); + // Otherwise, this is the echo to _our_ shutdown message, which we should ignore. + const StatusCodes statusCode = static_cast<StatusCodes>((((uint64_t)(unsigned char)_wsPayload[0]) << 8) + + (((uint64_t)(unsigned char)_wsPayload[1]) << 0)); + LOG_TRC("#" << socket->getFD() << ": Client initiated socket shutdown. Code: " << static_cast<int>(statusCode)); if (_wsPayload.size() > 2) { const std::string message(&_wsPayload[2], &_wsPayload[2] + _wsPayload.size() - 2); _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
