Giter Club home page Giter Club logo

Comments (8)

fafhrd91 avatar fafhrd91 commented on May 27, 2024 1

@ctron would you like to submit pr for this issue?

from ntex-mqtt.

ctron avatar ctron commented on May 27, 2024

During the handshake, the function simply overwrites the result, coming from the connect handler, with the value from the server:

ack.packet.max_packet_size = Some(max_size);

The value in the connect ack is actually an Option.

So me it would make sense to honor the values from the connect ack struct, as long as they are below the server maximum. If the value from connect ack is None, and the server maximum is zero, then None should be set, which would drop the value from the encoded package.

Aside from that, I think the handshake should also honor the other values and not overwrite them:

ntex-mqtt/src/v5/server.rs

Lines 422 to 423 in 828e696

ack.packet.topic_alias_max = max_topic_alias;
ack.packet.max_qos = Some(mqtt::QoS::AtLeastOnce);

from ntex-mqtt.

ctron avatar ctron commented on May 27, 2024

If you want, I can try coming up with a fix for this.

from ntex-mqtt.

fafhrd91 avatar fafhrd91 commented on May 27, 2024

good catch. max size should be omitted if it set to 0

from ntex-mqtt.

fafhrd91 avatar fafhrd91 commented on May 27, 2024

I agree regarding topic_alias_max and max_qos

from ntex-mqtt.

fafhrd91 avatar fafhrd91 commented on May 27, 2024

fixed in master

from ntex-mqtt.

ctron avatar ctron commented on May 27, 2024

fixed in master

Thanks! I am sorry I couldn't time for this so far.

from ntex-mqtt.

fafhrd91 avatar fafhrd91 commented on May 27, 2024

no problem

from ntex-mqtt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.