diff options
author | Alvaro Neira Ayuso <aneira@soleta.eu> | 2019-12-27 14:51:05 +0100 |
---|---|---|
committer | Alvaro Neira Ayuso <alvaroneay@gmail.com> | 2020-01-19 19:50:44 +0100 |
commit | d065e1998d4ff5cb5b5b79489032989b98936245 (patch) | |
tree | 9e6b723a29a8f1e8d20fb352110e62e008d543e4 | |
parent | db7cc0d99ef9f582a79d0ce28c0438085ee98839 (diff) |
Execute command received using Threads
Now we are blocking the execution when we apply a command sent from the server.
This behavior is unacceptable for our client.
-rw-r--r-- | src/ogRest.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ogRest.py b/src/ogRest.py index cec6aa8..60a33b0 100644 --- a/src/ogRest.py +++ b/src/ogRest.py @@ -86,11 +86,15 @@ class ogRest(): client.send(self.getResponse(ogResponses.OK)) def process_shellrun(self, client, cmd): + # Executing cmd thread + def execcmd(msgqueue): + msgqueue.put(ogOperations.execCMD(cmd)) + if cmd == None: client.send(self.getResponse(ogResponses.BAD_REQUEST)) return - self.msgqueue.put(ogOperations.execCMD(cmd)) + threading.Thread(target=execcmd, args=(self.msgqueue,)).start() client.send(self.getResponse(ogResponses.IN_PROGRESS)) def process_shellout(self, client): |