mirror of https://git.48k.eu/ogclient
#1000 ogRest: set idle state after processing bad request
Before this patch the ogRest would hang indifinitely in a BUSY state when a bad request was received. Fix this by returning ogRest state to IDLE once the corresponding bad request response has been sent. This accounts for the following cases: - Unknown GET action - Unknown POST action - Unknown HTTP verbmore_events
parent
a11224d6f5
commit
f8e566bf63
|
@ -300,6 +300,7 @@ class ogRest():
|
|||
f'{method[:ogRest.LOG_LENGTH]}')
|
||||
response = restResponse(ogResponses.BAD_REQUEST)
|
||||
client.send(response.get())
|
||||
self.state = ThreadState.IDLE
|
||||
elif ("POST" in method):
|
||||
if ("poweroff" in URI):
|
||||
self.process_poweroff(client)
|
||||
|
@ -327,9 +328,11 @@ class ogRest():
|
|||
f'{method[:ogRest.LOG_LENGTH]}')
|
||||
response = restResponse(ogResponses.BAD_REQUEST)
|
||||
client.send(response.get())
|
||||
self.state = ThreadState.IDLE
|
||||
else:
|
||||
response = restResponse(ogResponses.BAD_REQUEST)
|
||||
client.send(response.get())
|
||||
self.state = ThreadState.IDLE
|
||||
|
||||
return 0
|
||||
|
||||
|
|
Loading…
Reference in New Issue