diff options
Diffstat (limited to 'lib/common/SelfFlushingStream.h')
-rw-r--r-- | lib/common/SelfFlushingStream.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/common/SelfFlushingStream.h b/lib/common/SelfFlushingStream.h index 36e9a4d3..b4efa294 100644 --- a/lib/common/SelfFlushingStream.h +++ b/lib/common/SelfFlushingStream.h @@ -33,6 +33,12 @@ public: ~SelfFlushingStream() { + if(StreamDataLeft()) + { + BOX_WARNING("Not all data was read from stream, " + "discarding the rest"); + } + Flush(); } @@ -50,9 +56,10 @@ public: { return mrSource.BytesLeftToRead(); } - virtual void Write(const void *pBuffer, int NBytes) + virtual void Write(const void *pBuffer, int NBytes, + int Timeout = IOStream::TimeOutInfinite) { - mrSource.Write(pBuffer, NBytes); + mrSource.Write(pBuffer, NBytes, Timeout); } virtual bool StreamDataLeft() { |