mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-26 20:56:37 +00:00
Fix telnet bug
This commit is contained in:
parent
dbef094f01
commit
c51e5e98bb
@ -43,8 +43,8 @@ void telnetClientDisconnect()
|
|||||||
Log.unregisterOutput(1); // telnetClient
|
Log.unregisterOutput(1); // telnetClient
|
||||||
telnetLoginState = TELNET_UNAUTHENTICATED;
|
telnetLoginState = TELNET_UNAUTHENTICATED;
|
||||||
telnetLoginAttempt = 0; // Initial attempt
|
telnetLoginAttempt = 0; // Initial attempt
|
||||||
delete telnetConsole;
|
// delete telnetConsole;
|
||||||
telnetConsole = NULL;
|
// telnetConsole = NULL;
|
||||||
telnetClient.stop();
|
telnetClient.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -295,10 +295,12 @@ void IRAM_ATTR telnetLoop()
|
|||||||
Log.warning(TAG_TELN, F("Rejecting client, another connection is already active"));
|
Log.warning(TAG_TELN, F("Rejecting client, another connection is already active"));
|
||||||
telnetServer->available().stop(); // already have a client, block new connections
|
telnetServer->available().stop(); // already have a client, block new connections
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
#endif
|
if(!telnetClient.connected() && telnetLoginState != TELNET_UNAUTHENTICATED) {
|
||||||
|
telnetClientDisconnect(); // active client disconnected
|
||||||
|
} else {
|
||||||
|
|
||||||
/* Process user input */
|
/* Active Client: Process user input */
|
||||||
if(telnetConsole) {
|
if(telnetConsole) {
|
||||||
int16_t keypress = telnetConsole->readKey();
|
int16_t keypress = telnetConsole->readKey();
|
||||||
switch(keypress) {
|
switch(keypress) {
|
||||||
@ -306,6 +308,10 @@ void IRAM_ATTR telnetLoop()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool telnetGetConfig(const JsonObject & settings)
|
bool telnetGetConfig(const JsonObject & settings)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user