File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -20,10 +20,10 @@ class DuplexSocket extends Duplex {
20
20
}
21
21
22
22
_write ( chunk , encoding , callback ) {
23
- this [ kOtherSide ] . push ( chunk ) ;
24
- if ( ! this [ kOtherSide ] . readableLength ) {
23
+ if ( chunk . length === 0 ) {
25
24
process . nextTick ( callback ) ;
26
25
} else {
26
+ this [ kOtherSide ] . push ( chunk ) ;
27
27
this [ kOtherSide ] [ kCallback ] = callback ;
28
28
}
29
29
}
Original file line number Diff line number Diff line change @@ -24,10 +24,10 @@ class DuplexSocket extends Duplex {
24
24
_write ( chunk , encoding , callback ) {
25
25
assert . notStrictEqual ( this [ kOtherSide ] , null ) ;
26
26
assert . strictEqual ( this [ kOtherSide ] [ kCallback ] , null ) ;
27
- this [ kOtherSide ] . push ( chunk ) ;
28
- if ( ! this [ kOtherSide ] . readableLength ) {
27
+ if ( chunk . length === 0 ) {
29
28
process . nextTick ( callback ) ;
30
29
} else {
30
+ this [ kOtherSide ] . push ( chunk ) ;
31
31
this [ kOtherSide ] [ kCallback ] = callback ;
32
32
}
33
33
}
You can’t perform that action at this time.
0 commit comments