Skip to content

Commit

Permalink
fix: End without finishing output
Browse files Browse the repository at this point in the history
  • Loading branch information
XinRoom committed Aug 25, 2022
1 parent 3cde1e7 commit 9f2c240
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cmd/go-portScan.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ func run(c *cli.Context) error {
})
defer poolPortIdentify.Release()
go func() {
sendOverFlag := false
for {
select {
case <-single1:
single2 <- struct{}{}
return
sendOverFlag = true
case ret := <-retChan:
if sV || httpx {
// port fingerprint
Expand All @@ -163,6 +163,10 @@ func run(c *cli.Context) error {
fmt.Printf("%v:%d\n", ret.Ip, ret.Port)
}
default:
if sendOverFlag {
single2 <- struct{}{}
return
}
time.Sleep(time.Millisecond * 10)
}
}
Expand Down

0 comments on commit 9f2c240

Please sign in to comment.