mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-18 16:56:34 +00:00
Fix telnet
This commit is contained in:
parent
b50278a68b
commit
203c575d70
@ -85,7 +85,7 @@ void telnetAcceptClient()
|
|||||||
|
|
||||||
#if HASP_USE_HTTP > 0
|
#if HASP_USE_HTTP > 0
|
||||||
if(strlen(httpUser) != 0 || strlen(httpPassword) != 0) {
|
if(strlen(httpUser) != 0 || strlen(httpPassword) != 0) {
|
||||||
telnetClient.println(F("\r\n" D_TELNET_USERNAME " "));
|
telnetClient.println(F("\r\n" D_USERNAME " "));
|
||||||
telnetLoginState = TELNET_UNAUTHENTICATED;
|
telnetLoginState = TELNET_UNAUTHENTICATED;
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
@ -186,7 +186,7 @@ static inline void telnetProcessLine(const char * input)
|
|||||||
switch(telnetLoginState) {
|
switch(telnetLoginState) {
|
||||||
case TELNET_UNAUTHENTICATED: {
|
case TELNET_UNAUTHENTICATED: {
|
||||||
char buffer[20];
|
char buffer[20];
|
||||||
snprintf_P(buffer, sizeof(buffer), PSTR(D_TELNET_PASSWORD " %c%c%c\n"), 0xFF, 0xFB,
|
snprintf_P(buffer, sizeof(buffer), PSTR(D_PASSWORD " %c%c%c\n"), 0xFF, 0xFB,
|
||||||
0x01); // Hide characters
|
0x01); // Hide characters
|
||||||
telnetClient.print(buffer);
|
telnetClient.print(buffer);
|
||||||
#if HASP_USE_HTTP > 0
|
#if HASP_USE_HTTP > 0
|
||||||
@ -206,7 +206,7 @@ static inline void telnetProcessLine(const char * input)
|
|||||||
if(telnetLoginAttempt >= 3) {
|
if(telnetLoginAttempt >= 3) {
|
||||||
telnetClientDisconnect();
|
telnetClientDisconnect();
|
||||||
} else {
|
} else {
|
||||||
telnetClient.print(F(D_TELNET_USERNAME " "));
|
telnetClient.print(F(D_USERNAME " "));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@ -218,7 +218,7 @@ static inline void telnetProcessLine(const char * input)
|
|||||||
if(strcasecmp_P(input, PSTR("exit")) == 0) {
|
if(strcasecmp_P(input, PSTR("exit")) == 0) {
|
||||||
telnetClientDisconnect();
|
telnetClientDisconnect();
|
||||||
} else if(strcasecmp_P(input, PSTR("logoff")) == 0) {
|
} else if(strcasecmp_P(input, PSTR("logoff")) == 0) {
|
||||||
telnetClient.println(F("\r\n" D_TELNET_USERNAME " "));
|
telnetClient.println(F("\r\n" D_USERNAME " "));
|
||||||
telnetLoginState = TELNET_UNAUTHENTICATED;
|
telnetLoginState = TELNET_UNAUTHENTICATED;
|
||||||
} else {
|
} else {
|
||||||
dispatch_text_line(input);
|
dispatch_text_line(input);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user