From: Fredrik Tolf Date: Sat, 2 Feb 2019 10:44:41 +0000 (+0100) Subject: python*: Use poll instead of select in ckflush. X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=6e8b9b9d6d043ecbcaeb8ef807bd9648424aedd7;p=ashd.git python*: Use poll instead of select in ckflush. --- 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