From 8be3c4de23c74e6d0a5c26269c7ec6fd7d288b7d Mon Sep 17 00:00:00 2001 From: saxon Date: Wed, 21 Nov 2018 01:07:38 +1030 Subject: [PATCH] revid-cli: allow setting of udp address through revid-cli options --- revid/config.go | 4 ++++ revid/revid.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/revid/config.go b/revid/config.go index 93d46c33..52a3eaaa 100644 --- a/revid/config.go +++ b/revid/config.go @@ -316,5 +316,9 @@ func (c *Config) Validate(r *Revid) error { return errors.New("quantisation not unsigned integer or is over threshold") } } + + if c.UdpAddress == "" { + c.UdpAddress = defaultUdpAddr + } return nil } diff --git a/revid/revid.go b/revid/revid.go index e481bf51..3aa66919 100644 --- a/revid/revid.go +++ b/revid/revid.go @@ -228,7 +228,7 @@ func (r *Revid) reset(config Config) error { case Http: r.destination = newHttpSender(r.ns, r.config.Logger.Log) case Udp: - s, err := newUdpSender(defaultUdpAddr, r.config.Logger.Log) + s, err := newUdpSender(r.config.UdpAddress, r.config.Logger.Log) if err != nil { return err }