BOOL nego_recv_response(rdpNego* nego) { int status; wStream* s; s = Stream_New(NULL, 1024); if (!s) return FALSE; status = transport_read_pdu(nego->transport, s); if (status < 0) { Stream_Free(s, TRUE); return FALSE; } status = nego_recv(nego->transport, s, nego); Stream_Free(s, TRUE); if (status < 0) return FALSE; return TRUE; }
boolean nego_recv_response(rdpNego* nego) { STREAM* s = transport_recv_stream_init(nego->transport, 1024); if (transport_read(nego->transport, s) < 0) return false; return nego_recv(nego->transport, s, nego->transport->recv_extra); }
BOOL nego_recv_response(rdpNego* nego) { STREAM* s = transport_recv_stream_init(nego->transport, 1024); if (transport_read(nego->transport, s) < 0) return FALSE; return nego_recv(nego->transport, s, nego); }
/* Receive an X.224 TPDU */ static STREAM x224_recv(rdpIso * iso, STREAM s, int length, uint8 * pcode) { uint8 lengthIndicator; uint8 code; uint8 subcode; s = tcp_recv(iso->tcp, s, length - 4); if (s == NULL) return NULL; /* X.224 TPDU Header */ in_uint8(s, lengthIndicator); in_uint8(s, code); subcode = code & 0x0F; /* get the lower nibble */ code &= 0xF0; /* take out lower nibble */ *pcode = code; if (code == X224_TPDU_DATA) { in_uint8s(s, 1); /* EOT */ return s; } /* dst-ref (2 bytes) */ /* src-ref (2 bytes) */ /* class option (1 byte) */ in_uint8s(s, 5); switch (code) { /* Connection Request */ case X224_TPDU_CONNECTION_REQUEST: break; /* Connection Confirm */ case X224_TPDU_CONNECTION_CONFIRM: break; /* Disconnect Request */ case X224_TPDU_DISCONNECT_REQUEST: break; /* Data */ case X224_TPDU_DATA: break; /* Error */ case X224_TPDU_ERROR: break; } /* According to X.224 13.4 and [MS-RDPBCGR] 2.2.1.2, the rdpNegData field is optional and its length is included in the X.224 length indicator */ if (lengthIndicator > 6) { nego_recv(iso->nego, s); } return s; }