mirror of
https://github.com/fhmq/hmq.git
synced 2026-04-24 10:38:34 +00:00
cluster fix
This commit is contained in:
@@ -288,17 +288,11 @@ func (b *Broker) handleConnection(typ int, conn net.Conn, idx uint64) {
|
||||
conn: conn,
|
||||
info: info,
|
||||
}
|
||||
|
||||
c.init()
|
||||
|
||||
cid := c.info.clientID
|
||||
|
||||
if typ == ROUTER {
|
||||
c.route = route{
|
||||
remoteID: "",
|
||||
remoteUrl: conn.RemoteAddr().String(),
|
||||
}
|
||||
}
|
||||
|
||||
var msgPool *MessagePool
|
||||
var exist bool
|
||||
var old interface{}
|
||||
@@ -358,7 +352,7 @@ func (b *Broker) connectRouter(url, remoteID string) {
|
||||
}
|
||||
break
|
||||
}
|
||||
route := &route{
|
||||
route := route{
|
||||
remoteID: remoteID,
|
||||
remoteUrl: conn.RemoteAddr().String(),
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ type client struct {
|
||||
broker *Broker
|
||||
conn net.Conn
|
||||
info info
|
||||
route *route
|
||||
route route
|
||||
status int
|
||||
closed chan int
|
||||
smu sync.RWMutex
|
||||
|
||||
@@ -110,13 +110,14 @@ func (c *client) ProcessInfo(packet *packets.PublishPacket) {
|
||||
}
|
||||
b.mu.Unlock()
|
||||
|
||||
// log.Info("isforword: ", isForward)
|
||||
if !isForward {
|
||||
route := &route{
|
||||
remoteUrl: rurl,
|
||||
remoteID: rid,
|
||||
if c.typ == ROUTER {
|
||||
route := route{
|
||||
remoteUrl: rurl,
|
||||
remoteID: rid,
|
||||
}
|
||||
c.route = route
|
||||
}
|
||||
c.route = route
|
||||
|
||||
go b.SendLocalSubsToRouter(c)
|
||||
// log.Info("BroadcastInfoMessage starting... ")
|
||||
|
||||
Reference in New Issue
Block a user