Return OK in case of channel not connected.

This commit is contained in:
Armin Novak 2017-01-17 16:27:56 +01:00
parent 7f1d4222eb
commit ea45c148c0

View File

@ -989,14 +989,16 @@ static UINT VCAPITYPE FreeRDP_VirtualChannelWriteEx(LPVOID pInitHandle, DWORD op
if (!channels)
return CHANNEL_RC_BAD_CHANNEL_HANDLE;
/* If a channel is not connected do not send the data but ignore it.
* Return success to allow terminating channel threads to end gracefully. */
if (!channels->connected)
return CHANNEL_RC_OK;
pChannelOpenData = HashTable_GetItemValue(channels->openHandles, (void*)(UINT_PTR) openHandle);
if (!pChannelOpenData)
return CHANNEL_RC_BAD_CHANNEL_HANDLE;
if (!channels->connected)
return CHANNEL_RC_NOT_CONNECTED;
if (!pData)
return CHANNEL_RC_NULL_DATA;