5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-11-09 17:30:26 +00:00

Set queueTotalMaxSize before switch worker starts

This commit is contained in:
Neil Alexander 2018-12-02 23:24:54 +00:00
parent b5f4637b5c
commit 5a89a869be
No known key found for this signature in database
GPG Key ID: A02A2019A2BB0944

View File

@ -100,17 +100,15 @@ func (c *Core) Start(nc *config.NodeConfig, log *log.Logger) error {
return err
}
if nc.SwitchOptions.MaxTotalQueueSize >= SwitchQueueTotalMinSize {
c.switchTable.queueTotalMaxSize = nc.SwitchOptions.MaxTotalQueueSize
}
if err := c.switchTable.start(); err != nil {
c.log.Println("Failed to start switch")
return err
}
if nc.SwitchOptions.MaxTotalQueueSize >= SwitchQueueTotalMinSize {
c.switchTable.doAdmin(func() {
c.switchTable.queueTotalMaxSize = nc.SwitchOptions.MaxTotalQueueSize
})
}
c.sessions.setSessionFirewallState(nc.SessionFirewall.Enable)
c.sessions.setSessionFirewallDefaults(
nc.SessionFirewall.AllowFromDirect,