libfreerdp-core: fix connection issue where drawing functions were called in rdp_connect
This commit is contained in:
parent
632472f7f6
commit
d9b513b18c
@ -107,11 +107,13 @@ boolean rdp_client_connect(rdpRdp* rdp)
|
||||
return false;
|
||||
}
|
||||
|
||||
rdp->transport->process_single_pdu = true;
|
||||
while (rdp->state != CONNECTION_STATE_ACTIVE)
|
||||
{
|
||||
if (rdp_check_fds(rdp) < 0)
|
||||
return false;
|
||||
}
|
||||
rdp->transport->process_single_pdu = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -377,10 +377,10 @@ int transport_check_fds(rdpTransport** ptransport)
|
||||
stream_set_pos(received, length);
|
||||
stream_seal(received);
|
||||
stream_set_pos(received, 0);
|
||||
|
||||
|
||||
if (transport->recv_callback(transport, received, transport->recv_extra) == false)
|
||||
status = -1;
|
||||
|
||||
|
||||
stream_free(received);
|
||||
|
||||
if (status < 0)
|
||||
@ -388,6 +388,16 @@ int transport_check_fds(rdpTransport** ptransport)
|
||||
|
||||
/* transport might now have been freed by rdp_client_redirect and a new rdp->transport created */
|
||||
transport = *ptransport;
|
||||
|
||||
if (transport->process_single_pdu)
|
||||
{
|
||||
/* one at a time but set event if data buffered
|
||||
* so the main loop will call freerdp_check_fds asap */
|
||||
if (stream_get_pos(transport->recv_buffer) > 0)
|
||||
wait_obj_set(transport->recv_event);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -56,6 +56,7 @@ struct rdp_transport
|
||||
TransportRecv recv_callback;
|
||||
struct wait_obj* recv_event;
|
||||
boolean blocking;
|
||||
boolean process_single_pdu; /* process single pdu in transport_check_fds */
|
||||
};
|
||||
|
||||
STREAM* transport_recv_stream_init(rdpTransport* transport, int size);
|
||||
|
Loading…
Reference in New Issue
Block a user