From 0f540cef73f1dc9cb6d38c9e9a9b3364cf003c30 Mon Sep 17 00:00:00 2001 From: sy-records <52o@qq52o.cn> Date: Wed, 13 Nov 2024 16:03:54 +0800 Subject: [PATCH] Fix get MAXIMUM_PACKET_SIZE byte error --- src/Property/PackProperty.php | 2 +- src/Property/UnPackProperty.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Property/PackProperty.php b/src/Property/PackProperty.php index 0092677..4a4b221 100644 --- a/src/Property/PackProperty.php +++ b/src/Property/PackProperty.php @@ -27,6 +27,7 @@ public static function connect(array $data): string $tmpBody .= chr($property); switch ($property) { case Property::SESSION_EXPIRY_INTERVAL: + case Property::MAXIMUM_PACKET_SIZE: $tmpBody .= PackTool::longInt($item); break; case Property::AUTHENTICATION_METHOD: @@ -39,7 +40,6 @@ public static function connect(array $data): string break; case Property::RECEIVE_MAXIMUM: case Property::TOPIC_ALIAS_MAXIMUM: - case Property::MAXIMUM_PACKET_SIZE: $tmpBody .= PackTool::shortInt($item); break; } diff --git a/src/Property/UnPackProperty.php b/src/Property/UnPackProperty.php index 1c00f4d..ffec78b 100644 --- a/src/Property/UnPackProperty.php +++ b/src/Property/UnPackProperty.php @@ -28,6 +28,7 @@ public static function connect(int $length, string &$remaining): array $remaining = substr($remaining, 1); switch ($property) { case Property::SESSION_EXPIRY_INTERVAL: + case Property::MAXIMUM_PACKET_SIZE: $properties[$key] = UnPackTool::longInt($remaining); $length -= 5; break; @@ -44,7 +45,6 @@ public static function connect(int $length, string &$remaining): array break; case Property::RECEIVE_MAXIMUM: case Property::TOPIC_ALIAS_MAXIMUM: - case Property::MAXIMUM_PACKET_SIZE: $properties[$key] = UnPackTool::shortInt($remaining); $length -= 3; break;