Skip to content

Commit

Permalink
Minor, just code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
andsel committed Oct 26, 2024
1 parent 1baac6b commit 2329561
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ public void operationComplete(ChannelFuture future) throws Exception {
LOG.trace("dispatch connection: {}", msg);
}
} else {
// here the session should still be in CONNECTING state
sessionRegistry.connectionClosed(bindedSession);
LOG.error("CONNACK send failed, cleanup session and close the connection", future.cause());
channel.close();
Expand Down
4 changes: 2 additions & 2 deletions broker/src/main/java/io/moquette/broker/Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,9 @@ public void resendInflightNotAcked() {
debugLogPacketIds(nonAckPacketIds);
}

// TODO rework here because send quota max can be lower than the inflight window width!
if (nonAckPacketIds.size() > mqttConnection.sendQuota().availableSlots()) {
// send quota is smaller than the inflight messages to resend, split it
// Send quota is smaller than the inflight messages to resend, split it.
// Next partition will be sent on PUBREC or PUBACK reception to continue flushing the in flight.
resendingNonAcked = true;
List<Integer> partition = nonAckPacketIds.stream()
.limit(mqttConnection.sendQuota().availableSlots())
Expand Down

0 comments on commit 2329561

Please sign in to comment.