Skip to content

Commit 961ba56

Browse files
authored
Fix get MAXIMUM_PACKET_SIZE byte error (#106)
1 parent 94f2f73 commit 961ba56

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Property/PackProperty.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public static function connect(array $data): string
2727
$tmpBody .= chr($property);
2828
switch ($property) {
2929
case Property::SESSION_EXPIRY_INTERVAL:
30+
case Property::MAXIMUM_PACKET_SIZE:
3031
$tmpBody .= PackTool::longInt($item);
3132
break;
3233
case Property::AUTHENTICATION_METHOD:
@@ -39,7 +40,6 @@ public static function connect(array $data): string
3940
break;
4041
case Property::RECEIVE_MAXIMUM:
4142
case Property::TOPIC_ALIAS_MAXIMUM:
42-
case Property::MAXIMUM_PACKET_SIZE:
4343
$tmpBody .= PackTool::shortInt($item);
4444
break;
4545
}

src/Property/UnPackProperty.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public static function connect(int $length, string &$remaining): array
2828
$remaining = substr($remaining, 1);
2929
switch ($property) {
3030
case Property::SESSION_EXPIRY_INTERVAL:
31+
case Property::MAXIMUM_PACKET_SIZE:
3132
$properties[$key] = UnPackTool::longInt($remaining);
3233
$length -= 5;
3334
break;
@@ -44,7 +45,6 @@ public static function connect(int $length, string &$remaining): array
4445
break;
4546
case Property::RECEIVE_MAXIMUM:
4647
case Property::TOPIC_ALIAS_MAXIMUM:
47-
case Property::MAXIMUM_PACKET_SIZE:
4848
$properties[$key] = UnPackTool::shortInt($remaining);
4949
$length -= 3;
5050
break;

0 commit comments

Comments
 (0)