| Index: tools/findit/crash_utils.py
|
| diff --git a/tools/findit/crash_utils.py b/tools/findit/crash_utils.py
|
| index 7d6ac96eccbf9ddb2d75ffd2901b6305a23f0319..da060b1d51d224450f773f00fd79fd0e1402e603 100644
|
| --- a/tools/findit/crash_utils.py
|
| +++ b/tools/findit/crash_utils.py
|
| @@ -8,6 +8,8 @@ import os
|
| import time
|
| import urllib
|
|
|
| +import https
|
| +
|
|
|
| INFINITY = float('inf')
|
|
|
| @@ -96,20 +98,21 @@ def GetDataFromURL(url, retries=10, sleep_time=0.1):
|
| Returns:
|
| None if the data retrieval fails, or the raw data.
|
| """
|
| - data = None
|
| - for i in range(retries):
|
| + count = 0
|
| + while True:
|
| + count += 1
|
| # Retrieves data from URL.
|
| try:
|
| - data = urllib.urlopen(url)
|
| -
|
| - # If retrieval is successful, return the data.
|
| - if data:
|
| - return data.read()
|
| -
|
| - # If retrieval fails, try after sleep_time second.
|
| + if url.startswith('https://'):
|
| + return https.SendRequest(url)
|
| + else:
|
| + return urllib.urlopen(url).read()
|
| except IOError:
|
| - time.sleep(sleep_time)
|
| - continue
|
| + if count < retries:
|
| + # If retrieval fails, try after sleep_time second.
|
| + time.sleep(sleep_time)
|
| + else:
|
| + break
|
|
|
| # Return None if it fails to read data from URL 'retries' times.
|
| return None
|
|
|