diff options
author | George Lebl <jirka@5z.com> | 2003-12-10 23:36:49 +0000 |
---|---|---|
committer | George Lebl <jirka@src.gnome.org> | 2003-12-10 23:36:49 +0000 |
commit | fb3fd50f54649df05354bb7639c6975b6e1b0b2b (patch) | |
tree | f063a9b30cd1ff60715274671199c3d8c60374f1 | |
parent | 4fec3865933424d79ad54468d63461e60d05cef7 (diff) | |
download | gdm-fb3fd50f54649df05354bb7639c6975b6e1b0b2b.tar.gz |
Fix #126465 where xdmcp_sessions would not get decremented on normal
Wed Dec 10 15:33:09 2003 George Lebl <jirka@5z.com>
* daemon/display.c: Fix #126465 where xdmcp_sessions would not
get decremented on normal logout. Doh! Just do a recount of
all the limits on display dispose that is just a lot more robust.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | daemon/display.c | 37 |
2 files changed, 33 insertions, 10 deletions
@@ -1,3 +1,9 @@ +Wed Dec 10 15:33:09 2003 George Lebl <jirka@5z.com> + + * daemon/display.c: Fix #126465 where xdmcp_sessions would not + get decremented on normal logout. Doh! Just do a recount of + all the limits on display dispose that is just a lot more robust. + Fri Oct 17 10:54:12 2003 George Lebl <jirka@5z.com> * Release 2.4.4.5 diff --git a/daemon/display.c b/daemon/display.c index 668be828..46a80dcd 100644 --- a/daemon/display.c +++ b/daemon/display.c @@ -373,6 +373,30 @@ gdm_display_unmanage (GdmDisplay *d) gdm_debug ("gdm_display_unmanage: Display stopped"); } +/* Why recount? It's just a lot more robust this way and + gets around those nasty one off errors and races. And we never + have so many displays that this would get too slow. */ +static void +count_session_limits (void) +{ + GSList *li; + + xdmcp_sessions = 0; + xdmcp_pending = 0; + flexi_servers = 0; + + for (li = displays; li != NULL; li = li->next) { + GdmDisplay *d = li->data; + if (d->type == TYPE_XDMCP) { + if (d->dispstat == XDMCP_MANAGED) + xdmcp_sessions ++; + else if (d->dispstat == XDMCP_PENDING) + xdmcp_pending ++; + } else if (SERVER_IS_FLEXI (d)) { + flexi_servers ++; + } + } +} /** * gdm_display_dispose: @@ -405,17 +429,10 @@ gdm_display_dispose (GdmDisplay *d) displays = g_slist_remove (displays, d); - if (SERVER_IS_FLEXI (d)) - flexi_servers --; - - if (d->type == TYPE_XDMCP) { - if (d->dispstat == XDMCP_MANAGED) - xdmcp_sessions--; - else if (d->dispstat == XDMCP_PENDING) - xdmcp_pending--; + d->dispstat = DISPLAY_DEAD; + d->type = -1; - d->type = -1; - } + count_session_limits (); if (d->name) { gdm_debug ("gdm_display_dispose: Disposing %s", d->name); |