mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-21 12:13:55 +09:00
When a client disconnected, the handler stopped its pump and returned at once, while the pump could still be writing an event or a heartbeat to the response. net/http does not allow a write to a response after ServeHTTP has returned. The handler now waits for the pump to exit; a pump blocked in a write returns once the connection is gone. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <f@lex.la>