Hello community,

here is the log from the commit of package xorgxrdp for openSUSE:Factory 
checked in at 2018-12-21 08:22:32
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/xorgxrdp (Old)
 and      /work/SRC/openSUSE:Factory/.xorgxrdp.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "xorgxrdp"

Fri Dec 21 08:22:32 2018 rev:10 rq:660283 version:0.2.9

Changes:
--------
--- /work/SRC/openSUSE:Factory/xorgxrdp/xorgxrdp.changes        2018-09-24 
13:12:58.441736997 +0200
+++ /work/SRC/openSUSE:Factory/.xorgxrdp.new.28833/xorgxrdp.changes     
2018-12-21 08:22:35.749503884 +0100
@@ -1,0 +2,7 @@
+Tue Dec 18 09:36:17 UTC 2018 - Felix Zhang <fezh...@suse.com>
+
+- Update to version 0.2.9
+  + Add a feature to disconnect idle sessions
+  + Disable autorepeat in Xorg, it is done in RDP layer
+
+-------------------------------------------------------------------

Old:
----
  xorgxrdp-0.2.8.tar.gz
  xorgxrdp-0.2.8.tar.gz.asc

New:
----
  xorgxrdp-0.2.9.tar.gz
  xorgxrdp-0.2.9.tar.gz.asc

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ xorgxrdp.spec ++++++
--- /var/tmp/diff_new_pack.m0g32g/_old  2018-12-21 08:22:36.257503408 +0100
+++ /var/tmp/diff_new_pack.m0g32g/_new  2018-12-21 08:22:36.261503404 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           xorgxrdp
-Version:        0.2.8
+Version:        0.2.9
 Release:        0
 Summary:        Xorg drivers for xrdp
 License:        X11

