Fix possible race in netcontrol acld/broker plugins

Best to subscribe before connecting
This commit is contained in:
Jon Siwek 2018-08-17 10:29:58 -05:00
parent a04c76c035
commit fc7d3cd981
4 changed files with 7 additions and 3 deletions

View file

@ -270,8 +270,8 @@ function acld_remove_rule_fun(p: PluginState, r: Rule, reason: string) : bool
function acld_init(p: PluginState)
{
Broker::peer(cat(p$acld_config$acld_host), p$acld_config$acld_port);
Broker::subscribe(p$acld_config$acld_topic);
Broker::peer(cat(p$acld_config$acld_host), p$acld_config$acld_port);
}
event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string)

View file

@ -164,8 +164,8 @@ function broker_remove_rule_fun(p: PluginState, r: Rule, reason: string) : bool
function broker_init(p: PluginState)
{
Broker::peer(cat(p$broker_config$host), p$broker_config$bport);
Broker::subscribe(p$broker_config$topic);
Broker::peer(cat(p$broker_config$host), p$broker_config$bport);
}
event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string)