File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -560,7 +560,7 @@ server = doServer(tlsOptions,function(socket) {
560
560
connections [ this . hash ] . connected = false ;
561
561
connections [ this . hash ] . write ( "AWAY :jbnc\n" ) ;
562
562
if ( BOUNCER_TIMEOUT != 0 && BOUNCER_TIMEOUT != null ) {
563
- connections [ this . hash ] . gone = setTimeout ( function ( x ) { connections [ x ] . end ( ) ; } , BOUNCER_TIMEOUT * 1000 , this . hash ) ;
563
+ connections [ this . hash ] . gone = setTimeout ( function ( x ) { connections [ x ] . end ( ) ; delete connections [ x ] ; } , BOUNCER_TIMEOUT * 1000 , this . hash ) ;
564
564
}
565
565
}
566
566
}
@@ -748,13 +748,17 @@ function clientConnect(socket) {
748
748
console . log ( "Connection created." ) ;
749
749
} ) ;
750
750
connection . on ( 'data' , function ( d ) {
751
- if ( d . toString ( ) . substr ( d . length - 1 ) != "\n" )
752
- this . _buffer += d . toString ( ) ;
753
- else {
754
- _d = this . _buffer + d . toString ( ) ;
755
- this . _buffer = '' ;
756
- lines = _d . split ( "\n" ) ;
757
- for ( n = 0 ; n < lines . length ; n ++ ) {
751
+ _d = this . _buffer + d . toString ( ) ;
752
+ let lines = _d . toString ( ) . split ( '\n' ) ;
753
+ if ( lines [ lines . length - 1 ] !== '' ) {
754
+ this . _buffer = lines . pop ( ) ;
755
+ } else {
756
+ lines . pop ( ) ;
757
+ this . _buffer = '' ;
758
+ }
759
+
760
+ if ( true ) {
761
+ for ( let n = 0 ; n < lines . length ; n ++ ) {
758
762
if ( DEBUG )
759
763
console . log ( "> " + lines [ n ] ) ;
760
764
data = lines [ n ] . trim ( ) . split ( " " ) ;
You can’t perform that action at this time.
0 commit comments