Skip to content

Commit

Permalink
Modify the position of an if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
BoB13-Matter committed Dec 18, 2024
1 parent cca52cd commit d9316a2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/transport/raw/TCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,12 +343,15 @@ CHIP_ERROR TCPBase::ProcessReceivedBuffer(Inet::TCPEndPoint * endPoint, const Pe
// We have not yet received the complete message.
return CHIP_NO_ERROR;
}

state->mReceived.Consume(kPacketSizeBytes);

if (messageSize == 0)
{
// No payload but considered a valid message. Return success to keep the connection alive.
return CHIP_NO_ERROR;
}
state->mReceived.Consume(kPacketSizeBytes);

ReturnErrorOnFailure(ProcessSingleMessage(peerAddress, state, messageSize));
}

Expand Down

0 comments on commit d9316a2

Please sign in to comment.