libfreerdp-core: fix faulty rdpTransport server-side initialization
This commit is contained in:
parent
e2f377ae11
commit
9b28562cc1
@ -1273,6 +1273,7 @@ rdpRdp* rdp_new(rdpContext* context)
|
|||||||
BOOL newSettings = FALSE;
|
BOOL newSettings = FALSE;
|
||||||
|
|
||||||
rdp = (rdpRdp*) calloc(1, sizeof(rdpRdp));
|
rdp = (rdpRdp*) calloc(1, sizeof(rdpRdp));
|
||||||
|
|
||||||
if (!rdp)
|
if (!rdp)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@ -1298,7 +1299,8 @@ rdpRdp* rdp_new(rdpContext* context)
|
|||||||
if (context->instance)
|
if (context->instance)
|
||||||
context->instance->settings = rdp->settings;
|
context->instance->settings = rdp->settings;
|
||||||
|
|
||||||
rdp->transport = transport_new(rdp->settings);
|
rdp->transport = transport_new(context);
|
||||||
|
|
||||||
if (!rdp->transport)
|
if (!rdp->transport)
|
||||||
goto out_free_settings;
|
goto out_free_settings;
|
||||||
|
|
||||||
@ -1382,8 +1384,10 @@ out_free:
|
|||||||
|
|
||||||
void rdp_reset(rdpRdp* rdp)
|
void rdp_reset(rdpRdp* rdp)
|
||||||
{
|
{
|
||||||
|
rdpContext* context;
|
||||||
rdpSettings* settings;
|
rdpSettings* settings;
|
||||||
|
|
||||||
|
context = rdp->context;
|
||||||
settings = rdp->settings;
|
settings = rdp->settings;
|
||||||
|
|
||||||
bulk_reset(rdp->bulk);
|
bulk_reset(rdp->bulk);
|
||||||
@ -1411,7 +1415,7 @@ void rdp_reset(rdpRdp* rdp)
|
|||||||
free(settings->ClientAddress);
|
free(settings->ClientAddress);
|
||||||
settings->ClientAddress = NULL;
|
settings->ClientAddress = NULL;
|
||||||
|
|
||||||
rdp->transport = transport_new(rdp->settings);
|
rdp->transport = transport_new(context);
|
||||||
rdp->transport->rdp = rdp;
|
rdp->transport->rdp = rdp;
|
||||||
rdp->license = license_new(rdp);
|
rdp->license = license_new(rdp);
|
||||||
rdp->nego = nego_new(rdp->transport);
|
rdp->nego = nego_new(rdp->transport);
|
||||||
|
@ -1158,7 +1158,7 @@ static void* transport_client_thread(void* arg)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
rdpTransport* transport_new(rdpSettings* settings)
|
rdpTransport* transport_new(rdpContext* context)
|
||||||
{
|
{
|
||||||
rdpTransport* transport;
|
rdpTransport* transport;
|
||||||
|
|
||||||
@ -1167,20 +1167,20 @@ rdpTransport* transport_new(rdpSettings* settings)
|
|||||||
if (!transport)
|
if (!transport)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
transport->context = context;
|
||||||
|
transport->settings = context->settings;
|
||||||
|
|
||||||
WLog_Init();
|
WLog_Init();
|
||||||
transport->log = WLog_Get(TAG);
|
transport->log = WLog_Get(TAG);
|
||||||
|
|
||||||
if (!transport->log)
|
if (!transport->log)
|
||||||
goto out_free;
|
goto out_free;
|
||||||
|
|
||||||
transport->TcpIn = freerdp_tcp_new(settings);
|
transport->TcpIn = freerdp_tcp_new(context->settings);
|
||||||
|
|
||||||
if (!transport->TcpIn)
|
if (!transport->TcpIn)
|
||||||
goto out_free;
|
goto out_free;
|
||||||
|
|
||||||
transport->settings = settings;
|
|
||||||
transport->context = ((freerdp*) settings->instance)->context;
|
|
||||||
|
|
||||||
/* a small 0.1ms delay when transport is blocking. */
|
/* a small 0.1ms delay when transport is blocking. */
|
||||||
transport->SleepInterval = 100;
|
transport->SleepInterval = 100;
|
||||||
transport->ReceivePool = StreamPool_New(TRUE, BUFFER_SIZE);
|
transport->ReceivePool = StreamPool_New(TRUE, BUFFER_SIZE);
|
||||||
|
@ -111,7 +111,7 @@ int tranport_drain_output_buffer(rdpTransport* transport);
|
|||||||
wStream* transport_receive_pool_take(rdpTransport* transport);
|
wStream* transport_receive_pool_take(rdpTransport* transport);
|
||||||
int transport_receive_pool_return(rdpTransport* transport, wStream* pdu);
|
int transport_receive_pool_return(rdpTransport* transport, wStream* pdu);
|
||||||
|
|
||||||
rdpTransport* transport_new(rdpSettings* settings);
|
rdpTransport* transport_new(rdpContext* context);
|
||||||
void transport_free(rdpTransport* transport);
|
void transport_free(rdpTransport* transport);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user