From: Shivani Bhardwaj Date: Tue, 22 Jan 2019 15:49:37 +0000 (+0530) Subject: Add timeout of 30 sec for all GET requests X-Git-Tag: 1.1.0rc1~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e6883beb1ec0a6bb6c8ea60f753bdecc1ce351d;p=thirdparty%2Fsuricata-update.git Add timeout of 30 sec for all GET requests 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. --- diff --git a/suricata/update/net.py b/suricata/update/net.py index bbc8414..8135441 100644 --- a/suricata/update/net.py +++ b/suricata/update/net.py @@ -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: