mirror of
https://github.com/onyx-and-iris/q3rcon-proxy.git
synced 2025-01-18 08:40:53 +00:00
log bad rcon requests at info level
include client ip in log
This commit is contained in:
parent
0c054377ba
commit
3e039824de
@ -64,7 +64,11 @@ func (s *session) proxyFrom(buf []byte) error {
|
||||
}
|
||||
|
||||
if s.isRconResponsePacket(buf) {
|
||||
log.Debugf("Response: %s", string(buf[10:]))
|
||||
if s.isBadRconRequest(buf) {
|
||||
log.Infof("Response: Bad rcon from %s", s.caddr.IP)
|
||||
} else {
|
||||
log.Debugf("Response: %s", string(buf[10:]))
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
@ -26,3 +26,7 @@ func (v *validator) isQueryResponsePacket(buf []byte) bool {
|
||||
func (v *validator) isValidResponsePacket(buf []byte) bool {
|
||||
return v.isRconResponsePacket(buf) || v.isQueryResponsePacket(buf)
|
||||
}
|
||||
|
||||
func (v *validator) isBadRconRequest(buf []byte) bool {
|
||||
return string(buf[10:18]) == "Bad rcon"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user