[Git][NTPsec/ntpsec][master] Fixed too short timeout in ntpsnmpd

Ian Bruene gitlab at mg.gitlab.com
Tue Jan 2 15:36:34 UTC 2018


Ian Bruene pushed to branch master at NTPsec / ntpsec


Commits:
0491a585 by Ian Bruene at 2018-01-02T09:35:57-06:00
Fixed too short timeout in ntpsnmpd

- - - - -


1 changed file:

- ntpclients/ntpsnmpd.py


Changes:

=====================================
ntpclients/ntpsnmpd.py
=====================================
--- a/ntpclients/ntpsnmpd.py
+++ b/ntpclients/ntpsnmpd.py
@@ -30,7 +30,7 @@ logfile = "ntpsnmpd.log"
 logfp = sys.stderr
 nofork = True  # don't daemonize while still under construction
 debug = 0
-timeout = 5  # default timeout, what shuold this be?
+defaultTimeout = 30  # default timeout, what shuold this be?
 
 ntpRootOID = (1, 3, 6, 1, 2, 1, 197)  # mib-2 . 197, aka: NTPv4-MIB
 
@@ -944,7 +944,7 @@ class DataSource:  # This will be broken up in future to be less NTP-specific
 
 
 class PacketControl:
-    def __init__(self, sock, dbase, spinGap=0.001, timeout=5):
+    def __init__(self, sock, dbase, spinGap=0.001, timeout=30):
         # take a pre-made socket instead of making our own so that
         # PacketControl doesn't have to know or care about implementation
         self.socket = sock
@@ -1274,7 +1274,7 @@ def mainloop(masterAddress=None):
     dolog("initing loop\n", 1)
     sock = connect(masterAddress)
     dbase = DataSource()
-    control = PacketControl(sock, dbase)
+    control = PacketControl(sock, dbase, timeout=defaultTimeout)
     control.loopCallback = dbase.checkNotifications
     control.initNewSession()
     control.mainloop(True)



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/0491a5858207843c9165977d0736f0639ad62763

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/0491a5858207843c9165977d0736f0639ad62763
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20180102/dc25937f/attachment.html>


More information about the vc mailing list