diff options
| author | Franklin Wei <git@fwei.tk> | 2016-01-24 16:58:59 -0500 |
|---|---|---|
| committer | Franklin Wei <git@fwei.tk> | 2016-01-24 16:58:59 -0500 |
| commit | b346e948cb167c18efc33f32f0e7cfb21050fc96 (patch) | |
| tree | 2a6989023690021c15999ce8fc3fefdca3ab7d83 /src/telnet.c | |
| parent | e2c2a9878a0fb55923fbd77db1f73085013aa36c (diff) | |
| download | netcosm-b346e948cb167c18efc33f32f0e7cfb21050fc96.zip netcosm-b346e948cb167c18efc33f32f0e7cfb21050fc96.tar.gz netcosm-b346e948cb167c18efc33f32f0e7cfb21050fc96.tar.bz2 netcosm-b346e948cb167c18efc33f32f0e7cfb21050fc96.tar.xz | |
objects partially implemented, fixes some bugs
Diffstat (limited to 'src/telnet.c')
| -rw-r--r-- | src/telnet.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/src/telnet.c b/src/telnet.c index a28752a..743eb53 100644 --- a/src/telnet.c +++ b/src/telnet.c @@ -42,8 +42,6 @@ enum telnet_status telnet_parse_data(const unsigned char *buf, size_t buflen) bool in_sb = false; bool line_done = false; - debugf("telnet: "); - for(unsigned i = 0; i < buflen; ++i) { unsigned char c = buf[i]; @@ -51,16 +49,12 @@ enum telnet_status telnet_parse_data(const unsigned char *buf, size_t buflen) if(c == IAC) iac = true; else if(c == '\n' || c == '\r') - { - debugf("found newline, done reading.\n"); line_done = true; - } if(iac) { if(TELCMD_OK(c)) { - debugf("%s ", TELCMD(c)); found_cmd = true; switch(c) { @@ -78,7 +72,7 @@ enum telnet_status telnet_parse_data(const unsigned char *buf, size_t buflen) while(j < 4 && i < buflen) { bytes[j++] = buf[++i]; - debugf("%d ", buf[j - 1]); + //debugf("%d ", buf[j - 1]); if(bytes[j - 1] == 255) /* 255 is doubled to distinguish from IAC */ { ++i; @@ -94,13 +88,8 @@ enum telnet_status telnet_parse_data(const unsigned char *buf, size_t buflen) continue; } } - debugf("%d ", c); } - debugf("\n"); - if(found_cmd) - debugf("telnet: is NOT data\n"); - return found_cmd ? TELNET_FOUNDCMD : (line_done ? TELNET_LINEOVER : TELNET_DATA); } |