aboutsummaryrefslogtreecommitdiffstats
path: root/libpathod/pathoc.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2014-10-26 18:16:47 +1300
committerAldo Cortesi <aldo@nullcube.com>2014-10-26 18:16:47 +1300
commit956149c126c0500aa67604996ca310824b2f23a2 (patch)
tree7cbe51958d2ca926b4969ff517067249763423de /libpathod/pathoc.py
parentbd1f7ebb5c3cf3dfa613e194f4728bae1420b241 (diff)
downloadmitmproxy-956149c126c0500aa67604996ca310824b2f23a2.tar.gz
mitmproxy-956149c126c0500aa67604996ca310824b2f23a2.tar.bz2
mitmproxy-956149c126c0500aa67604996ca310824b2f23a2.zip
--memo-limit - limit failed attempts to find new generated requests to N
Diffstat (limited to 'libpathod/pathoc.py')
-rw-r--r--libpathod/pathoc.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/libpathod/pathoc.py b/libpathod/pathoc.py
index 0ff02b01..e7aff520 100644
--- a/libpathod/pathoc.py
+++ b/libpathod/pathoc.py
@@ -222,9 +222,14 @@ class Pathoc(tcp.TCPClient):
def main(args):
memo = set([])
+ trycount = 0
try:
cnt = 0
while 1:
+ if trycount > args.memolimit:
+ print >> sys.stderr, "Memo limit exceeded..."
+ return
+
cnt += 1
if args.random:
playlist = [random.choice(args.requests)]
@@ -251,8 +256,10 @@ def main(args):
newlist.append(spec)
playlist = newlist
if not playlist:
+ trycount += 1
continue
+ trycount = 0
try:
p.connect(args.connect_to)
except (tcp.NetLibError, PathocError), v: