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

Wrong condition for stopping a connection on endMessage #53

Open
JDuchniewicz opened this issue May 19, 2021 · 2 comments · May be fixed by #55
Open

Wrong condition for stopping a connection on endMessage #53

JDuchniewicz opened this issue May 19, 2021 · 2 comments · May be fixed by #55

Comments

@JDuchniewicz
Copy link

For secure connections where the Client is served over SSL, the message size is slightly greater and the below assert fails.
I replaced the != condition with < so that it fails only when message could not be send in full.

int MqttClient::endMessage()
{
  if (!_txStreamPayload) {
    if (!publishHeader(_txPayloadBufferIndex) ||
        (clientWrite(_txPayloadBuffer, _txPayloadBufferIndex) != _txPayloadBufferIndex)) {
      stop();

      return 0;
    }
  }
@aentinger
Copy link
Contributor

Hi @JDuchniewicz 👋 ☕ Could you get me a diff (or even better a PR)?

@JDuchniewicz JDuchniewicz linked a pull request May 25, 2021 that will close this issue
@JDuchniewicz
Copy link
Author

Submitted a PR, please check at your convenience @aentinger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants