summaryrefslogtreecommitdiffstats
path: root/xorg/X11R7.6/rdp/rdpup.c
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2012-05-20 21:14:15 -0700
committerJay Sorg <jay.sorg@gmail.com>2012-05-20 21:14:15 -0700
commitd88291c9ddc4abc81ae68897faaafcc91f6a6e86 (patch)
tree74eccdb284fed0ffd7c9d6493745652e51808fc9 /xorg/X11R7.6/rdp/rdpup.c
parentaa3fad894db4e9b02999b229eb7e63fd8e91bdf6 (diff)
downloadxrdp-proprietary-d88291c9ddc4abc81ae68897faaafcc91f6a6e86.tar.gz
xrdp-proprietary-d88291c9ddc4abc81ae68897faaafcc91f6a6e86.zip
-xorg: work on off screen bitmaps
Diffstat (limited to 'xorg/X11R7.6/rdp/rdpup.c')
-rw-r--r--xorg/X11R7.6/rdp/rdpup.c80
1 files changed, 41 insertions, 39 deletions
diff --git a/xorg/X11R7.6/rdp/rdpup.c b/xorg/X11R7.6/rdp/rdpup.c
index fa2092e2..19a6e6d1 100644
--- a/xorg/X11R7.6/rdp/rdpup.c
+++ b/xorg/X11R7.6/rdp/rdpup.c
@@ -64,9 +64,6 @@ extern rdpScreenInfoRec g_rdpScreen; /* from rdpmain.c */
extern int g_use_uds; /* in rdpmain.c */
extern char g_uds_data[]; /* in rdpmain.c */
-extern int g_pixmap_byte_total; /* in rdpdraw.c */
-extern int g_pixmap_num_used; /* in rdpdraw.c */
-
struct rdpup_os_bitmap
{
int used;
@@ -79,8 +76,8 @@ static struct rdpup_os_bitmap* g_os_bitmaps = 0;
static int g_max_os_bitmaps = 0;
static int g_os_bitmap_stamp = 0;
-int g_pixmap_byte_total = 0;
-int g_pixmap_num_used = 0;
+static int g_pixmap_byte_total = 0;
+static int g_pixmap_num_used = 0;
/*
0 GXclear, 0
@@ -122,6 +119,38 @@ static int g_rdp_opcodes[16] =
};
/*****************************************************************************/
+static int
+rdpup_disconnect(void)
+{
+ int index;
+
+ RemoveEnabledDevice(g_sck);
+ g_connected = 0;
+ g_tcp_close(g_sck);
+ g_sck = 0;
+ g_sck_closed = 1;
+ g_pixmap_byte_total = 0;
+ g_pixmap_num_used = 0;
+ if (g_max_os_bitmaps > 0)
+ {
+ for (index = 0; index < g_max_os_bitmaps; index++)
+ {
+ if (g_os_bitmaps[index].used)
+ {
+ if (g_os_bitmaps[index].priv != 0)
+ {
+ g_os_bitmaps[index].priv->status = 0;
+ }
+ }
+ }
+ }
+ g_max_os_bitmaps = 0;
+ g_free(g_os_bitmaps);
+ g_os_bitmaps = 0;
+ return 0;
+}
+
+/*****************************************************************************/
int
rdpup_add_os_bitmap(PixmapPtr pixmap, rdpPixmapPtr priv)
{
@@ -224,21 +253,13 @@ rdpup_send(char* data, int len)
}
else
{
- RemoveEnabledDevice(g_sck);
- g_connected = 0;
- g_tcp_close(g_sck);
- g_sck = 0;
- g_sck_closed = 1;
+ rdpup_disconnect();
return 1;
}
}
else if (sent == 0)
{
- RemoveEnabledDevice(g_sck);
- g_connected = 0;
- g_tcp_close(g_sck);
- g_sck = 0;
- g_sck_closed = 1;
+ rdpup_disconnect();
return 1;
}
else
@@ -338,25 +359,13 @@ rdpup_recv(char* data, int len)
}
else
{
- RemoveEnabledDevice(g_sck);
- g_connected = 0;
- g_tcp_close(g_sck);
- g_sck = 0;
- g_sck_closed = 1;
- //g_pixmap_byte_total = 0;
- //g_pixmap_num_used = 0;
+ rdpup_disconnect();
return 1;
}
}
else if (rcvd == 0)
{
- RemoveEnabledDevice(g_sck);
- g_connected = 0;
- g_tcp_close(g_sck);
- g_sck = 0;
- g_sck_closed = 1;
- //g_pixmap_byte_total = 0;
- //g_pixmap_num_used = 0;
+ rdpup_disconnect();
return 1;
}
else
@@ -638,6 +647,7 @@ param4 %d\n", msg, param1, param2, param3, param4));
if (g_rdpScreen.client_info.offscreen_cache_entries > 0)
{
g_max_os_bitmaps = g_rdpScreen.client_info.offscreen_cache_entries;
+ g_free(g_os_bitmaps);
g_os_bitmaps = (struct rdpup_os_bitmap*)
g_malloc(sizeof(struct rdpup_os_bitmap) * g_max_os_bitmaps, 1);
}
@@ -771,11 +781,7 @@ rdpup_check(void)
{
/* should maybe ask is user wants to allow here with timeout */
rdpLog("replacing connection, already got a connection\n");
- RemoveEnabledDevice(g_sck);
- g_connected = 0;
- g_tcp_close(g_sck);
- g_sck = 0;
- g_sck_closed = 1;
+ rdpup_disconnect();
}
rdpLog("got a connection\n");
g_sck = new_sck;
@@ -802,11 +808,7 @@ rdpup_check(void)
if (g_sck != 0)
{
rdpLog("disconnecting session via user request\n");
- RemoveEnabledDevice(g_sck);
- g_connected = 0;
- g_tcp_close(g_sck);
- g_sck = 0;
- g_sck_closed = 1;
+ rdpup_disconnect();
}
}
}