Enforce new msgpack format (use_bin_type=True)

Enforce new msgpack format (use_bin_type=True) in
ryu.services.protocols.bgp.net_ctrl.RpcSession; this option
is already used in ryu.lib.rpc.MessageEncoder

Backport from https://github.com/faucetsdn/ryu/commit/8990ed

Story: #2009283
Task: #46863
Change-Id: I2f04d74f85ade54e0826494f078c88a2a3e24a55
This commit is contained in:
Benjamin Beasley 2020-12-29 14:42:30 -05:00 committed by Rodolfo Alonso Hernandez
parent 0acd272cd1
commit f10f2b2852
1 changed files with 2 additions and 2 deletions

View File

@ -101,8 +101,8 @@ class RpcSession(Activity):
def __init__(self, sock, outgoing_msg_sink_iter):
self.peer_name = str(sock.getpeername())
super(RpcSession, self).__init__(self.NAME_FMT % self.peer_name)
self._packer = msgpack.Packer()
self._unpacker = msgpack.Unpacker(strict_map_key=False)
self._packer = msgpack.Packer(encoding='utf-8', use_bin_type=True)
self._unpacker = msgpack.Unpacker(encoding='utf-8')
self._next_msgid = 0
self._socket = sock
self._outgoing_msg_sink_iter = outgoing_msg_sink_iter