提交 45729c98 编写于 作者: wu-sheng's avatar wu-sheng

1.增加包长度的校验,后续要改掉此常量。

上级 05738419
......@@ -4,13 +4,15 @@ import com.ai.cloud.skywalking.reciever.buffer.DataBufferThreadContainer;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import static com.ai.cloud.skywalking.reciever.conf.Config.Persistence.*;
public class CollectionServerDataHandler extends SimpleChannelInboundHandler<byte[]> {
@Override
protected void channelRead0(ChannelHandlerContext ctx, byte[] msg) throws Exception {
Thread.currentThread().setName("ServerReceiver");
// 当接受到这条消息的是空,则忽略
if (msg != null && msg.length >= 0) {
if (msg != null && msg.length >= 0 && msg.length < MAX_STORAGE_SIZE_PER_TIME) {
DataBufferThreadContainer.getDataBufferThread().saveTemporarily(msg);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册