connect_op.hpp is missing the start_clean configuration feature.

Open Beginner friendly
#29 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
cpp
Domain
networking

Research direction

Start in connect_op.hpp at send_connect(), where the CONNECT packet is assembled and the hard-coded false value is passed to encoders::encode_connect. Trace the existing start_clean configuration in the connection context, then verify that the packet uses it and run the repository's relevant MQTT connection tests. Done means start_clean controls the generated CONNECT packet instead of a constant.

Written by the indexing model from the issue text.

Description

void send_connect() {
    auto packet = control_packet<allocator_type>::of(
        no_pid, get_allocator(),
        encoders::encode_connect,
        _ctx.creds.client_id,
        _ctx.creds.username, _ctx.creds.password,
        _ctx.keep_alive, false, _ctx.co_props, _ctx.will_msg
    );

the "false" is const, should be modified:
void send_connect() {
auto packet = control_packet<allocator_type>::of(
no_pid, get_allocator(),
encoders::encode_connect,
_ctx.creds.client_id,
_ctx.creds.username, _ctx.creds.password,
_ctx.keep_alive, _ctx.start_clean, _ctx.co_props, _ctx.will_msg
);

Dominant language
C++
Stars
207
Forks
25
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/mqtt5

All issues in boostorg/mqtt5

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.