Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #379. #381

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/async_mqtt/packet/detail/base_property.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ struct string_property : binary_property {
}
else {
return make_error_code(
disconnect_reason_code::protocol_error
disconnect_reason_code::malformed_packet
);
}
}
Expand Down Expand Up @@ -370,7 +370,7 @@ struct len_str {
}
else {
return make_error_code(
disconnect_reason_code::protocol_error
disconnect_reason_code::malformed_packet
);
}
}
Expand Down
12 changes: 6 additions & 6 deletions include/async_mqtt/packet/impl/v3_1_1_connect.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ connect_packet::connect_packet(
if (!utf8string_check(client_id_)) {
throw system_error(
make_error_code(
connect_reason_code::client_identifier_not_valid
connect_reason_code::malformed_packet
)
);
}
Expand All @@ -92,7 +92,7 @@ connect_packet::connect_packet(
if (!utf8string_check(*user_name)) {
throw system_error(
make_error_code(
connect_reason_code::bad_user_name_or_password
connect_reason_code::malformed_packet
)
);
}
Expand All @@ -114,7 +114,7 @@ connect_packet::connect_packet(
if (!utf8string_check(w->topic())) {
throw system_error(
make_error_code(
connect_reason_code::topic_name_invalid
connect_reason_code::malformed_packet
)
);
}
Expand Down Expand Up @@ -365,7 +365,7 @@ connect_packet::connect_packet(buffer buf, error_code& ec) {
client_id_ = buf.substr(0, client_id_length);
if (!utf8string_check(client_id_)) {
ec = make_error_code(
connect_reason_code::client_identifier_not_valid
connect_reason_code::malformed_packet
);
return;
}
Expand Down Expand Up @@ -401,7 +401,7 @@ connect_packet::connect_packet(buffer buf, error_code& ec) {
will_topic_ = buf.substr(0, will_topic_length);
if (!utf8string_check(will_topic_)) {
ec = make_error_code(
connect_reason_code::topic_name_invalid
connect_reason_code::malformed_packet
);
return;
}
Expand Down Expand Up @@ -463,7 +463,7 @@ connect_packet::connect_packet(buffer buf, error_code& ec) {
user_name_ = buf.substr(0, user_name_length);
if (!utf8string_check(user_name_)) {
ec = make_error_code(
connect_reason_code::bad_user_name_or_password
connect_reason_code::malformed_packet
);
return;
}
Expand Down
4 changes: 2 additions & 2 deletions include/async_mqtt/packet/impl/v3_1_1_publish.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ basic_publish_packet<PacketIdBytes>::basic_publish_packet(
if (!utf8string_check(topic_name_)) {
throw system_error(
make_error_code(
disconnect_reason_code::topic_name_invalid
disconnect_reason_code::malformed_packet
)
);
}
Expand Down Expand Up @@ -262,7 +262,7 @@ basic_publish_packet<PacketIdBytes>::basic_publish_packet(buffer buf, error_code

if (!utf8string_check(topic_name_)) {
ec = make_error_code(
disconnect_reason_code::topic_name_invalid
disconnect_reason_code::malformed_packet
);
return;
}
Expand Down
4 changes: 2 additions & 2 deletions include/async_mqtt/packet/impl/v3_1_1_subscribe.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ basic_subscribe_packet<PacketIdBytes>::basic_subscribe_packet(
if (!utf8string_check(e.all_topic())) {
throw system_error{
make_error_code(
disconnect_reason_code::topic_filter_invalid
disconnect_reason_code::malformed_packet
)
};
}
Expand Down Expand Up @@ -240,7 +240,7 @@ basic_subscribe_packet<PacketIdBytes>::basic_subscribe_packet(buffer buf, error_

if (!utf8string_check(topic)) {
ec = make_error_code(
disconnect_reason_code::topic_filter_invalid
disconnect_reason_code::malformed_packet
);
return;
}
Expand Down
4 changes: 2 additions & 2 deletions include/async_mqtt/packet/impl/v3_1_1_unsubscribe.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ basic_unsubscribe_packet<PacketIdBytes>::basic_unsubscribe_packet(
if (!utf8string_check(e.all_topic())) {
throw system_error{
make_error_code(
disconnect_reason_code::topic_filter_invalid
disconnect_reason_code::malformed_packet
)
};
}
Expand Down Expand Up @@ -207,7 +207,7 @@ basic_unsubscribe_packet<PacketIdBytes>::basic_unsubscribe_packet(buffer buf, er
auto topic = buf.substr(0, topic_length);
if (!utf8string_check(topic)) {
ec = make_error_code(
disconnect_reason_code::topic_filter_invalid
disconnect_reason_code::malformed_packet
);
return;
}
Expand Down
12 changes: 6 additions & 6 deletions include/async_mqtt/packet/impl/v5_connect.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ connect_packet::connect_packet(
if (!utf8string_check(client_id_)) {
throw system_error{
make_error_code(
connect_reason_code::client_identifier_not_valid
connect_reason_code::malformed_packet
)
};
}
Expand All @@ -102,7 +102,7 @@ connect_packet::connect_packet(
if (!utf8string_check(*user_name)) {
throw system_error{
make_error_code(
connect_reason_code::bad_user_name_or_password
connect_reason_code::malformed_packet
)
};
}
Expand Down Expand Up @@ -143,7 +143,7 @@ connect_packet::connect_packet(
if (!utf8string_check(w->topic())) {
throw system_error{
make_error_code(
connect_reason_code::topic_name_invalid
connect_reason_code::malformed_packet
)
};
}
Expand Down Expand Up @@ -453,7 +453,7 @@ connect_packet::connect_packet(buffer buf, error_code& ec) {
client_id_ = buf.substr(0, client_id_length);
if (!utf8string_check(client_id_)) {
ec = make_error_code(
connect_reason_code::client_identifier_not_valid
connect_reason_code::malformed_packet
);
return;
}
Expand Down Expand Up @@ -515,7 +515,7 @@ connect_packet::connect_packet(buffer buf, error_code& ec) {
will_topic_ = buf.substr(0, will_topic_length);
if (!utf8string_check(will_topic_)) {
ec = make_error_code(
connect_reason_code::topic_name_invalid
connect_reason_code::malformed_packet
);
return;
}
Expand Down Expand Up @@ -577,7 +577,7 @@ connect_packet::connect_packet(buffer buf, error_code& ec) {
user_name_ = buf.substr(0, user_name_length);
if (!utf8string_check(user_name_)) {
ec = make_error_code(
connect_reason_code::bad_user_name_or_password
connect_reason_code::malformed_packet
);
return;
}
Expand Down
4 changes: 2 additions & 2 deletions include/async_mqtt/packet/impl/v5_publish.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ basic_publish_packet<PacketIdBytes>::basic_publish_packet(
if (!utf8string_check(topic_name_)) {
throw system_error(
make_error_code(
disconnect_reason_code::topic_name_invalid
disconnect_reason_code::malformed_packet
)
);
}
Expand Down Expand Up @@ -436,7 +436,7 @@ basic_publish_packet<PacketIdBytes>::basic_publish_packet(buffer buf, error_code

if (!utf8string_check(topic_name_)) {
ec = make_error_code(
disconnect_reason_code::topic_name_invalid
disconnect_reason_code::malformed_packet
);
return;
}
Expand Down
4 changes: 2 additions & 2 deletions include/async_mqtt/packet/impl/v5_subscribe.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ basic_subscribe_packet<PacketIdBytes>::basic_subscribe_packet(
if (!utf8string_check(e.all_topic())) {
throw system_error{
make_error_code(
disconnect_reason_code::topic_filter_invalid
disconnect_reason_code::malformed_packet
)
};
}
Expand Down Expand Up @@ -313,7 +313,7 @@ basic_subscribe_packet<PacketIdBytes>::basic_subscribe_packet(buffer buf, error_

if (!utf8string_check(topic)) {
ec = make_error_code(
disconnect_reason_code::topic_filter_invalid
disconnect_reason_code::malformed_packet
);
return;
}
Expand Down
4 changes: 2 additions & 2 deletions include/async_mqtt/packet/impl/v5_unsubscribe.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ basic_unsubscribe_packet<PacketIdBytes>::basic_unsubscribe_packet(
if (!utf8string_check(e.all_topic())) {
throw system_error(
make_error_code(
disconnect_reason_code::topic_filter_invalid
disconnect_reason_code::malformed_packet
)
);
}
Expand Down Expand Up @@ -270,7 +270,7 @@ basic_unsubscribe_packet<PacketIdBytes>::basic_unsubscribe_packet(buffer buf, er
auto topic = buf.substr(0, topic_length);
if (!utf8string_check(topic)) {
ec = make_error_code(
disconnect_reason_code::topic_filter_invalid
disconnect_reason_code::malformed_packet
);
return;
}
Expand Down
Loading
Loading