File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -78,9 +78,8 @@ export default class Connection extends EventEmitter {
7878 return this ;
7979 }
8080
81- public write ( data : Buffer , callback ?: ( err ?: Error ) => void ) : this {
82- this . socket . write ( dump ( data ) , callback ) ;
83- return this ;
81+ public write ( data : Buffer , callback ?: ( err ?: Error ) => void ) : boolean {
82+ return this . socket . write ( dump ( data ) , callback ) ;
8483 }
8584
8685 public startServer ( ) : Bluebird < ChildProcess > {
Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ export default class Sync extends EventEmitter {
188188 const track = ( ) => transfer . pop ( ) ;
189189 const writeNext = ( ) => {
190190 let chunk : Buffer ;
191- if ( ( chunk = stream . read ( DATA_MAX_LENGTH ) || stream . read ( ) ) ) {
191+ 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 ) ;
194194 if ( this . connection . write ( chunk , track ) ) {
You can’t perform that action at this time.
0 commit comments