Commit f3e51a7b authored by David Wilson's avatar David Wilson

core: CALL_FUNCTION should check auth_id, not src_id

parent f001eba2
...@@ -1247,8 +1247,8 @@ class ExternalContext(object): ...@@ -1247,8 +1247,8 @@ class ExternalContext(object):
for msg in self.channel: for msg in self.channel:
data = msg.unpickle(throw=False) data = msg.unpickle(throw=False)
LOG.debug('_dispatch_calls(%r)', data) LOG.debug('_dispatch_calls(%r)', data)
if msg.src_id not in mitogen.parent_ids: if msg.auth_id not in mitogen.parent_ids:
LOG.warning('CALL_FUNCTION from non-parent %r', msg.src_id) LOG.warning('CALL_FUNCTION from non-parent %r', msg.auth_id)
modname, klass, func, args, kwargs = data modname, klass, func, args, kwargs = data
try: try:
......
...@@ -78,6 +78,7 @@ class Listener(mitogen.core.BasicStream): ...@@ -78,6 +78,7 @@ class Listener(mitogen.core.BasicStream):
context = mitogen.master.Context(self._router, context_id) context = mitogen.master.Context(self._router, context_id)
stream = mitogen.core.Stream(self._router, context_id) stream = mitogen.core.Stream(self._router, context_id)
stream.accept(sock.fileno(), sock.fileno()) stream.accept(sock.fileno(), sock.fileno())
stream.auth_id = mitogen.context_id
self._router.register(context, stream) self._router.register(context, stream)
sock.send(struct.pack('>LL', context_id, mitogen.context_id)) sock.send(struct.pack('>LL', context_id, mitogen.context_id))
sock.close() sock.close()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment