mcs: drop a server-side warning on FreeRDP_ChannelDefArray::len

Server side we often see "FreeRDP_ChannelDefArray::len expected to be >= 31,
but have XXX", where XXX is lower than 31.

This patche fixes that, the old code was setting the size of ChannelDefArray to the
number of ChannelCount, which is usually not what we want. We want to keep it to 31
and have ChannelCount indicate how many of these channels are used.
This commit is contained in:
David Fort 2023-04-26 09:22:09 +02:00 committed by akallabeth
parent fad46c4455
commit 7b0b273ec1
2 changed files with 2 additions and 5 deletions

View File

@ -1858,7 +1858,7 @@ BOOL rdp_channels_from_mcs(rdpSettings* settings, const rdpRdp* rdp)
WINPR_ASSERT(mcs);
if (!freerdp_settings_set_pointer_len(settings, FreeRDP_ChannelDefArray, NULL,
mcs->channelCount))
CHANNEL_MAX_COUNT))
return FALSE;
for (x = 0; x < mcs->channelCount; x++)
@ -1872,7 +1872,7 @@ BOOL rdp_channels_from_mcs(rdpSettings* settings, const rdpRdp* rdp)
return FALSE;
}
return TRUE;
return freerdp_settings_set_uint32(settings, FreeRDP_ChannelCount, mcs->channelCount);
}
/* Here we are in client state CONFIRM_ACTIVE.

View File

@ -1468,9 +1468,6 @@ BOOL mcs_server_apply_to_settings(const rdpMcs* mcs, rdpSettings* settings)
if (!freerdp_settings_set_uint32(settings, FreeRDP_ChannelCount, mcs->channelCount))
goto fail;
if (!freerdp_settings_set_pointer_len(settings, FreeRDP_ChannelDefArray, NULL,
mcs->channelCount))
goto fail;
for (UINT32 x = 0; x < mcs->channelCount; x++)
{