fix: firstWriteCallBackConn can pass N.ExtendedConn too

This commit is contained in:
wwqgtxx
2023-04-01 20:56:49 +08:00
parent 4af4935e7e
commit cd95cf4849
4 changed files with 78 additions and 35 deletions

View File

@@ -37,16 +37,13 @@ func (f *Fallback) DialContext(ctx context.Context, metadata *C.Metadata, opts .
}
if N.NeedHandshake(c) {
c = &callback.FirstWriteCallBackConn{
Conn: c,
Callback: func(err error) {
if err == nil {
f.onDialSuccess()
} else {
f.onDialFailed(proxy.Type(), err)
}
},
}
c = callback.NewFirstWriteCallBackConn(c, func(err error) {
if err == nil {
f.onDialSuccess()
} else {
f.onDialFailed(proxy.Type(), err)
}
})
}
return c, err