Correctly parse potentially buffered reply

master
Viktor Villainov 2018-12-30 07:59:36 -05:00
parent e4c79c581d
commit ebfb743222
No known key found for this signature in database
GPG Key ID: 8EB38B46F33BAF2F
1 changed files with 1 additions and 1 deletions

View File

@ -8,7 +8,7 @@ import i2plib.utils
BUFFER_SIZE = 65536
def parse_reply(data):
return i2plib.sam.Answer(data.decode().strip())
return i2plib.sam.Answer(data.split(b"\n")[0].decode())
async def get_sam_socket(sam_address=i2plib.sam.DEFAULT_ADDRESS, loop=None):
"""A couroutine used to create a new SAM socket.