Skip to content

Commit

Permalink
rename to buffer_params()
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed Mar 15, 2021
1 parent e9b6146 commit f463864
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 19 deletions.
4 changes: 2 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Changes

## [0.6.3] - 2021-03-15
## [0.6.4] - 2021-03-15

* `HandshakeAck::buffer_sizes()` replaces individual methods for buffer sizes
* `HandshakeAck::buffer_params()` replaces individual methods for buffer sizes

## [0.6.2] - 2021-03-04

Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ntex-mqtt"
version = "0.6.3"
version = "0.6.4"
authors = ["ntex contributors <[email protected]>"]
description = "MQTT Client/Server framework for v5 and v3.1.1 protocols"
documentation = "https://docs.rs/ntex-mqtt"
Expand All @@ -12,7 +12,7 @@ exclude = [".gitignore", ".travis.yml", ".cargo/config"]
edition = "2018"

[dependencies]
ntex = "0.3.9"
ntex = "0.3.10"
bitflags = "1.2.1"
derive_more = "0.99.11"
futures = "0.3.13"
Expand All @@ -29,4 +29,4 @@ tokio-rustls = "0.22.0"
openssl = "0.10"
tokio-openssl = "0.6.1"

ntex = { version = "0.3.9", features = ["rustls", "openssl"] }
ntex = { version = "0.3.10", features = ["rustls", "openssl"] }
2 changes: 1 addition & 1 deletion src/v3/handshake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ impl<Io, St> HandshakeAck<Io, St> {
///
/// By default max buffer size is 4kb for both read and write buffer,
/// Min size is 256 bytes.
pub fn buffer_sizes(
pub fn buffer_params(
mut self,
max_read_buf: u16,
max_write_buf: u16,
Expand Down
2 changes: 1 addition & 1 deletion src/v3/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ where

log::trace!("Sending success handshake ack: {:#?}", pkt);

state.set_buffer_sizes(ack.read_hw, ack.write_hw, ack.lw);
state.set_buffer_params(ack.read_hw, ack.write_hw, ack.lw);
state.send(&mut ack.io, &ack.shared.codec, pkt).await?;

Ok((
Expand Down
12 changes: 1 addition & 11 deletions src/v5/handshake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl<Io, St> HandshakeAck<Io, St> {
///
/// By default max buffer size is 4kb for both read and write buffer,
/// Min size is 256 bytes.
pub fn buffer_sizes(
pub fn buffer_params(
mut self,
max_read_buf: u16,
max_write_buf: u16,
Expand All @@ -148,30 +148,20 @@ impl<Io, St> HandshakeAck<Io, St> {

#[doc(hidden)]
#[deprecated(since = "0.6.3")]
/// Set buffer low watermark size
///
/// Low watermark is the same for read and write buffers.
/// By default lw value is 256 bytes.
pub fn low_watermark(mut self, lw: u16) -> Self {
self.lw = lw;
self
}

#[doc(hidden)]
#[deprecated(since = "0.6.3")]
/// Set read buffer high water mark size
///
/// By default read hw is 4kb
pub fn read_high_watermark(mut self, hw: u16) -> Self {
self.read_hw = hw;
self
}

#[doc(hidden)]
#[deprecated(since = "0.6.3")]
/// Set write buffer high watermark size
///
/// By default write hw is 4kb
pub fn write_high_watermark(mut self, hw: u16) -> Self {
self.write_hw = hw;
self
Expand Down
2 changes: 1 addition & 1 deletion src/v5/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ where
ack.packet.server_keepalive_sec = Some(ack.keepalive as u16);
}

state.set_buffer_sizes(ack.read_hw, ack.write_hw, ack.lw);
state.set_buffer_params(ack.read_hw, ack.write_hw, ack.lw);
state
.send(&mut ack.io, &shared.codec, mqtt::Packet::ConnectAck(ack.packet))
.await?;
Expand Down

0 comments on commit f463864

Please sign in to comment.