From dde8d81f46504ec86b890f21b837b6b30e6c3cd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benoi=CC=82t=20LeBlanc?= Date: Wed, 12 Mar 2014 18:23:17 -0400 Subject: [PATCH 1/3] Removed WLOG traces for audio playback --- channels/rdpsnd/client/rdpsnd_main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/channels/rdpsnd/client/rdpsnd_main.c b/channels/rdpsnd/client/rdpsnd_main.c index 3d4cc1900..0d7c1425a 100644 --- a/channels/rdpsnd/client/rdpsnd_main.c +++ b/channels/rdpsnd/client/rdpsnd_main.c @@ -1094,8 +1094,6 @@ int VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints) rdpsnd->log = WLog_Get("com.freerdp.channels.rdpsnd.client"); - WLog_SetLogLevel(rdpsnd->log, WLOG_TRACE); - rdpsnd->channelEntryPoints.pVirtualChannelInit(&rdpsnd->InitHandle, &rdpsnd->channelDef, 1, VIRTUAL_CHANNEL_VERSION_WIN2000, rdpsnd_virtual_channel_init_event); From af28a35e0de93b69740f5635ee6e8ab538684b64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benoi=CC=82t=20LeBlanc?= Date: Tue, 18 Mar 2014 15:27:23 -0400 Subject: [PATCH 2/3] Transport: closing transport before sending stop event caused SSL errors when stopping the session. --- libfreerdp/core/transport.c | 58 ++++++++++++++++--------------------- libfreerdp/core/transport.h | 1 + 2 files changed, 26 insertions(+), 33 deletions(-) diff --git a/libfreerdp/core/transport.c b/libfreerdp/core/transport.c index c609afe27..20c522d00 100644 --- a/libfreerdp/core/transport.c +++ b/libfreerdp/core/transport.c @@ -71,25 +71,8 @@ void transport_attach(rdpTransport* transport, int sockfd) transport->TcpOut = transport->TcpIn; } -BOOL transport_disconnect(rdpTransport* transport) +void transport_stop(rdpTransport* transport) { - BOOL status = TRUE; - - if (!transport) - return FALSE; - - if (transport->layer == TRANSPORT_LAYER_TLS) - status &= tls_disconnect(transport->TlsIn); - - if ((transport->layer == TRANSPORT_LAYER_TSG) || (transport->layer == TRANSPORT_LAYER_TSG_TLS)) - { - status &= tsg_disconnect(transport->tsg); - } - else - { - status &= tcp_disconnect(transport->TcpIn); - } - if (transport->async) { if (transport->stopEvent) @@ -104,6 +87,28 @@ BOOL transport_disconnect(rdpTransport* transport) transport->stopEvent = NULL; } } +} + +BOOL transport_disconnect(rdpTransport* transport) +{ + BOOL status = TRUE; + + if (!transport) + return FALSE; + + transport_stop(transport); + + if (transport->layer == TRANSPORT_LAYER_TLS) + status &= tls_disconnect(transport->TlsIn); + + if ((transport->layer == TRANSPORT_LAYER_TSG) || (transport->layer == TRANSPORT_LAYER_TSG_TLS)) + { + status &= tsg_disconnect(transport->tsg); + } + else + { + status &= tcp_disconnect(transport->TcpIn); + } return status; } @@ -1055,7 +1060,7 @@ static void* transport_client_thread(void* arg) transport_get_read_handles(transport, (HANDLE*) &handles, &nCount); - status = WaitForMultipleObjects(nCount, handles, FALSE, 100); + status = WaitForMultipleObjects(nCount, handles, FALSE, INFINITE); if (transport->layer == TRANSPORT_LAYER_CLOSED) { rdpRdp* rdp = (rdpRdp*) transport->rdp; @@ -1121,20 +1126,7 @@ void transport_free(rdpTransport* transport) { if (transport) { - if (transport->async) - { - if (transport->stopEvent) - { - SetEvent(transport->stopEvent); - WaitForSingleObject(transport->thread, INFINITE); - - CloseHandle(transport->thread); - CloseHandle(transport->stopEvent); - - transport->thread = NULL; - transport->stopEvent = NULL; - } - } + transport_stop(transport); if (transport->ReceiveBuffer) Stream_Release(transport->ReceiveBuffer); diff --git a/libfreerdp/core/transport.h b/libfreerdp/core/transport.h index 1ba273f7a..c9d0331a7 100644 --- a/libfreerdp/core/transport.h +++ b/libfreerdp/core/transport.h @@ -92,6 +92,7 @@ BOOL transport_connect_tsg(rdpTransport* transport); BOOL transport_accept_rdp(rdpTransport* transport); BOOL transport_accept_tls(rdpTransport* transport); BOOL transport_accept_nla(rdpTransport* transport); +void transport_stop(rdpTransport* transport); int transport_read(rdpTransport* transport, wStream* s); int transport_write(rdpTransport* transport, wStream* s); void transport_get_fds(rdpTransport* transport, void** rfds, int* rcount); From 23d80d78b7d7852b9f158c440732fad8135d3726 Mon Sep 17 00:00:00 2001 From: Benoit LeBlanc Date: Wed, 19 Mar 2014 11:52:12 -0400 Subject: [PATCH 3/3] added missing cast for GetProcAddress --- winpr/libwinpr/wtsapi/wtsapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winpr/libwinpr/wtsapi/wtsapi.c b/winpr/libwinpr/wtsapi/wtsapi.c index e428b1aa3..6a8dea945 100644 --- a/winpr/libwinpr/wtsapi/wtsapi.c +++ b/winpr/libwinpr/wtsapi/wtsapi.c @@ -408,7 +408,7 @@ void InitializeWtsApiStubs(void) if (!g_WtsApiModule) return; - pInitWtsApi = GetProcAddress(g_WtsApiModule, "InitWtsApi"); + pInitWtsApi = (INIT_WTSAPI_FN) GetProcAddress(g_WtsApiModule, "InitWtsApi"); if (pInitWtsApi) {