mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-06-08 11:44:13 +08:00
Fix missing handshake for early conn
This commit is contained in:
parent
d09d2fb665
commit
bab8dc0b82
@ -225,6 +225,17 @@ func (m *ConnectionManager) connectionCopy(ctx context.Context, source io.Reader
|
||||
}
|
||||
break
|
||||
}
|
||||
if earlyConn, isEarlyConn := common.Cast[N.EarlyConn](destination); isEarlyConn && earlyConn.NeedHandshake() {
|
||||
_, err := destination.Write(nil)
|
||||
if err != nil {
|
||||
if !direction {
|
||||
m.logger.ErrorContext(ctx, "connection upload handshake: ", err)
|
||||
} else {
|
||||
m.logger.ErrorContext(ctx, "connection download handshake: ", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
_, err := bufio.CopyWithCounters(destination, source, originSource, readCounters, writeCounters)
|
||||
if err != nil {
|
||||
common.Close(originDestination)
|
||||
|
Loading…
x
Reference in New Issue
Block a user