diff --git a/daemons.go b/daemons.go index 940cc76..d49cb75 100644 --- a/daemons.go +++ b/daemons.go @@ -3,11 +3,9 @@ package Prox5 import ( "errors" "strconv" - "strings" "sync" ) - func (s *Swamp) svcUp() { s.mu.Lock() s.runningdaemons++ @@ -37,28 +35,20 @@ func (sm swampMap) add(sock string) (*Proxy, bool) { sm.mu.Lock() defer sm.mu.Unlock() - var auth = &proxyAuth{} - - if strings.Contains(sock, "@") { - split := strings.Split(sock, "@") - sock = split[1] - authsplit := strings.Split(split[0], ":") - auth.username = authsplit[0] - auth.password = authsplit[1] - } - if sm.exists(sock) { return nil, false } + p := &Proxy{ Endpoint: sock, lock: stateUnlocked, parent: sm.parent, } + p.timesValidated.Store(0) p.timesBad.Store(0) sm.plot[sock] = p - return p, true + return sm.plot[sock], true } func (sm swampMap) exists(sock string) bool { diff --git a/defs.go b/defs.go index eaf012e..01dd170 100644 --- a/defs.go +++ b/defs.go @@ -154,11 +154,6 @@ const ( stateLocked ) -type proxyAuth struct { - username string - password string -} - // Proxy represents an individual proxy type Proxy struct { // Endpoint is the address:port of the proxy that we connect to @@ -174,8 +169,6 @@ type Proxy struct { // timesBad is the amount of times the proxy has been marked as bad. timesBad atomic.Value - auth *proxyAuth - parent *Swamp lock uint32 }