D901 #2
5 changed files with 268 additions and 269 deletions
|
|
@ -100,8 +100,6 @@ class ConfServer():
|
||||||
#Direct register from app:
|
#Direct register from app:
|
||||||
#/{apiversion}/private/{country}/{language}/{devid}/{apptype}/{appversion}/{devtype}/{aid}/user/directRegister
|
#/{apiversion}/private/{country}/{language}/{devid}/{apptype}/{appversion}/{devtype}/{aid}/user/directRegister
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
runner = web.AppRunner(app)
|
runner = web.AppRunner(app)
|
||||||
await runner.setup()
|
await runner.setup()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -312,11 +312,11 @@ class BumperMQTTServer_Plugin:
|
||||||
else:
|
else:
|
||||||
authenticated = False
|
authenticated = False
|
||||||
|
|
||||||
except KeyError:
|
except Exception as e:
|
||||||
self.context.logger.warning("Session information not available")
|
mqttserverlog.exception('{}'.format(e))
|
||||||
authenticated = False
|
authenticated = False
|
||||||
return authenticated
|
|
||||||
|
|
||||||
|
return authenticated
|
||||||
|
|
||||||
async def on_broker_client_connected(self, client_id):
|
async def on_broker_client_connected(self, client_id):
|
||||||
try:
|
try:
|
||||||
|
|
@ -328,7 +328,7 @@ class BumperMQTTServer_Plugin:
|
||||||
for bot in bumper_bots:
|
for bot in bumper_bots:
|
||||||
if didsplit[0] == bot.did:
|
if didsplit[0] == bot.did:
|
||||||
bot.mqtt_connection = True
|
bot.mqtt_connection = True
|
||||||
#mqttserverlog.info("bot connected {}".format(bot.did))
|
mqttserverlog.debug("bot connected {}".format(bot.did))
|
||||||
self.bumper_config['bumper_bots'].set(bumper_bots)
|
self.bumper_config['bumper_bots'].set(bumper_bots)
|
||||||
|
|
||||||
for client in bumper_clients:
|
for client in bumper_clients:
|
||||||
|
|
@ -351,7 +351,7 @@ class BumperMQTTServer_Plugin:
|
||||||
for bot in bumper_bots:
|
for bot in bumper_bots:
|
||||||
if didsplit[0] == bot.did:
|
if didsplit[0] == bot.did:
|
||||||
bot.mqtt_connection = False
|
bot.mqtt_connection = False
|
||||||
#mqttserverlog.info("bot disconnected {}".format(bot.did))
|
mqttserverlog.debug("bot disconnected {}".format(bot.did))
|
||||||
self.bumper_config['bumper_bots'].set(bumper_bots)
|
self.bumper_config['bumper_bots'].set(bumper_bots)
|
||||||
|
|
||||||
for client in bumper_clients:
|
for client in bumper_clients:
|
||||||
|
|
|
||||||
|
|
@ -536,7 +536,8 @@ class Client(threading.Thread):
|
||||||
if self.state == self.CONNECT or self.state == self.INIT:
|
if self.state == self.CONNECT or self.state == self.INIT:
|
||||||
self._handle_connect(data)
|
self._handle_connect(data)
|
||||||
else:
|
else:
|
||||||
xmppserverlog.error('xml parse error - {} - {}'.format(data.decode('utf-8'), e))
|
if not (data.decode('utf-8') == "" or data.decode('utf-8') == " "):
|
||||||
|
xmppserverlog.error('xml parse error - {} - {}'.format(data.decode('utf-8'), e))
|
||||||
|
|
||||||
elif "not well-formed (invalid token)" in e.msg:
|
elif "not well-formed (invalid token)" in e.msg:
|
||||||
#If a lone </stream:stream> - client is signalling end of session/disconnect
|
#If a lone </stream:stream> - client is signalling end of session/disconnect
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue