diff --git a/src/Io/CloseProtectionStream.php b/src/Io/CloseProtectionStream.php index 2e1ed6e4..91c38aaa 100644 --- a/src/Io/CloseProtectionStream.php +++ b/src/Io/CloseProtectionStream.php @@ -80,11 +80,7 @@ public function close() $this->input->removeListener('end', array($this, 'handleEnd')); $this->input->removeListener('close', array($this, 'close')); - // resume the stream to ensure we discard everything from incoming connection - if ($this->paused) { - $this->paused = false; - $this->input->resume(); - } + $this->close(); $this->emit('close'); $this->removeAllListeners(); diff --git a/tests/Io/CloseProtectionStreamTest.php b/tests/Io/CloseProtectionStreamTest.php index 8490daff..80c0c719 100644 --- a/tests/Io/CloseProtectionStreamTest.php +++ b/tests/Io/CloseProtectionStreamTest.php @@ -48,7 +48,7 @@ public function testCloseResumesInputStreamIfItWasPreviouslyPaused() { $input = $this->getMockBuilder('React\Stream\ReadableStreamInterface')->getMock(); $input->expects($this->once())->method('pause'); - $input->expects($this->once())->method('resume'); + $input->expects($this->never())->method('resume'); $protection = new CloseProtectionStream($input); $protection->pause();