Philipp Hörist pushed to branch master at gajim / gajim
Commits:
-
6ed04e2d
by Philipp Hörist at 2018-05-17T21:13:37+02:00
1 changed file:
Changes:
| ... | ... | @@ -49,12 +49,6 @@ from string import Template |
| 49 | 49 |
from urllib.request import urlopen
|
| 50 | 50 |
from urllib.error import URLError
|
| 51 | 51 |
|
| 52 |
-try:
|
|
| 53 |
- randomsource = random.SystemRandom()
|
|
| 54 |
-except Exception:
|
|
| 55 |
- randomsource = random.Random()
|
|
| 56 |
- randomsource.seed()
|
|
| 57 |
- |
|
| 58 | 52 |
if os.name == 'nt':
|
| 59 | 53 |
import certifi
|
| 60 | 54 |
import OpenSSL.crypto
|
| ... | ... | @@ -805,7 +799,7 @@ class Connection(CommonConnection, ConnectionHandlers): |
| 805 | 799 |
# do exponential backoff until less than 5 minutes
|
| 806 | 800 |
if self.retrycount < 2 or self.last_time_to_reconnect is None:
|
| 807 | 801 |
self.last_time_to_reconnect = 5
|
| 808 |
- self.last_time_to_reconnect += randomsource.randint(0, 5)
|
|
| 802 |
+ self.last_time_to_reconnect += random.randint(0, 5)
|
|
| 809 | 803 |
if self.last_time_to_reconnect < 200:
|
| 810 | 804 |
self.last_time_to_reconnect *= 1.5
|
| 811 | 805 |
self.time_to_reconnect = int(self.last_time_to_reconnect)
|