summaryrefslogtreecommitdiffstats
path: root/libxrdp/xrdp_mcs.c
diff options
context:
space:
mode:
authorspeidy <speidy@gmail.com>2014-02-08 13:34:01 +0200
committerspeidy <speidy@gmail.com>2014-02-08 13:34:01 +0200
commit113f2696fe4103474cb2703e3d2f8848304fdd3d (patch)
treeecc9554855a4d273b201f845aba7bb9a3a7eced5 /libxrdp/xrdp_mcs.c
parent423c583cddc31df98a01c8b5ed39558d691c19eb (diff)
downloadxrdp-proprietary-113f2696fe4103474cb2703e3d2f8848304fdd3d.tar.gz
xrdp-proprietary-113f2696fe4103474cb2703e3d2f8848304fdd3d.zip
libxrdp: work on fastpath
Diffstat (limited to 'libxrdp/xrdp_mcs.c')
-rw-r--r--libxrdp/xrdp_mcs.c61
1 files changed, 44 insertions, 17 deletions
diff --git a/libxrdp/xrdp_mcs.c b/libxrdp/xrdp_mcs.c
index c145158c..1828b28b 100644
--- a/libxrdp/xrdp_mcs.c
+++ b/libxrdp/xrdp_mcs.c
@@ -127,12 +127,14 @@ xrdp_mcs_recv(struct xrdp_mcs *self, struct stream *s, int *chan)
while (1)
{
+
if (xrdp_iso_recv(self->iso_layer, s) != 0)
{
- DEBUG((" out xrdp_mcs_recv xrdp_iso_recv returned non zero"));
+ free_stream(s);
return 1;
}
+
if (!s_check_rem(s, 1))
{
return 1;
@@ -320,10 +322,16 @@ xrdp_mcs_recv_connect_initial(struct xrdp_mcs *self)
make_stream(s);
init_stream(s, 16 * 1024);
- if (xrdp_iso_recv(self->iso_layer, s) != 0)
- {
- free_stream(s);
- return 1;
+ if (xrdp_iso_detect_tpkt(self->iso_layer, s) == 0) {
+ if (xrdp_iso_recv(self->iso_layer, s) != 0)
+ {
+ free_stream(s);
+ return 1;
+ }
+ } else {
+ g_writeln("xrdp_mcs_recv_connect_initial: TPKT not detected");
+ free_stream(s);
+ return 1;
}
if (xrdp_mcs_ber_parse_header(self, s, MCS_CONNECT_INITIAL, &len) != 0)
@@ -441,10 +449,16 @@ xrdp_mcs_recv_edrq(struct xrdp_mcs *self)
make_stream(s);
init_stream(s, 8192);
- if (xrdp_iso_recv(self->iso_layer, s) != 0)
- {
- free_stream(s);
- return 1;
+ if (xrdp_iso_detect_tpkt(self->iso_layer, s) == 0) {
+ if (xrdp_iso_recv(self->iso_layer, s) != 0)
+ {
+ free_stream(s);
+ return 1;
+ }
+ } else {
+ g_writeln("xrdp_mcs_recv_edrq: TPKT not detected");
+ free_stream(s);
+ return 1;
}
if (!s_check_rem(s, 1))
@@ -503,12 +517,19 @@ xrdp_mcs_recv_aurq(struct xrdp_mcs *self)
make_stream(s);
init_stream(s, 8192);
- if (xrdp_iso_recv(self->iso_layer, s) != 0)
- {
- free_stream(s);
- return 1;
+ if (xrdp_iso_detect_tpkt(self->iso_layer, s) == 0) {
+ if (xrdp_iso_recv(self->iso_layer, s) != 0)
+ {
+ free_stream(s);
+ return 1;
+ }
+ } else {
+ g_writeln("xrdp_mcs_recv_aurq: TPKT not detected");
+ free_stream(s);
+ return 1;
}
+
if (!s_check_rem(s, 1))
{
free_stream(s);
@@ -590,10 +611,16 @@ xrdp_mcs_recv_cjrq(struct xrdp_mcs *self)
make_stream(s);
init_stream(s, 8192);
- if (xrdp_iso_recv(self->iso_layer, s) != 0)
- {
- free_stream(s);
- return 1;
+ if (xrdp_iso_detect_tpkt(self->iso_layer, s) == 0) {
+ if (xrdp_iso_recv(self->iso_layer, s) != 0)
+ {
+ free_stream(s);
+ return 1;
+ }
+ } else {
+ g_writeln("xrdp_mcs_recv_cjrq: TPKT not detected");
+ free_stream(s);
+ return 1;
}
if (!s_check_rem(s, 1))