From 9d385a290daebecc10363caded29ef67cdcaceb3 Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Thu, 14 Mar 2013 11:58:52 -0400 Subject: [PATCH] Upon receiving bad data from peer (bad magic bytes) print the data to console for analysis --- bitmessagemain.py | 1 + messages.dat reader.py | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bitmessagemain.py b/bitmessagemain.py index 952cbc6f..8ba1ca2d 100755 --- a/bitmessagemain.py +++ b/bitmessagemain.py @@ -312,6 +312,7 @@ class receiveDataThread(QThread): if verbose >= 2: printLock.acquire() sys.stderr.write('The magic bytes were not correct. First 40 bytes of data: %s\n' % repr(self.data[0:40])) + print 'self.data:', self.data.encode('hex') printLock.release() self.data = "" else: diff --git a/messages.dat reader.py b/messages.dat reader.py index 7ca966a6..ec116a1e 100644 --- a/messages.dat reader.py +++ b/messages.dat reader.py @@ -39,7 +39,8 @@ def readSent(): cur.execute(item, parameters) output = cur.fetchall() for row in output: - print row + msgid, toaddress, toripe, fromaddress, subject, message, ackdata, lastactiontime, status, pubkeyretrynumber, msgretrynumber, folder = row + print msgid.encode('hex'), toaddress, 'toripe:', toripe.encode('hex'), 'fromaddress:', fromaddress, 'SUBJECT:', repr(subject), 'MESSAGE:', repr(message), 'ACKDATA:', ackdata.encode('hex'), lastactiontime, status, pubkeyretrynumber, msgretrynumber, folder def readSubscriptions(): print 'Printing everything in subscriptions table:' @@ -90,9 +91,9 @@ def takeSentMessagesOutOfTrash(): #takeInboxMessagesOutOfTrash() #takeSentMessagesOutOfTrash() #readInbox() -#readSent() +readSent() #readPubkeys() -readSubscriptions() +#readSubscriptions() #readInventory()