Files
openfsd/internal/server/handler_admin.go
Reese Norris 86e86c4350 feat: FSD connection, rate, and auth hardening
Add per-IP/CID connection caps, login/idle timeouts, per-session rate
limits, non-blocking fan-out, ATC vis-range caps, auth-fail throttling,
loopback-default service HTTP, and JWT secret entropy fixes.
2026-07-22 16:08:48 -04:00

28 lines
769 B
Go

package server
import "github.com/renorris/openfsd/internal/session"
func (s *Server) handleKillRequest(client *session.Session, packet []byte) {
if client.NetworkRating < NetworkRatingSupervisor {
return
}
// Attempt to find the victim client
recipient := getField(packet, 1)
victim, err := s.registry.Find(string(recipient))
if err != nil {
client.SendError(NoSuchCallsignError, "No such callsign")
return
}
// Synthetic (sweatbox) sessions have no handleConn Release defer — Remove
// performs pointer-scoped #DP + registry.Release + engine.Delete.
if victim.Synthetic && s.sweatbox != nil {
_ = s.sweatbox.Remove(victim.Callsign)
return
}
// Closing the context + transport forces disconnect on classic and gnet.
victim.Disconnect()
}