Skip to content

Commit

Permalink
Add timeout of 30 sec for all GET requests
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
inashivb committed Mar 26, 2019
1 parent 3e07963 commit 5e6883b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion suricata/update/net.py
Expand Up @@ -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:
Expand Down

0 comments on commit 5e6883b

Please sign in to comment.