]> git.ipfire.org Git - thirdparty/suricata-update.git/commitdiff
Add timeout of 30 sec for all GET requests
authorShivani Bhardwaj <shivanib134@gmail.com>
Tue, 22 Jan 2019 15:49:37 +0000 (21:19 +0530)
committerShivani Bhardwaj <shivanib134@gmail.com>
Tue, 26 Mar 2019 18:02:00 +0000 (23:32 +0530)
suricata-update has been reported to get hung in case the download fails
for a particular source. Add a timeout parameter to urllib to avoid that
and continue further processing after a timeout of 30 seconds.

Closes redmine ticket #2703.

suricata/update/net.py

index bbc8414dd6a3c4a58b1647fdfcc9538ecae48691..8135441a60d4e0bf3e7c10bd9eda5f7a8c52ba36 100644 (file)
@@ -134,7 +134,7 @@ def get(url, fileobj, progress_hook=None):
     opener.addheaders = http_headers
 
     try:
-        remote = opener.open(url)
+        remote = opener.open(url, timeout=30)
     except ValueError as ve:
         logger.error(ve)
     else: