Commits

Peter Arrenbrecht  committed 362c445

more/better config

  • Participants
  • Parent commits 8435e35

Comments (0)

Files changed (1)

File src/discovery_tonfa.py

 
 
 MAX_CLIENT_SAMPLE = 200
-MAX_CLIENT_ALL = MAX_CLIENT_SAMPLE
-CLIENT_ROOTS_ALWAYS = True
+MAX_CLIENT_ALL = 200
+ALWAYS_INCLUDE_ROOTS = True
 
 MAX_SERVER_SAMPLE = 200
-MAX_SERVER_ALL = MAX_SERVER_SAMPLE
+MAX_SERVER_ALL = 200
 
 HIDE_ALL = False
-HIDE_TRAFFIC = False
+HIDE_TRAFFIC = True
 HIDE_SAMPLER = True
 HIDE_SERVER = True
 HIDE_UPDATES = True
                 if d == factor:
                     sample.add(n)
 
-            if self.roots_always or not always:
+            if ALWAYS_INCLUDE_ROOTS or not always:
                 always.update(heads)
 
         self.writer.step("finalize")
         self.roundtrips = 0
         self.maxall = MAX_CLIENT_ALL
         self.maxsample = MAX_CLIENT_SAMPLE
-        self.roots_always = CLIENT_ROOTS_ALWAYS
         self.sampleheads = True
         self.sampleroots = True
 
         Participant.__init__(self, dag, writer, cfg)
         self.maxall = MAX_SERVER_ALL
         self.maxsample = MAX_SERVER_SAMPLE
-        self.roots_always = True
         self.sampleheads = False
         self.sampleroots = True
 
         self.writer.show("server remaining: %i" % len(allremaining))
         self.writer.unindent()
 
-        if len(allremaining) > self.maxall:
-            mysample = self._sample(allremaining, common)
-            return yesno, mysample, False
+        if len(allremaining) <= self.maxall:
+            return yesno, allremaining, True
 
-        return yesno, allremaining, True
+        if self.maxsample > 0:
+            return yesno, self._sample(allremaining, common), False
+
+        return yesno, set(), False
 
 
 class Tests(DiscoveryTests):