Skip to content

Commit 7ba6cf2

Browse files
authored
Merge branch 'master' into bugfix/ws_malformed_package
2 parents 2a9c9fc + c174cfd commit 7ba6cf2

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

hooks.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ func (h *Hooks) OnUnsubscribed(cl *Client, pk packets.Packet) {
351351
}
352352
}
353353

354-
// OnPublish is called when a client publishes a message. This method differs from OnMessage
354+
// OnPublish is called when a client publishes a message. This method differs from OnPublished
355355
// in that it allows you to modify you to modify the incoming packet before it is processed.
356356
// The return values of the hook methods are passed-through in the order the hooks were attached.
357357
func (h *Hooks) OnPublish(cl *Client, pk packets.Packet) (pkx packets.Packet, err error) {

server.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ import (
2626
)
2727

2828
const (
29-
Version = "2.0.0" // the current server version.
30-
defaultSysTopicInterval int64 = 1 // the interval between $SYS topic publishes
31-
defaultFanPoolSize uint64 = 64 // the number of concurrent workers in the pool
32-
defaultFanPoolQueueSize uint64 = 32 * 128 // the capacity of each worker queue
29+
Version = "2.0.5" // the current server version.
30+
defaultSysTopicInterval int64 = 1 // the interval between $SYS topic publishes
31+
defaultFanPoolSize uint64 = 32 // the number of concurrent workers in the pool
32+
defaultFanPoolQueueSize uint64 = 1024 // the capacity of each worker queue
3333
)
3434

3535
var (
@@ -697,6 +697,7 @@ func (s *Server) processPublish(cl *Client, pk packets.Packet) error {
697697
s.publishToSubscribers(pk)
698698
})
699699

700+
s.hooks.OnPublished(cl, pk)
700701
return nil
701702
}
702703

@@ -727,8 +728,7 @@ func (s *Server) processPublish(cl *Client, pk packets.Packet) error {
727728
s.publishToSubscribers(pk)
728729
})
729730

730-
s.hooks.OnPublish(cl, pk)
731-
731+
s.hooks.OnPublished(cl, pk)
732732
return nil
733733
}
734734

0 commit comments

Comments
 (0)