Remove workaround

pull/238/head
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
1 changed files with 0 additions and 12 deletions

View File

@ -2,7 +2,6 @@ package ws
import ( import (
"bufio" "bufio"
"fmt"
"io" "io"
"net" "net"
"sync" "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) { func (ws *wsconn) Write(b []byte) (n int, err error) {
ws.wlock.Lock() 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 { if ws.connClosing {
return 0, io.EOF return 0, io.EOF