'WSGI Application entry point for the Swift Object Server.'

def __call__(self, env, start_response):

    start_time = time.time()
    req = Request(env)
    self.logger.txn_id = req.headers.get('x-trans-id', None)
    if (not check_utf8(req.path_info)):
        res = HTTPPreconditionFailed(body='Invalid    UTF8    or    contains    NULL')
    else:
        try:
            if (req.method not in self.allowed_methods):
                res = HTTPMethodNotAllowed()
            else:
                res = getattr(self, req.method)(req)
        except DiskFileCollision:
            res = HTTPForbidden(request=req)
        except HTTPException as error_response:
            res = error_response
        except (Exception, Timeout):
            self.logger.exception(_('ERROR    __call__    error    with    %(method)s    %(path)s    '), {'method': req.method, 'path': req.path})
            res = HTTPInternalServerError(body=traceback.format_exc())
    trans_time = (time.time() - start_time)
    res.fix_conditional_response()
    if self.log_requests:
        log_line = get_log_line(req, res, trans_time, '')
        if ((req.method in ('REPLICATE', 'SSYNC')) or ('X-Backend-Replication' in req.headers)):
            self.logger.debug(log_line)
        else:
            self.logger.info(log_line)
    if (req.method in ('PUT', 'DELETE')):
        slow = (self.slow - trans_time)
        if (slow > 0):
            sleep(slow)
    if ((req.method == 'GET') and (res.status_int == 200) and isinstance(env['wsgi.input'], wsgi.Input)):
        app_iter = getattr(res, 'app_iter', None)
        checker = getattr(app_iter, 'can_zero_copy_send', None)
        if (checker and checker()):
            wsock = env['wsgi.input'].get_socket()
            wsockfd = wsock.fileno()
            def zero_copy_iter():
                if hasattr(socket, 'TCP_CORK'):
                    wsock.setsockopt(socket.IPPROTO_TCP, socket.TCP_CORK, 1)
                (yield EventletPlungerString())
                try:
                    app_iter.zero_copy_send(wsockfd)
                except Exception:
                    self.logger.exception('zero_copy_send()    blew    up')
                    raise
                (yield '')
            res(env, start_response)
            return zero_copy_iter()
        else:
            return res(env, start_response)
    else:
        return res(env, start_response)
