Simplify reconfiguration

This commit is contained in:
Neil Alexander 2019-08-28 19:31:04 +01:00
parent 764f9c8e11
commit fc9a1c6c31
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
13 changed files with 64 additions and 141 deletions

View file

@ -73,8 +73,7 @@ type sessionInfo struct {
callbacks []chan func() // Finished work from crypto workers
}
func (sinfo *sessionInfo) reconfigure(e chan error) {
defer close(e)
func (sinfo *sessionInfo) reconfigure() {
// This is where reconfiguration would go, if we had anything to do
}
@ -161,17 +160,9 @@ func (ss *sessions) init(r *router) {
ss.lastCleanup = time.Now()
}
func (ss *sessions) reconfigure(e chan error) {
defer close(e)
responses := make(map[crypto.Handle]chan error)
for index, session := range ss.sinfos {
responses[index] = make(chan error)
session.reconfigure(responses[index])
}
for _, response := range responses {
for err := range response {
e <- err
}
func (ss *sessions) reconfigure() {
for _, session := range ss.sinfos {
session.reconfigure()
}
}