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;
|
||||
|
||||
rdp = (rdpRdp*) calloc(1, sizeof(rdpRdp));
|
||||
|
||||
if (!rdp)
|
||||
return NULL;
|
||||
|
||||
@ -1298,7 +1299,8 @@ rdpRdp* rdp_new(rdpContext* context)
|
||||
if (context->instance)
|
||||
context->instance->settings = rdp->settings;
|
||||
|
||||
rdp->transport = transport_new(rdp->settings);
|
||||
rdp->transport = transport_new(context);
|
||||
|
||||
if (!rdp->transport)
|
||||
goto out_free_settings;
|
||||
|
||||
@ -1382,8 +1384,10 @@ out_free:
|
||||
|
||||
void rdp_reset(rdpRdp* rdp)
|
||||
{
|
||||
rdpContext* context;
|
||||
rdpSettings* settings;
|
||||
|
||||
context = rdp->context;
|
||||
settings = rdp->settings;
|
||||
|
||||
bulk_reset(rdp->bulk);
|
||||
@ -1411,7 +1415,7 @@ void rdp_reset(rdpRdp* rdp)
|
||||
free(settings->ClientAddress);
|
||||
settings->ClientAddress = NULL;
|
||||
|
||||
rdp->transport = transport_new(rdp->settings);
|
||||
rdp->transport = transport_new(context);
|
||||
rdp->transport->rdp = rdp;
|
||||
rdp->license = license_new(rdp);
|
||||
rdp->nego = nego_new(rdp->transport);
|
||||
|
@ -1158,7 +1158,7 @@ static void* transport_client_thread(void* arg)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
rdpTransport* transport_new(rdpSettings* settings)
|
||||
rdpTransport* transport_new(rdpContext* context)
|
||||
{
|
||||
rdpTransport* transport;
|
||||
|
||||
@ -1167,20 +1167,20 @@ rdpTransport* transport_new(rdpSettings* settings)
|
||||
if (!transport)
|
||||
return NULL;
|
||||
|
||||
transport->context = context;
|
||||
transport->settings = context->settings;
|
||||
|
||||
WLog_Init();
|
||||
transport->log = WLog_Get(TAG);
|
||||
|
||||
if (!transport->log)
|
||||
goto out_free;
|
||||
|
||||
transport->TcpIn = freerdp_tcp_new(settings);
|
||||
transport->TcpIn = freerdp_tcp_new(context->settings);
|
||||
|
||||
if (!transport->TcpIn)
|
||||
goto out_free;
|
||||
|
||||
transport->settings = settings;
|
||||
transport->context = ((freerdp*) settings->instance)->context;
|
||||
|
||||
/* a small 0.1ms delay when transport is blocking. */
|
||||
transport->SleepInterval = 100;
|
||||
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);
|
||||
int transport_receive_pool_return(rdpTransport* transport, wStream* pdu);
|
||||
|
||||
rdpTransport* transport_new(rdpSettings* settings);
|
||||
rdpTransport* transport_new(rdpContext* context);
|
||||
void transport_free(rdpTransport* transport);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user