Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
7fd5d934
Unverified
Commit
7fd5d934
authored
Mar 17, 2017
by
Mihai Moldovan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'sunweaver-pr/setnotifyfd-ABI' into 3.6.x
Attributes GH PR #331:
https://github.com/ArcticaProject/nx-libs/pull/331
parents
6ac805ab
f315ae06
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
201 additions
and
66 deletions
+201
-66
Display.c
nx-X11/programs/Xserver/hw/nxagent/Display.c
+2
-2
Init.c
nx-X11/programs/Xserver/hw/nxagent/Init.c
+7
-0
Init.h
nx-X11/programs/Xserver/hw/nxagent/Init.h
+2
-0
Screen.c
nx-X11/programs/Xserver/hw/nxagent/Screen.c
+1
-1
Imakefile
nx-X11/programs/Xserver/include/Imakefile
+1
-0
list.h
nx-X11/programs/Xserver/include/list.h
+0
-0
os.h
nx-X11/programs/Xserver/include/os.h
+11
-2
mieq.c
nx-X11/programs/Xserver/mi/mieq.c
+14
-0
WaitFor.c
nx-X11/programs/Xserver/os/WaitFor.c
+25
-17
connection.c
nx-X11/programs/Xserver/os/connection.c
+117
-17
io.c
nx-X11/programs/Xserver/os/io.c
+5
-4
osdep.h
nx-X11/programs/Xserver/os/osdep.h
+9
-1
osinit.c
nx-X11/programs/Xserver/os/osinit.c
+5
-0
xdmcp.c
nx-X11/programs/Xserver/os/xdmcp.c
+2
-22
No files found.
nx-X11/programs/Xserver/hw/nxagent/Display.c
View file @
7fd5d934
...
...
@@ -2877,7 +2877,7 @@ void nxagentAddXConnection()
"to the device set.
\n
"
,
nxagentXConnectionNumber
);
#endif
AddEnabledDevice
(
nxagentXConnectionNumber
);
SetNotifyFd
(
XConnectionNumber
(
nxagentDisplay
),
nxagentNotifyConnection
,
X_NOTIFY_READ
,
NULL
);
}
void
nxagentRemoveXConnection
()
...
...
@@ -2887,7 +2887,7 @@ void nxagentRemoveXConnection()
"from the device set.
\n
"
,
nxagentXConnectionNumber
);
#endif
Remove
EnabledDevice
(
nxagentXConnectionNumber
);
Remove
NotifyFd
(
nxagentXConnectionNumber
);
}
/*
...
...
nx-X11/programs/Xserver/hw/nxagent/Init.c
View file @
7fd5d934
...
...
@@ -58,6 +58,7 @@ is" without express or implied warranty.
#include "Pointer.h"
#include "Keyboard.h"
#include "Handlers.h"
#include "Events.h"
#include "Init.h"
#include "Args.h"
#include "Client.h"
...
...
@@ -407,6 +408,12 @@ FIXME: These variables, if not removed at all because have probably
blackRoot
=
TRUE
;
}
void
nxagentNotifyConnection
(
int
fd
,
int
ready
,
void
*
data
)
{
nxagentDispatchEvents
(
NULL
);
}
void
InitInput
(
argc
,
argv
)
int
argc
;
char
*
argv
[];
...
...
nx-X11/programs/Xserver/hw/nxagent/Init.h
View file @
7fd5d934
...
...
@@ -49,4 +49,6 @@ extern int nxagentX2go;
extern
ServerGrabInfoRec
nxagentGrabServerInfo
;
void
nxagentNotifyConnection
(
int
fd
,
int
ready
,
void
*
data
);
#endif
/* __Init_H__ */
nx-X11/programs/Xserver/hw/nxagent/Screen.c
View file @
7fd5d934
...
...
@@ -2781,7 +2781,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
"to the device set.
\n
"
,
fd
);
#endif
AddEnabledDevice
(
nxagentShadowXConnectionNumber
);
SetNotifyFd
(
nxagentShadowXConnectionNumber
,
nxagentNotifyConnection
,
X_NOTIFY_READ
,
NULL
);
accessPixmapID
=
FakeClientID
(
serverClient
->
index
);
...
...
nx-X11/programs/Xserver/include/Imakefile
View file @
7fd5d934
...
...
@@ -30,6 +30,7 @@ InstallDriverSDKNonExecFile(gcstruct.h,$(DRIVERSDKINCLUDEDIR))
InstallDriverSDKNonExecFile(globals.h,$(DRIVERSDKINCLUDEDIR))
InstallDriverSDKNonExecFile(input.h,$(DRIVERSDKINCLUDEDIR))
InstallDriverSDKNonExecFile(inputstr.h,$(DRIVERSDKINCLUDEDIR))
InstallDriverSDKNonExecFile(list.h,$(DRIVERSDKINCLUDEDIR))
InstallDriverSDKNonExecFile(misc.h,$(DRIVERSDKINCLUDEDIR))
InstallDriverSDKNonExecFile(miscstruct.h,$(DRIVERSDKINCLUDEDIR))
InstallDriverSDKNonExecFile(opaque.h,$(DRIVERSDKINCLUDEDIR))
...
...
nx-X11/programs/Xserver/include/list.h
0 → 100644
View file @
7fd5d934
This diff is collapsed.
Click to expand it.
nx-X11/programs/Xserver/include/os.h
View file @
7fd5d934
...
...
@@ -143,9 +143,18 @@ extern void CheckConnections(void);
extern
void
CloseDownConnection
(
ClientPtr
/*client*/
);
extern
void
AddEnabledDevice
(
int
/*fd*/
);
typedef
void
(
*
NotifyFdProcPtr
)(
int
fd
,
int
ready
,
void
*
data
);
extern
void
RemoveEnabledDevice
(
int
/*fd*/
);
#define X_NOTIFY_NONE 0
#define X_NOTIFY_READ 1
#define X_NOTIFY_WRITE 2
extern
Bool
SetNotifyFd
(
int
fd
,
NotifyFdProcPtr
notify_fd
,
int
mask
,
void
*
data
);
static
inline
void
RemoveNotifyFd
(
int
fd
)
{
(
void
)
SetNotifyFd
(
fd
,
NULL
,
X_NOTIFY_NONE
,
NULL
);
}
extern
void
OnlyListenToOneClient
(
ClientPtr
/*client*/
);
...
...
nx-X11/programs/Xserver/mi/mieq.c
View file @
7fd5d934
...
...
@@ -43,6 +43,12 @@ in this Software without prior written authorization from The Open Group.
# include "mi.h"
# include "scrnintstr.h"
#ifdef DPMSExtension
# include "dpmsproc.h"
# define DPMS_SERVER
# include <nx-X11/extensions/dpms.h>
#endif
#define QUEUE_SIZE 256
typedef
struct
_Event
{
...
...
@@ -151,6 +157,14 @@ void mieqProcessInputEvents ()
if
(
screenIsSaved
==
SCREEN_SAVER_ON
)
SaveScreens
(
SCREEN_SAVER_OFF
,
ScreenSaverReset
);
#ifdef DPMSExtension
else
if
(
DPMSPowerLevel
!=
DPMSModeOn
)
SetScreenSaverTimer
();
if
(
DPMSPowerLevel
!=
DPMSModeOn
)
DPMSSet
(
DPMSModeOn
);
#endif
e
=
&
miEventQueue
.
events
[
miEventQueue
.
head
];
/*
* Assumption - screen switching can only occur on motion events
...
...
nx-X11/programs/Xserver/os/WaitFor.c
View file @
7fd5d934
...
...
@@ -188,9 +188,9 @@ WaitForSomething(int *pClientsReady)
int
curclient
;
int
selecterr
;
int
nready
;
fd_set
devicesReadable
;
CARD32
now
=
0
;
Bool
someReady
=
FALSE
;
Bool
someNotifyWriteReady
=
FALSE
;
#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG)
fprintf
(
stderr
,
"WaitForSomething: Got called.
\n
"
);
...
...
@@ -338,7 +338,7 @@ WaitForSomething(int *pClientsReady)
if
(
dispatchException
)
i
=
-
1
;
#endif
else
if
(
Any
ClientsWriteBlocked
)
else
if
(
Any
WritesPending
)
{
#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_DEBUG)
if
(
wt
==
NULL
)
...
...
@@ -353,8 +353,9 @@ WaitForSomething(int *pClientsReady)
wt
->
tv_sec
,
wt
->
tv_usec
);
}
#endif
XFD_COPYSET
(
&
ClientsWriteBlocked
,
&
clientsWritable
);
i
=
Select
(
MaxClients
,
&
LastSelectMask
,
&
clientsWritable
,
NULL
,
wt
);
XFD_COPYSET
(
&
ClientsWriteBlocked
,
&
LastSelectWriteMask
);
XFD_ORSET
(
&
LastSelectWriteMask
,
&
NotifyWriteFds
,
&
LastSelectWriteMask
);
i
=
Select
(
MaxClients
,
&
LastSelectMask
,
&
LastSelectWriteMask
,
NULL
,
wt
);
}
else
{
...
...
@@ -489,26 +490,33 @@ WaitForSomething(int *pClientsReady)
}
if
(
someReady
)
XFD_ORSET
(
&
LastSelectMask
,
&
ClientsWithInput
,
&
LastSelectMask
);
if
(
AnyClientsWriteBlocked
&&
XFD_ANYSET
(
&
clientsWritable
))
{
NewOutputPending
=
TRUE
;
XFD_ORSET
(
&
OutputPending
,
&
clientsWritable
,
&
OutputPending
);
XFD_UNSET
(
&
ClientsWriteBlocked
,
&
clientsWritable
);
if
(
!
XFD_ANYSET
(
&
ClientsWriteBlocked
))
AnyClientsWriteBlocked
=
FALSE
;
if
(
AnyWritesPending
)
{
XFD_ANDSET
(
&
clientsWritable
,
&
LastSelectWriteMask
,
&
ClientsWriteBlocked
);
if
(
XFD_ANYSET
(
&
clientsWritable
))
{
NewOutputPending
=
TRUE
;
XFD_ORSET
(
&
OutputPending
,
&
clientsWritable
,
&
OutputPending
);
XFD_UNSET
(
&
ClientsWriteBlocked
,
&
clientsWritable
);
if
(
!
XFD_ANYSET
(
&
ClientsWriteBlocked
)
&&
NumNotifyWriteFd
==
0
)
AnyWritesPending
=
FALSE
;
}
if
(
NumNotifyWriteFd
!=
0
)
{
XFD_ANDSET
(
&
tmp_set
,
&
LastSelectWriteMask
,
&
NotifyWriteFds
);
if
(
XFD_ANYSET
(
&
tmp_set
))
someNotifyWriteReady
=
TRUE
;
}
}
XFD_ANDSET
(
&
devicesReadable
,
&
LastSelectMask
,
&
EnabledDevices
);
XFD_ANDSET
(
&
clientsReadable
,
&
LastSelectMask
,
&
AllClients
);
XFD_ANDSET
(
&
tmp_set
,
&
LastSelectMask
,
&
WellKnownConnections
);
if
(
XFD_ANYSET
(
&
tmp_set
))
QueueWorkProc
(
EstablishNewConnections
,
NULL
,
(
void
*
)
&
LastSelectMask
);
#ifdef DPMSExtension
if
(
XFD_ANYSET
(
&
devicesReadable
)
&&
(
DPMSPowerLevel
!=
DPMSModeOn
))
DPMSSet
(
DPMSModeOn
);
#endif
if
(
XFD_ANYSET
(
&
devicesReadable
)
||
XFD_ANYSET
(
&
clientsReadable
))
XFD_ANDSET
(
&
tmp_set
,
&
LastSelectMask
,
&
NotifyReadFds
);
if
(
XFD_ANYSET
(
&
tmp_set
)
||
someNotifyWriteReady
)
HandleNotifyFds
();
if
(
XFD_ANYSET
(
&
clientsReadable
))
break
;
#ifdef WIN32
/* Windows keyboard and mouse events are added to the input queue
...
...
nx-X11/programs/Xserver/os/connection.c
View file @
7fd5d934
...
...
@@ -48,8 +48,8 @@ SOFTWARE.
* Stuff to create connections --- OS dependent
*
* EstablishNewConnections, CreateWellKnownSockets, ResetWellKnownSockets,
* CloseDownConnection, CheckConnections,
AddEnabledDevice,
*
RemoveEnabledDevice,
OnlyListToOneClient,
* CloseDownConnection, CheckConnections,
*
OnlyListToOneClient,
* ListenToAllClients,
*
* (WaitForSomething is in its own file)
...
...
@@ -108,6 +108,7 @@ SOFTWARE.
#include <nx-X11/Xpoll.h>
#include "opaque.h"
#include "dixstruct.h"
#include "list.h"
#ifdef XCSECURITY
#define _SECURITY_SERVER
#include <nx-X11/extensions/security.h>
...
...
@@ -122,17 +123,19 @@ SOFTWARE.
int
lastfdesc
;
/* maximum file descriptor */
fd_set
WellKnownConnections
;
/* Listener mask */
fd_set
EnabledDevices
;
/* mask for input devices that are on */
fd_set
NotifyReadFds
;
/* mask for other file descriptors */
fd_set
NotifyWriteFds
;
/* mask for other write file descriptors */
fd_set
AllSockets
;
/* select on this */
fd_set
AllClients
;
/* available clients */
fd_set
LastSelectMask
;
/* mask returned from last select call */
fd_set
LastSelectWriteMask
;
/* mask returned from last select call */
fd_set
ClientsWithInput
;
/* clients with FULL requests in buffer */
fd_set
ClientsWriteBlocked
;
/* clients who cannot receive output */
fd_set
OutputPending
;
/* clients with reply/event data ready to go */
int
MaxClients
=
0
;
int
NumNotifyWriteFd
;
/* Number of NotifyFd members with write set */
Bool
NewOutputPending
;
/* not yet attempted to write some new output */
Bool
AnyClientsWriteBlocked
;
/* true if some client blocked on write */
Bool
AnyWritesPending
;
/* true if some client blocked on write or NotifyFd with write */
Bool
RunFromSmartParent
;
/* send SIGUSR1 to parent process */
Bool
PartialNetwork
;
/* continue even if unable to bind all addrs */
static
Pid_t
ParentProcess
;
...
...
@@ -911,8 +914,8 @@ CloseDownFileDescriptor(OsCommPtr oc)
FD_CLR
(
connection
,
&
SavedClientsWithInput
);
}
FD_CLR
(
connection
,
&
ClientsWriteBlocked
);
if
(
!
XFD_ANYSET
(
&
ClientsWriteBlocked
))
AnyClientsWriteBlocked
=
FALSE
;
if
(
!
XFD_ANYSET
(
&
ClientsWriteBlocked
)
&&
NumNotifyWriteFd
==
0
)
AnyWritesPending
=
FALSE
;
FD_CLR
(
connection
,
&
OutputPending
);
}
...
...
@@ -995,22 +998,119 @@ CloseDownConnection(ClientPtr client)
AuditF
(
"client %d disconnected
\n
"
,
client
->
index
);
}
struct
notify_fd
{
struct
xorg_list
list
;
int
fd
;
int
mask
;
NotifyFdProcPtr
notify
;
void
*
data
;
};
static
struct
xorg_list
notify_fds
;
void
AddEnabledDevice
(
int
f
d
)
InitNotifyFds
(
voi
d
)
{
FD_SET
(
fd
,
&
EnabledDevices
);
FD_SET
(
fd
,
&
AllSockets
);
if
(
GrabInProgress
)
FD_SET
(
fd
,
&
SavedAllSockets
);
struct
notify_fd
*
s
,
*
next
;
static
int
been_here
;
if
(
been_here
)
xorg_list_for_each_entry_safe
(
s
,
next
,
&
notify_fds
,
list
)
RemoveNotifyFd
(
s
->
fd
);
xorg_list_init
(
&
notify_fds
);
NumNotifyWriteFd
=
0
;
been_here
=
1
;
}
/*****************
* SetNotifyFd
* Registers a callback to be invoked when the specified
* file descriptor becomes readable.
*****************/
Bool
SetNotifyFd
(
int
fd
,
NotifyFdProcPtr
notify
,
int
mask
,
void
*
data
)
{
struct
notify_fd
*
n
;
int
changes
;
xorg_list_for_each_entry
(
n
,
&
notify_fds
,
list
)
if
(
n
->
fd
==
fd
)
break
;
if
(
&
n
->
list
==
&
notify_fds
)
{
if
(
mask
==
0
)
return
TRUE
;
n
=
calloc
(
1
,
sizeof
(
struct
notify_fd
));
if
(
!
n
)
return
FALSE
;
n
->
fd
=
fd
;
xorg_list_add
(
&
n
->
list
,
&
notify_fds
);
}
changes
=
n
->
mask
^
mask
;
if
(
changes
&
X_NOTIFY_READ
)
{
if
(
mask
&
X_NOTIFY_READ
)
{
FD_SET
(
fd
,
&
NotifyReadFds
);
FD_SET
(
fd
,
&
AllSockets
);
if
(
GrabInProgress
)
FD_SET
(
fd
,
&
SavedAllSockets
);
}
else
{
FD_CLR
(
fd
,
&
AllSockets
);
if
(
GrabInProgress
)
FD_CLR
(
fd
,
&
SavedAllSockets
);
FD_CLR
(
fd
,
&
NotifyReadFds
);
}
}
if
(
changes
&
X_NOTIFY_WRITE
)
{
if
(
mask
&
X_NOTIFY_WRITE
)
{
FD_SET
(
fd
,
&
NotifyWriteFds
);
if
(
!
NumNotifyWriteFd
++
)
AnyWritesPending
=
TRUE
;
}
else
{
FD_CLR
(
fd
,
&
NotifyWriteFds
);
if
(
!--
NumNotifyWriteFd
)
if
(
!
XFD_ANYSET
(
&
ClientsWriteBlocked
))
AnyWritesPending
=
FALSE
;
}
}
if
(
mask
==
0
)
{
xorg_list_del
(
&
n
->
list
);
free
(
n
);
}
else
{
n
->
mask
=
mask
;
n
->
data
=
data
;
n
->
notify
=
notify
;
}
return
TRUE
;
}
/*****************
* HandlNotifyFds
* A WorkProc to be called when any of the registered
* file descriptors are readable.
*****************/
void
RemoveEnabledDevice
(
int
f
d
)
HandleNotifyFds
(
voi
d
)
{
FD_CLR
(
fd
,
&
EnabledDevices
);
FD_CLR
(
fd
,
&
AllSockets
);
if
(
GrabInProgress
)
FD_CLR
(
fd
,
&
SavedAllSockets
);
struct
notify_fd
*
n
,
*
next
;
xorg_list_for_each_entry_safe
(
n
,
next
,
&
notify_fds
,
list
)
{
int
ready
=
0
;
if
((
n
->
mask
&
X_NOTIFY_READ
)
&&
FD_ISSET
(
n
->
fd
,
&
LastSelectMask
))
ready
|=
X_NOTIFY_READ
;
if
((
n
->
mask
&
X_NOTIFY_WRITE
)
&
FD_ISSET
(
n
->
fd
,
&
LastSelectWriteMask
))
ready
|=
X_NOTIFY_WRITE
;
if
(
ready
!=
0
)
n
->
notify
(
n
->
fd
,
ready
,
n
->
data
);
}
}
/*****************
...
...
nx-X11/programs/Xserver/os/io.c
View file @
7fd5d934
...
...
@@ -1062,7 +1062,7 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount)
and not ready to accept more. Make a note of it and buffer
the rest. */
FD_SET
(
connection
,
&
ClientsWriteBlocked
);
Any
ClientsWriteBlocked
=
TRUE
;
Any
WritesPending
=
TRUE
;
if
(
written
<
oco
->
count
)
{
...
...
@@ -1134,11 +1134,12 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount)
/* everything was flushed out */
oco
->
count
=
0
;
/* check to see if this client was write blocked */
if
(
Any
ClientsWriteBlocked
)
if
(
Any
WritesPending
)
{
FD_CLR
(
oc
->
fd
,
&
ClientsWriteBlocked
);
if
(
!
XFD_ANYSET
(
&
ClientsWriteBlocked
))
AnyClientsWriteBlocked
=
FALSE
;
if
(
!
XFD_ANYSET
(
&
ClientsWriteBlocked
)
&&
NumNotifyWriteFd
==
0
)
AnyWritesPending
=
FALSE
;
}
if
(
oco
->
size
>
BUFWATERMARK
)
{
...
...
nx-X11/programs/Xserver/os/osdep.h
View file @
7fd5d934
...
...
@@ -188,6 +188,10 @@ extern void FreeOsBuffers(
OsCommPtr
/*oc*/
);
extern
void
InitNotifyFds
(
void
);
extern
void
HandleNotifyFds
(
void
);
#include "dix.h"
extern
ConnectionInputPtr
AllocateInputBuffer
(
void
);
...
...
@@ -197,8 +201,11 @@ extern ConnectionOutputPtr AllocateOutputBuffer(void);
extern
fd_set
AllSockets
;
extern
fd_set
AllClients
;
extern
fd_set
LastSelectMask
;
extern
fd_set
LastSelectWriteMask
;
extern
fd_set
WellKnownConnections
;
extern
fd_set
EnabledDevices
;
extern
fd_set
NotifyReadFds
;
extern
fd_set
NotifyWriteFds
;
extern
fd_set
ClientsWithInput
;
extern
fd_set
ClientsWriteBlocked
;
extern
fd_set
OutputPending
;
...
...
@@ -213,7 +220,8 @@ extern void ClearConnectionTranslation();
#endif
extern
Bool
NewOutputPending
;
extern
Bool
AnyClientsWriteBlocked
;
extern
Bool
AnyWritesPending
;
extern
Bool
NumNotifyWriteFd
;
extern
Bool
CriticalOutputPending
;
extern
int
timesThisConnection
;
...
...
nx-X11/programs/Xserver/os/osinit.c
View file @
7fd5d934
...
...
@@ -101,10 +101,15 @@ OsInit(void)
#endif
if
(
!
been_here
)
{
InitNotifyFds
();
#if !defined(__SCO__) && !defined(__CYGWIN__) && !defined(__UNIXWARE__)
fclose
(
stdin
);
fclose
(
stdout
);
#endif
/*
* If a write of zero bytes to stderr returns non-zero, i.e. -1,
* then writing to stderr failed, and we'll write somewhere else
...
...
nx-X11/programs/Xserver/os/xdmcp.c
View file @
7fd5d934
...
...
@@ -88,8 +88,6 @@ static int req_socklen;
static
CARD32
SessionID
;
static
CARD32
timeOutTime
;
static
int
timeOutRtx
;
static
CARD32
defaultKeepaliveDormancy
=
XDM_DEF_DORMANCY
;
static
CARD32
keepaliveDormancy
=
XDM_DEF_DORMANCY
;
static
CARD16
DisplayNumber
;
static
xdmcp_states
XDM_INIT_STATE
=
XDM_OFF
;
#ifdef HASXDMAUTH
...
...
@@ -643,6 +641,7 @@ XdmcpOpenDisplay(int sock)
if
(
state
!=
XDM_AWAIT_MANAGE_RESPONSE
)
return
;
state
=
XDM_RUN_SESSION
;
timeOutTime
=
GetTimeInMillis
()
+
XDM_DEF_DORMANCY
*
1000
;
sessionSocket
=
sock
;
}
...
...
@@ -706,7 +705,6 @@ XdmcpWakeupHandler(
void
*
pReadmask
)
{
fd_set
*
LastSelectMask
=
(
fd_set
*
)
pReadmask
;
fd_set
devicesReadable
;
#ifdef NX_TRANS_SOCKET
...
...
@@ -731,16 +729,6 @@ XdmcpWakeupHandler(
FD_CLR
(
xdmcpSocket6
,
LastSelectMask
);
}
#endif
XFD_ANDSET
(
&
devicesReadable
,
LastSelectMask
,
&
EnabledDevices
);
if
(
XFD_ANYSET
(
&
devicesReadable
))
{
if
(
state
==
XDM_AWAIT_USER_INPUT
)
restart
();
else
if
(
state
==
XDM_RUN_SESSION
)
keepaliveDormancy
=
defaultKeepaliveDormancy
;
}
if
(
XFD_ANYSET
(
&
AllClients
)
&&
state
==
XDM_RUN_SESSION
)
timeOutTime
=
GetTimeInMillis
()
+
keepaliveDormancy
*
1000
;
}
else
if
(
timeOutTime
&&
(
int
)
(
GetTimeInMillis
()
-
timeOutTime
)
>=
0
)
{
...
...
@@ -1428,16 +1416,8 @@ recv_alive_msg (unsigned length)
{
if
(
SessionRunning
&&
AliveSessionID
==
SessionID
)
{
/* backoff dormancy period */
state
=
XDM_RUN_SESSION
;
if
((
GetTimeInMillis
()
-
lastDeviceEventTime
.
milliseconds
)
>
keepaliveDormancy
*
1000
)
{
keepaliveDormancy
<<=
1
;
if
(
keepaliveDormancy
>
XDM_MAX_DORMANCY
)
keepaliveDormancy
=
XDM_MAX_DORMANCY
;
}
timeOutTime
=
GetTimeInMillis
()
+
keepaliveDormancy
*
1000
;
timeOutTime
=
GetTimeInMillis
()
+
XDM_DEF_DORMANCY
*
1000
;
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment