issue #155: increase context ID width to 32 bits

Needed to make large range allocations (1000 per ALLOCATE_ID roundtrip)
feasible.
wip-fakessh-exit-status
David Wilson 7 years ago
parent 3579b6806b
commit 148ce1d703

@ -269,18 +269,18 @@ parent and child:
- Description
* - `dst_id`
- 2
- 4
- Integer target context ID. :py:class:`Router` delivers messages
locally when their `dst_id` matches :py:data:`mitogen.context_id`,
otherwise they are routed up or downstream.
* - `src_id`
- 2
- 4
- Integer source context ID. Used as the target of replies if any are
generated.
* - `auth_id`
- 2
- 4
- The context ID under whose authority the message is acting. See
:py:ref:`source-verification`.

@ -757,7 +757,7 @@ class Stream(BasicStream):
while self._receive_one(broker):
pass
HEADER_FMT = '>hhhLLL'
HEADER_FMT = '>LLLLLL'
HEADER_LEN = struct.calcsize(HEADER_FMT)
def _receive_one(self, broker):
@ -819,9 +819,9 @@ class Stream(BasicStream):
def _send(self, msg):
_vv and IOLOG.debug('%r._send(%r)', self, msg)
pkt = struct.pack('>hhhLLL', msg.dst_id, msg.src_id, msg.auth_id,
msg.handle, msg.reply_to or 0, len(msg.data)
) + msg.data
pkt = struct.pack(self.HEADER_FMT, msg.dst_id, msg.src_id,
msg.auth_id, msg.handle, msg.reply_to or 0,
len(msg.data)) + msg.data
self._output_buf.append(pkt)
self._router.broker.start_transmit(self)

Loading…
Cancel
Save