'Handle an FCGI_BEGIN_REQUEST from the web server.'

def _do_begin_request(self, inrec):

    (role, flags) = struct.unpack(FCGI_BeginRequestBody, inrec.contentData)
    req = self.server.request_class(self, self._inputStreamClass)
    (req.requestId, req.role, req.flags) = (inrec.requestId, role, flags)
    req.aborted = False
    if ((not self._multiplexed) and self._requests):
        self.end_request(req, 0L, FCGI_CANT_MPX_CONN, remove=False)
    else:
        self._requests[inrec.requestId] = req
