1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 01:57:12 -05:00

Remove workaround

This commit is contained in:
Shelikhoo 2016-08-15 18:57:39 +08:00
parent bfb4e0d9b0
commit a5ae6a0f4e
No known key found for this signature in database
GPG Key ID: 7791BDB0709ABD21

View File

@ -2,7 +2,6 @@ package ws
import (
"bufio"
"fmt"
"io"
"net"
"sync"
@ -80,18 +79,7 @@ func (ws *wsconn) readNext(b []byte) (n int, err error) {
func (ws *wsconn) Write(b []byte) (n int, err error) {
ws.wlock.Lock()
/*
process can crash as websocket report "concurrent write to websocket connection"
even if lock is persent.
This problem should have been resolved.
*/
defer func() {
if r := recover(); r != nil {
fmt.Println("WS workaround: recover", r)
ws.wlock.Unlock()
}
}()
if ws.connClosing {
return 0, io.EOF