Browse Source

Remove session on disconnect

pool
Sammy Libre 8 years ago
parent
commit
5d795dc56d
  1. 4
      go-pool/stratum/stratum.go

4
go-pool/stratum/stratum.go

@ -186,10 +186,10 @@ func (s *StratumServer) handleClient(cs *Session, e *Endpoint) error { @@ -186,10 +186,10 @@ func (s *StratumServer) handleClient(cs *Session, e *Endpoint) error {
data, isPrefix, err := connbuff.ReadLine()
if isPrefix {
log.Printf("Socket flood detected")
// TODO: Ban client
return errors.New("Socket flood")
} else if err == io.EOF {
log.Printf("Client disconnected")
log.Println("Client disconnected", cs.ip)
s.removeSession(cs)
break
} else if err != nil {
log.Printf("Error reading: %v", err)

Loading…
Cancel
Save