[server,proxy] use cached channel id

This commit is contained in:
Armin Novak 2022-12-22 14:57:43 +01:00 committed by David Fort
parent c4bbe09649
commit 22c47b7def

View File

@ -442,7 +442,6 @@ static BOOL pf_client_receive_channel_data_hook(freerdp* instance, UINT16 channe
pServerContext* ps;
proxyData* pdata;
pServerStaticChannelContext* channel;
UINT16 server_channel_id;
UINT64 channelId64 = channelId;
WINPR_ASSERT(instance);
@ -466,15 +465,13 @@ static BOOL pf_client_receive_channel_data_hook(freerdp* instance, UINT16 channe
switch (channel->onBackData(pdata, channel, xdata, xsize, flags, totalSize))
{
case PF_CHANNEL_RESULT_PASS:
server_channel_id = WTSChannelGetId(ps->context.peer, channel->channel_name);
/* Ignore messages for channels that can not be mapped.
* The client might not have enabled support for this specific channel,
* so just drop the message. */
if (server_channel_id == 0)
if (channel->front_channel_id == 0)
return TRUE;
return ps->context.peer->SendChannelPacket(ps->context.peer, server_channel_id,
return ps->context.peer->SendChannelPacket(ps->context.peer, channel->front_channel_id,
totalSize, flags, xdata, xsize);
case PF_CHANNEL_RESULT_DROP:
return TRUE;