fix: websocketWithEarlyDataConn can't close underlay conn when is dialing or not dialed

This commit is contained in:
wwqgtxx 2025-04-10 00:13:14 +08:00
parent 487d7fa81f
commit e8af058694

View file

@ -247,8 +247,8 @@ func (wsedc *websocketWithEarlyDataConn) Read(b []byte) (int, error) {
func (wsedc *websocketWithEarlyDataConn) Close() error {
wsedc.closed = true
wsedc.cancel()
if wsedc.Conn == nil {
return nil
if wsedc.Conn == nil { // is dialing or not dialed
return wsedc.underlay.Close()
}
return wsedc.Conn.Close()
}