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(remaining, 32768); + size_t nbytes = std::min(std::min(remaining, 32768), + buffer_space); mutex.unlock(); Error error;