]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
cope if time goes backwards a little bit
authorBob Halley <halley@dnspython.org>
Thu, 29 Sep 2005 05:12:48 +0000 (05:12 +0000)
committerBob Halley <halley@dnspython.org>
Thu, 29 Sep 2005 05:12:48 +0000 (05:12 +0000)
ChangeLog
dns/resolver.py

index cbfc804e23c8b4b6fb9f6e5e298591f2bf793fe7..88ec663d4189a1f81976e8e2f836aefb41a10712 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,9 @@
-2005-07-31  Bob Halley  <halley@nominum.com>
+2005-09-29  Bob Halley  <halley@dnspython.org>
+
+       * dns/resolver.py (Resolver._compute_timeout): If time goes
+         backwards a little bit, ignore it.
+
+2005-07-31  Bob Halley  <halley@dnspython.org>
 
        * (Version 1.3.4 released)
 
index 38e45d39aaab77c902f66766af68afa5d7328a68..7433d4a376dd1e230cfe659e4293502679ee0310 100644 (file)
@@ -427,8 +427,14 @@ class Resolver(object):
     def _compute_timeout(self, start):
         now = time.time()
         if now < start:
-            # Time going backwards is bad.  Just give up.
-            raise Timeout
+            if start - now > 1:
+                # Time going backwards is bad.  Just give up.
+                raise Timeout
+            else:
+                # Time went backwards, but only a little.  This can
+                # happen, e.g. under vmware with older linux kernels.
+                # Pretend it didn't happen.
+                now = start
         duration = now - start
         if duration >= self.lifetime:
             raise Timeout