Skip to content

Commit

Permalink
Fix parsing payload format indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
halfgaar committed Nov 9, 2024
1 parent c8daebf commit ed7bc61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mqttpacket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ ConnectData MqttPacket::parseConnectData()
if (pcounts[1]++ > 0)
throw ProtocolError("Can't specify " + propertyToString(prop) + " more than once", ReasonCodes::ProtocolError);

result.willpublish.payloadUtf8 = true;
result.willpublish.payloadUtf8 = static_cast<bool>(readByte());
break;
case Mqtt5Properties::ContentType:
{
Expand Down Expand Up @@ -1775,7 +1775,7 @@ void MqttPacket::parsePublishData()
if (pcounts[0]++ > 0)
throw ProtocolError("Can't specify " + propertyToString(prop) + " more than once", ReasonCodes::ProtocolError);

publishData.payloadUtf8 = true;
publishData.payloadUtf8 = static_cast<bool>(readByte());
break;
case Mqtt5Properties::MessageExpiryInterval:
if (pcounts[1]++ > 0)
Expand Down

0 comments on commit ed7bc61

Please sign in to comment.