Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect value of Maximum QoS #1848

Closed
zinid opened this issue Sep 21, 2018 · 5 comments
Assignees
Milestone

Comments

@zinid
Copy link

@zinid zinid commented Sep 21, 2018

Environment

  • OS: Linux (Debian Testing)
  • Erlang/OTP: OTP-21
  • EMQ: hard to say, I compiled it from git using make rel, the last commit in the log is ba2e2fbd

Description

The server sets Maximum QoS property in the CONNACK packet with value 2. However, it's explicitly forbidden to do so:

It is a Protocol Error to include Maximum QoS more than once, or to have a value other than 0 or 1

http://docs.oasis-open.org/mqtt/mqtt/v5.0/cs02/mqtt-v5.0-cs02.html#_Toc514345356

@gilbertwong96

This comment has been minimized.

Copy link
Contributor

@gilbertwong96 gilbertwong96 commented Sep 21, 2018

Yes, you are right. We would fix it as quick as possible.

@gilbertwong96

This comment has been minimized.

Copy link
Contributor

@gilbertwong96 gilbertwong96 commented Sep 21, 2018

Hi, @zinid . The connack packet has not supported mqtt 5.0 specification now. There is no properties in CONNACK packet now. Please read spec again. It said that when this property Maximum QoS is absent in CONNACK packet, Client would use qos 2 as maximum qos. The maximum qos is not only used to pass it in CONNACK packet. It has another usage.

@zinid

This comment has been minimized.

Copy link
Author

@zinid zinid commented Sep 22, 2018

There is no properties in CONNACK packet now

LOL wut? 😁 What's this then? I added io:format() and I see this:

#{'Maximum-Packet-Size' => 1048576,
  'Maximum-QoS' => 2,
  'Retain-Available' => 1,
  'Shared-Subscription-Available' => 1,
  'Subscription-Identifier-Available' => 1,
  'Topic-Alias-Maximum' => 0,
  'Wildcard-Subscription-Available' => 1}

It said that when this property Maximum QoS is absent in CONNACK packet, Client would use qos 2 as maximum qos

Right. But Maximum QoS is not absent, it is there, in the CONNACK packet 😁

@gilbertwong96

This comment has been minimized.

Copy link
Contributor

@gilbertwong96 gilbertwong96 commented Sep 22, 2018

Yes, you are right. I forgot this code.

@gilbertwong96

This comment has been minimized.

Copy link
Contributor

@gilbertwong96 gilbertwong96 commented Sep 22, 2018

Now, it has been fixed in #1857 (comment)

@zinid zinid closed this Sep 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.