Skip to content

Commit c2d227e

Browse files
authored
Merge pull request #17 from adator85/V1.x.x
V1.0.4 fix Live connection when response is provided without end tag
2 parents 929c105 + fbd6f91 commit c2d227e

File tree

5 files changed

+19
-3
lines changed

5 files changed

+19
-3
lines changed
33.4 KB
Binary file not shown.

dist/unrealircd_rpc_py-1.0.4.tar.gz

23 KB
Binary file not shown.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name='unrealircd_rpc_py',
5-
version='1.0.3',
5+
version='1.0.4',
66
packages=find_packages(),
77
install_requires=[
88
"requests>=2.25.1"

unrealircd_rpc_py/Live.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,25 @@ async def __send_to_permanent_unixsocket(self):
7676

7777
sock.sendall(f'{self.request}\r\n'.encode())
7878

79+
# Init batch variable
80+
batch = b''
81+
7982
while self.connected:
8083
# Recieve the data from the rpc server, decode it and split it
81-
response = sock.recv(4096).decode().split('\n')
84+
response = sock.recv(4096)
85+
if response[-1:] != b"\n":
86+
# If END not recieved then fill the batch and go to next itteration
87+
batch += response
88+
continue
89+
else:
90+
# The EOF is found, include current response to the batch and continue the code
91+
batch += response
92+
93+
# Decode and split the response
94+
response = batch.decode().split("\n")
95+
96+
# Clean batch variable
97+
batch = b''
8298

8399
for bdata in response:
84100
if bdata:

version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "1.0.3"
2+
"version": "1.0.4"
33
}

0 commit comments

Comments
 (0)