mirror of
https://github.com/nestriness/cdc-file-transfer.git
synced 2026-01-30 12:25:35 +02:00
[cdc_rsync] Fix issue in UnzstdStream (#59)
Fixes an issue in UnzstdStream where the Read() method always tries to read new input data if no input data is available, instead of first trying to uncompress. Since zstd maintains internal buffers, uncompression might succeed even without reading more input, so this is faster. This bug can lead to pipeline stalls in cdc_rsync.
This commit is contained in:
@@ -779,9 +779,9 @@ absl::Status CdcRsyncClient::StopCompressionStream() {
|
||||
message_pump_.FlushOutgoingQueue();
|
||||
message_pump_.RedirectOutput(nullptr);
|
||||
|
||||
// Flush compression stream and reset.
|
||||
RETURN_IF_ERROR(compression_stream_->Flush(),
|
||||
"Failed to flush compression stream");
|
||||
// Finish compression stream and reset.
|
||||
RETURN_IF_ERROR(compression_stream_->Finish(),
|
||||
"Failed to finish compression stream");
|
||||
compression_stream_.reset();
|
||||
|
||||
// Wait for the server ack. This must be done before sending more data.
|
||||
|
||||
Reference in New Issue
Block a user