++++++ xorgxrdp-0.2.8.tar.gz -> xorgxrdp-0.2.9.tar.gz ++++++
++++ 4293 lines of diff (skipped)
++++    retrying with extended exclude list
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/xorgxrdp-0.2.8/README.md new/xorgxrdp-0.2.9/README.md
--- old/xorgxrdp-0.2.8/README.md        2018-09-18 04:36:30.000000000 +0200
+++ new/xorgxrdp-0.2.9/README.md        2018-12-12 02:16:54.000000000 +0100
@@ -1,6 +1,6 @@
 [![Build 
Status](https://travis-ci.org/neutrinolabs/xorgxrdp.svg?branch=devel)](https://travis-ci.org/neutrinolabs/xorgxrdp)
 
-*Current Version:* 0.2.8
+*Current Version:* 0.2.9
 
 # xorgxrdp
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/xorgxrdp-0.2.8/configure.ac new/xorgxrdp-0.2.9/configure.ac
--- old/xorgxrdp-0.2.8/configure.ac     2018-09-18 04:36:30.000000000 +0200
+++ new/xorgxrdp-0.2.9/configure.ac     2018-12-12 02:16:54.000000000 +0100
@@ -2,7 +2,7 @@
 
 AC_PREREQ(2.65)
 # package version must be x.y.z
-AC_INIT([xorgxrdp], [0.2.8], [xrdp-de...@googlegroups.com])
+AC_INIT([xorgxrdp], [0.2.9], [xrdp-de...@googlegroups.com])
 package_version_major=$(echo ${PACKAGE_VERSION}|cut -d. -f1)
 package_version_minor=$(echo ${PACKAGE_VERSION}|cut -d. -f2)
 package_version_patchlevel=$(echo ${PACKAGE_VERSION}|cut -d. -f3)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/xorgxrdp-0.2.8/module/rdp.h new/xorgxrdp-0.2.9/module/rdp.h
--- old/xorgxrdp-0.2.8/module/rdp.h     2018-08-30 07:52:18.000000000 +0200
+++ new/xorgxrdp-0.2.9/module/rdp.h     2018-12-11 06:56:02.000000000 +0100
@@ -284,6 +284,10 @@
     int disconnect_timeout_s;
     int disconnect_time_ms;
 
+    OsTimerPtr idleDisconnectTimer;
+    int idle_disconnect_timeout_s;
+    time_t last_event_time;
+
     int conNumber;
 
     struct _rdpCounts counts;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/xorgxrdp-0.2.8/module/rdpClientCon.c 
new/xorgxrdp-0.2.9/module/rdpClientCon.c
--- old/xorgxrdp-0.2.8/module/rdpClientCon.c    2018-09-18 04:36:30.000000000 
+0200
+++ new/xorgxrdp-0.2.9/module/rdpClientCon.c    2018-12-11 06:56:02.000000000 
+0100
@@ -101,6 +101,8 @@
 
 static int
 rdpClientConDisconnect(rdpPtr dev, rdpClientCon *clientCon);
+static CARD32
+rdpDeferredIdleDisconnectCallback(OsTimerPtr timer, CARD32 now, pointer arg);
 
 #if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 18, 5, 0, 0)
 
@@ -208,6 +210,7 @@
     LLOGLN(0, ("rdpClientConGotConnection:"));
     clientCon = g_new0(rdpClientCon, 1);
     clientCon->dev = dev;
+    dev->last_event_time = time(0);
     dev->do_dirty_ons = 1;
 
     make_stream(clientCon->in_s);
@@ -245,6 +248,20 @@
     }
 #endif
 
+    /* set idle timer to disconnect */
+    if (dev->idle_disconnect_timeout_s > 0)
+    {
+        LLOGLN(0, ("rdpClientConGetConnection: "
+                   "engaging idle timer, timeout [%d] sec", 
dev->idle_disconnect_timeout_s));
+        dev->idleDisconnectTimer = TimerSet(dev->idleDisconnectTimer, 0, 1000 
* 1,
+                                            rdpDeferredIdleDisconnectCallback, 
dev);
+    }
+    else
+    {
+        LLOGLN(0, ("rdpClientConGetConnection: "
+                   "idle_disconnect_timeout set to non-positive value, idle 
timer turned off"));
+    }
+
     rdpAddClientConToDev(dev, clientCon);
 
     clientCon->dirtyRegion = rdpRegionCreate(NullBox, 0);
@@ -268,7 +285,7 @@
         LLOGLN(0, ("rdpDeferredDisconnectCallback: connected"));
         if (dev->disconnectTimer != NULL)
         {
-            LLOGLN(0, ("rdpDeferredDisconnectCallback: canceling 
g_dis_timer"));
+            LLOGLN(0, ("rdpDeferredDisconnectCallback: disengaging disconnect 
timer"));
             TimerCancel(dev->disconnectTimer);
             TimerFree(dev->disconnectTimer);
             dev->disconnectTimer = NULL;
@@ -294,17 +311,79 @@
 }
 
 /*****************************************************************************/
+static CARD32
+rdpDeferredIdleDisconnectCallback(OsTimerPtr timer, CARD32 now, pointer arg)
+{
+    LLOGLN(10, ("rdpDeferredIdleDisconnectCallback:"));
+
+    rdpPtr dev;
+    time_t current_time;
+
+    dev = (rdpPtr) arg;
+    current_time = time(0);
+
+    if (dev->idle_disconnect_timeout_s <= 0)
+    {
+        /* should not reach here */
+        LLOGLN(0, ("rdpDeferredIdleDisconnectCallback: timeout set to 
non-positive value, disengaging timer"));
+        goto cancel_timer;
+    }
+
+    if (dev->last_event_time > now)
+    {
+        LLOGLN(0, ("rdpDeferredIdleDisconnectCallback: time has gone 
backwards, resetting"));
+        dev->last_event_time = current_time;
+        goto next_timer;
+    }
+
+    if (current_time - dev->last_event_time > dev->idle_disconnect_timeout_s)
+    {
+        LLOGLN(0, ("rdpDeferredIdleDisconnectCallback: session has been idle 
for %d seconds, disconnecting",
+                    dev->idle_disconnect_timeout_s));
+
+        /* disconnect all clients */
+        while (dev->clientConHead != NULL)
+        {
+            rdpClientConDisconnect(dev, dev->clientConHead);
+        }
+
+        LLOGLN(0, ("rdpDeferredIdleDisconnectCallback: disconnected idle 
session"));
+        goto cancel_timer;
+    }
+
+next_timer:
+    dev->idleDisconnectTimer = TimerSet(dev->idleDisconnectTimer, 0, 1000 * 1,
+                                        rdpDeferredIdleDisconnectCallback, 
dev);
+    return 0;
+
+cancel_timer:
+    TimerCancel(dev->idleDisconnectTimer);
+    TimerFree(dev->idleDisconnectTimer);
+    dev->idleDisconnectTimer = NULL;
+    LLOGLN(0, ("rdpDeferredIdleDisconnectCallback: idle timer disengaged"));
+    return 0;
+}
+/*****************************************************************************/
 static int
 rdpClientConDisconnect(rdpPtr dev, rdpClientCon *clientCon)
 {
     int index;
 
     LLOGLN(0, ("rdpClientConDisconnect:"));
+
+    if (dev->idleDisconnectTimer != NULL && dev->idle_disconnect_timeout_s > 0)
+    {
+        LLOGLN(0, ("rdpClientConDisconnect: disconnected, idle timer 
disengaged"));
+        TimerCancel(dev->idleDisconnectTimer);
+        TimerFree(dev->idleDisconnectTimer);
+        dev->idleDisconnectTimer = NULL;
+    }
+
     if (dev->do_kill_disconnected)
     {
         if (dev->disconnect_scheduled == FALSE)
         {
-            LLOGLN(0, ("rdpClientConDisconnect: starting g_dis_timer, "
+            LLOGLN(0, ("rdpClientConDisconnect: engaging disconnect timer, "
                        "exit after %d seconds", dev->disconnect_timeout_s));
             dev->disconnectTimer = TimerSet(dev->disconnectTimer, 0, 1000 * 10,
                                             rdpDeferredDisconnectCallback, 
dev);
@@ -1273,6 +1352,21 @@
         rdpClientConAddEnabledDevice(dev->pScreen, dev->disconnect_sck);
     }
 
+    /* disconnect idle */
+    ptext = getenv("XRDP_SESMAN_MAX_IDLE_TIME");
+    if (ptext != 0)
+    {
+        i = atoi(ptext);
+        if (i > 0)
+        {
+            dev->idle_disconnect_timeout_s = i;
+        }
+
+    }
+    LLOGLN(0, ("rdpClientConInit: disconnect idle session after [%d] sec",
+               dev->idle_disconnect_timeout_s));
+
+    /* kill disconnected */
     ptext = getenv("XRDP_SESMAN_MAX_DISC_TIME");
     if (ptext != 0)
     {
@@ -1298,7 +1392,7 @@
         dev->disconnect_timeout_s = 60;
     }
 
-    LLOGLN(0, ("rdpClientConInit: kill disconnected [%d] timeout [%d] sec\n",
+    LLOGLN(0, ("rdpClientConInit: kill disconnected [%d] timeout [%d] sec",
                dev->do_kill_disconnected, dev->disconnect_timeout_s));
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/xorgxrdp-0.2.8/module/rdpInput.c new/xorgxrdp-0.2.9/module/rdpInput.c
--- old/xorgxrdp-0.2.8/module/rdpInput.c        2017-08-09 06:45:44.000000000 
+0200
+++ new/xorgxrdp-0.2.9/module/rdpInput.c        2018-12-11 06:56:02.000000000 
+0100
@@ -98,6 +98,8 @@
                       long param1, long param2,
                       long param3, long param4)
 {
+    dev->last_event_time = time(0);
+
     if (g_input_proc[0].proc != 0)
     {
         return g_input_proc[0].proc(dev, msg, param1, param2, param3, param4);
@@ -111,6 +113,8 @@
                    long param1, long param2,
                    long param3, long param4)
 {
+    dev->last_event_time = time(0);
+
     if (g_input_proc[1].proc != 0)
     {
         return g_input_proc[1].proc(dev, msg, param1, param2, param3, param4);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/xorgxrdp-0.2.8/xrdpkeyb/rdpKeyboard.c 
new/xorgxrdp-0.2.9/xrdpkeyb/rdpKeyboard.c
--- old/xorgxrdp-0.2.8/xrdpkeyb/rdpKeyboard.c   2017-08-09 06:45:44.000000000 
+0200
+++ new/xorgxrdp-0.2.9/xrdpkeyb/rdpKeyboard.c   2018-12-11 06:56:02.000000000 
+0100
@@ -90,8 +90,6 @@
 
 static char g_xrdp_keyb_name[] = XRDP_KEYB_NAME;
 
-static OsTimerPtr g_kbtimer = 0;
-
 static KeySym g_kbdMap[] =
 {
     NoSymbol,        NoSymbol,        /* 8 */
@@ -606,16 +604,30 @@
 
 
/******************************************************************************/
 static CARD32
-rdpInDeferredUpdateCallback(OsTimerPtr timer, CARD32 now, pointer arg)
+rdpInDeferredRepeatCallback(OsTimerPtr timer, CARD32 now, pointer arg)
 {
     DeviceIntPtr pDev;
+    DeviceIntPtr it;
+    Bool found;
 
-    LLOGLN(0, ("rdpInDeferredUpdateCallback:"));
+    LLOGLN(0, ("rdpInDeferredRepeatCallback:"));
+    TimerFree(timer);
     pDev = (DeviceIntPtr) arg;
-    /* our keyboard device */
-    XkbSetRepeatKeys(pDev, -1, AutoRepeatModeOff);
-    /* the main one for the server */
-    XkbSetRepeatKeys(inputInfo.keyboard, -1, AutoRepeatModeOff);
+    found = FALSE;
+    it = inputInfo.devices;
+    while (it != NULL)
+    {
+        if (it == pDev)
+        {
+            found = TRUE;
+            break;
+        }
+        it = it->next;
+    }
+    if (found)
+    {
+        XkbSetRepeatKeys(pDev, -1, AutoRepeatModeOff);
+    }
     return 0;
 }
 
@@ -650,8 +662,7 @@
             LLOGLN(0, ("rdpkeybChangeKeyboardControl: autoRepeat on"));
             /* schedule to turn off the autorepeat after 100 ms so any app
              * polling it will be happy it's on */
-            g_kbtimer = TimerSet(g_kbtimer, 0, 100,
-                                 rdpInDeferredUpdateCallback, pDev);
+            TimerSet(NULL, 0, 100, rdpInDeferredRepeatCallback, pDev);
         }
         else
         {


Reply via email to