Commit 38c3d94f authored by Ziirish's avatar Ziirish

prevent burp-ui from crashing when monitor is not ready (fix #318)

parent fa6d987d
Pipeline #1671 failed with stages
in 7 minutes and 13 seconds
This diff is collapsed.
......@@ -115,7 +115,7 @@ class MonitorPool:
self.burpbin = self.conf.safe_get('burpbin', section='Burp')
self.bconfcli = self.conf.safe_get('bconfcli', section='Burp')
self.timeout = self.conf.safe_get('timeout', 'integer', section='Burp')
self.timeout = self.conf.safe_get('timeout', 'integer', section='Burp', defaults=15)
self.conf.setdefault('BUI_MONITOR', True)
......
......@@ -58,7 +58,7 @@ class BUIbackend(object, metaclass=ABCMeta):
self.host = G_BURPHOST
self.port = G_BURPPORT
self.burpbin = G_BURPBIN
self.stripbin = G_STRIPBIN
self.stripbin = G_STRIPBIN2
self.burpconfcli = G_BURPCONFCLI
self.burpconfsrv = G_BURPCONFSRV
self.includes = G_INCLUDES
......@@ -70,7 +70,7 @@ class BUIbackend(object, metaclass=ABCMeta):
'bport': G_BURPPORT,
'bhost': G_BURPHOST,
'burpbin': G_BURPBIN,
'stripbin': G_STRIPBIN,
'stripbin': G_STRIPBIN2,
'bconfcli': G_BURPCONFCLI,
'bconfsrv': G_BURPCONFSRV,
'timeout': G_TIMEOUT,
......@@ -91,7 +91,7 @@ class BUIbackend(object, metaclass=ABCMeta):
'enforce': G_ENFORCE,
},
}
self.defaults['Burp2']['stripbin'] = G_STRIPBIN2
self.defaults['Burp1']['stripbin'] = G_STRIPBIN
tmpdir = G_TMPDIR
if conf is not None:
conf.update_defaults(self.defaults)
......@@ -116,9 +116,9 @@ class BUIbackend(object, metaclass=ABCMeta):
G_BURPBIN,
sect=section
)
STRIPBIN_DEFAULT = G_STRIPBIN
if self._vers == 2:
STRIPBIN_DEFAULT = G_STRIPBIN2
STRIPBIN_DEFAULT = G_STRIPBIN2
if self._vers == 1:
STRIPBIN_DEFAULT = G_STRIPBIN
self.stripbin = self._get_binary_path(
conf,
'stripbin',
......
......@@ -238,11 +238,14 @@ class Burp(Burp2):
exc = eee
time.sleep(1)
else:
self.logger.error('monitor not ready, giving up!')
raise exc
stats = self.statistics()
if 'alive' in stats and stats['alive']:
self.init_all()
self.logger.error(f'monitor not ready, giving up!: {exc}')
try:
stats = self.statistics()
if 'alive' in stats and stats['alive']:
self.init_all()
except BUIserverException:
pass
def init_all(self):
self._ready = True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment