Adding the missing return.

This commit is contained in:
2026-08-05 05:29:23 +08:00
parent b8aae421fa
commit fa8a76f53c
+2 -1
View File
@@ -224,13 +224,14 @@ func clientHandler(w http.ResponseWriter, r *http.Request) {
select { select {
case <-r.Context().Done(): case <-r.Context().Done():
fmt.Printf("Connection to client %s closed. Cleanup the channel.\n", remote) fmt.Printf("Connection to client %s closed. Cleanup the channel.\n", remote)
return
default: default:
} }
chunk := <-ch.Data chunk := <-ch.Data
_, err := w.Write(chunk) _, err := w.Write(chunk)
if err != nil { if err != nil {
fmt.Printf("Write to remote client %s failed, closing...\n", remote) fmt.Printf("Write to remote client %s failed, closing...\n", remote)
break return
} }
} }
} }