mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-22 01:20:29 +00:00
Don't log duplicate connection attempt
This commit is contained in:
parent
81839ad50d
commit
22caddef63
@ -23,7 +23,7 @@ func (l *links) newLinkSOCKS() *linkSOCKS {
|
|||||||
func (l *linkSOCKS) dial(url *url.URL, options linkOptions) error {
|
func (l *linkSOCKS) dial(url *url.URL, options linkOptions) error {
|
||||||
info := linkInfoFor("socks", "", url.Path)
|
info := linkInfoFor("socks", "", url.Path)
|
||||||
if l.links.isConnectedTo(info) {
|
if l.links.isConnectedTo(info) {
|
||||||
return fmt.Errorf("duplicate connection attempt")
|
return nil
|
||||||
}
|
}
|
||||||
proxyAuth := &proxy.Auth{}
|
proxyAuth := &proxy.Auth{}
|
||||||
proxyAuth.User = url.User.Username()
|
proxyAuth.User = url.User.Username()
|
||||||
|
@ -33,7 +33,7 @@ func (l *links) newLinkTCP() *linkTCP {
|
|||||||
func (l *linkTCP) dial(url *url.URL, options linkOptions, sintf string) error {
|
func (l *linkTCP) dial(url *url.URL, options linkOptions, sintf string) error {
|
||||||
info := linkInfoFor("tcp", sintf, strings.SplitN(url.Host, "%", 2)[0])
|
info := linkInfoFor("tcp", sintf, strings.SplitN(url.Host, "%", 2)[0])
|
||||||
if l.links.isConnectedTo(info) {
|
if l.links.isConnectedTo(info) {
|
||||||
return fmt.Errorf("duplicate connection attempt")
|
return nil
|
||||||
}
|
}
|
||||||
addr, err := net.ResolveTCPAddr("tcp", url.Host)
|
addr, err := net.ResolveTCPAddr("tcp", url.Host)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -49,7 +49,7 @@ func (l *links) newLinkTLS(tcp *linkTCP) *linkTLS {
|
|||||||
func (l *linkTLS) dial(url *url.URL, options linkOptions, sintf, sni string) error {
|
func (l *linkTLS) dial(url *url.URL, options linkOptions, sintf, sni string) error {
|
||||||
info := linkInfoFor("tls", sintf, strings.SplitN(url.Host, "%", 2)[0])
|
info := linkInfoFor("tls", sintf, strings.SplitN(url.Host, "%", 2)[0])
|
||||||
if l.links.isConnectedTo(info) {
|
if l.links.isConnectedTo(info) {
|
||||||
return fmt.Errorf("duplicate connection attempt")
|
return nil
|
||||||
}
|
}
|
||||||
addr, err := net.ResolveTCPAddr("tcp", url.Host)
|
addr, err := net.ResolveTCPAddr("tcp", url.Host)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -2,7 +2,6 @@ package core
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
|
||||||
"net"
|
"net"
|
||||||
"net/url"
|
"net/url"
|
||||||
"time"
|
"time"
|
||||||
@ -36,7 +35,7 @@ func (l *links) newLinkUNIX() *linkUNIX {
|
|||||||
func (l *linkUNIX) dial(url *url.URL, options linkOptions, _ string) error {
|
func (l *linkUNIX) dial(url *url.URL, options linkOptions, _ string) error {
|
||||||
info := linkInfoFor("unix", "", url.Path)
|
info := linkInfoFor("unix", "", url.Path)
|
||||||
if l.links.isConnectedTo(info) {
|
if l.links.isConnectedTo(info) {
|
||||||
return fmt.Errorf("duplicate connection attempt")
|
return nil
|
||||||
}
|
}
|
||||||
addr, err := net.ResolveUnixAddr("unix", url.Path)
|
addr, err := net.ResolveUnixAddr("unix", url.Path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user