From 1da0b9731455696e9e4ac8e63e40be6226bfa0db Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 17 Apr 2021 15:44:20 +0100 Subject: [PATCH] Revert "_seq does not appear to be an integer for peers" This reverts commit ad1906f5e23cc96700268d2690a6e16ec432c2d5. --- bridge_master.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/bridge_master.py b/bridge_master.py index 965071f..c60ff9b 100755 --- a/bridge_master.py +++ b/bridge_master.py @@ -1795,26 +1795,25 @@ class routerHBP(HBSYSTEM): self.STATUS[_slot]['_bcsq'] = True return - _int_seq == int(_seq.decode()) #Duplicate handling# #Duplicate complete packet - if self.STATUS[_slot]['lastData'] and self.STATUS[_slot]['lastData'] == _data and _int_seq > 1: + if self.STATUS[_slot]['lastData'] and self.STATUS[_slot]['lastData'] == _data and _seq > 1: logger.warning("(%s) *PacketControl* last packet is a complete duplicate of the previous one, disgarding. Stream ID:, %s TGID: %s",self._system,int_id(_stream_id),int_id(_dst_id)) return #Handle inbound duplicates - if _int_seq and _int_seq == self.STATUS[_slot]['lastSeq']: - logger.warning("(%s) *PacketControl* Duplicate sequence number %s, disgarding. Stream ID:, %s TGID: %s",self._system,_int_seq,int_id(_stream_id),int_id(_dst_id)) + if _seq and _seq == self.STATUS[_slot]['lastSeq']: + logger.warning("(%s) *PacketControl* Duplicate sequence number %s, disgarding. Stream ID:, %s TGID: %s",self._system,_seq,int_id(_stream_id),int_id(_dst_id)) return #Inbound out-of-order packets - if _int_seq and self.STATUS[_slot]['lastSeq'] and (_int_seq != 1) and (_int_seq < self.STATUS[_slot]['lastSeq']): - logger.warning("%s) *PacketControl* Out of order packet - last SEQ: %s, this SEQ: %s, disgarding. Stream ID:, %s TGID: %s ",self._system,self.STATUS[_slot]['lastSeq'],_int_seq,int_id(_stream_id),int_id(_dst_id)) + if _seq and self.STATUS[_slot]['lastSeq'] and (_seq != 1) and (_seq < self.STATUS[_slot]['lastSeq']): + logger.warning("%s) *PacketControl* Out of order packet - last SEQ: %s, this SEQ: %s, disgarding. Stream ID:, %s TGID: %s ",self._system,self.STATUS[_slot]['lastSeq'],_seq,int_id(_stream_id),int_id(_dst_id)) return #Inbound missed packets - if _int_seq and self.STATUS[_slot]['lastSeq'] and _int_seq > (self.STATUS[_slot]['lastSeq']+1): - logger.warning("(%s) *PacketControl* Missed packet(s) - last SEQ: %s, this SEQ: %s. Stream ID:, %s TGID: %s ",self._system,self.STATUS[_slot]['lastSeq'],_int_seq,int_id(_stream_id),int_id(_dst_id)) + if _seq and self.STATUS[_slot]['lastSeq'] and _seq > (self.STATUS[_slot]['lastSeq']+1): + logger.warning("(%s) *PacketControl* Missed packet(s) - last SEQ: %s, this SEQ: %s. Stream ID:, %s TGID: %s ",self._system,self.STATUS[_slot]['lastSeq'],_seq,int_id(_stream_id),int_id(_dst_id)) #Save this sequence number - self.STATUS[_slot]['lastSeq'] = _int_seq + self.STATUS[_slot]['lastSeq'] = _seq #Save this packet self.STATUS[_slot]['lastData'] = _data