Fixed channel cleanup.

This commit is contained in:
Armin Novak 2016-08-09 22:37:02 +02:00 committed by Armin Novak
parent d35823cf69
commit 122f25eb60
1 changed files with 13 additions and 11 deletions

View File

@ -146,7 +146,7 @@ BOOL freerdp_connect(freerdp* instance)
if (instance->settings->DumpRemoteFx)
{
instance->update->pcap_rfx = pcap_open(instance->settings->DumpRemoteFxFile,
TRUE);
TRUE);
if (instance->update->pcap_rfx)
instance->update->dump_rfx = TRUE;
@ -209,7 +209,7 @@ BOOL freerdp_connect(freerdp* instance)
if (rdp->errorInfo == ERRINFO_SERVER_INSUFFICIENT_PRIVILEGES)
freerdp_set_last_error(instance->context,
FREERDP_ERROR_INSUFFICIENT_PRIVILEGES);
FREERDP_ERROR_INSUFFICIENT_PRIVILEGES);
SetEvent(rdp->transport->connectedEvent);
freerdp_connect_finally:
@ -228,7 +228,7 @@ BOOL freerdp_abort_connect(freerdp* instance)
}
BOOL freerdp_get_fds(freerdp* instance, void** rfds, int* rcount, void** wfds,
int* wcount)
int* wcount)
{
rdpRdp* rdp = instance->context->rdp;
transport_get_fds(rdp->transport, rfds, rcount);
@ -267,7 +267,7 @@ BOOL freerdp_check_fds(freerdp* instance)
}
DWORD freerdp_get_event_handles(rdpContext* context, HANDLE* events,
DWORD count)
DWORD count)
{
DWORD nCount = 0;
nCount += transport_get_event_handles(context->rdp->transport, events, count);
@ -343,7 +343,7 @@ HANDLE freerdp_get_message_queue_event_handle(freerdp* instance, DWORD id)
}
int freerdp_message_queue_process_message(freerdp* instance, DWORD id,
wMessage* message)
wMessage* message)
{
int status = -1;
@ -380,7 +380,7 @@ int freerdp_message_queue_process_pending_messages(freerdp* instance, DWORD id)
}
static int freerdp_send_channel_data(freerdp* instance, UINT16 channelId,
BYTE* data, int size)
BYTE* data, int size)
{
return rdp_send_channel_data(instance->context->rdp, channelId, data, size);
}
@ -393,7 +393,9 @@ BOOL freerdp_disconnect(freerdp* instance)
rdp_client_disconnect(rdp);
update_post_disconnect(instance->update);
IFCALL(instance->PostDisconnect, instance);
if (freerdp_channels_disconnect(instance->context->channels, instance) != CHANNEL_RC_OK)
if (freerdp_channels_disconnect(instance->context->channels,
instance) != CHANNEL_RC_OK)
rc = FALSE;
if (instance->update->pcap_rfx)
@ -404,6 +406,7 @@ BOOL freerdp_disconnect(freerdp* instance)
}
codecs_free(instance->context->codecs);
freerdp_channels_close(instance->context->channels, instance);
return rc;
}
@ -532,7 +535,7 @@ BOOL freerdp_context_new(freerdp* instance)
goto fail;
PubSub_AddEventTypes(context->pubSub, FreeRDP_Events,
sizeof(FreeRDP_Events) / sizeof(wEventType));
sizeof(FreeRDP_Events) / sizeof(wEventType));
context->metrics = metrics_new(context);
if (!context->metrics)
@ -623,7 +626,6 @@ void freerdp_context_free(freerdp* instance)
free(instance->context->errorDescription);
CloseHandle(instance->context->abortEvent);
instance->context->abortEvent = NULL;
freerdp_channels_close(instance->context->channels, instance);
freerdp_channels_free(instance->context->channels);
free(instance->context);
instance->context = NULL;
@ -707,7 +709,7 @@ void freerdp_set_last_error(rdpContext* context, UINT32 lastError)
{
if (lastError)
WLog_ERR(TAG, "freerdp_set_last_error %s [0x%04X]",
freerdp_get_last_error_name(lastError), lastError);
freerdp_get_last_error_name(lastError), lastError);
context->LastError = lastError;
@ -813,7 +815,7 @@ BOOL checkChannelErrorEvent(rdpContext* context)
if (WaitForSingleObject(context->channelErrorEvent, 0) == WAIT_OBJECT_0)
{
WLog_ERR(TAG, "%s. Error was %lu", context->errorDescription,
context->channelErrorNum);
context->channelErrorNum);
return FALSE;
}