From aaec4dbd80100702f8a230b0a21309726caeaadb Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Tue, 23 Nov 2021 08:35:45 +1100 Subject: [PATCH] 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. --- tracker/udp/conn-client.go | 3 +++ 1 file changed, 3 insertions(+) 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)