mirror of
https://github.com/faucetsdn/ryu.git
synced 2025-08-07 15:17:13 +02:00
Add msgpack 1.0 support; use version testing to preserve compatibility with older versions
This commit is contained in:
parent
8990ed47ed
commit
aa10cac1db
4
debian/control
vendored
4
debian/control
vendored
@ -6,7 +6,7 @@ Build-Depends: debhelper (>= 9.0.0), python-all (>= 2.6), python-sphinx
|
|||||||
Build-Depends-Indep:
|
Build-Depends-Indep:
|
||||||
python-eventlet,
|
python-eventlet,
|
||||||
python-lxml,
|
python-lxml,
|
||||||
python-msgpack (>= 0.4.0), python-msgpack (< 1.0.0),
|
python-msgpack (>= 0.4.0),
|
||||||
python-netaddr,
|
python-netaddr,
|
||||||
python-oslo.config (>= 1:1.2.0),
|
python-oslo.config (>= 1:1.2.0),
|
||||||
python-paramiko,
|
python-paramiko,
|
||||||
@ -28,7 +28,7 @@ Section: python
|
|||||||
Depends:
|
Depends:
|
||||||
python-eventlet,
|
python-eventlet,
|
||||||
python-lxml,
|
python-lxml,
|
||||||
python-msgpack (>= 0.4.0), python-msgpack (< 1.0.0),
|
python-msgpack (>= 0.4.0),
|
||||||
python-netaddr,
|
python-netaddr,
|
||||||
python-oslo.config (>= 1:1.2.0),
|
python-oslo.config (>= 1:1.2.0),
|
||||||
python-paramiko,
|
python-paramiko,
|
||||||
|
@ -40,6 +40,14 @@ class MessageEncoder(object):
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(MessageEncoder, self).__init__()
|
super(MessageEncoder, self).__init__()
|
||||||
|
if msgpack.version >= (1, 0, 0):
|
||||||
|
self._packer = msgpack.Packer()
|
||||||
|
# The strict_map_key=False option is required to use int keys in
|
||||||
|
# maps; it is disabled by default to prevent hash collision denial
|
||||||
|
# of service attacks (hashdos) in scenarios where an attacker can
|
||||||
|
# control the keys to be hashed.
|
||||||
|
self._unpacker = msgpack.Unpacker(strict_map_key=False)
|
||||||
|
else:
|
||||||
self._packer = msgpack.Packer(encoding='utf-8', use_bin_type=True)
|
self._packer = msgpack.Packer(encoding='utf-8', use_bin_type=True)
|
||||||
self._unpacker = msgpack.Unpacker(encoding='utf-8')
|
self._unpacker = msgpack.Unpacker(encoding='utf-8')
|
||||||
self._next_msgid = 0
|
self._next_msgid = 0
|
||||||
|
@ -101,6 +101,14 @@ class RpcSession(Activity):
|
|||||||
def __init__(self, sock, outgoing_msg_sink_iter):
|
def __init__(self, sock, outgoing_msg_sink_iter):
|
||||||
self.peer_name = str(sock.getpeername())
|
self.peer_name = str(sock.getpeername())
|
||||||
super(RpcSession, self).__init__(self.NAME_FMT % self.peer_name)
|
super(RpcSession, self).__init__(self.NAME_FMT % self.peer_name)
|
||||||
|
if msgpack.version >= (1, 0, 0):
|
||||||
|
self._packer = msgpack.Packer()
|
||||||
|
# The strict_map_key=False option is required to use int keys in
|
||||||
|
# maps; it is disabled by default to prevent hash collision denial
|
||||||
|
# of service attacks (hashdos) in scenarios where an attacker can
|
||||||
|
# control the keys to be hashed.
|
||||||
|
self._unpacker = msgpack.Unpacker(strict_map_key=False)
|
||||||
|
else:
|
||||||
self._packer = msgpack.Packer(encoding='utf-8', use_bin_type=True)
|
self._packer = msgpack.Packer(encoding='utf-8', use_bin_type=True)
|
||||||
self._unpacker = msgpack.Unpacker(encoding='utf-8')
|
self._unpacker = msgpack.Unpacker(encoding='utf-8')
|
||||||
self._next_msgid = 0
|
self._next_msgid = 0
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# following issue.
|
# following issue.
|
||||||
# https://github.com/eventlet/eventlet/issues/401
|
# https://github.com/eventlet/eventlet/issues/401
|
||||||
eventlet!=0.18.3,>=0.18.2,!=0.20.1,!=0.21.0,!=0.23.0
|
eventlet!=0.18.3,>=0.18.2,!=0.20.1,!=0.21.0,!=0.23.0
|
||||||
msgpack>=0.4.0,<1.0.0 # RPC library, BGP speaker(net_cntl)
|
msgpack>=0.4.0 # RPC library, BGP speaker(net_cntl)
|
||||||
netaddr
|
netaddr
|
||||||
oslo.config>=2.5.0
|
oslo.config>=2.5.0
|
||||||
ovs>=2.6.0 # OVSDB
|
ovs>=2.6.0 # OVSDB
|
||||||
|
Loading…
Reference in New Issue
Block a user