fix send on close channel
This commit is contained in:
@@ -34,6 +34,7 @@ func CrawlGo() {
|
||||
wg := &sync.WaitGroup{}
|
||||
var pc = make(chan proxy.Proxy)
|
||||
for _, g := range Getters {
|
||||
wg.Add(1)
|
||||
go g.Get2Chan(pc, wg)
|
||||
}
|
||||
proxies := cache.GetProxies()
|
||||
|
||||
@@ -40,12 +40,11 @@ func (s *Subscribe) Get() []proxy.Proxy {
|
||||
}
|
||||
|
||||
func (s *Subscribe) Get2Chan(pc chan proxy.Proxy, wg *sync.WaitGroup) {
|
||||
wg.Add(1)
|
||||
defer wg.Done()
|
||||
nodes := s.Get()
|
||||
for _, node := range nodes {
|
||||
pc <- node
|
||||
}
|
||||
wg.Done()
|
||||
}
|
||||
|
||||
func NewSubscribe(options tool.Options) Getter {
|
||||
|
||||
@@ -61,10 +61,9 @@ func (g *TGChannelGetter) Get() []proxy.Proxy {
|
||||
}
|
||||
|
||||
func (g *TGChannelGetter) Get2Chan(pc chan proxy.Proxy, wg *sync.WaitGroup) {
|
||||
wg.Add(1)
|
||||
defer wg.Done()
|
||||
nodes := g.Get()
|
||||
for _, node := range nodes {
|
||||
pc <- node
|
||||
}
|
||||
wg.Done()
|
||||
}
|
||||
|
||||
@@ -61,10 +61,9 @@ func (w *WebFanqiangdang) Get() []proxy.Proxy {
|
||||
}
|
||||
|
||||
func (w *WebFanqiangdang) Get2Chan(pc chan proxy.Proxy, wg *sync.WaitGroup) {
|
||||
wg.Add(1)
|
||||
defer wg.Done()
|
||||
nodes := w.Get()
|
||||
for _, node := range nodes {
|
||||
pc <- node
|
||||
}
|
||||
wg.Done()
|
||||
}
|
||||
|
||||
@@ -34,12 +34,11 @@ func (w *WebFreessrXyz) Get() []proxy.Proxy {
|
||||
}
|
||||
|
||||
func (w *WebFreessrXyz) Get2Chan(pc chan proxy.Proxy, wg *sync.WaitGroup) {
|
||||
wg.Add(1)
|
||||
defer wg.Done()
|
||||
nodes := w.Get()
|
||||
for _, node := range nodes {
|
||||
pc <- node
|
||||
}
|
||||
wg.Done()
|
||||
}
|
||||
|
||||
func freessrxyzFetch(link string) []proxy.Proxy {
|
||||
|
||||
@@ -32,12 +32,11 @@ func (w *WebFuzz) Get() []proxy.Proxy {
|
||||
}
|
||||
|
||||
func (w *WebFuzz) Get2Chan(pc chan proxy.Proxy, wg *sync.WaitGroup) {
|
||||
wg.Add(1)
|
||||
defer wg.Done()
|
||||
nodes := w.Get()
|
||||
for _, node := range nodes {
|
||||
pc <- node
|
||||
}
|
||||
wg.Done()
|
||||
}
|
||||
|
||||
func NewWebFuzzGetter(options tool.Options) Getter {
|
||||
|
||||
@@ -67,12 +67,11 @@ func (w *WebLucnOrg) Get() []proxy.Proxy {
|
||||
}
|
||||
|
||||
func (w *WebLucnOrg) Get2Chan(pc chan proxy.Proxy, wg *sync.WaitGroup) {
|
||||
wg.Add(1)
|
||||
defer wg.Done()
|
||||
nodes := w.Get()
|
||||
for _, node := range nodes {
|
||||
pc <- node
|
||||
}
|
||||
wg.Done()
|
||||
}
|
||||
|
||||
func decryptAesForLucn(code string, c string) []byte {
|
||||
|
||||
Reference in New Issue
Block a user