summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspeidy <speidy@gmail.com>2014-03-04 23:25:49 +0200
committerspeidy <speidy@gmail.com>2014-03-04 23:25:49 +0200
commit08baf1a5bca7ed41cd9809118f01ba583f5e160b (patch)
tree16ec9b880774276b14691f2057376011fd53254d
parent43f4d439ec52616ccf6380374e21bce0b7087694 (diff)
downloadxrdp-proprietary-08baf1a5bca7ed41cd9809118f01ba583f5e160b.tar.gz
xrdp-proprietary-08baf1a5bca7ed41cd9809118f01ba583f5e160b.zip
libxrdp: fastpath input working
-rw-r--r--libxrdp/xrdp_fastpath.c26
-rw-r--r--libxrdp/xrdp_rdp.c9
2 files changed, 8 insertions, 27 deletions
diff --git a/libxrdp/xrdp_fastpath.c b/libxrdp/xrdp_fastpath.c
index e7308ba0..843fdc1b 100644
--- a/libxrdp/xrdp_fastpath.c
+++ b/libxrdp/xrdp_fastpath.c
@@ -59,17 +59,10 @@ xrdp_fastpath_recv(struct xrdp_fastpath *self, struct stream *s)
int len = 0;
int byte;
int hdr_len = 2; /* fastpath header length - can be 2 or 3 bytes long, depends on length */
- DEBUG((" in xrdp_fastpath_recv"));
+ DEBUG((" in xrdp_fastpath_recv"));
- /* read the first fastpath byte
- * (we already received it via iso layer */
- // receive fastpath first length packet
- init_stream(s, hdr_len);
- if (trans_force_read_s(self->trans, s, hdr_len) != 0)
- {
- return 1;
- }
in_uint8(s, fp_hdr); /* fpInputHeader (1 byte) */
+ g_writeln("xrdp_fastpath_recv: header= 0x%8.8x", fp_hdr);
self->numEvents = (fp_hdr & 0x3C) >> 2;
self->secFlags = (fp_hdr & 0xC0) >> 6;
@@ -82,13 +75,8 @@ xrdp_fastpath_recv(struct xrdp_fastpath *self, struct stream *s)
byte &= ~(0x80);
len = (byte << 8);
// receive fastpath second length packet
- init_stream(s, 1);
- if (trans_force_read_s(self->trans, s, 1) != 0)
- {
- return 1;
- }
- hdr_len++;
in_uint8(s, byte); /* length 2 */
+ hdr_len++;
len += byte;
}
else
@@ -96,14 +84,8 @@ xrdp_fastpath_recv(struct xrdp_fastpath *self, struct stream *s)
len = byte;
}
- g_writeln("len= %d , numEvents= %d, secFlags= %d, bytesleft: %d", len, self->numEvents, self->secFlags, (s->p - s->data));
+// g_writeln("len= %d , numEvents= %d, secFlags= %d, bytesleft: %d", len, self->numEvents, self->secFlags, (s->p - s->data));
- // receive the left bytes
- init_stream(s, len - hdr_len);
- if (trans_force_read_s(self->trans, s, len - hdr_len) != 0)
- {
- return 1;
- }
DEBUG((" out xrdp_fastpath_recv"));
return 0;
diff --git a/libxrdp/xrdp_rdp.c b/libxrdp/xrdp_rdp.c
index ea2204f5..d909abd9 100644
--- a/libxrdp/xrdp_rdp.c
+++ b/libxrdp/xrdp_rdp.c
@@ -303,23 +303,22 @@ xrdp_rdp_recv(struct xrdp_rdp *self, struct stream *s, int *code)
header = (const tui8 *) (self->session->trans->in_s->p);
DEBUG(("in xrdp_rdp_recv"));
-
- /* not fastpath, do tpkt */
if (s->next_packet == 0 || s->next_packet >= s->end)
{
- /* check for fastpath first */
- g_writeln("xrdp_rdp_recv: header= 0x%8.8x", header[0]);
- if ((header[0] & 0x3) == 0 && (header[0] != 0x3c))
+ /* check for fastpath first */
+ if ((header[0] != 0x3) && (header[0] != 0x3c))
{
if (xrdp_sec_recv_fastpath(self->sec_layer, s) != 0)
{
return 1;
}
*code = 2; // special code for fastpath
+ DEBUG(("out (fastpath) xrdp_rdp_recv"));
return 0;
}
+ /* not fastpath, do tpkt */
chan = 0;
error = xrdp_sec_recv(self->sec_layer, s, &chan);