Skip to content

Commit

Permalink
Refs 11562. Fix number of bytes to skip.
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
  • Loading branch information
MiguelCompany committed May 14, 2021
1 parent bb54d78 commit 62038a9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/cpp/rtps/transport/TCPTransportInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -884,13 +884,13 @@ bool receive_header(
bytes_needed -= bytes_read;
if (0 == bytes_needed)
{
size_t skip =
(tcp_header.rtcp[0] != 'R') ? 1 :
(tcp_header.rtcp[1] != 'T') ? 2 :
(tcp_header.rtcp[2] != 'C') ? 3 :
(tcp_header.rtcp[3] != 'P') ? 4 : 0;
size_t skip = // Text Next possible match Skip to next match
(tcp_header.rtcp[0] != 'R') ? 1 : // X--- XRTCP 1
(tcp_header.rtcp[1] != 'T') ? 1 : // RX-- RRTCP 1
(tcp_header.rtcp[2] != 'C') ? 2 : // RTX- RTRTCP 2
(tcp_header.rtcp[3] != 'P') ? 3 : 0; // RTCX RTCRTCP 3

if (skip && (skip < 4))
if (skip)
{
memmove(ptr, &ptr[skip], 4 - skip);
}
Expand Down

0 comments on commit 62038a9

Please sign in to comment.