File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -78,8 +78,9 @@ export default class Connection extends EventEmitter {
7878 return this ;
7979 }
8080
81- public write ( data : Buffer , callback ?: ( err ?: Error ) => void ) : boolean {
82- return this . socket . write ( dump ( data ) , callback ) ;
81+ public write ( data : Buffer , callback ?: ( err ?: Error ) => void ) : this {
82+ this . socket . write ( dump ( data ) , callback ) ;
83+ return this ;
8384 }
8485
8586 public startServer ( ) : Bluebird < ChildProcess > {
Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ export default class Sync extends EventEmitter {
191191 if ( ! this . connection . socket . writableNeedDrain && ( chunk = stream . read ( DATA_MAX_LENGTH ) || stream . read ( ) ) ) {
192192 this . _sendCommandWithLength ( Protocol . DATA , chunk . length ) ;
193193 transfer . push ( chunk . length ) ;
194- if ( this . connection . write ( chunk , track ) ) {
194+ if ( ! this . connection . write ( chunk , track ) . socket . writableNeedDrain ) {
195195 return writeNext ( ) ;
196196 } else {
197197 return waitForDrain ( ) . then ( writeNext ) ;
You can’t perform that action at this time.
0 commit comments