tracker/udp: Panic on read errors if ConnClient not closed

There's nothing exposed to handle this error currently, and if it occurs, it's better not to fail in silence. I'm currently debugging a situation where ConnClients stop working, this would be a condition we'd want to know about.
This commit is contained in:
Matt Joiner 2021-11-23 08:35:45 +11:00
parent 615669ecf8
commit aaec4dbd80
1 changed files with 3 additions and 0 deletions

View File

@ -35,6 +35,9 @@ func (cc *ConnClient) reader() {
// TODO: Do bad things to the dispatcher, and incoming calls to the client if we have a
// read error.
cc.readErr = err
if !cc.closed {
panic(err)
}
break
}
err = cc.d.Dispatch(b[:n], addr)