From 451d804c51ab1b966ef529d9dde4563e5ff68aec Mon Sep 17 00:00:00 2001 From: Symphorien Gibol <symphorien.gibol@gmail.com> Date: Fri, 20 May 2016 17:22:10 +0200 Subject: [PATCH] fix --- tunmgr/tunmgr.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tunmgr/tunmgr.py b/tunmgr/tunmgr.py index d600572..8975161 100755 --- a/tunmgr/tunmgr.py +++ b/tunmgr/tunmgr.py @@ -33,11 +33,15 @@ while 1: for key, events in sel.select(): try: if key.data=="tun": - print("tun") - s.sendto(base64.b64encode(tun.read(tun.mtu)), (PEER, PORT)) + msg = tun.read(tun.mtu) + print("tun", msg, len(msg), "bytes") + msg = base64.b64encode(msg)+b"\n" + print("base64", msg, len(msg), "bytes") + print(msg, (PEER, PORT)) + s.sendto(msg, (PEER, PORT)) elif key.data == "sms": print("sms") - tun.write(base64.b64decode(s.recv(tun.mtu*4))+b"\n") + tun.write(base64.b64decode(s.recv(tun.mtu*4))) except Exception: traceback.print_exc() -- GitLab