aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/util/DynamicFifoBuffer.hxx3
-rw-r--r--src/util/ForeignFifoBuffer.hxx4
2 files changed, 6 insertions, 1 deletions
diff --git a/src/util/DynamicFifoBuffer.hxx b/src/util/DynamicFifoBuffer.hxx
index d441b4484..91cbbc4c7 100644
--- a/src/util/DynamicFifoBuffer.hxx
+++ b/src/util/DynamicFifoBuffer.hxx
@@ -54,6 +54,7 @@ public:
using ForeignFifoBuffer<T>::IsEmpty;
using ForeignFifoBuffer<T>::IsFull;
+ using ForeignFifoBuffer<T>::GetAvailable;
using ForeignFifoBuffer<T>::Read;
using ForeignFifoBuffer<T>::Consume;
using ForeignFifoBuffer<T>::Write;
@@ -73,7 +74,7 @@ public:
/* we already have enough space */
return;
- const size_type in_use = Read().size;
+ const size_type in_use = GetAvailable();
const size_type required_capacity = in_use + n;
size_type new_capacity = GetCapacity();
do {
diff --git a/src/util/ForeignFifoBuffer.hxx b/src/util/ForeignFifoBuffer.hxx
index c119fb6d5..cd6fb6101 100644
--- a/src/util/ForeignFifoBuffer.hxx
+++ b/src/util/ForeignFifoBuffer.hxx
@@ -171,6 +171,10 @@ public:
tail += n;
}
+ constexpr size_type GetAvailable() const {
+ return tail - head;
+ }
+
/**
* Return a buffer range which may be read. The buffer pointer is
* writable, to allow modifications while parsing.