diff options
author | mhalaj1 <matus.halaj@pantheon.tech> | 2021-08-26 20:15:08 +0200 |
---|---|---|
committer | mhalaj1 <matus.halaj@pantheon.tech> | 2021-09-07 15:24:53 +0200 |
commit | c09ee3241377aae2530a73d48c4e20641d76d0ee (patch) | |
tree | 219fd1f7d9ba595f0f4c8dac9796bc76ce3556fc /binapi/ipsec/ipsec_rpc.ba.go | |
parent | debc52dea8a81417bb08ca5bb934c7876b6d65e0 (diff) |
Refactoring and fixes
* refactor creation of new channel
* add missing closing of created streams
* correct documentation regarding thread safety of stream
Signed-off-by: mhalaj1 <matus.halaj@pantheon.tech>
Change-Id: Ic601efff298fcbdecaafab83fa236253af69de21
Diffstat (limited to 'binapi/ipsec/ipsec_rpc.ba.go')
-rw-r--r-- | binapi/ipsec/ipsec_rpc.ba.go | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/binapi/ipsec/ipsec_rpc.ba.go b/binapi/ipsec/ipsec_rpc.ba.go index 2779873..faecda6 100644 --- a/binapi/ipsec/ipsec_rpc.ba.go +++ b/binapi/ipsec/ipsec_rpc.ba.go @@ -77,6 +77,10 @@ func (c *serviceClient_IpsecBackendDumpClient) Recv() (*IpsecBackendDetails, err case *IpsecBackendDetails: return m, nil case *vpe.ControlPingReply: + err = c.Stream.Close() + if err != nil { + return nil, err + } return nil, io.EOF default: return nil, fmt.Errorf("unexpected message: %T %v", m, m) @@ -143,6 +147,10 @@ func (c *serviceClient_IpsecItfDumpClient) Recv() (*IpsecItfDetails, error) { case *IpsecItfDetails: return m, nil case *vpe.ControlPingReply: + err = c.Stream.Close() + if err != nil { + return nil, err + } return nil, io.EOF default: return nil, fmt.Errorf("unexpected message: %T %v", m, m) @@ -182,6 +190,10 @@ func (c *serviceClient_IpsecSaDumpClient) Recv() (*IpsecSaDetails, error) { case *IpsecSaDetails: return m, nil case *vpe.ControlPingReply: + err = c.Stream.Close() + if err != nil { + return nil, err + } return nil, io.EOF default: return nil, fmt.Errorf("unexpected message: %T %v", m, m) @@ -221,6 +233,10 @@ func (c *serviceClient_IpsecSaV2DumpClient) Recv() (*IpsecSaV2Details, error) { case *IpsecSaV2Details: return m, nil case *vpe.ControlPingReply: + err = c.Stream.Close() + if err != nil { + return nil, err + } return nil, io.EOF default: return nil, fmt.Errorf("unexpected message: %T %v", m, m) @@ -260,6 +276,10 @@ func (c *serviceClient_IpsecSaV3DumpClient) Recv() (*IpsecSaV3Details, error) { case *IpsecSaV3Details: return m, nil case *vpe.ControlPingReply: + err = c.Stream.Close() + if err != nil { + return nil, err + } return nil, io.EOF default: return nil, fmt.Errorf("unexpected message: %T %v", m, m) @@ -353,6 +373,10 @@ func (c *serviceClient_IpsecSpdDumpClient) Recv() (*IpsecSpdDetails, error) { case *IpsecSpdDetails: return m, nil case *vpe.ControlPingReply: + err = c.Stream.Close() + if err != nil { + return nil, err + } return nil, io.EOF default: return nil, fmt.Errorf("unexpected message: %T %v", m, m) @@ -401,6 +425,10 @@ func (c *serviceClient_IpsecSpdInterfaceDumpClient) Recv() (*IpsecSpdInterfaceDe case *IpsecSpdInterfaceDetails: return m, nil case *vpe.ControlPingReply: + err = c.Stream.Close() + if err != nil { + return nil, err + } return nil, io.EOF default: return nil, fmt.Errorf("unexpected message: %T %v", m, m) @@ -440,6 +468,10 @@ func (c *serviceClient_IpsecSpdsDumpClient) Recv() (*IpsecSpdsDetails, error) { case *IpsecSpdsDetails: return m, nil case *vpe.ControlPingReply: + err = c.Stream.Close() + if err != nil { + return nil, err + } return nil, io.EOF default: return nil, fmt.Errorf("unexpected message: %T %v", m, m) @@ -488,6 +520,10 @@ func (c *serviceClient_IpsecTunnelProtectDumpClient) Recv() (*IpsecTunnelProtect case *IpsecTunnelProtectDetails: return m, nil case *vpe.ControlPingReply: + err = c.Stream.Close() + if err != nil { + return nil, err + } return nil, io.EOF default: return nil, fmt.Errorf("unexpected message: %T %v", m, m) |