Skip to content

Wrong condition for stopping a connection on endMessage #53

Open
@JDuchniewicz

Description

@JDuchniewicz

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;
    }
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions