transport: exit transport loop when the session is activated.

This commit is contained in:
Vic Lee 2014-09-11 14:04:32 -07:00
parent c86b81f966
commit af57056228
2 changed files with 9 additions and 5 deletions

View File

@ -1153,7 +1153,10 @@ static int rdp_recv_callback(rdpTransport* transport, wStream* s, void* extra)
status = rdp_recv_pdu(rdp, s); status = rdp_recv_pdu(rdp, s);
if ((status >= 0) && (rdp->finalize_sc_pdus == FINALIZE_SC_COMPLETE)) if ((status >= 0) && (rdp->finalize_sc_pdus == FINALIZE_SC_COMPLETE))
{
rdp_client_transition_to_state(rdp, CONNECTION_STATE_ACTIVE); rdp_client_transition_to_state(rdp, CONNECTION_STATE_ACTIVE);
return 2;
}
break; break;
case CONNECTION_STATE_ACTIVE: case CONNECTION_STATE_ACTIVE:

View File

@ -1071,13 +1071,14 @@ int transport_check_fds(rdpTransport* transport)
*/ */
recv_status = transport->ReceiveCallback(transport, received, transport->ReceiveExtra); recv_status = transport->ReceiveCallback(transport, received, transport->ReceiveExtra);
if (recv_status == 1)
{
return 1; /* session redirection */
}
Stream_Release(received); Stream_Release(received);
/* session redirection or activation */
if (recv_status == 1 || recv_status == 2)
{
return recv_status;
}
if (recv_status < 0) if (recv_status < 0)
return -1; return -1;
} }