mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Fixed a crash in MQTT outgoing PUBREL
This really was a cut/paste/typo error. The effect was that when there was a pending PUBREL in JetStream, we would sometimes attempt to deliver it immediately once the client connected, cpending was already initialized, but the pubrel map was not (yet).
This commit is contained in:
@@ -2891,10 +2891,11 @@ func (sess *mqttSession) trackAsPubRel(pi uint16, jsAckSubject string) {
|
|||||||
|
|
||||||
sseq, _, _ := ackReplyInfo(jsAckSubject)
|
sseq, _, _ := ackReplyInfo(jsAckSubject)
|
||||||
|
|
||||||
var sseqToPi map[uint64]uint16
|
|
||||||
if sess.cpending == nil {
|
if sess.cpending == nil {
|
||||||
sess.cpending = make(map[string]map[uint64]uint16)
|
sess.cpending = make(map[string]map[uint64]uint16)
|
||||||
} else if sseqToPi = sess.cpending[jsDur]; sseqToPi == nil {
|
}
|
||||||
|
sseqToPi := sess.cpending[jsDur]
|
||||||
|
if sseqToPi == nil {
|
||||||
sseqToPi = make(map[uint64]uint16)
|
sseqToPi = make(map[uint64]uint16)
|
||||||
sess.cpending[jsDur] = sseqToPi
|
sess.cpending[jsDur] = sseqToPi
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user