Forking what is left of ZeroNet and hopefully adding an AT Proto Frontend/Proxy
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Use Msgpack module in BroadcastServer plugin

+4 -5
+4 -5
plugins/AnnounceLocal/BroadcastServer.py
··· 3 3 import time 4 4 from contextlib import closing 5 5 6 - import msgpack 7 - 8 6 from Debug import Debug 9 7 from util import UpnpPunch 8 + from util import Msgpack 10 9 11 10 12 11 class BroadcastServer(object): ··· 69 68 break 70 69 71 70 try: 72 - message = msgpack.unpackb(data) 71 + message = Msgpack.unpack(data) 73 72 response_addr, message = self.handleMessage(addr, message) 74 73 if message: 75 74 self.send(response_addr, message) ··· 93 92 self.log.debug("Send to %s: %s" % (addr, message_part["cmd"])) 94 93 with closing(socket.socket(socket.AF_INET, socket.SOCK_DGRAM)) as sock: 95 94 sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) 96 - sock.sendto(msgpack.packb(message_part), addr) 95 + sock.sendto(Msgpack.pack(message_part), addr) 97 96 98 97 def getMyIps(self): 99 98 return UpnpPunch._get_local_ips() ··· 114 113 sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) 115 114 sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) 116 115 sock.bind((my_ip, 0)) 117 - sock.sendto(msgpack.packb(message), addr) 116 + sock.sendto(Msgpack.pack(message), addr) 118 117 except Exception as err: 119 118 self.log.warning("Error sending broadcast using ip %s: %s" % (my_ip, err)) 120 119