1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-05-18 13:09:04 -04:00

fix wrong use a nil value error err (#3365)

the `err` has been check abrove, so it is nil value,

check the errWrite != nil, should return `.Base(errWrite)`
This commit is contained in:
alingse 2025-04-05 22:50:30 +08:00 committed by GitHub
parent 2b4546a4b3
commit 21653e2ecf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -164,7 +164,7 @@ func (d dialerWithEarlyData) Dial(earlyData []byte) (*websocket.Conn, error) {
}
if n != int64(len(earlyData)) {
if errWrite := conn.WriteMessage(websocket.BinaryMessage, earlyData[n:]); errWrite != nil {
return nil, newError("failed to dial to (", d.uriBase, ") with early data as write of remainder early data failed: ").Base(err)
return nil, newError("failed to dial to (", d.uriBase, ") with early data as write of remainder early data failed: ").Base(errWrite)
}
}
return conn, nil
@ -209,7 +209,7 @@ func (d dialerWithEarlyDataRelayed) Dial(earlyData []byte) (io.ReadWriteCloser,
}
if n != int64(len(earlyData)) {
if _, errWrite := conn.Write(earlyData[n:]); errWrite != nil {
return nil, newError("failed to dial to (", d.uriBase, ") with early data as write of remainder early data failed: ").Base(err)
return nil, newError("failed to dial to (", d.uriBase, ") with early data as write of remainder early data failed: ").Base(errWrite)
}
}
return conn, nil