summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libxrdp/libxrdp.h1
-rw-r--r--libxrdp/xrdp_fastpath.c15
-rw-r--r--libxrdp/xrdp_rdp.c5
3 files changed, 15 insertions, 6 deletions
diff --git a/libxrdp/libxrdp.h b/libxrdp/libxrdp.h
index 4059dbed..91f21974 100644
--- a/libxrdp/libxrdp.h
+++ b/libxrdp/libxrdp.h
@@ -82,7 +82,6 @@ struct xrdp_fastpath
struct xrdp_tcp* tcp_layer;
int numEvents;
int secFlags;
- int firstPacket;
};
/* sec */
diff --git a/libxrdp/xrdp_fastpath.c b/libxrdp/xrdp_fastpath.c
index 0d5c58c3..71e7f7c6 100644
--- a/libxrdp/xrdp_fastpath.c
+++ b/libxrdp/xrdp_fastpath.c
@@ -56,8 +56,9 @@ int APP_CC
xrdp_fastpath_recv(struct xrdp_fastpath *self, struct stream *s)
{
int fp_hdr;
- int len;
+ int len = 0;
int byte;
+ int hdr_len = 2;
DEBUG((" in xrdp_fastpath_recv"));
/* read the first fastpath byte
@@ -67,7 +68,7 @@ xrdp_fastpath_recv(struct xrdp_fastpath *self, struct stream *s)
self->numEvents = (fp_hdr & 0x3C) >> 2;
self->secFlags = (fp_hdr & 0xC0) >> 6;
- // receive fastpath packet length
+ // receive fastpath first packet length
if (xrdp_tcp_recv(self->tcp_layer, s, 1) != 0)
{
return 1;
@@ -79,6 +80,12 @@ xrdp_fastpath_recv(struct xrdp_fastpath *self, struct stream *s)
{
byte &= ~(0x80);
len = (byte << 8);
+ // receive fastpath second packet length
+ if (xrdp_tcp_recv(self->tcp_layer, s, 1) != 0)
+ {
+ return 1;
+ }
+ hdr_len++;
in_uint8(s, byte); /* length 2 */
len += byte;
}
@@ -87,8 +94,10 @@ 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));
+
// receive the left bytes
- if (xrdp_tcp_recv(self->tcp_layer, s, len - (s->p - s->data)) != 0)
+ if (xrdp_tcp_recv(self->tcp_layer, s, len - hdr_len) != 0)
{
return 1;
}
diff --git a/libxrdp/xrdp_rdp.c b/libxrdp/xrdp_rdp.c
index e4d79159..7bcdab62 100644
--- a/libxrdp/xrdp_rdp.c
+++ b/libxrdp/xrdp_rdp.c
@@ -277,7 +277,6 @@ xrdp_rdp_recv(struct xrdp_rdp *self, struct stream *s, int *code)
if (error == 2) /* we have fastpath packet! */
{
- s->next_packet = 0;
*code = 2;
return 0;
}
@@ -1710,6 +1709,8 @@ xrdp_rdp_process_fastpath_data_input(struct xrdp_rdp *self, struct stream *s)
int eventFlags;
int code;
int flags;
+ int param2;
+ int time;
// process fastpath input events
for (i = 0 ; i < self->sec_layer->fastpath_layer->numEvents ; i++) {
@@ -1740,7 +1741,7 @@ xrdp_rdp_process_fastpath_data_input(struct xrdp_rdp *self, struct stream *s)
RDP_INPUT_MOUSE - 0x8001
RDP_INPUT_MOUSEX - 0x8002 */
/* call to xrdp_wm.c : callback */
- self->session->callback(self->session->id, RDP_INPUT_SCANCODE, flags, 0,
+ self->session->callback(self->session->id, RDP_INPUT_SCANCODE, flags, param2,
code, time);
}
break;