so->log('debug',sprintf('%s:+ Session Char [%02x] (%c)',self::LOGKEY,ord($read),$read),['complete'=>$this->complete,'option'=>$this->option]); switch (ord($read)) { // Command being sent. case self::TCP_IAC: $this->complete = FALSE; $this->note = 'IAC '; break; case self::TCP_SB: $this->option = TRUE; break; case self::TCP_SE: $this->option = FALSE; $this->complete = TRUE; $this->so->log('debug',sprintf('%s:%% Session Terminal: %s',self::LOGKEY,$this->terminal)); break; case self::TCP_DO: $this->note .= 'DO '; break; case self::TCP_WILL: $this->note .= 'WILL '; break; case self::TCP_WONT: $this->note .= 'WONT '; break; case self::TCP_OPT_TERMTYPE: break; case self::TCP_OPT_ECHO: $this->note .= 'ECHO'; $this->complete = TRUE; $this->so->log('debug',sprintf('%s:%% Session Note: [%s]',self::LOGKEY,$this->note)); break; case self::TCP_OPT_SUP_GOAHEAD: $this->note .= 'SUPPRESS GO AHEAD'; $this->complete = TRUE; $this->so->log('debug',sprintf('%s:%% Session Note: [%s]',self::LOGKEY,$this->note)); break; case self::TCP_OPT_WINDOWSIZE: $this->note .= 'WINDOWSIZE'; $this->complete = TRUE; $this->so->log('debug',sprintf('%s:%% Session Note: [%s]',self::LOGKEY,$this->note)); break; default: if ($this->option && $read) $this->terminal .= $read; else $this->so->log('debug',sprintf('%s:= Unhandled char in session_init: [%02x] (%c)',self::LOGKEY,ord($read),$read)); } if ($this->complete) $this->so->log('debug',sprintf('%s:= TELNET control COMPLETE',self::LOGKEY)); return ''; } }