Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
de-sh committed May 10, 2024
1 parent dd28353 commit 47a55b6
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion rumqttc/Cargo.toml
Expand Up @@ -23,7 +23,7 @@ websocket = ["dep:async-tungstenite", "dep:ws_stream_tungstenite", "dep:http"]
proxy = ["dep:async-http-proxy"]

[dependencies]
futures-util = { version = "0.3", default_features = false, features = ["std", "sink"] }
futures-util = { version = "0.3", default-features = false, features = ["std", "sink"] }
tokio = { version = "1.36", features = ["rt", "macros", "io-util", "net", "time"] }
tokio-util = { version = "0.7", features = ["codec"] }
bytes = "1.5"
Expand Down
2 changes: 1 addition & 1 deletion rumqttc/src/state.rs
Expand Up @@ -90,7 +90,7 @@ impl MqttState {
// index 0 is wasted as 0 is not a valid packet id
outgoing_pub: vec![None; max_inflight as usize + 1],
outgoing_rel: vec![None; max_inflight as usize + 1],
incoming_pub: vec![None; std::u16::MAX as usize + 1],
incoming_pub: vec![None; u16::MAX as usize + 1],
collision: None,
// TODO: Optimize these sizes later
events: VecDeque::with_capacity(100),
Expand Down
2 changes: 1 addition & 1 deletion rumqttc/src/v5/state.rs
Expand Up @@ -138,7 +138,7 @@ impl MqttState {
// index 0 is wasted as 0 is not a valid packet id
outgoing_pub: vec![None; max_inflight as usize + 1],
outgoing_rel: vec![None; max_inflight as usize + 1],
incoming_pub: vec![None; std::u16::MAX as usize + 1],
incoming_pub: vec![None; u16::MAX as usize + 1],
collision: None,
// TODO: Optimize these sizes later
events: VecDeque::with_capacity(100),
Expand Down
6 changes: 3 additions & 3 deletions rumqttd/src/router/alertlog.rs
Expand Up @@ -71,14 +71,14 @@ pub mod alert {
pub use alert::*;

pub struct AlertLog {
pub config: RouterConfig,
pub _config: RouterConfig,
pub alerts: VecDeque<Alert>,
}

impl AlertLog {
pub fn new(config: RouterConfig) -> AlertLog {
pub fn new(_config: RouterConfig) -> AlertLog {
AlertLog {
config,
_config,
alerts: VecDeque::with_capacity(100),
}
}
Expand Down
14 changes: 7 additions & 7 deletions rumqttd/src/router/mod.rs
Expand Up @@ -212,7 +212,7 @@ pub struct Message {
/// Log to sweep
pub topic: String,
/// Qos of the topic
pub qos: u8,
pub _qos: u8,
/// Reply data chain
pub payload: Bytes,
}
Expand Down Expand Up @@ -250,12 +250,12 @@ impl fmt::Debug for Data {
}
}

#[derive(Debug, Clone)]
pub struct Disconnection {
pub id: String,
pub execute_will: bool,
pub pending: Vec<Notification>,
}
// #[derive(Debug, Clone)]
// pub struct Disconnection {
// pub id: String,
// pub execute_will: bool,
// pub pending: Vec<Notification>,
// }

#[derive(Debug, Clone)]
pub struct ShadowRequest {
Expand Down
2 changes: 1 addition & 1 deletion rumqttd/src/router/routing.rs
Expand Up @@ -322,7 +322,7 @@ impl Router {
|session_state| {
connection.subscriptions = session_state.subscriptions;
// for using in acklog
pending_acks = session_state.unacked_pubrels.clone();
pending_acks.clone_from(&session_state.unacked_pubrels);
outgoing.unacked_pubrels = session_state.unacked_pubrels;
session_state.tracker
},
Expand Down
1 change: 0 additions & 1 deletion rumqttd/src/segments/mod.rs
@@ -1,5 +1,4 @@
use crate::Offset;
use std::usize;
use std::{collections::VecDeque, io};

mod segment;
Expand Down
6 changes: 3 additions & 3 deletions rumqttd/src/server/mod.rs
@@ -1,10 +1,10 @@
use tokio::io::{AsyncRead, AsyncWrite};
// use tokio::io::{AsyncRead, AsyncWrite};

mod broker;
#[cfg(any(feature = "use-rustls", feature = "use-native-tls"))]
mod tls;

pub use broker::Broker;

pub trait IO: AsyncRead + AsyncWrite + Send + Sync + Unpin {}
impl<T: AsyncRead + AsyncWrite + Send + Sync + Unpin> IO for T {}
// pub trait IO: AsyncRead + AsyncWrite + Send + Sync + Unpin {}
// impl<T: AsyncRead + AsyncWrite + Send + Sync + Unpin> IO for T {}

0 comments on commit 47a55b6

Please sign in to comment.