Skip to content

Commit 228ee41

Browse files
author
Al S-M
committed
Set Username/Password flags on CONNECT
The contents of username and password for the CONNECT packet were being set but the flags to indicate they were being used was not which meant the username and password fields were not being encoded in the CONNECT packet.
1 parent 818e1bc commit 228ee41

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

message.go

+2
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,11 @@ func newConnectMsgFromOptions(options ClientOptions) *ConnectPacket {
8787
}
8888

8989
if options.username != "" {
90+
m.UsernameFlag = true
9091
m.Username = options.username
9192
//mustn't have password without user as well
9293
if options.password != "" {
94+
m.PasswordFlag = true
9395
m.Password = []byte(options.password)
9496
}
9597
}

0 commit comments

Comments
 (0)