server/proxy/pf_client.c
static void pf_client_post_disconnect(freerdp* instance)
{
	pClientContext* pc;
	proxyData* pdata;

	if (!instance)
		return;

	if (!instance->context)
		return;

	pc = (pClientContext*)instance->context;
	WINPR_ASSERT(pc);
	pdata = pc->pdata;
	WINPR_ASSERT(pdata);

	pc->connected = FALSE;
	pf_modules_run_hook(pc->pdata->module, HOOK_TYPE_CLIENT_POST_CONNECT, pc->pdata, pc);

	PubSub_UnsubscribeChannelConnected(instance->context->pubSub,
	                                   pf_channels_on_client_channel_connect);
	PubSub_UnsubscribeChannelDisconnected(instance->context->pubSub,
	                                      pf_channels_on_client_channel_disconnect);
	PubSub_UnsubscribeErrorInfo(instance->context->pubSub, pf_client_on_error_info);
	gdi_free(instance);

	/* Only close the connection if NLA fallback process is done */
	if (!pc->allow_next_conn_failure)
		proxy_data_abort_connect(pdata);
}
/* This function is called whether a session ends by failure or success.
 * Clean up everything allocated by pre_connect and post_connect.
 */
This function is called whether a session ends by failure or success.
Clean up everything allocated by pre_connect and post_connect.
This function is called whether a session ends by failure or success . Clean up everything allocated by pre_connect and post_connect .
static void pf_client_post_disconnect(freerdp* instance)
{
	pClientContext* pc;
	proxyData* pdata;
	if (!instance)
		return;
	if (!instance->context)
		return;
	pc = (pClientContext*)instance->context;
	WINPR_ASSERT(pc);
	pdata = pc->pdata;
	WINPR_ASSERT(pdata);
	pc->connected = FALSE;
	pf_modules_run_hook(pc->pdata->module, HOOK_TYPE_CLIENT_POST_CONNECT, pc->pdata, pc);
	PubSub_UnsubscribeChannelConnected(instance->context->pubSub,
	                                   pf_channels_on_client_channel_connect);
	PubSub_UnsubscribeChannelDisconnected(instance->context->pubSub,
	                                      pf_channels_on_client_channel_disconnect);
	PubSub_UnsubscribeErrorInfo(instance->context->pubSub, pf_client_on_error_info);
	gdi_free(instance);
	if (!pc->allow_next_conn_failure)
		proxy_data_abort_connect(pdata);
}
static void pf_client_post_disconnect ( freerdp * instance ) { pClientContext * pc ; proxyData * pdata ; if ( ! instance ) return ; if ( ! instance -> context ) return ; pc = ( pClientContext * ) instance -> context ; WINPR_ASSERT ( pc ) ; pdata = pc -> pdata ; WINPR_ASSERT ( pdata ) ; pc -> connected = FALSE ; pf_modules_run_hook ( pc -> pdata -> module , HOOK_TYPE_CLIENT_POST_CONNECT , pc -> pdata , pc ) ; PubSub_UnsubscribeChannelConnected ( instance -> context -> pubSub , pf_channels_on_client_channel_connect ) ; PubSub_UnsubscribeChannelDisconnected ( instance -> context -> pubSub , pf_channels_on_client_channel_disconnect ) ; PubSub_UnsubscribeErrorInfo ( instance -> context -> pubSub , pf_client_on_error_info ) ; gdi_free ( instance ) ; if ( ! pc -> allow_next_conn_failure ) proxy_data_abort_connect ( pdata ) ; }
This function is called whether a session ends by failure or success.
This function is called whether a session ends by failure or success .
/* Only close the connection if NLA fallback process is done */