[PATCH 1/2] os/connection: Call ClientReady() based on a level trigger rather than an edge trigger

Jeremy Huddleston Sequoia jeremyhu at apple.com
Sat Sep 17 08:55:50 UTC 2016


On encountering an EAGAIN, FlushClient() re-adds the client to the pending list
and returns, but FlushClient() doesn't get called again.  We would expect it to
be called via FlushAllOutput() via WaitForSomething(), but that only happens
when NewOutputPending is set.  FlushAllOutput() also early-exits if
NewOutputPending is not set.

The only place that is setting NewOutputPending is ClientReady().  The problem
there is that ClientReady() is called based on an edge trigger and not a level
trigger.

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
CC: Keith Packard <keithp at keithp.com>
---
 os/connection.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/os/connection.c b/os/connection.c
index 0d42184..4630438 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -749,7 +749,7 @@ AllocNewConnection(XtransConnInfo trans_conn, int fd, CARD32 conn_time)
     SetConnectionTranslation(fd, client->index);
 #endif
     ospoll_add(server_poll, fd,
-               ospoll_trigger_edge,
+               ospoll_trigger_level,
                ClientReady,
                client);
     set_poll_client(client);
-- 
2.10.0 (Apple Git-99)



More information about the xorg-devel mailing list