Fix API command 'shutdown'

python3android
Dmitri Bogomolov 3 years ago
parent ae76d369f2
commit 9992626438
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13
  1. 9
      src/api.py

@ -204,6 +204,10 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
self.wfile.flush()
self.connection.shutdown(1)
# actually handle shutdown command after sending response
if state.shutdown is False:
shutdown.doCleanShutdown()
def APIAuthenticateClient(self):
"""Predicate to check for valid API credentials in the request header"""
@ -1386,10 +1390,11 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
return None
def HandleShutdown(self, params):
"""Handle a request to huutdown the client"""
"""Handle a request to shutdown the node"""
if not params:
shutdown.doCleanShutdown()
# backward compatible trick because False == 0 is True
state.shutdown = False
return 'done'
return None

Loading…
Cancel
Save