From 7d103aaf1bfa238db73d414f59ddb38ac8c4ed24 Mon Sep 17 00:00:00 2001 From: Jean Flach Date: Tue, 27 Feb 2018 14:48:37 +0100 Subject: [PATCH] Add cork --- lib/base/stream.cpp | 10 ++++++++++ lib/base/stream.hpp | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/lib/base/stream.cpp b/lib/base/stream.cpp index 72ca82c1a..3048f096c 100644 --- a/lib/base/stream.cpp +++ b/lib/base/stream.cpp @@ -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() { } diff --git a/lib/base/stream.hpp b/lib/base/stream.hpp index 8a140a586..bb4129138 100644 --- a/lib/base/stream.hpp +++ b/lib/base/stream.hpp @@ -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}; }; }