summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2014-03-10 22:54:28 -0700
committerJay Sorg <jay.sorg@gmail.com>2014-03-10 22:54:28 -0700
commit630f735a28eca8c6cd4b64ac7e38abe6634a0698 (patch)
tree421ca2e7e2af7b2499ac6d0bdc6ec7c68378e43a
parent6f63f93890c3d16b1a6016cc5097853f4158e968 (diff)
downloadxrdp-proprietary-630f735a28eca8c6cd4b64ac7e38abe6634a0698.tar.gz
xrdp-proprietary-630f735a28eca8c6cd4b64ac7e38abe6634a0698.zip
libxrdp: send, get, and use multi fragment max caps
-rw-r--r--common/xrdp_client_info.h2
-rw-r--r--libxrdp/xrdp_caps.c12
-rw-r--r--libxrdp/xrdp_fastpath.c9
3 files changed, 22 insertions, 1 deletions
diff --git a/common/xrdp_client_info.h b/common/xrdp_client_info.h
index c17675e4..6536db48 100644
--- a/common/xrdp_client_info.h
+++ b/common/xrdp_client_info.h
@@ -121,6 +121,8 @@ struct xrdp_client_info
int mcs_connection_type;
int mcs_early_capability_flags;
+ int max_fastpath_frag_bytes;
+
};
#endif
diff --git a/libxrdp/xrdp_caps.c b/libxrdp/xrdp_caps.c
index b882de56..d9e39c71 100644
--- a/libxrdp/xrdp_caps.c
+++ b/libxrdp/xrdp_caps.c
@@ -455,6 +455,10 @@ static int APP_CC
xrdp_caps_process_multifragmetupdate(struct xrdp_rdp *self, struct stream *s,
int len)
{
+ int MaxRequestSize;
+
+ in_uint32_le(s, MaxRequestSize);
+ self->client_info.max_fastpath_frag_bytes = MaxRequestSize;
return 0;
}
@@ -821,6 +825,14 @@ xrdp_caps_send_demand_active(struct xrdp_rdp *self)
out_uint16_le(s, 5);
out_uint8(s, 0); /* client sets */
+ if (self->client_info.use_fast_path & 1) /* fastpath output on */
+ {
+ caps_count++;
+ out_uint16_le(s, 0x001A); /* 26 CAPSETTYPE_MULTIFRAGMENTUPDATE */
+ out_uint16_le(s, 8);
+ out_uint32_le(s, 3 * 1024 * 1024); /* 3MB */
+ }
+
out_uint8s(s, 4); /* pad */
s_mark_end(s);
diff --git a/libxrdp/xrdp_fastpath.c b/libxrdp/xrdp_fastpath.c
index 9ba171f0..e9c2b82e 100644
--- a/libxrdp/xrdp_fastpath.c
+++ b/libxrdp/xrdp_fastpath.c
@@ -101,7 +101,14 @@ xrdp_fastpath_recv(struct xrdp_fastpath *self, struct stream *s)
int APP_CC
xrdp_fastpath_init(struct xrdp_fastpath *self, struct stream *s)
{
- init_stream(s, 32 * 1024);
+ int bytes;
+
+ bytes = self->session->client_info->max_fastpath_frag_bytes;
+ if (bytes < 32 * 1024)
+ {
+ bytes = 32 * 1024;
+ }
+ init_stream(s, bytes);
return 0;
}