diff --git a/src/Connection/Http2Connection.php b/src/Connection/Http2Connection.php index b2870e24..30694713 100644 --- a/src/Connection/Http2Connection.php +++ b/src/Connection/Http2Connection.php @@ -919,9 +919,8 @@ private function parser(): \Generator $error = \unpack("N", $buffer)[1]; if (isset($this->streams[$id])) { - $stream = $this->streams[$id]; $exception = new Http2StreamException("Stream closed by server", $id, $error); - if ($error === self::REFUSED_STREAM && $stream->request !== null) { + if ($error === self::REFUSED_STREAM) { $exception = new UnprocessedRequestException($exception); } $this->releaseStream($id, $exception); @@ -1463,7 +1462,7 @@ private function shutdown(?int $lastId = null, ?\Throwable $reason = null): Prom $reason = $exception = $reason ?? new SocketException("Connection closed"); foreach ($this->streams as $id => $stream) { $exception = $reason; - if ($id > $lastId && $stream->request !== null) { + if ($id > $lastId) { $exception = new UnprocessedRequestException($reason); }