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

头部内容固定,脏数据不能处理,一直阻塞到半包 #236

Open
vertee opened this issue May 31, 2023 · 3 comments
Open

头部内容固定,脏数据不能处理,一直阻塞到半包 #236

vertee opened this issue May 31, 2023 · 3 comments

Comments

@vertee
Copy link

vertee commented May 31, 2023

比如头部是0xCAFE,framedecoder,不会按照这个头部去截取正确的帧,只是简单的按长度处理,如果上传的数据有的错误的,不按0xCAFE这个头部传,后续的数据都无法解析

@xxl6097
Copy link
Collaborator

xxl6097 commented Jun 5, 2023

framedecoder只能处理断黏包,包的完整性,是需要业务校验的

@vertee
Copy link
Author

vertee commented Jun 5, 2023

好的,但是请问下我校验出来了,怎么丢弃错误的数据

@xxl6097
Copy link
Collaborator

xxl6097 commented Jun 7, 2023

framedecoder计算后的数据包,是符合你私有协议的数据包,只是你通过包头或者crc校验数据包是错误的,那么这个错误大概率是客户端发的一包错误数据,你直接丢弃,不做处理就行

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