Skip to content

Commit

Permalink
network: use 32 bits instead of 16 bits to support larger packets
Browse files Browse the repository at this point in the history
  • Loading branch information
sderonne authored and Sébastien Deronne committed Dec 5, 2023
1 parent be0d02a commit c24de8e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/network/model/packet-metadata.cc
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ PacketMetadata::ReplaceTail(PacketMetadata::SmallItem* item,
AppendValue(extraItem->fragmentEnd, buffer);
buffer += fragEndSize;
Append32(extraItem->packetUid, buffer);
m_used = std::max(m_used, (uint16_t)(buffer - &m_data->m_data[0]));
m_used = std::max(m_used, static_cast<uint32_t>(buffer - &m_data->m_data[0]));
m_data->m_dirtyEnd = m_used;
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/network/model/packet-metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ class PacketMetadata
/** number of references to this struct Data instance. */
uint32_t m_count;
/** size (in bytes) of m_data buffer below */
uint16_t m_size;
uint32_t m_size;
/** max of the m_used field over all objects which reference this struct Data instance */
uint16_t m_dirtyEnd;
/** variable-sized buffer of bytes */
Expand Down Expand Up @@ -697,7 +697,7 @@ class PacketMetadata
*/
uint16_t m_head; //!< list head
uint16_t m_tail; //!< list tail
uint16_t m_used; //!< used portion
uint32_t m_used; //!< used portion
uint64_t m_packetUid; //!< packet Uid
};

Expand Down

0 comments on commit c24de8e

Please sign in to comment.