Skip to content

Commit

Permalink
libfreerdp-core: server synchronized access to dvc channel seq.
Browse files Browse the repository at this point in the history
  • Loading branch information
llyzs committed Dec 19, 2014
1 parent ec3be62 commit 7449abe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions libfreerdp/core/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ HANDLE WINAPI FreeRDP_WTSOpenServerA(LPSTR pServerName)

vcm->queue = MessageQueue_New(NULL);

vcm->dvc_channel_id_seq = 1;
vcm->dvc_channel_id_seq = 0;
vcm->dynamicVirtualChannels = ArrayList_New(TRUE);

client->ReceiveChannelData = WTSReceiveChannelData;
Expand Down Expand Up @@ -991,7 +991,7 @@ HANDLE WINAPI FreeRDP_WTSVirtualChannelOpenEx(DWORD SessionId, LPSTR pVirtualNam
channel->receiveData = Stream_New(NULL, client->settings->VirtualChannelChunkSize);
channel->queue = MessageQueue_New(NULL);

channel->channelId = vcm->dvc_channel_id_seq++;
channel->channelId = InterlockedIncrement(&vcm->dvc_channel_id_seq);
ArrayList_Add(vcm->dynamicVirtualChannels, channel);

s = Stream_New(NULL, 64);
Expand Down
2 changes: 1 addition & 1 deletion libfreerdp/core/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ struct WTSVirtualChannelManager

rdpPeerChannel* drdynvc_channel;
BYTE drdynvc_state;
UINT32 dvc_channel_id_seq;
LONG dvc_channel_id_seq;

wArrayList* dynamicVirtualChannels;
};
Expand Down

0 comments on commit 7449abe

Please sign in to comment.