From 961ba5615e06786b82c5d85c967e4c29e8b7490e Mon Sep 17 00:00:00 2001 From: Luffy <52o@qq52o.cn> Date: Fri, 15 Nov 2024 07:52:38 +0800 Subject: [PATCH] Fix get MAXIMUM_PACKET_SIZE byte error (#106) --- 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;