fix: reject unrouted messages without seq
This commit is contained in:
+6
-3
@@ -255,14 +255,17 @@ func (h *Hub) run() {
|
||||
}
|
||||
} else if msg.Note == nil {
|
||||
// Topic is unknown or offline.
|
||||
// Note is silently ignored, all other messages are reported as accepted to prevent
|
||||
// clients from guessing valid topic names.
|
||||
// Note is silently ignored. Other client messages cannot be accepted here
|
||||
// because they are not routed to a live topic and therefore cannot reserve a
|
||||
// message seq or be persisted.
|
||||
|
||||
// TODO(gene): validate topic name, discarding invalid topics.
|
||||
|
||||
logs.Info.Printf("Hub. Topic[%s] is unknown or offline", msg.RcptTo)
|
||||
|
||||
msg.sess.queueOut(NoErrAcceptedExplicitTs(msg.Id, msg.RcptTo, types.TimeNow(), msg.Timestamp))
|
||||
if msg.sess != nil {
|
||||
msg.sess.queueOut(ErrAttachFirst(msg, types.TimeNow()))
|
||||
}
|
||||
}
|
||||
case msg := <-h.routeSrv:
|
||||
// This is a server message from a connection not subscribed to topic
|
||||
|
||||
Reference in New Issue
Block a user