From 3c40cb07666db839153a801e6677c0f796a629ce Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Fri, 1 Sep 2017 17:42:20 -0600 Subject: [PATCH] Fix WONT/DONT cycle seen with EtherTerm --- core/servers/login/telnet.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/servers/login/telnet.js b/core/servers/login/telnet.js index 501d9408..4377f029 100644 --- a/core/servers/login/telnet.js +++ b/core/servers/login/telnet.js @@ -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');