mirror of
https://github.com/zrepl/zrepl.git
synced 2025-05-29 22:30:49 +02: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 {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
if rs == nil {
|
if !r.DryRun && rs == nil {
|
||||||
return nil, nil, errors.New("response does not contain a stream")
|
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
|
var res pdu.SendRes
|
||||||
if err := proto.Unmarshal(rb.Bytes(), &res); err != nil {
|
if err := proto.Unmarshal(rb.Bytes(), &res); err != nil {
|
||||||
rs.Close()
|
rs.Close()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user