fix: don't put 0 sized data packets in received_data

This commit is contained in:
RipleyTom
2026-09-30 18:29:21 +02:00
committed by Ani
parent 38d27036f9
commit 431b169358
2 changed files with 2 additions and 2 deletions
@@ -420,7 +420,7 @@ bool lv2_socket_p2ps::handle_connected(p2ps_encapsulated_tcp* tcp_header, u8* da
return true;
}
if (!received_data.count(tcp_header->seq))
if (!received_data.count(tcp_header->seq) && tcp_header->length != 0u)
{
// New data
received_data.emplace(tcp_header->seq, std::vector<u8>(data, data + tcp_header->length));
+1 -1
View File
@@ -1253,7 +1253,7 @@ namespace rpcn
auto get_usernames = [](vec_stream& stream, std::set<std::string>& usernames)
{
u32 num_usernames = stream.get<u32>();
for (u32 i = 0; i < num_usernames; i++)
for (u32 i = 0; i < num_usernames && !stream.is_error(); i++)
{
std::string username = stream.get_string(false);
usernames.insert(std::move(username));