From 58faad90dd5ff33babc95e3a22916449f77c4b2c Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Mon, 9 Oct 2017 13:17:49 -0400 Subject: [PATCH] add loglines for IP limits --- irc/server.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/irc/server.go b/irc/server.go index 6b22de34..bf1fe26c 100644 --- a/irc/server.go +++ b/irc/server.go @@ -298,6 +298,7 @@ func (server *Server) checkBans(ipaddr net.IP) (banned bool, message string) { // check DLINEs isBanned, info := server.dlines.CheckIP(ipaddr) if isBanned { + server.logger.Info("localconnect-ip", fmt.Sprintf("Client from %v rejected by d-line", ipaddr)) return true, info.BanMessage("You are banned from this server (%s)") } @@ -305,6 +306,7 @@ func (server *Server) checkBans(ipaddr net.IP) (banned bool, message string) { err := server.connectionLimits.AddClient(ipaddr, false) if err != nil { // too many connections from one client, tell the client and close the connection + server.logger.Info("localconnect-ip", fmt.Sprintf("Client from %v rejected for connection limit", ipaddr)) return true, "Too many clients from your network" } @@ -324,6 +326,9 @@ func (server *Server) checkBans(ipaddr net.IP) (banned bool, message string) { server.connectionThrottle.ResetFor(ipaddr) // this might not show up properly on some clients, but our objective here is just to close it out before it has a load impact on us + server.logger.Info( + "localconnect-ip", + fmt.Sprintf("Client from %v exceeded connection throttle, d-lining for %v", ipaddr, duration)) return true, server.connectionThrottle.BanMessage() }