@@ -37,7 +37,7 @@ p.connect = function(port, host) {
3737 this . stream . on ( 'connect' , function ( ) {
3838 self . emit ( 'connect' ) ;
3939 } ) ;
40-
40+
4141 this . stream . on ( 'error' , function ( error ) {
4242 self . emit ( 'error' , error ) ;
4343 } ) ;
@@ -53,9 +53,9 @@ p.connect = function(port, host) {
5353 if ( msg . text == 0x53 ) {
5454 var tls = require ( 'tls' ) ;
5555 self . stream . removeAllListeners ( ) ;
56- self . stream = tls . connect ( {
57- socket : self . stream ,
58- servername : host ,
56+ self . stream = tls . connect ( {
57+ socket : self . stream ,
58+ servername : host ,
5959 rejectUnauthorized : self . ssl . rejectUnauthorized ,
6060 ca : self . ssl . ca ,
6161 pfx : self . ssl . pfx ,
@@ -67,9 +67,12 @@ p.connect = function(port, host) {
6767 self . attachListeners ( self . stream ) ;
6868 self . emit ( 'sslconnect' ) ;
6969 } else {
70- self . emit ( 'error' , new Error ( "The server doesn't support SSL/TLS connections." ) ) ;
70+ self . emit (
71+ 'error' ,
72+ new Error ( "The server doesn't support SSL/TLS connections." )
73+ ) ;
7174 }
72- } ) ;
75+ } ) ;
7376
7477 } else {
7578 this . attachListeners ( this . stream ) ;
@@ -91,13 +94,13 @@ p.attachListeners = function(stream) {
9194
9295p . requestSsl = function ( config ) {
9396 this . checkSslResponse = true ;
94-
97+
9598 var bodyBuffer = this . writer
9699 . addInt16 ( 0x04D2 )
97100 . addInt16 ( 0x162F ) . flush ( ) ;
98-
101+
99102 var length = bodyBuffer . length + 4 ;
100-
103+
101104 var buffer = new Writer ( )
102105 . addInt32 ( length )
103106 . add ( bodyBuffer )
@@ -247,7 +250,7 @@ p.flush = function() {
247250p . sync = function ( ) {
248251 //clear out any pending data in the writer
249252 this . writer . flush ( 0 ) ;
250-
253+
251254 this . writer . add ( emptyBuffer ) ;
252255 this . _send ( 0x53 ) ;
253256} ;
@@ -391,7 +394,7 @@ p.parseMessage = function() {
391394
392395 case 0x48 : //H
393396 msg . name = 'copyOutResponse' ;
394- return this . parseGH ( msg ) ;
397+ return this . parseGH ( msg ) ;
395398 case 0x63 : //c
396399 msg . name = 'copyDone' ;
397400 return msg ;
@@ -540,7 +543,7 @@ p.parseGH = function (msg) {
540543 return msg ;
541544} ;
542545p . parseInt8 = function ( ) {
543- var value = Number ( this . buffer [ this . offset ] ) ;
546+ var value = Number ( this . buffer [ this . offset ] ) ;
544547 this . offset ++ ;
545548 return value ;
546549} ;
@@ -570,7 +573,8 @@ p.parseInt16 = function() {
570573} ;
571574
572575p . readString = function ( length ) {
573- return this . buffer . toString ( this . encoding , this . offset , ( this . offset += length ) ) ;
576+ return this . buffer . toString ( this . encoding , this . offset ,
577+ ( this . offset += length ) ) ;
574578} ;
575579
576580p . readBytes = function ( length ) {
@@ -585,7 +589,7 @@ p.parseCString = function() {
585589p . parsed = function ( msg ) {
586590 //exclude length field
587591 msg . chunk = this . readBytes ( msg . length - 4 ) ;
588- return msg ;
592+ return msg ;
589593} ;
590594//end parsing methods
591595module . exports = Connection ;
0 commit comments