[Libreoffice-commits] online.git: net/Socket.hpp net/WebSocketHandler.hpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Mon Mar 13 04:21:06 UTC 2017


 net/Socket.hpp           |    1 +
 net/WebSocketHandler.hpp |    2 ++
 2 files changed, 3 insertions(+)

New commits:
commit c9a07a3087cced9c0ea8973a039b284bcb01a0e7
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Sun Mar 12 19:04:52 2017 -0400

    wsd: assert socket is in correct thread
    
    Change-Id: I22c3f62bdf45188641326774dd86b7cacfce9198
    Reviewed-on: https://gerrit.libreoffice.org/35120
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/net/Socket.hpp b/net/Socket.hpp
index 6929938..c4badea 100644
--- a/net/Socket.hpp
+++ b/net/Socket.hpp
@@ -555,6 +555,7 @@ public:
 
     int getPollEvents() override
     {
+        assert(isCorrectThread());
         if (!_outBuffer.empty() || _socketHandler->hasQueuedWrites() || _shutdownSignalled)
             return POLLIN | POLLOUT;
         else
diff --git a/net/WebSocketHandler.hpp b/net/WebSocketHandler.hpp
index 7416586..d89f49b 100644
--- a/net/WebSocketHandler.hpp
+++ b/net/WebSocketHandler.hpp
@@ -255,6 +255,7 @@ public:
         if (socket == nullptr)
             return -1; // no socket == error.
 
+        assert(socket->isCorrectThread());
         auto lock = socket->getWriteLock();
         std::vector<char>& out = socket->_outBuffer;
 
@@ -287,6 +288,7 @@ protected:
         if (!socket || data == nullptr || len == 0)
             return -1;
 
+        assert(socket->isCorrectThread());
         std::vector<char>& out = socket->_outBuffer;
 
         out.push_back(flags);


More information about the Libreoffice-commits mailing list