File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 66namespace acl {
77
88mqtt_unsuback::mqtt_unsuback (void )
9- : mqtt_ack(MQTT_PUBACK )
9+ : mqtt_ack(MQTT_UNSUBACK )
1010{
1111}
1212
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ mqtt_unsubscribe& mqtt_unsubscribe::set_pkt_id(unsigned short id) {
4646
4747mqtt_unsubscribe& mqtt_unsubscribe::add_topic (const char * topic) {
4848 topics_.push_back (topic);
49- body_len_ += (unsigned ) strlen (topic);
49+ body_len_ += 2 + (unsigned ) strlen (topic);
5050 return *this ;
5151}
5252
@@ -63,7 +63,8 @@ bool mqtt_unsubscribe::to_string(string& out) {
6363 body_len_ += sizeof (pkt_id_);
6464
6565 mqtt_header& header = this ->get_header ();
66- header.set_remaing_length (body_len_);
66+ header.set_header_flags (0x02 )
67+ .set_remaing_length (body_len_);
6768
6869 if (!header.build_header (out)) {
6970 return false ;
You can’t perform that action at this time.
0 commit comments