"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libxrdp/libxrdp.c" between
xrdp-0.9.13.1.tar.gz and xrdp-0.9.14.tar.gz

About: xrdp is a remote desktop protocol (rdp) server (accepting connections from rdesktop and Microsoft’s own terminal server / remote desktop clients).

libxrdp.c  (xrdp-0.9.13.1):libxrdp.c  (xrdp-0.9.14)
skipping to change at line 50 skipping to change at line 50
libxrdp_init(tbus id, struct trans *trans) libxrdp_init(tbus id, struct trans *trans)
{ {
struct xrdp_session *session; struct xrdp_session *session;
session = (struct xrdp_session *)g_malloc(sizeof(struct xrdp_session), 1); session = (struct xrdp_session *)g_malloc(sizeof(struct xrdp_session), 1);
session->id = id; session->id = id;
session->trans = trans; session->trans = trans;
session->rdp = xrdp_rdp_create(session, trans); session->rdp = xrdp_rdp_create(session, trans);
session->orders = xrdp_orders_create(session, (struct xrdp_rdp *)session->rd p); session->orders = xrdp_orders_create(session, (struct xrdp_rdp *)session->rd p);
session->client_info = &(((struct xrdp_rdp *)session->rdp)->client_info); session->client_info = &(((struct xrdp_rdp *)session->rdp)->client_info);
session->check_for_app_input = 1;
return session; return session;
} }
/******************************************************************************/ /******************************************************************************/
int EXPORT_CC int EXPORT_CC
libxrdp_exit(struct xrdp_session *session) libxrdp_exit(struct xrdp_session *session)
{ {
if (session == 0) if (session == 0)
{ {
return 0; return 0;
skipping to change at line 128 skipping to change at line 129
libxrdp_force_read(struct trans* trans) libxrdp_force_read(struct trans* trans)
{ {
int bytes; int bytes;
struct stream *s; struct stream *s;
s = trans->in_s; s = trans->in_s;
init_stream(s, 32 * 1024); init_stream(s, 32 * 1024);
if (trans_force_read(trans, 4) != 0) if (trans_force_read(trans, 4) != 0)
{ {
g_writeln("libxrdp_force_read: error"); g_writeln("libxrdp_force_read: header read error");
return 0; return 0;
} }
bytes = libxrdp_get_pdu_bytes(s->data); bytes = libxrdp_get_pdu_bytes(s->data);
if (bytes < 1) if (bytes < 4 || bytes > s->size)
{ {
g_writeln("libxrdp_force_read: error"); g_writeln("libxrdp_force_read: bad header length %d", bytes);
return 0; return 0;
} }
if (bytes > 32 * 1024)
{
g_writeln("libxrdp_force_read: error");
return 0;
}
if (trans_force_read(trans, bytes - 4) != 0) if (trans_force_read(trans, bytes - 4) != 0)
{ {
g_writeln("libxrdp_force_read: error"); g_writeln("libxrdp_force_read: Can't read PDU");
return 0; return 0;
} }
return s; return s;
} }
/******************************************************************************/ /******************************************************************************/
int EXPORT_CC int EXPORT_CC
libxrdp_process_data(struct xrdp_session *session, struct stream *s) libxrdp_process_data(struct xrdp_session *session, struct stream *s)
{ {
int cont; int cont;
skipping to change at line 1050 skipping to change at line 1045
int EXPORT_CC int EXPORT_CC
libxrdp_orders_send_font(struct xrdp_session *session, libxrdp_orders_send_font(struct xrdp_session *session,
struct xrdp_font_char *font_char, struct xrdp_font_char *font_char,
int font_index, int char_index) int font_index, int char_index)
{ {
return xrdp_orders_send_font((struct xrdp_orders *)session->orders, return xrdp_orders_send_font((struct xrdp_orders *)session->orders,
font_char, font_index, char_index); font_char, font_index, char_index);
} }
/*****************************************************************************/ /*****************************************************************************/
/* Note : if this is called on a multimon setup, the client is resized
* to a single monitor */
int EXPORT_CC int EXPORT_CC
libxrdp_reset(struct xrdp_session *session, libxrdp_reset(struct xrdp_session *session,
int width, int height, int bpp) int width, int height, int bpp)
{ {
if (session->client_info != 0) if (session->client_info != 0)
{ {
struct xrdp_client_info *client_info = session->client_info;
/* older client can't resize */ /* older client can't resize */
if (session->client_info->build <= 419) if (client_info->build <= 419)
{ {
return 0; return 0;
} }
/* if same, don't need to do anything */ /* if same (and only one monitor on client) don't need to do anything */
if (session->client_info->width == width && if (client_info->width == width &&
session->client_info->height == height && client_info->height == height &&
session->client_info->bpp == bpp) client_info->bpp == bpp &&
(client_info->monitorCount == 0 || client_info->multimon == 0))
{ {
return 0; return 0;
} }
session->client_info->width = width; client_info->width = width;
session->client_info->height = height; client_info->height = height;
session->client_info->bpp = bpp; client_info->bpp = bpp;
client_info->monitorCount = 0;
client_info->multimon = 0;
} }
else else
{ {
return 1; return 1;
} }
/* this will send any lingering orders */ /* this will send any lingering orders */
if (xrdp_orders_reset((struct xrdp_orders *)session->orders) != 0) if (xrdp_orders_reset((struct xrdp_orders *)session->orders) != 0)
{ {
return 1; return 1;
} }
/* shut down the rdp client */ /* shut down the rdp client
*
* When resetting the lib, disable application input checks, as
* otherwise we can send a channel message to the other end while
* the channels are inactive ([MS-RDPBCGR] 3.2.5.5.1 */
session->check_for_app_input = 0;
if (xrdp_rdp_send_deactivate((struct xrdp_rdp *)session->rdp) != 0) if (xrdp_rdp_send_deactivate((struct xrdp_rdp *)session->rdp) != 0)
{ {
return 1; return 1;
} }
/* this should do the resizing */ /* this should do the resizing */
if (xrdp_caps_send_demand_active((struct xrdp_rdp *)session->rdp) != 0) if (xrdp_caps_send_demand_active((struct xrdp_rdp *)session->rdp) != 0)
{ {
return 1; return 1;
} }
/* Re-enable application input checks */
session->check_for_app_input = 1;
return 0; return 0;
} }
/*****************************************************************************/ /*****************************************************************************/
int EXPORT_CC int EXPORT_CC
libxrdp_orders_send_raw_bitmap2(struct xrdp_session *session, libxrdp_orders_send_raw_bitmap2(struct xrdp_session *session,
int width, int height, int bpp, char *data, int width, int height, int bpp, char *data,
int cache_id, int cache_idx) int cache_id, int cache_idx)
{ {
return xrdp_orders_send_raw_bitmap2((struct xrdp_orders *)session->orders, return xrdp_orders_send_raw_bitmap2((struct xrdp_orders *)session->orders,
 End of changes. 13 change blocks. 
19 lines changed or deleted 29 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)