[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [depictor/master] Add a timeout to the clock skew request



commit 3355279b34a3e21c64cd61fc81b5eb7566a0d895
Author: Tom Ritter <tom@xxxxxxxxx>
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')

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits