Skip to content

Commit

Permalink
Update mqtt/packet/connack.go
Browse files Browse the repository at this point in the history
  • Loading branch information
yosssi committed Dec 23, 2014
1 parent 9da551c commit 8307f1d
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions mqtt/packet/connack.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ const lenCONNACKVariableHeader = 2

// Connect Return code values
const (
Accepted byte = 0x00
UnacceptableProtocolVersion byte = 0x01
IdentifierRejected byte = 0x02
ServerUnavailable byte = 0x03
BadUserNameOrPassword byte = 0x04
NotAuthorized byte = 0x05
connRetAccepted byte = 0x00
connRetUnacceptableProtocolVersion byte = 0x01
connRetIdentifierRejected byte = 0x02
connRetServerUnavailable byte = 0x03
connRetBadUserNameOrPassword byte = 0x04
connRetNotAuthorized byte = 0x05
)

// Error values
Expand Down Expand Up @@ -101,12 +101,12 @@ func validateCONNACKBytes(fixedHeader FixedHeader, variableHeader []byte) error
// Check the Connect Return code of the variable header.
switch variableHeader[1] {
case
Accepted,
UnacceptableProtocolVersion,
IdentifierRejected,
ServerUnavailable,
BadUserNameOrPassword,
NotAuthorized:
connRetAccepted,
connRetUnacceptableProtocolVersion,
connRetIdentifierRejected,
connRetServerUnavailable,
connRetBadUserNameOrPassword,
connRetNotAuthorized:
default:
return ErrInvalidConnectReturnCode
}
Expand Down

0 comments on commit 8307f1d

Please sign in to comment.