]> granicus.if.org Git - icinga2/commitdiff
Add cork
authorJean Flach <jean-marcel.flach@icinga.com>
Tue, 27 Feb 2018 13:48:37 +0000 (14:48 +0100)
committerGunnar Beutner <gunnar.beutner@icinga.com>
Wed, 28 Feb 2018 10:40:58 +0000 (11:40 +0100)
lib/base/stream.cpp
lib/base/stream.hpp

index 72ca82c1a021dc67b878a508cb5089bb61ace30f..3048f096c137a1f3242a1011b5f5a233fded9bba 100644 (file)
@@ -91,6 +91,16 @@ bool Stream::WaitForData(int timeout)
        return IsDataAvailable() || IsEof();
 }
 
+void Stream::SetCorked(bool corked)
+{
+       m_Corked = corked;
+}
+
+bool Stream::IsCorked() const
+{
+       return m_Corked;
+}
+
 static void StreamDummyCallback()
 { }
 
index 8a140a58607395c74d318aae6ffa53d2a72af497..bb41291387ee6b64ce5b0325150b3255f480c23b 100644 (file)
@@ -127,6 +127,9 @@ public:
        bool WaitForData();
        bool WaitForData(int timeout);
 
+       virtual void SetCorked(bool corked);
+       bool IsCorked() const;
+
        virtual bool SupportsWaiting() const;
 
        virtual bool IsDataAvailable() const;
@@ -143,6 +146,8 @@ private:
 
        boost::mutex m_Mutex;
        boost::condition_variable m_CV;
+
+       bool m_Corked{false};
 };
 
 }