Skip to content

Commit

Permalink
调整 wg Done 的位置
Browse files Browse the repository at this point in the history
Signed-off-by: allan716 <[email protected]>
  • Loading branch information
allanpk716 committed Aug 9, 2022
1 parent 6e65987 commit f7a6458
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/scan_tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (s ScanTools) Scan(protocolType ProtocolType, inputInfo InputInfo, showProg
println(protocolType.String(), deliveryInfo.Host, deliveryInfo.Port, checkResult.Success)
}
deliveryInfo.CheckResultChan <- checkResult
deliveryInfo.Wg.Done()
//deliveryInfo.Wg.Done()
}()

switch protocolType {
Expand Down Expand Up @@ -131,6 +131,7 @@ func (s ScanTools) Scan(protocolType ProtocolType, inputInfo InputInfo, showProg
outputInfo := OutputInfo{
ProtocolType: protocolType,
}
wg := &sync.WaitGroup{}
outputInfo.SuccessMapString = make(map[string][]string, 0)
outputInfo.FailedMapString = make(map[string][]string, 0)
go func() {
Expand All @@ -150,14 +151,13 @@ func (s ScanTools) Scan(protocolType ProtocolType, inputInfo InputInfo, showProg
outputInfo.SuccessMapString[revCheckResult.Host] = []string{revCheckResult.Port}
}
}
wg.Done()
case <-exitRevResultChan:
return
}
}
}()
// --------------------------------------------------
wg := &sync.WaitGroup{}

for _, ipRangeInfo := range ipRangeInfos {

if ipRangeInfo.CICR != nil {
Expand Down

0 comments on commit f7a6458

Please sign in to comment.