Skip to content

Commit

Permalink
Fix directly mqtt for mqtt-ws-server.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
aamalev authored Feb 24, 2025
1 parent faa0d47 commit 8ffe291
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/mqtt-ws-server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ async fn main() -> std::io::Result<()> {
loop {
// we can read incoming bytes stream without consuming it
let result = io.with_read_buf(|buf| {
if buf.len() < 4 {
if buf.len() < 8 {
None
} else if &buf[..4] == b"MQTT" {
} else if &buf[4..8] == b"MQTT" {
println!("MQTT protocol is selected");
Some(Protocol::Mqtt)
} else if &buf[..4] == b"GET " {
Expand Down

0 comments on commit 8ffe291

Please sign in to comment.