diff options
author | Justin Bronder <jsbronder@cold-front.org> | 2022-11-09 04:29:35 -1000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-11-10 14:43:30 +0000 |
commit | 25f355e0ef2fa98699cc62587a8f265258c09fda (patch) | |
tree | e49406e133d6c8d8b12f5e7bd28c12e508200977 /bitbake | |
parent | 186d1796149c94522c746d76973adbfd61313f21 (diff) | |
download | poky-25f355e0ef2fa98699cc62587a8f265258c09fda.tar.gz |
bitbake: asyncrpc: serv: correct closed client socket detection
If the client socket is closed, asyncio.StreamReader.readline() will
return an empty bytes object, not None.
This prevents multiple tracebacks being logged by bitbake-hashserv each
time bitbake is started and performs a connection check.
(Bitbake rev: 4bdd9ba43f34a1473db31a6a3b10bd33e358fe3a)
Signed-off-by: Justin Bronder <jsbronder@cold-front.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 2d07f252704dff7747fa1f9adf223a452806717f)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/asyncrpc/serv.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bitbake/lib/bb/asyncrpc/serv.py b/bitbake/lib/bb/asyncrpc/serv.py index 5cf45f908a..d2de4891b8 100644 --- a/bitbake/lib/bb/asyncrpc/serv.py +++ b/bitbake/lib/bb/asyncrpc/serv.py | |||
@@ -42,7 +42,7 @@ class AsyncServerConnection(object): | |||
42 | 42 | ||
43 | # Read protocol and version | 43 | # Read protocol and version |
44 | client_protocol = await self.reader.readline() | 44 | client_protocol = await self.reader.readline() |
45 | if client_protocol is None: | 45 | if not client_protocol: |
46 | return | 46 | return |
47 | 47 | ||
48 | (client_proto_name, client_proto_version) = client_protocol.decode('utf-8').rstrip().split() | 48 | (client_proto_name, client_proto_version) = client_protocol.decode('utf-8').rstrip().split() |
@@ -59,7 +59,7 @@ class AsyncServerConnection(object): | |||
59 | # an empty line to signal the end of the headers | 59 | # an empty line to signal the end of the headers |
60 | while True: | 60 | while True: |
61 | line = await self.reader.readline() | 61 | line = await self.reader.readline() |
62 | if line is None: | 62 | if not line: |
63 | return | 63 | return |
64 | 64 | ||
65 | line = line.decode('utf-8').rstrip() | 65 | line = line.decode('utf-8').rstrip() |