Skip to content

Commit

Permalink
Remove MaximumQoS property from CONNECT packet, because it's not incl…
Browse files Browse the repository at this point in the history
…uded in MQTTv5.0 specification.

Closes eclipse#161
  • Loading branch information
tomatod committed Feb 16, 2024
1 parent ace27f7 commit e3fc793
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 11 deletions.
2 changes: 1 addition & 1 deletion packets/properties.go
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ var ValidProperties = map[byte]map[byte]struct{}{
PropReasonString: {CONNACK: {}, PUBACK: {}, PUBREC: {}, PUBREL: {}, PUBCOMP: {}, SUBACK: {}, UNSUBACK: {}, DISCONNECT: {}, AUTH: {}},
PropReceiveMaximum: {CONNECT: {}, CONNACK: {}},
PropTopicAliasMaximum: {CONNECT: {}, CONNACK: {}},
PropMaximumQOS: {CONNECT: {}, CONNACK: {}},
PropMaximumQOS: {CONNACK: {}},
PropMaximumPacketSize: {CONNECT: {}, CONNACK: {}},
PropUser: {CONNECT: {}, CONNACK: {}, PUBLISH: {}, PUBACK: {}, PUBREC: {}, PUBREL: {}, PUBCOMP: {}, SUBSCRIBE: {}, UNSUBSCRIBE: {}, SUBACK: {}, UNSUBACK: {}, DISCONNECT: {}, AUTH: {}},
}
Expand Down
4 changes: 0 additions & 4 deletions packets/properties_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,6 @@ func TestPropertiess(t *testing.T) {
t.Fatalf("'topicAlias' is valid for 'PUBLISH' packets")
}

if !ValidateID(CONNECT, PropMaximumQOS) {
t.Fatalf("'maximumQOS' is valid for 'CONNECT' packets")
}

if !ValidateID(CONNACK, PropMaximumQOS) {
t.Fatalf("'maximumQOS' is valid for 'CONNACK' packets")
}
Expand Down
3 changes: 0 additions & 3 deletions paho/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,6 @@ func (c *Client) Connect(ctx context.Context, cp *Connect) (*Connack, error) {
if cp.Properties.MaximumPacketSize != nil {
c.clientProps.MaximumPacketSize = *cp.Properties.MaximumPacketSize
}
if cp.Properties.MaximumQOS != nil {
c.clientProps.MaximumQoS = *cp.Properties.MaximumQOS
}
if cp.Properties.ReceiveMaximum != nil {
c.clientProps.ReceiveMaximum = *cp.Properties.ReceiveMaximum
}
Expand Down
3 changes: 0 additions & 3 deletions paho/cp_connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ type (
WillDelayInterval *uint32
ReceiveMaximum *uint16
TopicAliasMaximum *uint16
MaximumQOS *byte
MaximumPacketSize *uint32
User UserProperties
RequestProblemInfo bool
Expand All @@ -62,7 +61,6 @@ func (c *Connect) InitProperties(p *packets.Properties) {
RequestProblemInfo: true,
ReceiveMaximum: p.ReceiveMaximum,
TopicAliasMaximum: p.TopicAliasMaximum,
MaximumQOS: p.MaximumQOS,
MaximumPacketSize: p.MaximumPacketSize,
User: UserPropertiesFromPacketUser(p.User),
}
Expand Down Expand Up @@ -137,7 +135,6 @@ func (c *Connect) Packet() *packets.Connect {
WillDelayInterval: c.Properties.WillDelayInterval,
ReceiveMaximum: c.Properties.ReceiveMaximum,
TopicAliasMaximum: c.Properties.TopicAliasMaximum,
MaximumQOS: c.Properties.MaximumQOS,
MaximumPacketSize: c.Properties.MaximumPacketSize,
User: c.Properties.User.ToPacketProperties(),
}
Expand Down

0 comments on commit e3fc793

Please sign in to comment.