Skip to content

Commit

Permalink
proxy: Fix handling of in drdynvc DATA_FIRST_PDU in proxy
Browse files Browse the repository at this point in the history
During tests I sometimes received DATA_FIRST_PDUs that were not part of
a fragmented message but contained a complete PDU.

The documentation is not quite clear about if this is a possible
scenario or a protocol violation. However in the description of the Data
field it says:

If the sum of the DVC header size and the value specified by the Length
field is less than 1600 bytes, then the actual data length equals the
value specified by the Length field.

This hints that DATA_FIRST_PDU might also contain complete Data and does
not necessarily mean to be the first part of a fragmented PDU.
  • Loading branch information
mfleisz authored and akallabeth committed Sep 29, 2022
1 parent b448104 commit e4f476f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions server/proxy/channels/pf_channel_drdynvc.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,13 +406,6 @@ static PfChannelResult DynvcTrackerPeekFn(ChannelStateTracker* tracker, BOOL fir
trackerState->CurrentDataReceived, trackerState->currentDataLength);
return PF_CHANNEL_RESULT_ERROR;
}

if (trackerState->CurrentDataReceived == trackerState->currentDataLength)
{
trackerState->currentDataLength = 0;
trackerState->CurrentDataFragments = 0;
trackerState->CurrentDataReceived = 0;
}
}
else
{
Expand All @@ -421,6 +414,13 @@ static PfChannelResult DynvcTrackerPeekFn(ChannelStateTracker* tracker, BOOL fir
}
}

if (trackerState->CurrentDataReceived == trackerState->currentDataLength)
{
trackerState->currentDataLength = 0;
trackerState->CurrentDataFragments = 0;
trackerState->CurrentDataReceived = 0;
}

switch (dynChannel->channelMode)
{
case PF_UTILS_CHANNEL_PASSTHROUGH:
Expand Down

0 comments on commit e4f476f

Please sign in to comment.