flat_mutation_reader: Fix make_nonforwardable()

It emitted end-of-stream prematurely if buffer was full.
Message-Id: <1513697716-32634-1-git-send-email-tgrabiec@scylladb.com>

(cherry picked from commit 6a6bf58b98)
This commit is contained in:
Tomasz Grabiec
2017-12-19 16:35:16 +01:00
committed by Paweł Dziepak
parent 4606300b25
commit bcb06bb043

View File

@@ -381,7 +381,10 @@ flat_mutation_reader make_nonforwardable(flat_mutation_reader r, bool single_par
virtual future<> fill_buffer() override {
return do_until([this] { return is_end_of_stream() || is_buffer_full(); }, [this] {
return fill_buffer_from(_underlying).then([this] (bool underlying_finished) {
return on_end_of_underlying_stream();
if (underlying_finished) {
return on_end_of_underlying_stream();
}
return make_ready_future<>();
});
});
}