You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 13, 2019. It is now read-only.
In connector_Forwarder_Metis.c, the function _readPacket is responsible for consuming the available socket buffer to read 0 or more CCNx packets. The first if statement reads the header and then, optionally, the second statement continues and reads the body. The problem lies in the if (returnCode == ReturnCode_Finished) portion of the second statement.
static ReadReturnCode
_readPacket(FwdMetisState *fwd_state)
{
ReadReturnCode returnCode = ReadReturnCode_PartialRead;
// are we still reading the header?
if (fwd_state->nextMessage.remainingReadLength > 0) {
returnCode = _readPacketHeader(fwd_state);
}
// After reading the header, it may be possible to read the body too
if (returnCode == ReadReturnCode_Finished && fwd_state->nextMessage.remainingReadLength == 0) {
returnCode = _readPacketBody(fwd_state);
}
return returnCode;
}
Let's say we have a partial body read as a result of one call of this function from the parcEvent handler. On the next invocation of this function, due to data being available on the socket fd, we see the problem. fwd_state->nextMessage.remainingReadLength is 0 since the header has already been read and added to the packet buffer. The first if statement is not executed. This leaves the returnCode variable with a value of ReadReturnCode_PartialRead. Now, the second if statement will never be executed to complete the read of the packet body. We end up in an endless loop of parcEvent notifications (since the socket fd is available for reading), but no actual reads of the socket ever take place.
The text was updated successfully, but these errors were encountered:
In connector_Forwarder_Metis.c, the function
_readPacket
is responsible for consuming the available socket buffer to read 0 or more CCNx packets. The firstif
statement reads the header and then, optionally, the second statement continues and reads the body. The problem lies in theif (returnCode == ReturnCode_Finished)
portion of the second statement.Let's say we have a partial body read as a result of one call of this function from the parcEvent handler. On the next invocation of this function, due to data being available on the socket fd, we see the problem.
fwd_state->nextMessage.remainingReadLength
is 0 since the header has already been read and added to the packet buffer. The firstif
statement is not executed. This leaves thereturnCode
variable with a value ofReadReturnCode_PartialRead
. Now, the secondif
statement will never be executed to complete the read of the packet body. We end up in an endless loop of parcEvent notifications (since the socket fd is available for reading), but no actual reads of the socket ever take place.The text was updated successfully, but these errors were encountered: