Skip to content

Commit

Permalink
fix(rumqttd): Make Type::write return correct value for rumqttd (byte…
Browse files Browse the repository at this point in the history
  • Loading branch information
amokfa authored Mar 12, 2024
1 parent 372fe73 commit bfc9f9a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 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
- Make write method return the number of bytes written correctly everywhere

### Security

Expand Down
2 changes: 1 addition & 1 deletion rumqttd/src/protocol/v4/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ pub fn write(

// update connect flags
buffer[flags_index] = connect_flags;
Ok(len)
Ok(1 + count + len)
}

mod will {
Expand Down
1 change: 0 additions & 1 deletion rumqttd/src/protocol/v4/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,5 @@ pub fn write(publish: &Publish, buffer: &mut BytesMut) -> Result<usize, Error> {

buffer.extend_from_slice(&publish.payload);

// TODO: Returned length is wrong in other packets. Fix it
Ok(1 + count + len)
}
2 changes: 1 addition & 1 deletion rumqttd/src/protocol/v5/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ pub fn write(

// update connect flags
buffer[flags_index] = connect_flags;
Ok(len)
Ok(1 + count + len)
}

mod will {
Expand Down

0 comments on commit bfc9f9a

Please sign in to comment.