loolwsd/test/httpwstest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
New commits: commit 47a17fa8d017b12c6e15f3ec5566fcbff96a3118 Author: Mike Kaganski <mike.kagan...@collabora.com> Date: Tue Jun 21 22:19:13 2016 +1000 testCloseAfterClose: don't hang on bytes==0 && flags==0 At least in some versions of Poco (namely, 1.7.3), WebSocketImpl::receiveBytes may return both bytes and flags equal to zero. It makes the HTTPWSTest::testCloseAfterClose() loop exit condition to never happen, thus test hangs. According to WebSoket.h, "A return value of 0 means that the peer has shut down or closed the connection". Thus, this modification makes this loop robust. Change-Id: I5dd4f30936dd8246c966f094f2fdae9a45b89ff9 Reviewed-on: https://gerrit.libreoffice.org/26547 Reviewed-by: Ashod Nakashian <ashnak...@gmail.com> Tested-by: Ashod Nakashian <ashnak...@gmail.com> diff --git a/loolwsd/test/httpwstest.cpp b/loolwsd/test/httpwstest.cpp index 6b8cb0f..9061641 100644 --- a/loolwsd/test/httpwstest.cpp +++ b/loolwsd/test/httpwstest.cpp @@ -307,7 +307,7 @@ void HTTPWSTest::testCloseAfterClose() { bytes = socket.receiveFrame(buffer, sizeof(buffer), flags); } - while ((flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) != Poco::Net::WebSocket::FRAME_OP_CLOSE); + while (bytes && (flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) != Poco::Net::WebSocket::FRAME_OP_CLOSE); // no more messages is received. bytes = socket.receiveFrame(buffer, sizeof(buffer), flags); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits