code: def fetch(self, path, sender, msg):
          
          if path not in self._paths and not self._prefix_is_authorized(path):
              msg.reply(mitogen.core.CallError(
                  Error(self.unregistered_msg % (path,))
              ))
              return
  
          if msg.src_id != sender.context.context_id:
              msg.reply(mitogen.core.CallError(
                  Error(self.context_mismatch_msg)
              ))
              return
  
          LOG.debug('Serving %r', path)
  
          # Response must arrive first so requestee can begin receive loop,
          # otherwise first ack won't arrive until all pending chunks were
          # delivered. In that case max BDP would always be 128KiB, aka. max
          # ~10Mbit/sec over a 100ms link.
          try:
              fp = open(path, 'rb', self.IO_SIZE)
              msg.reply(self._generate_stat(path))
          except IOError:
              msg.reply(mitogen.core.CallError(
                  sys.exc_info()[1]
              ))
              return
  
          stream = self.router.stream_by_id(sender.context.context_id)
          state = self._state_by_stream.setdefault(stream, FileStreamState())
          state.lock.acquire()
          try:
              state.jobs.append((sender, fp))
              self._schedule_pending_unlocked(state)
          finally:
              state.lock.release()
docs: Start a transfer for a registered path.
  
          :param str path:
              File path.
          :param mitogen.core.Sender sender:
              Sender to receive file data.
          :returns:
              Dict containing the file metadata:
  
              * ``size``: File size in bytes.
              * ``mode``: Integer file mode.
              * ``owner``: Owner account name on host machine.
              * ``group``: Owner group name on host machine.
              * ``mtime``: Floating point modification time.
              * ``ctime``: Floating point change time.
          :raises Error:
              Unregistered path, or Sender did not match requestee context.