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

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