From 6e8b9b9d6d043ecbcaeb8ef807bd9648424aedd7 Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Sat, 2 Feb 2019 11:44:41 +0100 Subject: [PATCH] python*: Use poll instead of select in ckflush. --- python/ashd/serve.py | 4 +++- python3/ashd/serve.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/python/ashd/serve.py b/python/ashd/serve.py index e9f92b0..3de5861 100644 --- a/python/ashd/serve.py +++ b/python/ashd/serve.py @@ -75,8 +75,10 @@ class handler(object): def handle(self, request): raise Exception() def ckflush(self, req): + p = select.poll() + p.register(req, select.POLLOUT) while len(req.buffer) > 0: - rls, wls, els = select.select([], [req], [req]) + p.poll() req.flush() def close(self): pass diff --git a/python3/ashd/serve.py b/python3/ashd/serve.py index 87f60a0..0927710 100644 --- a/python3/ashd/serve.py +++ b/python3/ashd/serve.py @@ -75,8 +75,10 @@ class handler(object): def handle(self, request): raise Exception() def ckflush(self, req): + p = select.poll() + p.register(req, select.POLLOUT) while len(req.buffer) > 0: - rls, wls, els = select.select([], [req], [req]) + p.poll() req.flush() def close(self): pass -- 2.11.0