Adding the missing return.
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user