forked from boostorg/mqtt5
control_packet::wire_data() returns std::string_view
Summary: related to T13332 Reviewers: ivica Reviewed By: ivica Subscribers: miljen, iljazovic Differential Revision: https://repo.mireo.local/D27099
This commit is contained in:
@ -105,7 +105,7 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string& wire_data() const {
|
std::string_view wire_data() const {
|
||||||
return *_packet;
|
return *_packet;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -199,7 +199,7 @@ public:
|
|||||||
10u, false, _ctx.co_props, _ctx.will_msg
|
10u, false, _ctx.co_props, _ctx.will_msg
|
||||||
);
|
);
|
||||||
|
|
||||||
const auto& wire_data = packet.wire_data();
|
auto wire_data = packet.wire_data();
|
||||||
|
|
||||||
detail::async_write(
|
detail::async_write(
|
||||||
_stream, asio::buffer(wire_data),
|
_stream, asio::buffer(wire_data),
|
||||||
@ -349,7 +349,7 @@ public:
|
|||||||
reason_codes::continue_authentication.value(), props
|
reason_codes::continue_authentication.value(), props
|
||||||
);
|
);
|
||||||
|
|
||||||
const auto& wire_data = packet.wire_data();
|
auto wire_data = packet.wire_data();
|
||||||
|
|
||||||
detail::async_write(
|
detail::async_write(
|
||||||
_stream, asio::buffer(wire_data),
|
_stream, asio::buffer(wire_data),
|
||||||
|
@ -86,7 +86,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void send_disconnect(control_packet<allocator_type> disconnect) {
|
void send_disconnect(control_packet<allocator_type> disconnect) {
|
||||||
const auto& wire_data = disconnect.wire_data();
|
auto wire_data = disconnect.wire_data();
|
||||||
_svc_ptr->async_send(
|
_svc_ptr->async_send(
|
||||||
wire_data,
|
wire_data,
|
||||||
no_serial, send_flag::terminal,
|
no_serial, send_flag::terminal,
|
||||||
|
@ -70,7 +70,7 @@ public:
|
|||||||
no_pid, get_allocator(), encoders::encode_pingreq
|
no_pid, get_allocator(), encoders::encode_pingreq
|
||||||
);
|
);
|
||||||
|
|
||||||
const auto& wire_data = pingreq.wire_data();
|
auto wire_data = pingreq.wire_data();
|
||||||
_svc_ptr->async_send(
|
_svc_ptr->async_send(
|
||||||
wire_data,
|
wire_data,
|
||||||
no_serial, send_flag::none,
|
no_serial, send_flag::none,
|
||||||
|
@ -87,7 +87,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void send_puback(control_packet<allocator_type> puback) {
|
void send_puback(control_packet<allocator_type> puback) {
|
||||||
const auto& wire_data = puback.wire_data();
|
auto wire_data = puback.wire_data();
|
||||||
_svc_ptr->async_send(
|
_svc_ptr->async_send(
|
||||||
wire_data,
|
wire_data,
|
||||||
no_serial, send_flag::none,
|
no_serial, send_flag::none,
|
||||||
@ -106,7 +106,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void send_pubrec(control_packet<allocator_type> pubrec) {
|
void send_pubrec(control_packet<allocator_type> pubrec) {
|
||||||
const auto& wire_data = pubrec.wire_data();
|
auto wire_data = pubrec.wire_data();
|
||||||
_svc_ptr->async_send(
|
_svc_ptr->async_send(
|
||||||
wire_data,
|
wire_data,
|
||||||
no_serial, send_flag::none,
|
no_serial, send_flag::none,
|
||||||
@ -163,7 +163,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void send_pubcomp(control_packet<allocator_type> pubcomp) {
|
void send_pubcomp(control_packet<allocator_type> pubcomp) {
|
||||||
const auto& wire_data = pubcomp.wire_data();
|
auto wire_data = pubcomp.wire_data();
|
||||||
_svc_ptr->async_send(
|
_svc_ptr->async_send(
|
||||||
wire_data,
|
wire_data,
|
||||||
no_serial, send_flag::none,
|
no_serial, send_flag::none,
|
||||||
|
@ -136,7 +136,7 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto& wire_data = publish.wire_data();
|
auto wire_data = publish.wire_data();
|
||||||
_svc_ptr->async_send(
|
_svc_ptr->async_send(
|
||||||
wire_data,
|
wire_data,
|
||||||
_serial_num,
|
_serial_num,
|
||||||
@ -266,7 +266,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void send_pubrel(control_packet<allocator_type> pubrel, bool throttled) {
|
void send_pubrel(control_packet<allocator_type> pubrel, bool throttled) {
|
||||||
const auto& wire_data = pubrel.wire_data();
|
auto wire_data = pubrel.wire_data();
|
||||||
_svc_ptr->async_send(
|
_svc_ptr->async_send(
|
||||||
wire_data,
|
wire_data,
|
||||||
_serial_num,
|
_serial_num,
|
||||||
|
@ -108,7 +108,7 @@ public:
|
|||||||
rc.value(), props
|
rc.value(), props
|
||||||
);
|
);
|
||||||
|
|
||||||
const auto& wire_data = packet.wire_data();
|
auto wire_data = packet.wire_data();
|
||||||
|
|
||||||
_svc_ptr->async_send(
|
_svc_ptr->async_send(
|
||||||
wire_data,
|
wire_data,
|
||||||
|
@ -94,7 +94,7 @@ public:
|
|||||||
if (_handler.empty()) // already cancelled
|
if (_handler.empty()) // already cancelled
|
||||||
return _svc_ptr->free_pid(subscribe.packet_id());
|
return _svc_ptr->free_pid(subscribe.packet_id());
|
||||||
|
|
||||||
const auto& wire_data = subscribe.wire_data();
|
auto wire_data = subscribe.wire_data();
|
||||||
_svc_ptr->async_send(
|
_svc_ptr->async_send(
|
||||||
wire_data,
|
wire_data,
|
||||||
no_serial, send_flag::none,
|
no_serial, send_flag::none,
|
||||||
|
@ -90,7 +90,7 @@ public:
|
|||||||
if (_handler.empty()) // already cancelled
|
if (_handler.empty()) // already cancelled
|
||||||
return _svc_ptr->free_pid(unsubscribe.packet_id());
|
return _svc_ptr->free_pid(unsubscribe.packet_id());
|
||||||
|
|
||||||
const auto& wire_data = unsubscribe.wire_data();
|
auto wire_data = unsubscribe.wire_data();
|
||||||
_svc_ptr->async_send(
|
_svc_ptr->async_send(
|
||||||
wire_data,
|
wire_data,
|
||||||
no_serial, send_flag::none,
|
no_serial, send_flag::none,
|
||||||
|
Reference in New Issue
Block a user