Skip to content

Commit 7150ba8

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

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

websocket.go

+9-6
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ 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.
89-
c.readDataLock <- struct{}{}
90-
c.writeFrameLock <- struct{}{}
91-
92-
returnBufioReader(c.br)
93-
returnBufioWriter(c.bw)
88+
// TODO this does not work if reader errors out so skip for now.
89+
// c.readDataLock <- struct{}{}
90+
// c.writeFrameLock <- struct{}{}
91+
//
92+
// returnBufioReader(c.br)
93+
// returnBufioWriter(c.bw)
9494
}()
9595
}
9696
})
@@ -326,12 +326,15 @@ func (c *Conn) writePong(p []byte) error {
326326
}
327327

328328
// Close closes the WebSocket connection with the given status code and reason.
329+
//
329330
// It will write a WebSocket close frame with a timeout of 5 seconds.
330331
// The connection can only be closed once. Additional calls to Close
331332
// are no-ops.
333+
//
332334
// The maximum length of reason must be 125 bytes otherwise an internal
333335
// error will be sent to the peer. For this reason, you should avoid
334336
// sending a dynamic reason.
337+
//
335338
// Close will unblock all goroutines interacting with the connection.
336339
func (c *Conn) Close(code StatusCode, reason string) error {
337340
err := c.exportedClose(code, reason)

0 commit comments

Comments
 (0)