[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [ooni-probe/master] Fix bug that lead processPacket being called even if no packet has been received



commit fc24e4f29d25a2cef91525e4d47c39da3c6b4d8d
Author: Arturo Filastò <art@xxxxxxxxx>
Date:   Sun Nov 25 16:49:06 2012 +0100

    Fix bug that lead processPacket being called even if no packet has been received
---
 ooni/utils/txscapy.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/ooni/utils/txscapy.py b/ooni/utils/txscapy.py
index fbe9c38..7902133 100644
--- a/ooni/utils/txscapy.py
+++ b/ooni/utils/txscapy.py
@@ -113,8 +113,9 @@ class ScapyFactory(abstract.FileDescriptor):
 
     def doRead(self):
         packet = self.super_socket.recv(MTU)
-        for protocol in self.protocols:
-            protocol.packetReceived(packet)
+        if packet:
+            for protocol in self.protocols:
+                protocol.packetReceived(packet)
 
     def registerProtocol(self, protocol):
         if not self.connected:

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits