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:
parent
bfb4e0d9b0
commit
a5ae6a0f4e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user