Skip to content

Fix a leaky go-routine on server side connections

Compare
Choose a tag to compare
@tsachiherman tsachiherman released this 25 Mar 18:54
· 7 commits to master since this release
e8779fc

Fix a leaky go-routine on server side connections.
The Upgrader.Upgrade method in the server.go was not shutting down the connection cleanly when it had write errors right after the connection was established. This codepath is expected when a non-websocket aware client is trying to connect to the server.
Instead of calling the CloseWithoutFlush, the Upgrader.Upgrade method was closing the underlying network connection ( correctly ), and returning, potentially leaving the flush goroutine abandoned.