[Git][NTPsec/ntpsec][master] Fix instrumentation bugs.

Eric S. Raymond gitlab at mg.gitlab.com
Wed Nov 9 15:26:24 UTC 2016


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
2cf7f5b8 by Eric S. Raymond at 2016-11-09T10:25:55-05:00
Fix instrumentation bugs.

- - - - -


2 changed files:

- pylib/packet.py
- pylib/util.py


Changes:

=====================================
pylib/packet.py
=====================================
--- a/pylib/packet.py
+++ b/pylib/packet.py
@@ -544,7 +544,7 @@ class Mode6Session:
         warn = sys.stderr.write
 
         if self.debug:
-            warn("Fragment collection begins %d\n")
+            warn("Fragment collection begins\n")
         # Loop until we have an error or a complete response.  Nearly all
         # code paths to loop again use continue.
         while True:
@@ -701,7 +701,8 @@ class Mode6Session:
                     if fragments[f-1].end() != fragments[f].offset:
                         break
                 else:
-                    #warn("%d packets reassembled\n" % len(fragments))
+                    if self.debug:
+                        warn("Fragment collection ends\n")
                     self.response = "".join([frag.data for frag in fragments])
                     if self.debug >= 4:
                         sys.stdout.write("Response packet:\n")


=====================================
pylib/util.py
=====================================
--- a/pylib/util.py
+++ b/pylib/util.py
@@ -231,10 +231,10 @@ class PeerSummary:
         elif self.showhostnames:
             try:
                 if self.debug:
-                    self.say("DNS lookup begins...")
+                    sys.stderr.write("DNS lookup begins...\n")
                 clock_name = canonicalize_dns(srcadr)
                 if self.debug:
-                    self.say("DNS lookup ends.")
+                    sys.stderr.write("DNS lookup ends.\n")
             except TypeError:
                 return ''
         else:



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/2cf7f5b8576f4b10d83672ac86797694afa60b45
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161109/bd3ac348/attachment.html>


More information about the vc mailing list