#999 Fix ogClient session command

Disconnect gracefully from ogServer after booting OS, the script to start the
OS calls kexec, so everything is gone after it. For Windows, this results in a
reboot.

This commit also improves the disconnect function to make sure the
disconnection is synchronous.
more_events
Javier Sánchez Parra 2020-08-21 14:38:57 +02:00 committed by OpenGnSys Support Team
parent de129f7449
commit 0593119352
2 changed files with 2 additions and 1 deletions

View File

@ -119,6 +119,7 @@ class ogClient:
def disconnect(self): def disconnect(self):
self.state = State.FORCE_DISCONNECTED self.state = State.FORCE_DISCONNECTED
self.sock.shutdown(socket.SHUT_RDWR)
self.sock.close() self.sock.close()
def run(self): def run(self):

View File

@ -120,7 +120,7 @@ class ogThread():
response = restResponse(ogResponses.OK) response = restResponse(ogResponses.OK)
client.send(response.get()) client.send(response.get())
ogRest.state = ThreadState.IDLE client.disconnect()
def software(client, request, path, ogRest): def software(client, request, path, ogRest):
try: try: