Browse Source

Skip first garbage message in telnet module

i18n
Xose Pérez 7 years ago
parent
commit
d69d6bfd54
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      code/espurna/telnet.ino

+ 7
- 0
code/espurna/telnet.ino View File

@ -49,6 +49,13 @@ unsigned char _telnetWrite(void *data, size_t len) {
void _telnetData(unsigned char clientId, void *data, size_t len) {
// Skip first message since it's always garbage
static bool first = true;
if (first) {
first = false;
return;
}
// Capture close connection
char * p = (char *) data;
if ((strncmp(p, "close", 5) == 0) || (strncmp(p, "quit", 4) == 0)) {


Loading…
Cancel
Save