Skip to content

Commit 5423dfa

Browse files
committed
Fix msgpack compatibility issues
1 parent 2a019d5 commit 5423dfa

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

wfb_ng/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class AntennaStat(Int32StringReceiver):
129129
MAX_LENGTH = 1024 * 1024
130130

131131
def stringReceived(self, string):
132-
attrs = msgpack.unpackb(string, strict_map_key=False, use_list=False)
132+
attrs = msgpack.unpackb(string, strict_map_key=False, use_list=False, raw=False)
133133

134134
if attrs['type'] == 'rx':
135135
self.draw_rx(attrs)

wfb_ng/log_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def main():
2424
if len(data) < data_len:
2525
break
2626

27-
msg = msgpack.unpackb(data, strict_map_key=False, use_list=False)
27+
msg = msgpack.unpackb(data, strict_map_key=False, use_list=False, raw=False)
2828
ts = msg.pop('timestamp')
2929
mtype = msg.pop('type')
3030

wfb_ng/server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ class BinLogger(ErrorSafeLogFile):
7676
log_cls = BinLogFile
7777

7878
def send_stats(self, data):
79-
data = msgpack.packb(data)
79+
data = msgpack.packb(data, use_bin_type=True)
8080
self.write(b''.join((struct.pack('!I', len(data)), data)))
8181

8282

8383
class StatisticsProtocol(Int32StringReceiver):
8484
MAX_LENGTH = 1024 * 1024
8585

8686
def connectionMade(self):
87-
self.sendString(msgpack.packb(dict(type='cli_title', cli_title=self.factory.cli_title)))
87+
self.sendString(msgpack.packb(dict(type='cli_title', cli_title=self.factory.cli_title), use_bin_type=True))
8888
self.factory.ui_sessions.append(self)
8989

9090
def stringReceived(self, string):
@@ -94,7 +94,7 @@ def connectionLost(self, reason):
9494
self.factory.ui_sessions.remove(self)
9595

9696
def send_stats(self, data):
97-
self.sendString(msgpack.packb(data))
97+
self.sendString(msgpack.packb(data, use_bin_type=True))
9898

9999

100100
class StatsAndSelectorFactory(Factory):

0 commit comments

Comments
 (0)