[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [ooni-probe/master] Clean up
commit 44bac35872571102a88d36f5c04a1afb8f0d372c
Author: Arturo Filastò <art@xxxxxxxxx>
Date: Sat Nov 10 18:17:49 2012 +0100
Clean up
---
nettests/core/traceroute.py | 8 +++-----
ooni/utils/txscapy.py | 7 +------
2 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/nettests/core/traceroute.py b/nettests/core/traceroute.py
index b14e013..23f124a 100644
--- a/nettests/core/traceroute.py
+++ b/nettests/core/traceroute.py
@@ -28,12 +28,11 @@ class TracerouteTest(scapyt.BaseScapyTest):
def test_tcp_traceroute(self):
def finished(packets, port):
- log.debug("Finished tcp %s" % port)
+ log.debug("Finished running TCP traceroute test" % port)
answered, unanswered = packets
self.report['hops_'+str(port)] = []
for snd, rcv in answered:
report = {'ttl': snd.ttl, 'address': rcv.src}
- log.debug("Writing %s" % report)
self.report['hops_'+str(port)].append(report)
dl = []
@@ -47,12 +46,11 @@ class TracerouteTest(scapyt.BaseScapyTest):
def test_udp_traceroute(self):
def finished(packets, port):
- log.debug("Finished udp")
+ log.debug("Finished running udp traceroute test")
answered, unanswered = packets
- self.report['hops_'+str(port)].append(report)
+ self.report['hops_'+str(port)] = []
for snd, rcv in answered:
report = {'ttl': snd.ttl, 'address': rcv.src}
- log.debug("Writing %s" % report)
self.report['hops_'+str(port)].append(report)
dl = []
for port in self.dst_ports:
diff --git a/ooni/utils/txscapy.py b/ooni/utils/txscapy.py
index 2559d19..2b108ca 100644
--- a/ooni/utils/txscapy.py
+++ b/ooni/utils/txscapy.py
@@ -70,14 +70,10 @@ class ScapyProtocol(abstract.FileDescriptor):
"""
def processAnswer(self, packet, answer_hr):
- log.debug("Got an answer processing it")
+ log.debug("Got a packet from %s" % packet.src)
for i in range(len(answer_hr)):
if packet.answers(answer_hr[i]):
self.answered_packets.append((answer_hr[i], packet))
- if self.debug:
- print packet.src, packet.ttl
- #answer.show()
-
if not self.multi:
del(answer_hr[i])
break
@@ -87,7 +83,6 @@ class ScapyProtocol(abstract.FileDescriptor):
def doRead(self):
timeout = time.time() - self._start_time
- log.debug("Checking for timeout %s > %s" % (timeout, self.timeout))
if self.timeout and time.time() - self._start_time > self.timeout:
self.stopSending()
packet = self.super_socket.recv()
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits