Made whitelisting user async.

This commit is contained in:
empathetic-alligator 2014-12-16 01:23:43 -05:00
parent 932410d057
commit 8329c8d7fd

View File

@ -416,12 +416,14 @@ func (c *Client) handleShell(channel ssh.Channel) {
c.SysMsg("Missing $FINGERPRINT from: /whitelist $FINGERPRINT") c.SysMsg("Missing $FINGERPRINT from: /whitelist $FINGERPRINT")
} else { } else {
fingerprint := parts[1] fingerprint := parts[1]
err = c.Server.Whitelist(fingerprint) go func() {
if err != nil { err = c.Server.Whitelist(fingerprint)
c.SysMsg("Error adding to whitelist: %s", err) if err != nil {
} else { c.SysMsg("Error adding to whitelist: %s", err)
c.SysMsg("Added %s to the whitelist", fingerprint) } else {
} c.SysMsg("Added %s to the whitelist", fingerprint)
}
}()
} }
default: default: