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

代码中对TLV结构的拆包异常处理 #25

Open
luweimy opened this issue Apr 14, 2018 · 1 comment
Open

代码中对TLV结构的拆包异常处理 #25

luweimy opened this issue Apr 14, 2018 · 1 comment

Comments

@luweimy
Copy link

luweimy commented Apr 14, 2018

tao/message.go

Line 196 in 50d6193

if msgLen > MessageMaxBytes {

代码中对读出的msgLen大于MessageMaxBytes,就直接返回关闭连接吗。
有没有更好的处理方法?

@leesper
Copy link
Owner

leesper commented Apr 14, 2018

我以前在做游戏开发的时候遇到过这种问题……突然收到一个包,检查它的len字段发现这个数据包有几十上百M,就是直接关闭链接处理的,因为某种程度上我可以把它当成某种恶意消息

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