From 73583686660f8058462ad0c1abdfc16fa3ec3d11 Mon Sep 17 00:00:00 2001 From: marha Date: Wed, 16 Feb 2011 15:14:04 +0000 Subject: Do not use a delay of 0 --- xorg-server/os/xdmcp.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) (limited to 'xorg-server/os/xdmcp.c') diff --git a/xorg-server/os/xdmcp.c b/xorg-server/os/xdmcp.c index 582a0bd97..d587e91b5 100644 --- a/xorg-server/os/xdmcp.c +++ b/xorg-server/os/xdmcp.c @@ -692,8 +692,8 @@ XdmcpBlockHandler( if (timeOutTime == 0) return; millisToGo = timeOutTime - GetTimeInMillis(); - if ((int) millisToGo < 0) - millisToGo = 0; + if ((int) millisToGo <= 0) + millisToGo = 1; AdjustWaitForDelay (wt, millisToGo); } @@ -737,18 +737,6 @@ XdmcpWakeupHandler( 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) - { - if (state == XDM_RUN_SESSION) - { - state = XDM_KEEPALIVE; - send_packet(); - } - else - timeout(); } } @@ -1185,15 +1173,15 @@ send_query_msg(void) for (mcl = mcastlist; mcl != NULL; mcl = mcl->next) { for (ai = mcl->ai ; ai != NULL; ai = ai->ai_next) { if (ai->ai_family == AF_INET) { - unsigned char hopflag = (unsigned char) mcl->hops; + int hopflag = mcl->hops; socketfd = xdmcpSocket; setsockopt(socketfd, IPPROTO_IP, IP_MULTICAST_TTL, - &hopflag, sizeof(hopflag)); + (char*)&hopflag, sizeof(hopflag)); } else if (ai->ai_family == AF_INET6) { int hopflag6 = mcl->hops; socketfd = xdmcpSocket6; setsockopt(socketfd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, - &hopflag6, sizeof(hopflag6)); + (char*)&hopflag6, sizeof(hopflag6)); } else { continue; } @@ -1573,6 +1561,10 @@ get_addr_by_name( char *pport = portstr; int gaierr; +#if defined(WIN32) && defined(TCPCONN) + _XSERVTransWSAStartup(); +#endif + memset(&hints, 0, sizeof(hints)); hints.ai_socktype = socktype; -- cgit v1.2.3