about summary refs log tree commit diff
path: root/src/libutil
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/serialise.cc6
-rw-r--r--src/libutil/serialise.hh2
2 files changed, 8 insertions, 0 deletions
diff --git a/src/libutil/serialise.cc b/src/libutil/serialise.cc
index 9270806a7798..1f817a869539 100644
--- a/src/libutil/serialise.cc
+++ b/src/libutil/serialise.cc
@@ -90,6 +90,12 @@ size_t BufferedSource::read(unsigned char * data, size_t len)
 }
 
 
+bool BufferedSource::hasData()
+{
+    return bufPosOut < bufPosIn;
+}
+
+
 size_t FdSource::readUnbuffered(unsigned char * data, size_t len)
 {
     ssize_t n;
diff --git a/src/libutil/serialise.hh b/src/libutil/serialise.hh
index 42dd271176db..e1c4514dbb4b 100644
--- a/src/libutil/serialise.hh
+++ b/src/libutil/serialise.hh
@@ -63,6 +63,8 @@ struct BufferedSource : Source
     
     /* Underlying read call, to be overriden. */
     virtual size_t readUnbuffered(unsigned char * data, size_t len) = 0;
+
+    bool hasData();
 };