From a4d2917a0a169c0672dc61be4f7b4689a02278b3 Mon Sep 17 00:00:00 2001 From: speidy Date: Wed, 9 Oct 2013 23:06:45 +0300 Subject: libxrdp: iso_send_rdpnegrdp fix + notes. --- libxrdp/xrdp_iso.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'libxrdp') diff --git a/libxrdp/xrdp_iso.c b/libxrdp/xrdp_iso.c index 04e19983..e77f5316 100644 --- a/libxrdp/xrdp_iso.c +++ b/libxrdp/xrdp_iso.c @@ -176,24 +176,18 @@ xrdp_iso_send_rdpnegrsp(struct xrdp_iso *self, struct stream *s, int code) return 1; } - //check for RDPNEGDATA - send_rdpnegdata = 1; - if (self->selectedProtocol == -1) { - send_rdpnegdata = 0; - } - /* TPKT HEADER - 4 bytes */ out_uint8(s, 3); /* version */ out_uint8(s, 0); /* RESERVED */ - if (send_rdpnegdata == 1) { - out_uint16_be(s, 19); /* length */ + if (self->selectedProtocol != -1) { + out_uint16_be(s, 19); /* length */ //rdp negotiation happens. } else { - out_uint16_be(s, 11); /* length */ + out_uint16_be(s, 11); /* length */ //rdp negotiation doesn't happen. } /* ISO LAYER - X.224 - 7 bytes*/ - if (send_rdpnegdata == 1) { + if (self->selectedProtocol != -1) { out_uint8(s, 14); /* length */ } else @@ -204,7 +198,7 @@ xrdp_iso_send_rdpnegrsp(struct xrdp_iso *self, struct stream *s, int code) out_uint16_be(s, 0); out_uint16_be(s, 0x1234); out_uint8(s, 0); - if (send_rdpnegdata == 1) { + if (self->selectedProtocol != -1) { /* RDP_NEG_RSP - 8 bytes*/ out_uint8(s, RDP_NEG_RSP); out_uint8(s, EXTENDED_CLIENT_DATA_SUPPORTED); /* flags */ -- cgit v1.2.1