Merge pull request #2770 from akallabeth/bio_event_reset

Resetting frontBio after read now.
This commit is contained in:
Vic Lee 2015-07-16 06:57:46 -07:00
commit 042cb250f3
1 changed files with 8 additions and 3 deletions

View File

@ -674,7 +674,8 @@ DWORD transport_get_event_handles(rdpTransport* transport, HANDLE* events, DWORD
{
if (events && (nCount < count))
{
BIO_get_event(transport->frontBio, &events[nCount]);
if (BIO_get_event(transport->frontBio, &events[nCount]) != 1)
return 0;
nCount++;
}
}
@ -744,10 +745,14 @@ int transport_check_fds(rdpTransport* transport)
int status;
int recv_status;
wStream* received;
HANDLE event;
if (!transport)
return -1;
if (BIO_get_event(transport->frontBio, &event) != 1)
return -1;
/**
* Loop through and read all available PDUs. Since multiple
* PDUs can exist, it's important to deliver them all before
@ -755,6 +760,7 @@ int transport_check_fds(rdpTransport* transport)
* wait for a socket to get signaled that data is available
* (which may never happen).
*/
ResetEvent(event);
for (;;)
{
/**
@ -770,7 +776,6 @@ int transport_check_fds(rdpTransport* transport)
{
if (status < 0)
WLog_DBG(TAG, "transport_check_fds: transport_read_pdu() - %i", status);
return status;
}
@ -966,7 +971,7 @@ out:
rdpTransport* transport_new(rdpContext* context)
{
rdpTransport* transport;
transport = (rdpTransport*) calloc(1, sizeof(rdpTransport));
if (!transport)