[tor-commits] [depictor/master] Add a timeout to the clock skew request
tom at torproject.org
tom at torproject.org
Fri Dec 18 18:56:13 UTC 2020
commit 3355279b34a3e21c64cd61fc81b5eb7566a0d895
Author: Tom Ritter <tom at ritter.vg>
Date: Fri Dec 18 12:55:56 2020 -0600
Add a timeout to the clock skew request
---
utility.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/utility.py b/utility.py
index 7b35f00..390cebf 100755
--- a/utility.py
+++ b/utility.py
@@ -112,7 +112,7 @@ def get_clockskew():
try:
startTimeStamp = datetime.datetime.utcnow()
startTime = time.time()
- f = urllib.request.urlopen(authority_address)
+ f = urllib.request.urlopen(authority_address, timeout=30)
h = f.getheader('date')
if h:
clockskew[nickname] = datetime.datetime.strptime(h, '%a, %d %b %Y %H:%M:%S %Z')
More information about the tor-commits
mailing list