merge develop into master #21

Merged
JakeHillion merged 149 commits from develop into master 2021-05-12 00:22:59 +01:00
2 changed files with 15 additions and 4 deletions
Showing only changes of commit 1cf9cc880d - Show all commits

View File

@ -75,8 +75,12 @@ func buildTcp(ctx context.Context, p *proxy.Proxy, peer Peer, g func() proxy.Mac
return err return err
} }
if !peer.DisableConsumer {
p.AddConsumer(ctx, f, g()) p.AddConsumer(ctx, f, g())
}
if !peer.DisableProducer {
p.AddProducer(ctx, f, v()) p.AddProducer(ctx, f, v())
}
return nil return nil
} }
@ -121,8 +125,12 @@ func buildUdp(ctx context.Context, p *proxy.Proxy, peer Peer, g func() proxy.Mac
return err return err
} }
if !peer.DisableConsumer {
p.AddConsumer(ctx, f, g()) p.AddConsumer(ctx, f, g())
}
if !peer.DisableProducer {
p.AddProducer(ctx, f, v()) p.AddProducer(ctx, f, v())
}
return nil return nil
} }

View File

@ -57,6 +57,9 @@ type Peer struct {
KeepAlive uint KeepAlive uint
Timeout uint Timeout uint
RetryWait uint RetryWait uint
DisableConsumer bool `validate:"omitempty,nefield=DisableProducer"`
DisableProducer bool `validate:"omitempty,nefield=DisableConsumer"`
} }
func (p Peer) GetLocalHost() string { func (p Peer) GetLocalHost() string {