aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/input/plugins/NfsInputPlugin.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/input/plugins/NfsInputPlugin.cxx b/src/input/plugins/NfsInputPlugin.cxx
index 8f63d80a1..baa707738 100644
--- a/src/input/plugins/NfsInputPlugin.cxx
+++ b/src/input/plugins/NfsInputPlugin.cxx
@@ -93,12 +93,14 @@ NfsInputStream::DoRead()
if (remaining <= 0)
return true;
- if (IsBufferFull()) {
+ const size_t buffer_space = GetBufferSpace();
+ if (buffer_space == 0) {
Pause();
return true;
}
- size_t nbytes = std::min<uint64_t>(remaining, 32768);
+ size_t nbytes = std::min<size_t>(std::min<uint64_t>(remaining, 32768),
+ buffer_space);
mutex.unlock();
Error error;