mirror of
https://github.com/zrepl/zrepl.git
synced 2024-11-24 17:35:01 +01:00
endpoint Remote: fix broken Send endpoint for DryRun=true
This commit is contained in:
parent
ffe33aff3d
commit
9c86e03384
@ -401,9 +401,13 @@ func (s Remote) Send(ctx context.Context, r *pdu.SendReq) (*pdu.SendRes, io.Read
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
if rs == nil {
|
||||
if !r.DryRun && rs == nil {
|
||||
return nil, nil, errors.New("response does not contain a stream")
|
||||
}
|
||||
if r.DryRun && rs != nil {
|
||||
rs.Close()
|
||||
return nil, nil, errors.New("response contains unexpected stream (was dry run)")
|
||||
}
|
||||
var res pdu.SendRes
|
||||
if err := proto.Unmarshal(rb.Bytes(), &res); err != nil {
|
||||
rs.Close()
|
||||
|
Loading…
Reference in New Issue
Block a user