@@ -754,23 +754,13 @@ Socket.prototype._writeGeneric = function(writev, data, encoding, cb) {
754
754
return false ;
755
755
}
756
756
757
- var ret ;
758
757
var req = createWriteWrap ( this . _handle , afterWrite ) ;
759
758
if ( writev )
760
- ret = writevGeneric ( this , req , data , cb ) ;
759
+ writevGeneric ( this , req , data , cb ) ;
761
760
else
762
- ret = writeGeneric ( this , req , data , encoding , cb ) ;
763
-
764
- // Bail out if handle.write* returned an error
765
- if ( ret ) return ret ;
766
-
767
- if ( ! req . async ) {
768
- cb ( ) ;
769
- return ;
770
- }
771
-
772
- req . cb = cb ;
773
- this [ kLastWriteQueueSize ] = req . bytes ;
761
+ writeGeneric ( this , req , data , encoding , cb ) ;
762
+ if ( req . async )
763
+ this [ kLastWriteQueueSize ] = req . bytes ;
774
764
} ;
775
765
776
766
@@ -845,7 +835,7 @@ function afterWrite(status, handle, err) {
845
835
if ( status < 0 ) {
846
836
var ex = errnoException ( status , 'write' , this . error ) ;
847
837
debug ( 'write failure' , ex ) ;
848
- self . destroy ( ex , this . cb ) ;
838
+ self . destroy ( ex , this . callback ) ;
849
839
return ;
850
840
}
851
841
@@ -854,8 +844,8 @@ function afterWrite(status, handle, err) {
854
844
if ( self !== process . stderr && self !== process . stdout )
855
845
debug ( 'afterWrite call cb' ) ;
856
846
857
- if ( this . cb )
858
- this . cb . call ( undefined ) ;
847
+ if ( this . callback )
848
+ this . callback . call ( undefined ) ;
859
849
}
860
850
861
851
0 commit comments