revid-cli: allow setting of udp address through revid-cli options

This commit is contained in:
saxon 2018-11-21 01:07:38 +10:30
parent 2ff7e6318d
commit 8be3c4de23
2 changed files with 5 additions and 1 deletions

View File

@ -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
}

View File

@ -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
}