Skip to content

Commit

Permalink
chore: address PR comments
Browse files Browse the repository at this point in the history
Signed-off-by: Skyler Ross <skyler@launchbadge.com>
  • Loading branch information
izik1 committed Mar 8, 2024
1 parent a542b85 commit 9b8bbb1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions rumqttd/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- MQTT keep alive interval
- record client id for remote link's span
- session present flag in connack
- (MQTT v5) handle connack and unsuback packets properly instead of panic.

### Security

Expand Down
1 change: 0 additions & 1 deletion rumqttd/src/protocol/v4/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ impl Protocol for V4 {
// v4 Disconnect packet gets handled in the previous check, this branch gets hit when
// Disconnect packet has properties which is only valid for v5
PacketType::Disconnect => return Err(Error::InvalidProtocol),
_ => unreachable!(),
};

Ok(packet)
Expand Down
16 changes: 8 additions & 8 deletions rumqttd/src/protocol/v5/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,10 @@ impl Protocol for V5 {
connect::read(fixed_header, packet)?;
Packet::Connect(connect, properties, will, willproperties, login)
}
PacketType::ConnAck => {
let (puback, properties) = connack::read(fixed_header, packet)?;
Packet::ConnAck(puback, properties)
}
PacketType::Publish => {
let (publish, properties) = publish::read(fixed_header, packet)?;
Packet::Publish(publish, properties)
Expand All @@ -408,6 +412,10 @@ impl Protocol for V5 {
let (unsubscribe, properties) = unsubscribe::read(fixed_header, packet)?;
Packet::Unsubscribe(unsubscribe, properties)
}
PacketType::UnsubAck => {
let (unsuback, properties) = unsuback::read(fixed_header, packet)?;
Packet::UnsubAck(unsuback, properties)
}
PacketType::PingReq => Packet::PingReq(PingReq),
PacketType::PingResp => Packet::PingResp(PingResp),
PacketType::Disconnect => {
Expand All @@ -426,14 +434,6 @@ impl Protocol for V5 {
let (pubcomp, properties) = pubcomp::read(fixed_header, packet)?;
Packet::PubComp(pubcomp, properties)
}
PacketType::ConnAck => {
let (puback, properties) = connack::read(fixed_header, packet)?;
Packet::ConnAck(puback, properties)
}
PacketType::UnsubAck => {
let (unsuback, properties) = unsuback::read(fixed_header, packet)?;
Packet::UnsubAck(unsuback, properties)
}
};

Ok(packet)
Expand Down

0 comments on commit 9b8bbb1

Please sign in to comment.