show expected size of current send

Needs to be changed to send sizes for all planned steps
This commit is contained in:
Anton Schirg
2018-08-29 23:29:45 +02:00
parent 6ca11a7391
commit 98f3f3dfd8
6 changed files with 152 additions and 75 deletions
+7 -1
View File
@@ -74,11 +74,17 @@ func (p *Sender) Send(ctx context.Context, r *pdu.SendReq) (*pdu.SendRes, io.Rea
if !pass {
return nil, nil, replication.NewFilteredError(r.Filesystem)
}
size, err := zfs.ZFSSendDry(r.Filesystem, r.From, r.To)
if err != nil {
return nil, nil, err
}
stream, err := zfs.ZFSSend(r.Filesystem, r.From, r.To)
if err != nil {
return nil, nil, err
}
return &pdu.SendRes{}, stream, nil
return &pdu.SendRes{ExpectedSize: size}, stream, nil
}
func (p *Sender) DestroySnapshots(ctx context.Context, req *pdu.DestroySnapshotsReq) (*pdu.DestroySnapshotsRes, error) {