summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorJustin Bronder <jsbronder@cold-front.org>2022-10-24 16:07:41 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-10-29 16:30:43 +0100
commit6ca9f04b8e2cf1475ead09e55ac6282cab3ee9e7 (patch)
tree0ae249eacf9a3435106598b02f3663ef9428620c /bitbake
parenteff3042f0eb0b66d57199fdc920f7fe7ed1c02d6 (diff)
downloadpoky-6ca9f04b8e2cf1475ead09e55ac6282cab3ee9e7.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: 2d07f252704dff7747fa1f9adf223a452806717f) 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>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/asyncrpc/serv.py4
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()