From fa8a76f53cb0617e12f2e348bcdf6ff05eba6412 Mon Sep 17 00:00:00 2001 From: Yifu Yu Date: Wed, 5 Aug 2026 05:29:23 +0800 Subject: [PATCH] Adding the missing return. --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index a1fd40a..206100e 100644 --- a/main.go +++ b/main.go @@ -224,13 +224,14 @@ func clientHandler(w http.ResponseWriter, r *http.Request) { select { case <-r.Context().Done(): fmt.Printf("Connection to client %s closed. Cleanup the channel.\n", remote) + return default: } chunk := <-ch.Data _, err := w.Write(chunk) if err != nil { fmt.Printf("Write to remote client %s failed, closing...\n", remote) - break + return } } }