chore: remove unsed code
This commit is contained in:
parent
05f877a324
commit
cdd91f5132
@ -17,9 +17,7 @@ var (
|
|||||||
actualSingleStackDialContext = serialSingleStackDialContext
|
actualSingleStackDialContext = serialSingleStackDialContext
|
||||||
actualDualStackDialContext = serialDualStackDialContext
|
actualDualStackDialContext = serialDualStackDialContext
|
||||||
tcpConcurrent = false
|
tcpConcurrent = false
|
||||||
DisableIPv6 = false
|
|
||||||
ErrorInvalidedNetworkStack = errors.New("invalided network stack")
|
ErrorInvalidedNetworkStack = errors.New("invalided network stack")
|
||||||
ErrorDisableIPv6 = errors.New("IPv6 is disabled, dialer cancel")
|
|
||||||
ErrorConnTimeout = errors.New("connect timeout")
|
ErrorConnTimeout = errors.New("connect timeout")
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -113,10 +111,6 @@ func dialContext(ctx context.Context, network string, destination netip.Addr, po
|
|||||||
bindMarkToDialer(opt.routingMark, dialer, network, destination)
|
bindMarkToDialer(opt.routingMark, dialer, network, destination)
|
||||||
}
|
}
|
||||||
|
|
||||||
if DisableIPv6 && destination.Is6() {
|
|
||||||
return nil, ErrorDisableIPv6
|
|
||||||
}
|
|
||||||
|
|
||||||
address := net.JoinHostPort(destination.String(), port)
|
address := net.JoinHostPort(destination.String(), port)
|
||||||
if opt.tfo {
|
if opt.tfo {
|
||||||
return dialTFO(ctx, *dialer, network, address)
|
return dialTFO(ctx, *dialer, network, address)
|
||||||
@ -296,7 +290,7 @@ type dialResult struct {
|
|||||||
isPrimary bool
|
isPrimary bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func parseAddr(ctx context.Context, network,address string, preferResolver resolver.Resolver) ([]netip.Addr, string, error) {
|
func parseAddr(ctx context.Context, network, address string, preferResolver resolver.Resolver) ([]netip.Addr, string, error) {
|
||||||
host, port, err := net.SplitHostPort(address)
|
host, port, err := net.SplitHostPort(address)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, "-1", err
|
return nil, "-1", err
|
||||||
|
@ -331,11 +331,7 @@ func updateTunnels(tunnels []LC.Tunnel) {
|
|||||||
func updateGeneral(general *config.General) {
|
func updateGeneral(general *config.General) {
|
||||||
tunnel.SetMode(general.Mode)
|
tunnel.SetMode(general.Mode)
|
||||||
tunnel.SetFindProcessMode(general.FindProcessMode)
|
tunnel.SetFindProcessMode(general.FindProcessMode)
|
||||||
dialer.DisableIPv6 = !general.IPv6
|
resolver.DisableIPv6 =!general.IPv6
|
||||||
if !dialer.DisableIPv6 {
|
|
||||||
log.Infoln("Use IPv6")
|
|
||||||
}
|
|
||||||
resolver.DisableIPv6 = dialer.DisableIPv6
|
|
||||||
|
|
||||||
if general.TCPConcurrent {
|
if general.TCPConcurrent {
|
||||||
dialer.SetDial(general.TCPConcurrent)
|
dialer.SetDial(general.TCPConcurrent)
|
||||||
|
Reference in New Issue
Block a user