Skip to content

Commit

Permalink
Refs #7534. Fixed submessage_size calculation on last data_frag.
Browse files Browse the repository at this point in the history
  • Loading branch information
MiguelCompany committed Feb 4, 2020
1 parent 6c25545 commit 4c6d40a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cpp/rtps/messages/submessages/DataMsg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,10 @@ bool RTPSMessageCreator::addSubmessageDataFrag(
// TODO(Ricardo) This should be on cachechange.
// Align submessage to rtps alignment (4).
submessage_size = uint16_t(msg->pos - position_size_count_size);
uint32_t align = (4 - msg->pos % 4) & 3;
for (uint32_t count = 0; count < align; ++count)
for (; submessage_size & 3; ++submessage_size)
{
added_no_error &= CDRMessage::addOctet(msg, 0);
}

//TODO(Ricardo) Improve.
octet* o= reinterpret_cast<octet*>(&submessage_size);
Expand Down

0 comments on commit 4c6d40a

Please sign in to comment.