Files
openfsd/internal/server/handler_admin.go
Reese Norris 8180994186 test: handler table tests + split handler_*.go
Split handlers by domain; fake Registry unit tests.
2026-07-16 12:37:31 -04:00

21 lines
530 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
}
// Closing the context of the victim client will eventually cause it to disconnect
victim.Cancel()
}