From c9c4d65c2cf9c3dff1612ff80dc542a270bbdb4a Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Wed, 29 Jul 2015 16:21:02 -0700 Subject: [PATCH] Set errorFired flag on timeout An 'error' callback can occur after the setTimeout() fires in rare occasions, which should be ignored to prevent multiple error callbacks. --- lib/ntp-client.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ntp-client.js b/lib/ntp-client.js index 4b9a840..e4db7a2 100644 --- a/lib/ntp-client.js +++ b/lib/ntp-client.js @@ -50,6 +50,7 @@ var timeout = setTimeout(function () { client.close(); callback("Timeout waiting for NTP response.", null); + errorFired = true; }, exports.ntpReplyTimeout); // Some errors can happen before/after send() or cause send() to was impossible.