Skip to content

Commit

Permalink
Fix telnet
Browse files Browse the repository at this point in the history
  • Loading branch information
fvanroie committed Feb 22, 2021
1 parent b50278a commit 203c575
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/svc/hasp_telnet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void telnetAcceptClient()

#if HASP_USE_HTTP > 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;
} else
#endif
Expand Down Expand Up @@ -186,7 +186,7 @@ static inline void telnetProcessLine(const char * input)
switch(telnetLoginState) {
case TELNET_UNAUTHENTICATED: {
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
telnetClient.print(buffer);
#if HASP_USE_HTTP > 0
Expand All @@ -206,7 +206,7 @@ static inline void telnetProcessLine(const char * input)
if(telnetLoginAttempt >= 3) {
telnetClientDisconnect();
} else {
telnetClient.print(F(D_TELNET_USERNAME " "));
telnetClient.print(F(D_USERNAME " "));
}
}
#else
Expand All @@ -218,7 +218,7 @@ static inline void telnetProcessLine(const char * input)
if(strcasecmp_P(input, PSTR("exit")) == 0) {
telnetClientDisconnect();
} 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;
} else {
dispatch_text_line(input);
Expand Down

0 comments on commit 203c575

Please sign in to comment.