Fix totals.

This commit is contained in:
Nikolai Kochetov 2019-04-17 18:06:19 +03:00
parent 355c16eb79
commit e8dbf94807

View File

@ -34,19 +34,23 @@ IProcessor::Status SourceFromInputStream::prepare()
if (!is_stream_finished)
return Status::Ready;
if (has_totals_port && has_totals)
if (has_totals_port)
{
auto & totals_out = outputs.back();
if (totals_out.isFinished())
return Status::Finished;
if (!totals_out.canPush())
return Status::PortFull;
if (has_totals)
{
if (!totals_out.canPush())
return Status::PortFull;
totals_out.push(std::move(totals));
has_totals = false;
}
totals_out.push(std::move(totals));
totals_out.finish();
has_totals = false;
}
}