Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syn扫描器中队列缓冲区调整判断似乎存在bug #21

Closed
yuanchenyyy opened this issue Jul 16, 2024 · 1 comment
Closed

syn扫描器中队列缓冲区调整判断似乎存在bug #21

yuanchenyyy opened this issue Jul 16, 2024 · 1 comment

Comments

@yuanchenyyy
Copy link

具体位置在syn.go的149行到158行

// 与recv协同,当队列缓冲区到达80%时降半速,90%将为1/s
if len(ss.openPortChan)*10 >= cap(ss.openPortChan)*8 {
	if ss.option.Rate/2 != 0 {
		ss.limiter.SetLimit(limiter.Every(time.Second / time.Duration(ss.option.Rate/2)))
	}
} else if len(ss.openPortChan)*10 >= cap(ss.openPortChan)*9 {
	ss.limiter.SetLimit(1)
} else {
	ss.limiter.SetLimit(limiter.Every(time.Second / time.Duration(ss.option.Rate)))
}

问题存在于这里第二个else if

因为第一个if条件涵盖了第二个判断条件

@XinRoom
Copy link
Owner

XinRoom commented Jul 18, 2024

确实有误,fix:c19feb9

@XinRoom XinRoom closed this as completed Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants