xline: Add ANDKILL param to kill all matching clients

This commit is contained in:
Daniel Oaks 2017-05-24 00:58:36 -06:00
parent 3101f16478
commit ebb9d629d7
5 changed files with 88 additions and 10 deletions

View file

@ -137,6 +137,11 @@ func NewClient(server *Server, conn net.Conn, isTLS bool) *Client {
return client
}
// IP returns the IP address of this client.
func (client *Client) IP() net.IP {
return net.ParseIP(IPString(client.socket.conn.RemoteAddr()))
}
//
// command goroutine
//
@ -475,7 +480,7 @@ func (client *Client) destroy() {
friends.Remove(client)
// remove from connection limits
ipaddr := net.ParseIP(IPString(client.socket.conn.RemoteAddr()))
ipaddr := client.IP()
// this check shouldn't be required but eh
if ipaddr != nil {
client.server.connectionLimitsMutex.Lock()