File tree Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Original file line number Diff line number Diff line change 27
27
-n 请求的SNI数量,默认为1
28
28
如设置为0则检测全部可检测的域名
29
29
-c 检测任务的并发数量,请根据系统资源自行调整,默认为50
30
-
31
30
```
32
31
33
32
Original file line number Diff line number Diff line change @@ -18,25 +18,31 @@ func HandleRecords(rs []Record) {
18
18
fetch .Con = len (domainList )
19
19
}
20
20
dIndex := 0
21
- for i := 0 ; i < fetch .Con ; i ++ {
21
+ for i := 0 ; i < fetch .Con ; i ++ {
22
22
go processChallenge (domainList [dIndex ], ch )
23
23
dIndex ++
24
24
}
25
25
26
26
for {
27
+ // When a check task finished
27
28
<- ch
28
- if fetch . Num == 0 {
29
- if sniNum == len (domainList ) {
30
- break
31
- }
32
- } else {
33
- if fetch . Num == len (vaildSNIs ) {
29
+ // All the SNI checks finished
30
+ if sniNum == len (domainList ) {
31
+ break
32
+ }
33
+ if fetch . Num != 0 {
34
+ if len (vaildSNIs ) >= fetch . Num {
34
35
break
35
36
}
36
37
}
37
- go processChallenge (domainList [dIndex ], ch )
38
- dIndex ++
38
+ // Continue to create more tasks,
39
+ // if not cover all the domains wanted to be checked
40
+ if dIndex < len (domainList ) {
41
+ go processChallenge (domainList [dIndex ], ch )
42
+ dIndex ++
43
+ }
39
44
}
45
+ close (ch )
40
46
output ()
41
47
}
42
48
You can’t perform that action at this time.
0 commit comments