koding / kite

Micro-service framework in Go
https://godoc.org/github.com/koding/kite
MIT License
3.26k stars 300 forks source link

sockjsclient: do not block on sending do() method Result #189

Closed ppknap closed 7 years ago

ppknap commented 7 years ago

when the XHR session is closed, there is no way to drain <-chan doResult created by do() method because Recv() internal loop is already aborted.

This PR makes returned doResult channel buffered, thus, it will prevent go-routine leaks after session is closed.