xserver: Branch 'server-1.8-branch'
Jesse Barnes
jbarnes at kemper.freedesktop.org
Fri Jul 2 09:25:00 PDT 2010
include/dixstruct.h | 1 +
os/connection.c | 9 +++++++++
2 files changed, 10 insertions(+)
New commits:
commit 665aa7ce8645b50b888db32ebab4e192dbe00649
Author: Jesse Barnes <jbarnes at virtuousgeek.org>
Date: Wed Jun 30 07:59:04 2010 -0700
OS support: fix writeable client vs IgnoreClient behavior
When ResetCurrentRequest is called, or IgnoreClient is called when a
client has input pending, IgnoredClientsWithInput will be set. However,
a subsequent IgnoreClient request will clear the client fd from that fd
set, potentially causing the client to hang.
So add an Ignore/Attend count, and only apply the ignore logic on the
first ignore and the attend logic on the last attend. This is
consistent with the comments for these functions; callers must pair
them.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=27035.
Reviewed-by: Keith Packard <keithp at keithp.com>
Reviewed-by: Daniel Stone <daniel at fooishbar.org>
Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
Signed-off-by: Keith Packard <keithp at keithp.com>
diff --git a/include/dixstruct.h b/include/dixstruct.h
index 696b793..568ea1f 100644
--- a/include/dixstruct.h
+++ b/include/dixstruct.h
@@ -99,6 +99,7 @@ typedef struct _Client {
int clientGone;
int noClientException; /* this client died or needs to be
* killed */
+ int ignoreCount; /* count for Attend/IgnoreClient */
SaveSetElt *saveSet;
int numSaved;
void *unused_screenPrivate[16];
diff --git a/os/connection.c b/os/connection.c
index 61ba72a..3178b7e 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -1147,6 +1147,10 @@ IgnoreClient (ClientPtr client)
OsCommPtr oc = (OsCommPtr)client->osPrivate;
int connection = oc->fd;
+ client->ignoreCount++;
+ if (client->ignoreCount > 1)
+ return;
+
isItTimeToYield = TRUE;
if (!GrabInProgress || FD_ISSET(connection, &AllClients))
{
@@ -1181,6 +1185,11 @@ AttendClient (ClientPtr client)
{
OsCommPtr oc = (OsCommPtr)client->osPrivate;
int connection = oc->fd;
+
+ client->ignoreCount--;
+ if (client->ignoreCount)
+ return;
+
if (!GrabInProgress || GrabInProgress == client->index ||
FD_ISSET(connection, &GrabImperviousClients))
{
More information about the xorg-commit
mailing list