From 5f02fa0e59dc84e12fae1fde61bdfa8edb5446b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magdalena=20Grodzi=C5=84ska?= Date: Mon, 6 Jan 2020 18:58:25 +0100 Subject: Fix handling of multipart udp messages --- src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/UDUPServer.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/main/java/pl/edu') diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/UDUPServer.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/UDUPServer.java index 6807a86..fb79dc6 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/UDUPServer.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/UDUPServer.java @@ -31,12 +31,11 @@ public class UDUPServer { System.out.println("UDP " + this.address + " received packet from " + packet.getAddress()); if (packet.getOffset() == 0) { - UDUPMessage msg = this.serializer.deserialize(packet.getData()); - System.out.println("UDP received message " + msg.getContent().getMessageId()); - if (packet.getLength() == this.bufSize) { this.addPartialMessageAndCheckSerialization(packet.getAddress(), packet.getData()); } else { + UDUPMessage msg = this.serializer.deserialize(packet.getData()); + System.out.println("UDP received message " + msg.getContent().getMessageId()); if (msg.getContent().getDestinationModule() == ModuleType.TEST) { System.out.println("UDP server: test message received"); } else if (msg.getContent().getDestinationModule() != ModuleType.UDP) { -- cgit v1.2.3