aboutsummaryrefslogtreecommitdiff
path: root/src/common/io/BufferStream.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2024-06-10 13:40:32 +0800
committercrupest <crupest@outlook.com>2024-06-10 23:48:32 +0800
commit2f5651cd1a1efb136179cdbcb3b29ed0cc11ca2a (patch)
tree400236cca0b1d28b0361f51c09ce4e2bf7d89d6c /src/common/io/BufferStream.cpp
parent633c77d7cd2dd5cd22018aca17da1490e34d94ec (diff)
downloadcru-2f5651cd1a1efb136179cdbcb3b29ed0cc11ca2a.tar.gz
cru-2f5651cd1a1efb136179cdbcb3b29ed0cc11ca2a.tar.bz2
cru-2f5651cd1a1efb136179cdbcb3b29ed0cc11ca2a.zip
HALF WORK: still need to fix invalid size value in Buffer.
NEED TEST: BufferStream, AutoReadStream, SubProcess.
Diffstat (limited to 'src/common/io/BufferStream.cpp')
-rw-r--r--src/common/io/BufferStream.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/io/BufferStream.cpp b/src/common/io/BufferStream.cpp
index b2467a17..3060a608 100644
--- a/src/common/io/BufferStream.cpp
+++ b/src/common/io/BufferStream.cpp
@@ -67,7 +67,7 @@ Index BufferStream::Write(const std::byte* buffer, Index offset, Index size) {
}
condition_variable_.wait(lock, [this] {
- return buffer_list_.size() < max_block_count_ ||
+ return max_block_count_ <= 0 || buffer_list_.size() < max_block_count_ ||
buffer_list_.back().GetBackFree() > 0;
});