Skip to content

Commit

Permalink
Fix get MAXIMUM_PACKET_SIZE byte error
Browse files Browse the repository at this point in the history
  • Loading branch information
sy-records committed Nov 13, 2024
1 parent ab44f7e commit 0f540ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Property/PackProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Property/UnPackProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 0f540ce

Please sign in to comment.