Skip to content

Commit cb89fcf

Browse files
authored
fix(rumqttd): set default network timeout as Duration::MAX instead of zero. (#949)
1 parent a76d2a0 commit cb89fcf

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

rumqttd/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2525

2626
### Fixed
2727
- MQTT keep alive interval
28+
- Change default network keep alive interval from `Duration::ZERO` to `Duration::MAX`.
2829
- record client id for remote link's span
2930
- session present flag in connack
3031
- Make write method return the number of bytes written correctly everywhere

rumqttd/src/link/network.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ impl<P: Protocol> Network<P> {
5555
write: BytesMut::with_capacity(10 * 1024),
5656
max_incoming_size,
5757
max_connection_buffer_len,
58-
keepalive: Duration::ZERO,
58+
// Overwritten by keepalive value in connect packet, otherwise we
59+
// would wait indefinitely until we get a packet / network error
60+
// when we call read.
61+
keepalive: Duration::MAX,
5962
protocol,
6063
}
6164
}

0 commit comments

Comments
 (0)