Skip to content

Commit

Permalink
Review update
Browse files Browse the repository at this point in the history
  • Loading branch information
lordgamez committed Aug 16, 2023
1 parent 3825218 commit 4830868
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libminifi/src/io/InputStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,13 @@ size_t InputStream::read(std::string &str, bool widen) {
str.reserve(string_length);

auto bytes_to_read = string_length;
auto zero_return_retry_count = 0;
while (bytes_to_read > 0) {
std::vector<std::byte> buffer(bytes_to_read);
const auto read_return = read(buffer);
if (io::isError(read_return))
return read_return;
if (read_return == 0) {
if (read_return == 0 && ++zero_return_retry_count > 3) {
return STREAM_ERROR;
}
bytes_to_read -= read_return;
Expand Down

0 comments on commit 4830868

Please sign in to comment.