libfreerdp-core: fix connection issue where drawing functions were called in rdp_connect

This commit is contained in:
Jay Sorg 2012-04-09 10:28:33 -07:00
parent 632472f7f6
commit d9b513b18c
3 changed files with 15 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;

View File

@ -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);