From 859c9146d99f67b5083f958e4a3f34a568206e8f Mon Sep 17 00:00:00 2001 From: js Date: Mon, 3 Feb 2020 14:06:21 +0100 Subject: [PATCH] Correction bugs compil checksum --- src/protocolP2P/ProtocolP2PDatagram.java | 13 +++++++++---- src/tools/BytesArrayTools.java | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/protocolP2P/ProtocolP2PDatagram.java b/src/protocolP2P/ProtocolP2PDatagram.java index f17cc02..11db2d5 100644 --- a/src/protocolP2P/ProtocolP2PDatagram.java +++ b/src/protocolP2P/ProtocolP2PDatagram.java @@ -10,6 +10,7 @@ import remoteException.NotFound; import remoteException.ProtocolRemoteError; import remoteException.VersionRemoteError; import remoteException.EmptyFile; +import tools.BytesArrayTools; import protocolP2P.Payload; import protocolP2P.RequestResponseCode; import protocolP2P.LoadRequest; @@ -243,7 +244,7 @@ public class ProtocolP2PDatagram { } private int computeCheckSum(byte [] datagram){ - int checksum; + int checksum = 0; for (int i=CHECKSUM_POSITION+2; i