mirror of
https://github.com/fhmq/hmq.git
synced 2026-08-30 14:24:53 +00:00
[cleanup] delete comment out code (#137)
This commit is contained in:
@@ -514,7 +514,6 @@ func (b *Broker) connectRouter(id, addr string) {
|
|||||||
|
|
||||||
c.SendConnect()
|
c.SendConnect()
|
||||||
|
|
||||||
// mpool := b.messagePool[fnv1a.HashString64(cid)%MessagePoolNum]
|
|
||||||
go c.readLoop()
|
go c.readLoop()
|
||||||
go c.StartPing()
|
go c.StartPing()
|
||||||
|
|
||||||
@@ -597,7 +596,6 @@ func (b *Broker) BroadcastInfoMessage(remoteID string, msg *packets.PublishPacke
|
|||||||
return true
|
return true
|
||||||
|
|
||||||
})
|
})
|
||||||
// log.Info("BroadcastInfoMessage success ")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *Broker) BroadcastSubOrUnsubMessage(packet packets.ControlPacket) {
|
func (b *Broker) BroadcastSubOrUnsubMessage(packet packets.ControlPacket) {
|
||||||
@@ -609,7 +607,6 @@ func (b *Broker) BroadcastSubOrUnsubMessage(packet packets.ControlPacket) {
|
|||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
// log.Info("BroadcastSubscribeMessage remotes: ", s.remotes)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *Broker) removeClient(c *client) {
|
func (b *Broker) removeClient(c *client) {
|
||||||
@@ -623,7 +620,6 @@ func (b *Broker) removeClient(c *client) {
|
|||||||
case REMOTE:
|
case REMOTE:
|
||||||
b.remotes.Delete(clientId)
|
b.remotes.Delete(clientId)
|
||||||
}
|
}
|
||||||
// log.Info("delete client ,", clientId)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *Broker) PublishMessage(packet *packets.PublishPacket) {
|
func (b *Broker) PublishMessage(packet *packets.PublishPacket) {
|
||||||
|
|||||||
@@ -141,17 +141,6 @@ func unWrapPublishPacket(packet *packets.PublishPacket) *packets.PublishPacket {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func publish(sub *subscription, packet *packets.PublishPacket) {
|
func publish(sub *subscription, packet *packets.PublishPacket) {
|
||||||
// var p *packets.PublishPacket
|
|
||||||
// if sub.client.info.username != "root" {
|
|
||||||
// p = unWrapPublishPacket(packet)
|
|
||||||
// } else {
|
|
||||||
// p = wrapPublishPacket(packet)
|
|
||||||
// }
|
|
||||||
// err := sub.client.WriterPacket(p)
|
|
||||||
// if err != nil {
|
|
||||||
// log.Error("process message for psub error, ", zap.Error(err))
|
|
||||||
// }
|
|
||||||
|
|
||||||
switch packet.Qos {
|
switch packet.Qos {
|
||||||
case QosAtMostOnce:
|
case QosAtMostOnce:
|
||||||
err := sub.client.WriterPacket(packet)
|
err := sub.client.WriterPacket(packet)
|
||||||
|
|||||||
@@ -66,7 +66,6 @@ func NewInfo(sid, url string, isforword bool) *packets.PublishPacket {
|
|||||||
pub.TopicName = BrokerInfoTopic
|
pub.TopicName = BrokerInfoTopic
|
||||||
pub.Retain = false
|
pub.Retain = false
|
||||||
info := fmt.Sprintf(`{"brokerID":"%s","brokerUrl":"%s"}`, sid, url)
|
info := fmt.Sprintf(`{"brokerID":"%s","brokerUrl":"%s"}`, sid, url)
|
||||||
// log.Info("new info", string(info))
|
|
||||||
pub.Payload = []byte(info)
|
pub.Payload = []byte(info)
|
||||||
return pub
|
return pub
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user