self.recv() can return an empty array
This commit is contained in:
parent
923809ab43
commit
d571ad7ff9
1 changed files with 7 additions and 5 deletions
|
@ -107,10 +107,12 @@ class Server(IServer):
|
||||||
both = self._read_queue.popleft()
|
both = self._read_queue.popleft()
|
||||||
else:
|
else:
|
||||||
data = await self._reader.read(1024)
|
data = await self._reader.read(1024)
|
||||||
|
while True:
|
||||||
lines = self.recv(data)
|
lines = self.recv(data)
|
||||||
|
if lines:
|
||||||
self._read_queue.extend(lines[1:])
|
self._read_queue.extend(lines[1:])
|
||||||
both = lines[0]
|
both = lines[0]
|
||||||
|
break
|
||||||
|
|
||||||
line, emits = both
|
line, emits = both
|
||||||
for emit in emits:
|
for emit in emits:
|
||||||
|
|
Loading…
Reference in a new issue