'Respond to an incoming pull
@param r: the S3Request
@param attr: the controller attributes'

def __send(self, r, **attr):

    mixed = attr.get('mixed', False)
    get_vars = r.get_vars
    vars_get = get_vars.get
    resource = r.resource
    repository_uuid = vars_get('repository')
    connector = None
    if repository_uuid:
        rtable = current.s3db.sync_repository
        query = (rtable.uuid == repository_uuid)
        row = current.db(query).select(limitby=(0, 1)).first()
        if row:
            connector = S3SyncRepository(row)
    if (connector is None):
        connector = S3SyncRepository(Storage(id=None, name='unknown', apitype='eden'))
    current.log.debug(('S3Sync    PULL    from    %s    (%s)' % (connector.name, connector.apitype)))
    start = vars_get('start', None)
    if (start is not None):
        try:
            start = int(start)
        except ValueError:
            start = None
    limit = vars_get('limit', None)
    if (limit is not None):
        try:
            limit = int(limit)
        except ValueError:
            limit = None
    msince = vars_get('msince', None)
    if (msince is not None):
        msince = s3_parse_datetime(msince)
    filters = {}
    for (k, v) in get_vars.items():
        if ((k[0] == '[') and (']' in k)):
            (tablename, urlvar) = k[1:].split(']', 1)
            if urlvar:
                if ((not tablename) or (tablename == '~')):
                    tablename = resource.tablename
                f = filters.get(tablename, {})
                u = f.get(urlvar, None)
                if u:
                    u = ('%s&%s' % (u, v))
                else:
                    u = v
                f[urlvar] = u
                filters[tablename] = f
    if (not filters):
        filters = None
    components = vars_get('components', None)
    if (components and (components.lower() == 'none')):
        resource.components = Storage()
    try:
        result = connector.send(resource, start=start, limit=limit, msince=msince, filters=filters, mixed=mixed)
    except NotImplementedError:
        r.error(405, 'Synchronization    method    not    supported    for    repository')
    log = self.log
    log.write(repository_id=connector.id, resource_name=('mixed' if mixed else resource.tablename), transmission=log.IN, mode=log.PULL, action='send', remote=result.get('remote', False), result=result.get('status', log.NONE), message=result.get('message', ''))
    return result.get('response')
