diff --git a/os/xdmcp.c b/os/xdmcp.c index b1ee5d255..7939b4138 100644 --- a/os/xdmcp.c +++ b/os/xdmcp.c @@ -84,8 +84,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; @@ -632,6 +630,7 @@ XdmcpOpenDisplay(int sock) if (state != XDM_AWAIT_MANAGE_RESPONSE) return; state = XDM_RUN_SESSION; + timeOutTime = GetTimeInMillis() + XDM_DEF_DORMANCY * 1000; sessionSocket = sock; } @@ -689,7 +688,6 @@ XdmcpWakeupHandler(void *data, /* unused */ int i, void *pReadmask) { fd_set *last_select_mask = (fd_set *) pReadmask; - fd_set devicesReadable; if (state == XDM_OFF) return; @@ -704,13 +702,6 @@ XdmcpWakeupHandler(void *data, /* unused */ FD_CLR(xdmcpSocket6, last_select_mask); } #endif - XFD_ANDSET(&devicesReadable, last_select_mask, &EnabledDevices); - if (XFD_ANYSET(&devicesReadable)) { - 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) { if (state == XDM_RUN_SESSION) { @@ -1399,15 +1390,8 @@ recv_alive_msg(unsigned length) if (XdmcpReadCARD8(&buffer, &SessionRunning) && XdmcpReadCARD32(&buffer, &AliveSessionID)) { if (SessionRunning && AliveSessionID == SessionID) { - /* backoff dormancy period */ state = XDM_RUN_SESSION; - if ((GetTimeInMillis() - LastEventTime(XIAllDevices).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 { XdmcpDeadSession("Alive response indicates session dead");