o added fastpath output, syncronize update pdu

o refactor caps a bit
This commit is contained in:
speidy 2014-03-15 16:10:20 +02:00
parent f66c5911a2
commit 53df4335eb
3 changed files with 43 additions and 20 deletions

View File

@ -636,7 +636,7 @@ libxrdp_send_pointer(struct xrdp_session *session, int cache_idx,
out_uint16_le(s, bpp);
}
}
else
else /* slowpath */
{
LLOGLN(10, ("libxrdp_send_pointer: slowpath"));
xrdp_rdp_init_data((struct xrdp_rdp *)session->rdp, s);

View File

@ -266,8 +266,8 @@ xrdp_caps_process_cache_v3_codec_id(struct xrdp_rdp *self, struct stream *s,
/*****************************************************************************/
/* get the number of client cursor cache */
static int APP_CC
xrdp_caps_process_pointercache(struct xrdp_rdp *self, struct stream *s,
int len)
xrdp_caps_process_pointer(struct xrdp_rdp *self, struct stream *s,
int len)
{
int i;
int colorPointerFlag;
@ -275,7 +275,7 @@ xrdp_caps_process_pointercache(struct xrdp_rdp *self, struct stream *s,
if (len < 2 + 2 + 2)
{
g_writeln("xrdp_caps_process_pointercache: error");
g_writeln("xrdp_caps_process_pointer: error");
return 1;
}
no_new_cursor = self->client_info.pointer_flags & 2;
@ -286,7 +286,7 @@ xrdp_caps_process_pointercache(struct xrdp_rdp *self, struct stream *s,
self->client_info.pointer_cache_entries = i;
if (colorPointerFlag & 1)
{
g_writeln("xrdp_caps_process_pointercache: client supports "
g_writeln("xrdp_caps_process_pointer: client supports "
"new(color) cursor");
in_uint16_le(s, i);
i = MIN(i, 32);
@ -294,12 +294,12 @@ xrdp_caps_process_pointercache(struct xrdp_rdp *self, struct stream *s,
}
else
{
g_writeln("xrdp_caps_process_pointercache: client does not support "
g_writeln("xrdp_caps_process_pointer: client does not support "
"new(color) cursor");
}
if (no_new_cursor)
{
g_writeln("xrdp_caps_process_pointercache: new(color) cursor is "
g_writeln("xrdp_caps_process_pointer: new(color) cursor is "
"disabled by config");
self->client_info.pointer_flags = 0;
}
@ -567,7 +567,7 @@ xrdp_caps_process_confirm_active(struct xrdp_rdp *self, struct stream *s)
break;
case RDP_CAPSET_POINTER: /* 8 */
DEBUG(("RDP_CAPSET_POINTER"));
xrdp_caps_process_pointercache(self, s, len);
xrdp_caps_process_pointer(self, s, len);
break;
case RDP_CAPSET_SHARE: /* 9 */
DEBUG(("RDP_CAPSET_SHARE"));

View File

@ -629,23 +629,46 @@ xrdp_rdp_send_data_update_sync(struct xrdp_rdp *self)
init_stream(s, 8192);
DEBUG(("in xrdp_rdp_send_data_update_sync"));
if (xrdp_rdp_init_data(self, s) != 0)
if (self->client_info.use_fast_path & 1) /* fastpath output supported */
{
DEBUG(("out xrdp_rdp_send_data_update_sync error"));
free_stream(s);
return 1;
LLOGLN(10, ("xrdp_rdp_send_data_update_sync: fastpath"));
if (xrdp_rdp_init_fastpath(self, s) != 0)
{
return 1;
}
}
else /* slowpath */
{
if (xrdp_rdp_init_data(self, s) != 0)
{
DEBUG(("out xrdp_rdp_send_data_update_sync error"));
free_stream(s);
return 1;
}
out_uint16_le(s, RDP_UPDATE_SYNCHRONIZE);
}
out_uint16_le(s, RDP_UPDATE_SYNCHRONIZE);
out_uint8s(s, 2);
out_uint16_le(s, 0); /* pad */
s_mark_end(s);
if (xrdp_rdp_send_data(self, s, RDP_DATA_PDU_UPDATE) != 0)
if (self->client_info.use_fast_path & 1) /* fastpath output supported */
{
DEBUG(("out xrdp_rdp_send_data_update_sync error"));
free_stream(s);
return 1;
if (xrdp_rdp_send_fastpath(self, s,
FASTPATH_UPDATETYPE_SYNCHRONIZE) != 0)
{
return 1;
}
}
else /* slowpath */
{
if (xrdp_rdp_send_data(self, s, RDP_DATA_PDU_UPDATE) != 0)
{
DEBUG(("out xrdp_rdp_send_data_update_sync error"));
free_stream(s);
return 1;
}
}
DEBUG(("out xrdp_rdp_send_data_update_sync"));
free_stream(s);
@ -748,8 +771,8 @@ xrdp_rdp_send_synchronise(struct xrdp_rdp *self)
return 1;
}
out_uint16_le(s, 1);
out_uint16_le(s, 1002);
out_uint16_le(s, 1); /* messageType (2 bytes) */
out_uint16_le(s, 1002); /* targetUser (2 bytes) */
s_mark_end(s);
if (xrdp_rdp_send_data(self, s, RDP_DATA_PDU_SYNCHRONISE) != 0)