fix truncation of received ackdata in objectProcessor
This commit is contained in:
parent
1798c90622
commit
dbd12ab8b4
|
@ -97,14 +97,24 @@ class objectProcessor(threading.Thread):
|
||||||
# Let's check whether this is a message acknowledgement bound for us.
|
# Let's check whether this is a message acknowledgement bound for us.
|
||||||
if len(data) < 32:
|
if len(data) < 32:
|
||||||
return
|
return
|
||||||
if data[-32:] in shared.ackdataForWhichImWatching:
|
readPosition = 20 # bypass the nonce, time, and object type
|
||||||
|
# chomp version number
|
||||||
|
versionNumber, varIntLength = decodeVarint(
|
||||||
|
data[readPosition:readPosition + 10])
|
||||||
|
readPosition += varIntLength
|
||||||
|
# chomp stream number
|
||||||
|
streamNumber, varIntLength = decodeVarint(
|
||||||
|
data[readPosition:readPosition + 10])
|
||||||
|
readPosition += varIntLength
|
||||||
|
|
||||||
|
if data[readPosition:] in shared.ackdataForWhichImWatching:
|
||||||
logger.info('This object is an acknowledgement bound for me.')
|
logger.info('This object is an acknowledgement bound for me.')
|
||||||
del shared.ackdataForWhichImWatching[data[-32:]]
|
del shared.ackdataForWhichImWatching[data[readPosition:]]
|
||||||
sqlExecute('UPDATE sent SET status=?, lastactiontime=? WHERE ackdata=?',
|
sqlExecute('UPDATE sent SET status=?, lastactiontime=? WHERE ackdata=?',
|
||||||
'ackreceived',
|
'ackreceived',
|
||||||
int(time.time()),
|
int(time.time()),
|
||||||
data[-32:])
|
data[readPosition:])
|
||||||
queues.UISignalQueue.put(('updateSentItemStatusByAckdata', (data[-32:], tr._translate("MainWindow",'Acknowledgement of the message received %1').arg(l10n.formatTimestamp()))))
|
queues.UISignalQueue.put(('updateSentItemStatusByAckdata', (data[readPosition:], tr._translate("MainWindow",'Acknowledgement of the message received %1').arg(l10n.formatTimestamp()))))
|
||||||
else:
|
else:
|
||||||
logger.debug('This object is not an acknowledgement bound for me.')
|
logger.debug('This object is not an acknowledgement bound for me.')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user