Fix WONT/DONT cycle seen with EtherTerm

This commit is contained in:
Bryan Ashby 2017-09-01 17:42:20 -06:00
parent dd2d7c1b30
commit 3c40cb0766
1 changed files with 9 additions and 1 deletions

View File

@ -439,6 +439,8 @@ function TelnetClient(input, output) {
let bufs = buffers();
this.bufs = bufs;
this.sentDont = {}; // DON'T's we've already sent
this.setInputOutput(input, output);
this.negotiationsComplete = false; // are we in the 'negotiation' phase?
@ -579,7 +581,13 @@ TelnetClient.prototype.handleWillCommand = function(evt) {
};
TelnetClient.prototype.handleWontCommand = function(evt) {
if('new environment' === evt.option) {
if(this.sentDont[evt.option]) {
return this.connectionTrace(evt, 'WONT - DON\'T already sent');
}
this.sentDont[evt.option] = true;
if('new environment' === evt.option) {
this.dont.new_environment();
} else {
this.connectionTrace(evt, 'WONT');