[PATCH xserver 2/2] os: Mark client as ready to read when closing due to write failure [100863]

Keith Packard keithp at keithp.com
Sat Apr 29 07:29:09 UTC 2017


This makes sure the server will go look at the client again, notice
that the FD is no longer valid and close the client down.

Bugzilla: https://bugs.freedesktop.org/100863
Signed-off-by: Keith Packard <keithp at keithp.com>
---
 os/io.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/os/io.c b/os/io.c
index 18f4108ac..a46972b7c 100644
--- a/os/io.c
+++ b/os/io.c
@@ -635,7 +635,10 @@ SetCriticalOutputPending(void)
 /*****************
  * AbortClient:
  *    When a write error occurs to a client, close
- *    the connection and clean things up.
+ *    the connection and clean things up. Mark
+ *    the client as 'ready' so that the server will
+ *    try to read from it again, notice that the fd is
+ *    closed and clean up from there.
  *****************/
 
 static void
@@ -647,6 +650,7 @@ AbortClient(ClientPtr client)
         _XSERVTransDisconnect(oc->trans_conn);
         _XSERVTransClose(oc->trans_conn);
         oc->trans_conn = NULL;
+        mark_client_ready(client);
     }
 }
 
-- 
2.11.0



More information about the xorg-devel mailing list