simple fix (#35)

This commit is contained in:
Marc Magnin authored and joy.zhou committed 2019-01-07 19:56:00 +08:00
1 parent 2b56664d85
commit 6c7fe6a0f7
2 files changed
+4

No files matched your search

+2
View File
@@ -617,7 +617,9 @@ func (b *Broker) removeClient(c *client) {
func (b *Broker) PublishMessage(packet *packets.PublishPacket) {
var subs []interface{}
var qoss []byte
b.mu.Lock()
err := b.topicsMgr.Subscribers([]byte(packet.TopicName), packet.Qos, &subs, &qoss)
b.mu.Unlock()
if err != nil {
log.Error("search sub client error, ", zap.Error(err))
return
+2
View File
@@ -213,7 +213,9 @@ func (c *client) ProcessPublishMessage(packet *packets.PublishPacket) {
}
}
c.mu.Lock()
err := c.topicsMgr.Subscribers([]byte(packet.TopicName), packet.Qos, &c.subs, &c.qoss)
c.mu.Unlock()
if err != nil {
log.Error("Error retrieving subscribers list: ", zap.String("ClientID", c.info.clientID))
return