mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-24 09:31:30 +00:00
Fix v2ray ws crash
This commit is contained in:
parent
3ef9b1b343
commit
f7c2eb6e76
|
@ -153,6 +153,9 @@ func (c *EarlyWebsocketConn) Write(b []byte) (n int, err error) {
|
|||
}
|
||||
c.access.Lock()
|
||||
defer c.access.Unlock()
|
||||
if c.err != nil {
|
||||
return 0, c.err
|
||||
}
|
||||
if c.conn != nil {
|
||||
return c.conn.Write(b)
|
||||
}
|
||||
|
@ -174,6 +177,9 @@ func (c *EarlyWebsocketConn) WriteBuffer(buffer *buf.Buffer) error {
|
|||
if c.conn != nil {
|
||||
return c.conn.WriteBuffer(buffer)
|
||||
}
|
||||
if c.err != nil {
|
||||
return c.err
|
||||
}
|
||||
err := c.writeRequest(buffer.Bytes())
|
||||
c.err = err
|
||||
close(c.create)
|
||||
|
|
Loading…
Reference in a new issue