{
pClientContext* context;
proxyData* pdata;
- rdpContext* ps;
- freerdp_peer* peer;
if (!instance)
return;
context = (pClientContext*) instance->context;
pdata = context->pdata;
- ps = (rdpContext*) pdata->ps;
- peer = ps->peer;
PubSub_UnsubscribeChannelConnected(instance->context->pubSub,
pf_OnChannelConnectedEventHandler);
PubSub_UnsubscribeErrorInfo(instance->context->pubSub, pf_OnErrorInfo);
gdi_free(instance);
- if (!pf_common_connection_aborted_by_peer(pdata))
- {
- SetEvent(pdata->connectionClosed);
- WLog_INFO(TAG, "connectionClosed event is not set; closing connection with client");
- peer->Disconnect(peer);
- }
-
+ SetEvent(pdata->connectionClosed);
/* It's important to avoid calling `freerdp_peer_context_free` and `freerdp_peer_free` here,
* in order to avoid double-free. Those objects will be freed by the server when needed.
*/
ps = (pServerContext*)client->context;
pc = (rdpContext*) ps->pdata->pc;
pdata = ps->pdata;
- WLog_INFO(TAG, "Client %s disconnected; closing connection with server %s",
+ WLog_INFO(TAG, "Client %s disconnected; closing proxy's client <> target server connection %s",
client->hostname, pc->settings->ServerHostname);
/* Mark connection closed for sContext */
SetEvent(pdata->connectionClosed);
eventCount += tmp;
}
eventHandles[eventCount++] = ChannelEvent;
+ eventHandles[eventCount++] = pdata->connectionClosed;
eventHandles[eventCount++] = WTSVirtualChannelManagerGetEventHandle(ps->vcm);
status = WaitForMultipleObjects(eventCount, eventHandles, FALSE, INFINITE);
if (status == WAIT_FAILED)
{
- /* Ignore wait fails that are caused by legitimate client disconnections */
- if (pf_common_connection_aborted_by_peer(pdata))
- break;
-
WLog_ERR(TAG, "WaitForMultipleObjects failed (errno: %d)", errno);
break;
}
+ if (pf_common_connection_aborted_by_peer(pdata))
+ {
+ WLog_INFO(TAG, "proxy's client disconnected, closing connection with client %s", client->hostname);
+ break;
+ }
+
if (client->CheckFileDescriptor(client) != TRUE)
break;