Skip to content

Commit 3dc3628

Browse files
committed
Disable reuse of client buffers for now
Don't want buggy code in master.
1 parent 510eed5 commit 3dc3628

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

websocket.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ func (c *Conn) close(err error) {
8585
if c.client {
8686
go func() {
8787
<-c.readLoopDone
88-
// TODO this does not work if reader errors out.
88+
// TODO this does not work if reader errors out so skip for now.
89+
return
8990
c.readDataLock <- struct{}{}
9091
c.writeFrameLock <- struct{}{}
9192

@@ -326,12 +327,15 @@ func (c *Conn) writePong(p []byte) error {
326327
}
327328

328329
// Close closes the WebSocket connection with the given status code and reason.
330+
//
329331
// It will write a WebSocket close frame with a timeout of 5 seconds.
330332
// The connection can only be closed once. Additional calls to Close
331333
// are no-ops.
334+
//
332335
// The maximum length of reason must be 125 bytes otherwise an internal
333336
// error will be sent to the peer. For this reason, you should avoid
334337
// sending a dynamic reason.
338+
//
335339
// Close will unblock all goroutines interacting with the connection.
336340
func (c *Conn) Close(code StatusCode, reason string) error {
337341
err := c.exportedClose(code, reason)

0 commit comments

Comments
 (0)