mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Add c.isMqtt() and c.isWebsocket()
This hides the check on "c.mqtt != nil" or "c.ws != nil". Added some tests. Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This commit is contained in:
@@ -132,7 +132,7 @@ const (
|
||||
func (c *client) parse(buf []byte) error {
|
||||
// Branch out to mqtt clients. c.mqtt is immutable, but should it become
|
||||
// an issue (say data race detection), we could branch outside in readLoop
|
||||
if c.mqtt != nil {
|
||||
if c.isMqtt() {
|
||||
return c.mqttParse(buf)
|
||||
}
|
||||
var i int
|
||||
|
||||
Reference in New Issue
Block a user