Reconsidered the logic

pull/123/head
Hieromon Ikasamo 6 years ago
parent 379298091f
commit d2eac80930
  1. 15
      src/AutoConnectUpdate.cpp

@ -525,10 +525,10 @@ void AutoConnectUpdateAct::_progress(void) {
switch (_webServer->method()) { switch (_webServer->method()) {
case HTTP_POST: case HTTP_POST:
if (_webServer->hasArg(reqOperation)) {
reqOperand = _webServer->arg(reqOperation); reqOperand = _webServer->arg(reqOperation);
switch (_status) {
case UPDATE_IDLE:
if (reqOperand == String(UPDATE_NOTIFY_START)) { if (reqOperand == String(UPDATE_NOTIFY_START)) {
if (_status == UPDATE_IDLE) {
httpCode = 200; httpCode = 200;
_status = UPDATE_START; _status = UPDATE_START;
} }
@ -536,9 +536,9 @@ void AutoConnectUpdateAct::_progress(void) {
payload = String(FPSTR(reply_msg_seq)); payload = String(FPSTR(reply_msg_seq));
httpCode = 500; httpCode = 500;
} }
} break;
else if (reqOperand == String(UPDATE_NOTIFY_REBOOT)) { case UPDATE_SUCCESS:
if (_status == UPDATE_SUCCESS) { if (reqOperand == String(UPDATE_NOTIFY_REBOOT)) {
_status = UPDATE_RESET; _status = UPDATE_RESET;
httpCode = 200; httpCode = 200;
} }
@ -546,9 +546,8 @@ void AutoConnectUpdateAct::_progress(void) {
payload = String(FPSTR(reply_msg_seq)); payload = String(FPSTR(reply_msg_seq));
httpCode = 500; httpCode = 500;
} }
} break;
} default:
else {
payload = String(FPSTR(reply_msg_op)); payload = String(FPSTR(reply_msg_op));
httpCode = 500; httpCode = 500;
} }

Loading…
Cancel
Save