Update server version

This commit is contained in:
mochi-co
2023-02-28 20:57:59 +00:00
parent e4c76cc60c
commit 44ce819318

View File

@@ -26,7 +26,7 @@ import (
)
const (
Version = "2.2.4" // the current server version.
Version = "2.2.5" // the current server version.
defaultSysTopicInterval int64 = 1 // the interval between $SYS topic publishes
)
@@ -365,7 +365,7 @@ func (s *Server) attachClient(cl *Client, listener string) error {
if expire && atomic.LoadUint32(&cl.State.isTakenOver) == 0 {
cl.ClearInflights(math.MaxInt64, 0)
s.UnsubscribeClient(cl)
s.Clients.Delete(cl.ID) // [MQTT-4.1.0-2] ![MQTT-3.1.2-23] }
s.Clients.Delete(cl.ID) // [MQTT-4.1.0-2] ![MQTT-3.1.2-23]
}
return err
@@ -442,12 +442,11 @@ func (s *Server) inheritClientSession(pk packets.Packet, cl *Client) bool {
if pk.Connect.Clean || (existing.Properties.Clean && existing.Properties.ProtocolVersion < 5) { // [MQTT-3.1.2-4] [MQTT-3.1.4-4]
s.UnsubscribeClient(existing)
existing.ClearInflights(math.MaxInt64, 0)
atomic.StoreUint32(&existing.State.isTakenOver, 1)
return false // [MQTT-3.2.2-3]
atomic.StoreUint32(&existing.State.isTakenOver, 1) // only set isTakenOver after unsubscribe has occurred
return false // [MQTT-3.2.2-3]
}
atomic.StoreUint32(&existing.State.isTakenOver, 1)
if existing.State.Inflight.Len() > 0 {
cl.State.Inflight = existing.State.Inflight.Clone() // [MQTT-3.1.2-5]
if cl.State.Inflight.maximumReceiveQuota == 0 && cl.ops.capabilities.ReceiveMaximum != 0 {