forked from External/ergo
add loglines for IP limits
This commit is contained in:
parent
ac9ac5ef19
commit
58faad90dd
1 changed files with 5 additions and 0 deletions
|
|
@ -298,6 +298,7 @@ func (server *Server) checkBans(ipaddr net.IP) (banned bool, message string) {
|
||||||
// check DLINEs
|
// check DLINEs
|
||||||
isBanned, info := server.dlines.CheckIP(ipaddr)
|
isBanned, info := server.dlines.CheckIP(ipaddr)
|
||||||
if isBanned {
|
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)")
|
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)
|
err := server.connectionLimits.AddClient(ipaddr, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// too many connections from one client, tell the client and close the connection
|
// 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"
|
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)
|
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
|
// 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()
|
return true, server.connectionThrottle.BanMessage()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue