Skip to content

Commit fb80499

Browse files
committed
Avoid potential race condition between close/drain events when piping
1 parent 936b259 commit fb80499

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/Stream.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ public function pause()
5050

5151
public function resume()
5252
{
53-
$this->loop->addReadStream($this->stream, array($this, 'handleData'));
53+
if ($this->readable) {
54+
$this->loop->addReadStream($this->stream, array($this, 'handleData'));
55+
}
5456
}
5557

5658
public function write($data)

0 commit comments

Comments
 (0)