From: Matt Joiner Date: Mon, 22 Nov 2021 21:35:45 +0000 (+1100) Subject: tracker/udp: Panic on read errors if ConnClient not closed X-Git-Tag: v1.39.0~35^2 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=aaec4dbd80100702f8a230b0a21309726caeaadb;p=btrtrc.git 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. --- diff --git a/tracker/udp/conn-client.go b/tracker/udp/conn-client.go index 4e0d9852..1958c659 100644 --- a/tracker/udp/conn-client.go +++ b/tracker/udp/conn-client.go @@ -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)