mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-10 06:34:41 +02:00
* Fix bug causing asserts with many clients in telnet server
This commit is contained in:
parent
aea6782f8c
commit
2b963ce6f9
1 changed files with 7 additions and 9 deletions
|
@ -432,15 +432,16 @@ function TelnetClient(input, output) {
|
||||||
|
|
||||||
var i;
|
var i;
|
||||||
while((i = bufs.indexOf(IAC_BUF)) >= 0) {
|
while((i = bufs.indexOf(IAC_BUF)) >= 0) {
|
||||||
/*
|
|
||||||
if(bufs.length < (i + 1)) {
|
//
|
||||||
|
// Some clients will send even IAC separate from data
|
||||||
|
//
|
||||||
|
if(bufs.length <= (i + 1)) {
|
||||||
i = MORE_DATA_REQUIRED;
|
i = MORE_DATA_REQUIRED;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
// :TODO: Android client Irssi ConnectBot asserts here:
|
assert(bufs.length > (i + 1));
|
||||||
assert(bufs.length > (i + 1),
|
|
||||||
'bufs.length=' + bufs.length + ' i=' + i + ' bufs=' + require('../string_util.js').debugEscapedString(bufs.toBuffer()))
|
|
||||||
|
|
||||||
if(i > 0) {
|
if(i > 0) {
|
||||||
self.emit('data', bufs.splice(0, i).toBuffer());
|
self.emit('data', bufs.splice(0, i).toBuffer());
|
||||||
|
@ -451,9 +452,6 @@ function TelnetClient(input, output) {
|
||||||
if(MORE_DATA_REQUIRED === i) {
|
if(MORE_DATA_REQUIRED === i) {
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
//self.emit('event', i); // generic event
|
|
||||||
//self.emit(i.command, i); // "will", "wont", ...
|
|
||||||
|
|
||||||
if(i.option) {
|
if(i.option) {
|
||||||
self.emit(i.option, i); // "transmit binary", "echo", ...
|
self.emit(i.option, i); // "transmit binary", "echo", ...
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue