Skip to content

Commit

Permalink
Fixed submessage_size calculation on last data_frag
Browse files Browse the repository at this point in the history
This is a port of #999 from 1.9.x
  • Loading branch information
IkerLuengo committed Mar 2, 2020
1 parent 9b7f143 commit 5f64810
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 5f64810

Please sign in to comment.