File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -2292,6 +2292,27 @@ PubRecData MqttPacket::parsePubRecData()
22922292 if (!atEnd ())
22932293 {
22942294 result.reasonCode = static_cast <ReasonCodes>(readUint8 ());
2295+
2296+ if (result.reasonCode > ReasonCodes::Success)
2297+ {
2298+ switch (result.reasonCode )
2299+ {
2300+ case ReasonCodes::Success:
2301+ case ReasonCodes::NoMatchingSubscribers:
2302+ case ReasonCodes::UnspecifiedError:
2303+ case ReasonCodes::ImplementationSpecificError:
2304+ case ReasonCodes::NotAuthorized:
2305+ case ReasonCodes::TopicNameInvalid:
2306+ case ReasonCodes::PacketIdentifierInUse:
2307+ case ReasonCodes::QuotaExceeded:
2308+ case ReasonCodes::PayloadFormatInvalid:
2309+ {
2310+ break ;
2311+ }
2312+ default :
2313+ throw ProtocolError (" Invalid reason code in PUBREC" , ReasonCodes::ProtocolError);
2314+ }
2315+ }
22952316 }
22962317
22972318 return result;
You can’t perform that action at this time.
0 commit comments