From e7c4757f7ef31e256e1d90769c2d4248962399a9 Mon Sep 17 00:00:00 2001 From: Xxx-Bin Date: Sat, 3 Jun 2023 16:14:31 +0800 Subject: [PATCH] Update Http2Parser.php weight need An unsigned 8-bit integer --- src/Http2/Http2Parser.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Http2/Http2Parser.php b/src/Http2/Http2Parser.php index fab9e9d..db5cfe6 100644 --- a/src/Http2/Http2Parser.php +++ b/src/Http2/Http2Parser.php @@ -408,7 +408,7 @@ private function parseHeaders(string $frameBuffer, int $frameLength, int $frameF $padding = $isPadded ? \ord($header[0]) : 0; if ($isPriority) { - ['parent' => $parent, 'weight' => $weight] = \unpack("Nparent/cweight", $header, $isPadded ? 1 : 0); + ['parent' => $parent, 'weight' => $weight] = \unpack("Nparent/Cweight", $header, $isPadded ? 1 : 0); $parent &= 0x7fffffff; @@ -465,7 +465,7 @@ private function parsePriorityFrame(string $frameBuffer, int $frameLength, int $ $this->throwInvalidFrameSizeError(); } - ['parent' => $parent, 'weight' => $weight] = \unpack("Nparent/cweight", $frameBuffer); + ['parent' => $parent, 'weight' => $weight] = \unpack("Nparent/Cweight", $frameBuffer); if ($exclusive = ($parent & 0x80000000)) { $parent &= 0x7fffffff;