Skip to content

Commit 90799fd

Browse files
authored
Update reapi.py
1 parent 2872a0f commit 90799fd

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/reapi.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# tls-scan - lib: REST API
33
# https://github.com/ArtiomL/tls-scan
44
# Artiom Lichtenstein
5-
# v0.0.3, 13/11/2016
5+
# v0.0.4, 14/11/2016
66

77
import json
88
import log
@@ -11,7 +11,7 @@
1111

1212
__author__ = 'Artiom Lichtenstein'
1313
__license__ = 'MIT'
14-
__version__ = '0.0.3'
14+
__version__ = '0.0.4'
1515

1616
# SSL Labs REST API
1717
class clsSAPI(object):
@@ -35,8 +35,10 @@ def funAnalyze(self, strHost):
3535
while True:
3636
try:
3737
objHResp = self.objHS.get(self.strAPIE + self.strAnalyze + strHost + self.strAnStNew)
38-
if objHResp.status_code == 429:
39-
# Request rate too high
38+
if objHResp.status_code in [429, 503, 529]:
39+
# 429 - client request rate too high or too many new assessments too fast
40+
# 503 - the service is not available (e.g. down for maintenance)
41+
# 529 - the service is overloaded
4042
intSleep += 1
4143
log.funLog(2, 'Request rate too high! Sleeping for %s seconds.' % str(intSleep))
4244
time.sleep(intSleep)

0 commit comments

Comments
 (0)